diff src/clojure/clojure.cpp @ 93:4c60ebca1a9d

added function to get all the GB's memory.
author Robert McIntyre <rlm@mit.edu>
date Sun, 11 Mar 2012 20:16:09 -0500
parents 1ff2c546f5ad
children cb487c4ce5c0
line wrap: on
line diff
     1.1 --- a/src/clojure/clojure.cpp	Sun Mar 11 19:07:31 2012 -0500
     1.2 +++ b/src/clojure/clojure.cpp	Sun Mar 11 20:16:09 2012 -0500
     1.3 @@ -130,6 +130,20 @@
     1.4    return getRamSize();
     1.5  }
     1.6  
     1.7 +
     1.8 +/*
     1.9 + * Class:     com_aurellem_gb_Gb
    1.10 + * Method:    getMemory
    1.11 + * Signature: ([I)V
    1.12 + */
    1.13 +JNIEXPORT void JNICALL Java_com_aurellem_gb_Gb_getMemory
    1.14 +(JNIEnv *env, jclass clazz, jintArray arr){
    1.15 +  jint *mem_store = env->GetIntArrayElements(arr, 0);
    1.16 +  storeMemory(mem_store);
    1.17 +  env->ReleaseIntArrayElements(arr, mem_store, 0);
    1.18 +}
    1.19 +
    1.20 +
    1.21  /*
    1.22   * Class:     com_aurellem_gb_Gb
    1.23   * Method:    getRAM
    1.24 @@ -150,9 +164,9 @@
    1.25   */
    1.26  JNIEXPORT void JNICALL Java_com_aurellem_gb_Gb_getROM
    1.27  (JNIEnv *env, jclass clazz, jintArray arr){
    1.28 -  jint *ram_store = env->GetIntArrayElements(arr, 0);
    1.29 -  storeRom(ram_store);
    1.30 -  env->ReleaseIntArrayElements(arr, ram_store, 0);
    1.31 +  jint *rom_store = env->GetIntArrayElements(arr, 0);
    1.32 +  storeRom(rom_store);
    1.33 +  env->ReleaseIntArrayElements(arr, rom_store, 0);
    1.34  }
    1.35  
    1.36