2019-06-29 02:35:14 +02:00
|
|
|
#include <jni.h>
|
|
|
|
#include <string>
|
2019-06-29 16:21:59 +02:00
|
|
|
#include <syslog.h>
|
2019-07-02 23:43:49 +02:00
|
|
|
#include <core/arm/cpu.h>
|
|
|
|
#include <core/hos/loaders/nro.h>
|
|
|
|
#include <core/arm/memory.h>
|
2019-06-29 16:21:59 +02:00
|
|
|
|
2019-07-03 01:19:45 +02:00
|
|
|
extern "C"
|
|
|
|
JNIEXPORT void JNICALL
|
|
|
|
Java_gq_cyuubi_lightswitch_MainActivity_loadFile(JNIEnv *env, jobject instance, jstring file_) {
|
|
|
|
const char *file = env->GetStringUTFChars(file_, 0);
|
2019-07-02 23:43:49 +02:00
|
|
|
core::cpu::Initialize();
|
2019-07-03 01:19:45 +02:00
|
|
|
core::loader::LoadNro(file);
|
2019-07-02 23:43:49 +02:00
|
|
|
core::cpu::Run(BASE_ADDRESS);
|
2019-07-03 01:19:45 +02:00
|
|
|
env->ReleaseStringUTFChars(file_, file);
|
|
|
|
}
|