comparison src/clojure/clojure.cpp @ 49:139178c4d843

clojure can now drive vba
author Robert McIntyre <rlm@mit.edu>
date Wed, 07 Mar 2012 01:17:53 -0600
parents
children 9d0ec2614443
comparison
equal deleted inserted replaced
48:75349da4c344 49:139178c4d843
1 #include "com_aurellem_gb_Gb.h"
2 #include "../sdl/Drive.h"
3
4 #include <string.h>
5
6 #define UNUSED(x) (void)(x)
7
8
9 /*
10 * Class: com_aurellem_gb_Gb
11 * Method: sayHello
12 * Signature: ()V
13 */
14 JNIEXPORT void JNICALL Java_com_aurellem_gb_Gb_sayHello
15 (JNIEnv *env, jclass clazz){
16 UNUSED(env);UNUSED(clazz);
17 printf("Hello from GB\n");
18 }
19
20 /*
21 * Class: com_aurellem_gb_Gb
22 * Method: startEmulator
23 * Signature: (Ljava/lang/String;)V
24 */
25 JNIEXPORT void JNICALL Java_com_aurellem_gb_Gb_startEmulator
26 (JNIEnv *env, jclass clazz, jstring str){
27 UNUSED(env);UNUSED(clazz);UNUSED(str);
28
29 const char *_romName = env->GetStringUTFChars(str, 0);
30 size_t len = strlen(_romName);
31
32 char romName[len + 1];
33
34 strcpy(romName, _romName);
35
36 char* arguments[] = {"vba-rlm", romName};
37 runVBA(2, arguments);
38 }
39