rlm@49
|
1 #include "com_aurellem_gb_Gb.h"
|
rlm@49
|
2 #include "../sdl/Drive.h"
|
rlm@49
|
3
|
rlm@49
|
4 #include <string.h>
|
rlm@49
|
5
|
rlm@49
|
6 #define UNUSED(x) (void)(x)
|
rlm@49
|
7
|
rlm@49
|
8
|
rlm@49
|
9 /*
|
rlm@49
|
10 * Class: com_aurellem_gb_Gb
|
rlm@49
|
11 * Method: sayHello
|
rlm@49
|
12 * Signature: ()V
|
rlm@49
|
13 */
|
rlm@49
|
14 JNIEXPORT void JNICALL Java_com_aurellem_gb_Gb_sayHello
|
rlm@49
|
15 (JNIEnv *env, jclass clazz){
|
rlm@49
|
16 UNUSED(env);UNUSED(clazz);
|
rlm@49
|
17 printf("Hello from GB\n");
|
rlm@49
|
18 }
|
rlm@49
|
19
|
rlm@49
|
20 /*
|
rlm@49
|
21 * Class: com_aurellem_gb_Gb
|
rlm@49
|
22 * Method: startEmulator
|
rlm@49
|
23 * Signature: (Ljava/lang/String;)V
|
rlm@49
|
24 */
|
rlm@49
|
25 JNIEXPORT void JNICALL Java_com_aurellem_gb_Gb_startEmulator
|
rlm@49
|
26 (JNIEnv *env, jclass clazz, jstring str){
|
rlm@49
|
27 UNUSED(env);UNUSED(clazz);UNUSED(str);
|
rlm@49
|
28
|
rlm@49
|
29 const char *_romName = env->GetStringUTFChars(str, 0);
|
rlm@49
|
30 size_t len = strlen(_romName);
|
rlm@49
|
31
|
rlm@49
|
32 char romName[len + 1];
|
rlm@49
|
33
|
rlm@49
|
34 strcpy(romName, _romName);
|
rlm@49
|
35
|
rlm@49
|
36 char* arguments[] = {"vba-rlm", romName};
|
rlm@49
|
37 runVBA(2, arguments);
|
rlm@49
|
38 }
|
rlm@49
|
39
|
rlm@55
|
40
|
rlm@55
|
41
|
rlm@55
|
42
|
rlm@53
|
43 /*
|
rlm@53
|
44 * Class: com_aurellem_gb_Gb
|
rlm@53
|
45 * Method: step
|
rlm@53
|
46 * Signature: ()V
|
rlm@53
|
47 */
|
rlm@55
|
48 JNIEXPORT void JNICALL Java_com_aurellem_gb_Gb_step__
|
rlm@53
|
49 (JNIEnv *env, jclass clazz){
|
rlm@53
|
50 step();
|
rlm@53
|
51 }
|
rlm@53
|
52
|
rlm@53
|
53 /*
|
rlm@53
|
54 * Class: com_aurellem_gb_Gb
|
rlm@55
|
55 * Method: step
|
rlm@55
|
56 * Signature: (I)V
|
rlm@55
|
57 */
|
rlm@55
|
58 JNIEXPORT void JNICALL Java_com_aurellem_gb_Gb_step__I
|
rlm@55
|
59 (JNIEnv *env, jclass clazz, jint keymask){
|
rlm@55
|
60 step(keymask);
|
rlm@55
|
61 }
|
rlm@55
|
62
|
rlm@55
|
63
|
rlm@55
|
64
|
rlm@55
|
65
|
rlm@55
|
66
|
rlm@55
|
67 /*
|
rlm@55
|
68 * Class: com_aurellem_gb_Gb
|
rlm@53
|
69 * Method: shutdown
|
rlm@53
|
70 * Signature: ()V
|
rlm@53
|
71 */
|
rlm@53
|
72 JNIEXPORT void JNICALL Java_com_aurellem_gb_Gb_shutdown
|
rlm@53
|
73 (JNIEnv *env, jclass clazz){
|
rlm@53
|
74 shutdown();
|
rlm@53
|
75 }
|
rlm@53
|
76
|
rlm@53
|
77
|
rlm@55
|
78
|
rlm@55
|
79
|
rlm@55
|
80
|