comparison src/clojure/clojure.cpp @ 56:ba4fdfb722ed

emabled loading and saving CPU state from clojure.
author Robert McIntyre <rlm@mit.edu>
date Wed, 07 Mar 2012 14:18:44 -0600
parents 719d910c90f8
children 3ce48d803e74
comparison
equal deleted inserted replaced
55:719d910c90f8 56:ba4fdfb722ed
1 #include "com_aurellem_gb_Gb.h" 1 #include "com_aurellem_gb_Gb.h"
2 #include "../sdl/Drive.h" 2 #include "../sdl/Drive.h"
3 #include "../gb/GB.h"
3 4
4 #include <string.h> 5 #include <string.h>
5 6
6 #define UNUSED(x) (void)(x) 7 #define UNUSED(x) (void)(x)
7 8
70 * Signature: ()V 71 * Signature: ()V
71 */ 72 */
72 JNIEXPORT void JNICALL Java_com_aurellem_gb_Gb_shutdown 73 JNIEXPORT void JNICALL Java_com_aurellem_gb_Gb_shutdown
73 (JNIEnv *env, jclass clazz){ 74 (JNIEnv *env, jclass clazz){
74 shutdown(); 75 shutdown();
76
77 }
78
79 /*
80 * Class: com_aurellem_gb_Gb
81 * Method: saveState
82 * Signature: (Ljava/nio/ByteBuffer;)V
83 */
84 JNIEXPORT void JNICALL Java_com_aurellem_gb_Gb_saveState
85 (JNIEnv *env, jclass clazz, jobject buffer, jint size){
86 char* buffer_address =
87 ((char*) env->GetDirectBufferAddress(buffer));
88 gbWriteMemSaveState(buffer_address, size);
89 }
90
91 /*
92 * Class: com_aurellem_gb_Gb
93 * Method: loadState
94 * Signature: (Ljava/nio/ByteBuffer;)V
95 */
96 JNIEXPORT void JNICALL Java_com_aurellem_gb_Gb_loadState
97 (JNIEnv *env, jclass clazz, jobject buffer, jint size){
98 char* buffer_address =
99 ((char*) env->GetDirectBufferAddress(buffer));
100 gbReadMemSaveState(buffer_address, size);
75 } 101 }
76 102
77 103
78 104
79 105
80 106
107
108