diff src/clojure/clojure.cpp @ 96:cb487c4ce5c0

added write-memory!, which allows me to write any value to the gameboy's memory-mapped rom or ram.
author Robert McIntyre <rlm@mit.edu>
date Sun, 11 Mar 2012 23:27:19 -0500
parents 4c60ebca1a9d
children 2090bcb78f44
line wrap: on
line diff
     1.1 --- a/src/clojure/clojure.cpp	Sun Mar 11 23:10:44 2012 -0500
     1.2 +++ b/src/clojure/clojure.cpp	Sun Mar 11 23:27:19 2012 -0500
     1.3 @@ -143,6 +143,18 @@
     1.4    env->ReleaseIntArrayElements(arr, mem_store, 0);
     1.5  }
     1.6  
     1.7 +/*
     1.8 + * Class:     com_aurellem_gb_Gb
     1.9 + * Method:    writeMemory
    1.10 + * Signature: ([I)V
    1.11 + */
    1.12 +JNIEXPORT void JNICALL Java_com_aurellem_gb_Gb_writeMemory
    1.13 +(JNIEnv *env, jclass clazz, jintArray arr){
    1.14 +  jint *new_memory = env->GetIntArrayElements(arr, 0);
    1.15 +  writeMemory(new_memory);
    1.16 +  env->ReleaseIntArrayElements(arr, new_memory, 0);
    1.17 +}
    1.18 +
    1.19  
    1.20  /*
    1.21   * Class:     com_aurellem_gb_Gb