Add but disable CPU trace on Android

This commit is contained in:
Aaron Culliney 2016-01-24 09:29:47 -08:00
parent b9acdc7d4c
commit 1358a52eee
3 changed files with 18 additions and 4 deletions

View File

@ -173,6 +173,15 @@ void Java_org_deadc0de_apple2ix_Apple2Activity_nativeOnCreate(JNIEnv *env, jclas
joydriver_setClampBeyondRadius(true);
//#define DO_CPU65_TRACING 1
#if DO_CPU65_TRACING
# warning !!!!!!!!!! this will quickly eat up disk space !!!!!!!!!!
char *trfile = NULL;
asprintf(&trfile, "%s/%s", data_dir, "cpu_trace.txt");
cpu65_trace_begin(trfile);
ASPRINTF_FREE(trfile);
#endif
#if !TESTING
cpu_pause();
emulator_start();
@ -215,6 +224,10 @@ void Java_org_deadc0de_apple2ix_Apple2Activity_nativeEmulationPause(JNIEnv *env,
return;
}
#if DO_CPU65_TRACING
cpu65_trace_checkpoint();
#endif
disk6_flush(0);
disk6_flush(1);
@ -277,6 +290,10 @@ void Java_org_deadc0de_apple2ix_Apple2Activity_nativeOnQuit(JNIEnv *env, jclass
disk6_eject(0);
disk6_eject(1);
#if DO_CPU65_TRACING
cpu65_trace_end();
#endif
cpu_resume();
#endif
}

View File

@ -923,7 +923,7 @@ GLUE_C_WRITE(cpu65_trace_epilogue)
void cpu65_trace_checkpoint(void) {
if (cpu_trace_fp) {
fprintf(cpu_trace_fp, "---TOTAL CYC:%lu\n",cycles_count_total);
//fprintf(cpu_trace_fp, "---TOTAL CYC:%lu\n",cycles_count_total);
fflush(cpu_trace_fp);
}
}

View File

@ -406,9 +406,6 @@ static void *cpu_thread(void *dummyptr) {
#endif
timing_checkpoint_cycles();
#if CPU_TRACING
cpu65_trace_checkpoint();
#endif
#ifdef AUDIO_ENABLED
speaker_flush(); // play audio