-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
63 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
// Write C++ code here. | ||
// | ||
// Do not forget to dynamically load the C++ library into your application. | ||
// Created by nick on 01.08.24. | ||
// | ||
// For instance, | ||
// | ||
// In MainActivity.java: | ||
// static { | ||
// System.loadLibrary("app"); | ||
// } | ||
// | ||
// Or, in MainActivity.kt: | ||
// companion object { | ||
// init { | ||
// System.loadLibrary("app") | ||
// } | ||
// } | ||
|
||
#include <jni.h> | ||
|
||
extern void simulator_start(JNIEnv* env, jobject bitmap, jint w, jint h); | ||
extern void simulator_stop(); | ||
extern void simulator_key(jint key); | ||
|
||
extern "C" JNIEXPORT void JNICALL Java_org_andbootmgr_app_Simulator_key(JNIEnv* env, jobject thiz, jint key) { | ||
simulator_key(key); | ||
} | ||
|
||
extern "C" JNIEXPORT void JNICALL Java_org_andbootmgr_app_Simulator_stop(JNIEnv* env, jobject thiz) { | ||
simulator_stop(); | ||
} | ||
|
||
extern "C" JNIEXPORT void JNICALL Java_org_andbootmgr_app_Simulator_start(JNIEnv* env, jobject thiz, jobject bitmap, jint w, jint h) { | ||
simulator_start(env, bitmap, w, h); | ||
} |
Submodule droidboot_gui
updated
8 files
+61 β0 | CMakeLists.txt | |
+2 β2 | backend/droidboot_drivers.c | |
+1 β1 | droidboot_platforms | |
+1 β1 | extras/droidboot_dtb.c | |
+1 β1 | lib/lvgl | |
+ β | storage/.droidboot_mapped.c.kate-swp | |
+6 β6 | storage/droidboot_gpt.c | |
+1 β1 | storage/droidboot_mapped.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package org.andbootmgr.app | ||
|
||
import android.graphics.Bitmap | ||
import android.graphics.Canvas | ||
import android.os.Bundle | ||
import android.view.View | ||
import androidx.appcompat.app.AppCompatActivity | ||
|
||
class Simulator : AppCompatActivity() { | ||
external fun start(bitmap: Bitmap, w: Int, h: Int) | ||
external fun stop() | ||
external fun key(key: Int) | ||
private lateinit var bitmap: Bitmap | ||
private var w: Int = 0 | ||
private var h: Int = 0 | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
w = 1080 | ||
h = 1920 | ||
bitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888) | ||
setContentView(object : View(this) { | ||
override fun onDraw(canvas: Canvas) { | ||
super.onDraw(canvas) | ||
canvas.drawBitmap(this@Simulator.bitmap, 0f, 0f, null) | ||
} | ||
}) | ||
start(bitmap, w, h) | ||
} | ||
} |