Tests build and run on Desktop Linux and Android

This commit is contained in:
Aaron Culliney 2015-10-04 12:59:47 -07:00
parent 236b8e358a
commit d93a91cca8
6 changed files with 16 additions and 12 deletions

View File

@ -51,17 +51,21 @@ void Java_org_deadc0de_apple2ix_Apple2Preferences_nativeSetSpeakerVolume(JNIEnv
}
void Java_org_deadc0de_apple2ix_Apple2Preferences_nativeSetAudioLatency(JNIEnv *env, jclass cls, jfloat latencySecs) {
#if !TESTING
LOG("audio latency : %fsecs", latencySecs);
assert(cpu_isPaused());
audio_setLatency(latencySecs);
timing_reinitializeAudio();
#endif
}
jboolean Java_org_deadc0de_apple2ix_Apple2Preferences_nativeSetMockingboardEnabled(JNIEnv *env, jclass cls, jboolean enabled) {
#if !TESTING
LOG("mockingboard enabled : %d", enabled);
assert(cpu_isPaused());
MB_SetEnabled(enabled);
timing_reinitializeAudio();
#endif
return enabled;
}

View File

@ -768,12 +768,11 @@ void test_disk(int argc, char **argv) {
struct timespec ts = { .tv_sec=0, .tv_nsec=33333333 };
nanosleep(&ts, NULL);
}
timing_startCPU();
video_main_loop();
emulator_start();
//pthread_join(p, NULL);
}
#if !defined(__APPLE__)
#if !defined(__APPLE__) && !defined(ANDROID)
int main(int argc, char **argv) {
test_disk(argc, argv);
}

View File

@ -467,12 +467,11 @@ void test_display(int argc, char **argv) {
struct timespec ts = { .tv_sec=0, .tv_nsec=33333333 };
nanosleep(&ts, NULL);
}
timing_startCPU();
video_main_loop();
emulator_start();
//pthread_join(p, NULL);
}
#if !defined(__APPLE__)
#if !defined(__APPLE__) && !defined(ANDROID)
int main(int argc, char **argv) {
test_display(argc, argv);
}

View File

@ -440,12 +440,11 @@ void test_trace(int argc, char **argv) {
struct timespec ts = { .tv_sec=0, .tv_nsec=33333333 };
nanosleep(&ts, NULL);
}
timing_startCPU();
video_main_loop();
emulator_start();
//pthread_join(p, NULL);
}
#if !defined(__APPLE__)
#if !defined(__APPLE__) && !defined(ANDROID)
int main(int argc, char **argv) {
test_trace(argc, argv);
}

View File

@ -3484,12 +3484,11 @@ void test_vm(int argc, char **argv) {
struct timespec ts = { .tv_sec=0, .tv_nsec=33333333 };
nanosleep(&ts, NULL);
}
timing_startCPU();
video_main_loop();
emulator_start();
//pthread_join(p, NULL);
}
#if !defined(__APPLE__)
#if !defined(__APPLE__) && !defined(ANDROID)
int main(int argc, char **argv) {
test_vm(argc, argv);
}

View File

@ -308,15 +308,19 @@ static void *cpu_thread(void *dummyptr) {
do {
// -LOCK----------------------------------------------------------------------------------------- SAMPLE ti
#ifdef AUDIO_ENABLED
if (UNLIKELY(emul_pause_audio)) {
emul_pause_audio = false;
audio_pause();
}
#endif
pthread_mutex_lock(&interface_mutex);
#ifdef AUDIO_ENABLED
if (UNLIKELY(emul_resume_audio)) {
emul_resume_audio = false;
audio_resume();
}
#endif
clock_gettime(CLOCK_MONOTONIC, &ti);
deltat = timespec_diff(t0, ti, &negative);