annotate src/clojure/clojure.cpp @ 53:9d0ec2614443

enabled stepping from clojure
author Robert McIntyre <rlm@mit.edu>
date Wed, 07 Mar 2012 02:31:39 -0600
parents 139178c4d843
children 719d910c90f8
rev   line source
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@53 40 /*
rlm@53 41 * Class: com_aurellem_gb_Gb
rlm@53 42 * Method: step
rlm@53 43 * Signature: ()V
rlm@53 44 */
rlm@53 45 JNIEXPORT void JNICALL Java_com_aurellem_gb_Gb_step
rlm@53 46 (JNIEnv *env, jclass clazz){
rlm@53 47 step();
rlm@53 48 }
rlm@53 49
rlm@53 50 /*
rlm@53 51 * Class: com_aurellem_gb_Gb
rlm@53 52 * Method: shutdown
rlm@53 53 * Signature: ()V
rlm@53 54 */
rlm@53 55 JNIEXPORT void JNICALL Java_com_aurellem_gb_Gb_shutdown
rlm@53 56 (JNIEnv *env, jclass clazz){
rlm@53 57 shutdown();
rlm@53 58 }
rlm@53 59
rlm@53 60