skyline/app/src/main/cpp/lightswitch.cpp

16 lines
475 B
C++
Raw Normal View History

#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
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();
core::loader::LoadNro(file);
2019-07-02 23:43:49 +02:00
core::cpu::Run(BASE_ADDRESS);
env->ReleaseStringUTFChars(file_, file);
}