Skip to content

Commit

Permalink
wip simulator
Browse files Browse the repository at this point in the history
  • Loading branch information
nift4 committed Aug 1, 2024
1 parent 57e8ddc commit 7b7ba42
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
<!--<category android:name="android.intent.category.LAUNCHER" />-->
</intent-filter>
</activity>
<activity
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/cpp/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

#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" void simulator_start(JNIEnv* env, jobject bitmap, jint w, jint h);
extern "C" void simulator_stop();
extern "C" 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);
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/java/org/andbootmgr/app/Simulator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import android.view.View
import androidx.appcompat.app.AppCompatActivity

class Simulator : AppCompatActivity() {
init {
System.loadLibrary("app")
}
external fun start(bitmap: Bitmap, w: Int, h: Int)
external fun stop()
external fun key(key: Int)
Expand All @@ -25,6 +28,8 @@ class Simulator : AppCompatActivity() {
canvas.drawBitmap(this@Simulator.bitmap, 0f, 0f, null)
}
})
start(bitmap, w, h)
Thread {
start(bitmap, w, h)
}.start()
}
}

0 comments on commit 7b7ba42

Please sign in to comment.