comparison src/clojure/clojure.cpp @ 524:7ef5c73ea8fa

working on recording sound. almost have it, but there is still unexplained popping sounds.
author Robert McIntyre <rlm@mit.edu>
date Sat, 23 Jun 2012 23:10:31 -0500
parents d00096b6bf17
children fa7676dbf6f2
comparison
equal deleted inserted replaced
523:d00096b6bf17 524:7ef5c73ea8fa
346 JNIEXPORT jint JNICALL Java_com_aurellem_gb_Gb_readMemory 346 JNIEXPORT jint JNICALL Java_com_aurellem_gb_Gb_readMemory
347 (JNIEnv *env, jclass clazz, jint address){ 347 (JNIEnv *env, jclass clazz, jint address){
348 return (jint) gbReadMemory((u16) address); 348 return (jint) gbReadMemory((u16) address);
349 } 349 }
350 350
351
352 /* 351 /*
353 * Class: com_aurellem_gb_Gb 352 * Class: com_aurellem_gb_Gb
354 * Method: getFrameSound 353 * Method: getFrameSound
355 * Signature: ([I)V 354 * Signature: ([B)V
356 */ 355 */
357 JNIEXPORT void JNICALL Java_com_aurellem_gb_Gb_getFrameSound 356 JNIEXPORT void JNICALL Java_com_aurellem_gb_Gb_getFrameSound
358 (JNIEnv *env, jclass clazz, jintArray arr){ 357 (JNIEnv *env, jclass clazz, jbyteArray arr){
359 jint *sound_store = env->GetIntArrayElements(arr, 0); 358 jbyte *sound_store = env->GetByteArrayElements(arr, 0);
360 int i; 359 int i;
361 for (i = 0; i < 44100; i++){ 360
362 sound_store[i] = (jint) soundFrameSound[i]; 361
362 u8* soundBytes = (u8*) soundFrameSound;
363 for (i = 0; i < 44100*2; i++){
364 sound_store[i] = (jbyte) soundBytes[i];
363 } 365 }
364 env->ReleaseIntArrayElements(arr, sound_store, 0); 366
367 /*
368 u8* soundBytes = (u8*) soundFinalWave;
369 for (i = 0; i < 1470*2 ; i++){
370 sound_store[i] = (jbyte) soundBytes[i];
371 }
372 */
373
374 env->ReleaseByteArrayElements(arr, sound_store, 0);
365 } 375 }
366 376
367 377
368 /* 378 /*
369 * Class: com_aurellem_gb_Gb 379 * Class: com_aurellem_gb_Gb