Excise HEADLESS ... it was only being used by testcpu

This commit is contained in:
Aaron Culliney 2015-09-06 17:14:38 -07:00
parent 2cf119b5e9
commit 2c97f7af19
13 changed files with 25 additions and 58 deletions

View File

@ -13,7 +13,7 @@ include $(COMMON_SOURCES_MK)
LOCAL_MODULE := libapple2ix
LOCAL_SRC_FILES := jniprefs.c androidkeys.c
#LOCAL_ARM_MODE := arm
LOCAL_CFLAGS := $(APPLE2_BASE_CFLAGS) -DHEADLESS=0
LOCAL_CFLAGS := $(APPLE2_BASE_CFLAGS)
LOCAL_LDLIBS := -llog -landroid -lGLESv2 -lz -lOpenSLES
# Add assembly files first ... mostly for the benefit of the ARM assembler ...

View File

@ -12,7 +12,7 @@ include $(COMMON_SOURCES_MK)
LOCAL_MODULE := libapple2ix
LOCAL_SRC_FILES := $(APPLE2_SRC_PATH)/test/testcommon.c $(APPLE2_SRC_PATH)/test/testcpu.c
LOCAL_CFLAGS := $(APPLE2_BASE_CFLAGS) -DTEST_CPU -DTESTING=1 -DHEADLESS=1
LOCAL_CFLAGS := $(APPLE2_BASE_CFLAGS) -DTEST_CPU -DTESTING=1
LOCAL_LDLIBS := -llog -landroid -lGLESv2 -lz
# Add assembly files first ... mostly for the benefit of the ARM assembler ...

View File

@ -1475,7 +1475,6 @@
"DEBUGGER=1",
"KEYPAD_JOYSTICK=1",
"TEST_DISK=1",
"HEADLESS=1",
"TESTING=1",
"CPU_TRACING=1",
"DISK_TRACING=1",
@ -1507,7 +1506,6 @@
"DEBUGGER=1",
"KEYPAD_JOYSTICK=1",
"TEST_VM=1",
"HEADLESS=1",
"TESTING=1",
"CPU_TRACING=1",
);
@ -1536,7 +1534,6 @@
"DEBUGGER=1",
"KEYPAD_JOYSTICK=1",
"TEST_VM=1",
"HEADLESS=1",
"TESTING=1",
"CPU_TRACING=1",
"DISK_TRACING=1",
@ -1568,7 +1565,6 @@
"DEBUGGER=1",
"KEYPAD_JOYSTICK=1",
"TEST_VM=1",
"HEADLESS=1",
"TESTING=1",
"CPU_TRACING=1",
);
@ -1777,7 +1773,6 @@
"DEBUGGER=1",
"KEYPAD_JOYSTICK=1",
"TEST_DISPLAY=1",
"HEADLESS=1",
"TESTING=1",
"CPU_TRACING=1",
"DISK_TRACING=1",
@ -1809,7 +1804,6 @@
"DEBUGGER=1",
"KEYPAD_JOYSTICK=1",
"TEST_DISPLAY=1",
"HEADLESS=1",
"TESTING=1",
"CPU_TRACING=1",
);

View File

@ -96,7 +96,7 @@ TESTS = testcpu testdisplay testvm testdisk
check_PROGRAMS = testcpu testdisplay testvm testdisk
testcpu_SOURCES = src/test/testcpu.c $(A2_TEST_SOURCES) $(META_SRC)
testcpu_CFLAGS = $(apple2ix_CFLAGS) $(A2_TEST_CFLAGS) -UAUDIO_ENABLED -UINTERFACE_CLASSIC -DHEADLESS=1
testcpu_CFLAGS = $(apple2ix_CFLAGS) $(A2_TEST_CFLAGS) -UAUDIO_ENABLED -UINTERFACE_CLASSIC
testcpu_CCASFLAGS = $(testcpu_CFLAGS)
testcpu_LDFLAGS = $(apple2ix_LDFLAGS)
testcpu_LDADD = @ASM_O@ @VIDEO_O@
@ -105,7 +105,7 @@ testcpu_DEPENDENCIES = @ASM_O@ @META_O@ @VIDEO_O@
EXTRA_testcpu_SOURCES = $(ASM_SRC_x86)
testdisplay_SOURCES = src/test/testdisplay.c $(A2_TEST_SOURCES) $(META_SRC)
testdisplay_CFLAGS = $(apple2ix_CFLAGS) $(A2_TEST_CFLAGS) -UAUDIO_ENABLED -UINTERFACE_CLASSIC -DHEADLESS=0
testdisplay_CFLAGS = $(apple2ix_CFLAGS) $(A2_TEST_CFLAGS) -UAUDIO_ENABLED -UINTERFACE_CLASSIC
testdisplay_CCASFLAGS = $(testdisplay_CFLAGS)
testdisplay_LDFLAGS = $(apple2ix_LDFLAGS)
testdisplay_LDADD = @ASM_O@ @VIDEO_O@
@ -114,7 +114,7 @@ testdisplay_DEPENDENCIES = @ASM_O@ @META_O@ @VIDEO_O@
EXTRA_testdisplay_SOURCES = $(ASM_SRC_x86) $(VIDEO_SRC)
testvm_SOURCES = src/test/testvm.c $(A2_TEST_SOURCES) $(META_SRC)
testvm_CFLAGS = $(apple2ix_CFLAGS) $(A2_TEST_CFLAGS) -UAUDIO_ENABLED -UINTERFACE_CLASSIC -DHEADLESS=0
testvm_CFLAGS = $(apple2ix_CFLAGS) $(A2_TEST_CFLAGS) -UAUDIO_ENABLED -UINTERFACE_CLASSIC
testvm_CCASFLAGS = $(testvm_CFLAGS)
testvm_LDFLAGS = $(apple2ix_LDFLAGS)
# HACK FIXME TODO NOTE: specify TESTVM_ASM_O to force it to rebuild with proper CCASFLAGS ... automake bug?
@ -124,7 +124,7 @@ testvm_DEPENDENCIES = @TESTVM_ASM_O@ @META_O@ @VIDEO_O@
EXTRA_testvm_SOURCES = $(ASM_SRC_x86) $(VIDEO_SRC)
testdisk_SOURCES = src/test/testdisk.c $(A2_TEST_SOURCES) $(META_SRC)
testdisk_CFLAGS = $(apple2ix_CFLAGS) $(A2_TEST_CFLAGS) -UAUDIO_ENABLED -UINTERFACE_CLASSIC -DHEADLESS=0
testdisk_CFLAGS = $(apple2ix_CFLAGS) $(A2_TEST_CFLAGS) -UAUDIO_ENABLED -UINTERFACE_CLASSIC
testdisk_CCASFLAGS = $(testdisk_CFLAGS)
testdisk_LDFLAGS = $(apple2ix_LDFLAGS)
# HACK FIXME TODO NOTE: specify testdisk_ASM_O to force it to rebuild with proper CCASFLAGS ... automake bug?

View File

@ -213,7 +213,6 @@ AS_IF([test "x$opengl_supported" = "xyes"], [
])
AC_SUBST(VIDEO_O)
AC_DEFINE(HEADLESS, 0, [Set to 1 to disable video output driver])
dnl ---------------------------------------------------------------------------
dnl Sound ...

View File

@ -1067,27 +1067,17 @@ void video_init(void) {
memset(video__fb1,0,SCANWIDTH*SCANHEIGHT);
memset(video__fb2,0,SCANWIDTH*SCANHEIGHT);
#if !HEADLESS
# if !defined(__APPLE__) && !defined(ANDROID)
if (!is_headless) {
video_backend->init((void*)0);
}
# endif
#if !defined(__APPLE__) && !defined(ANDROID)
video_backend->init((void*)0);
#endif
}
void video_shutdown(void) {
#if !HEADLESS
if (!is_headless) {
video_backend->shutdown();
}
#endif
video_backend->shutdown();
}
void video_main_loop(void) {
#if !HEADLESS
video_backend->main_loop();
#endif
}
void video_setpage(int p) {

View File

@ -240,9 +240,7 @@ extern void gldriver_joystick_reset(void);
void c_joystick_reset(void)
{
#if VIDEO_OPENGL && !TESTING
if (!is_headless) {
gldriver_joystick_reset();
}
gldriver_joystick_reset();
#endif
joy_button0 = 0x0;
joy_button1 = 0x0;

View File

@ -27,7 +27,6 @@ bool do_logging = true; // also controlled by NDEBUG
FILE *error_log = NULL;
int sound_volume = 2;
bool is_headless = false;
color_mode_t color_mode = COLOR;
const char *data_dir = NULL;

View File

@ -48,7 +48,6 @@ extern char disk_path[PATH_MAX];
extern int apple_mode; /* undocumented instructions or //e mode */
extern int sound_volume;
extern bool is_headless;
extern color_mode_t color_mode;
extern a2_video_mode_t a2_video_mode;

View File

@ -92,17 +92,12 @@ void test_type_input(const char *input) {
// ----------------------------------------------------------------------------
void test_breakpoint(void *arg) {
fprintf(GREATEST_STDOUT, "set breakpoint on test_breakpoint to check for problems...\n");
#if !HEADLESS
if (!is_headless) {
fprintf(GREATEST_STDOUT, "DISPLAY NOTE: busy-spinning, needs gdb/lldb intervention to continue...\n");
volatile bool debug_continue = false;
while (!debug_continue) {
struct timespec ts = { .tv_sec=0, .tv_nsec=33333333 };
nanosleep(&ts, NULL);
}
fprintf(GREATEST_STDOUT, "DISPLAY NOTE: busy-spinning in test_breakpoint(), needs gdb/lldb intervention to continue...\n");
volatile bool debug_continue = false;
while (!debug_continue) {
struct timespec ts = { .tv_sec=0, .tv_nsec=33333333 };
nanosleep(&ts, NULL);
}
#endif
}
// ----------------------------------------------------------------------------

View File

@ -11,6 +11,8 @@
#include "testcommon.h"
static bool test_thread_running = false;
extern pthread_mutex_t interface_mutex; // TODO FIXME : raw access to CPU mutex because stepping debugger ...
static void testdisplay_setup(void *arg) {
@ -315,15 +317,13 @@ TEST test_80col_hires() {
// ----------------------------------------------------------------------------
// Test Suite
static int begin_video = -1;
GREATEST_SUITE(test_suite_display) {
GREATEST_SET_SETUP_CB(testdisplay_setup, NULL);
GREATEST_SET_TEARDOWN_CB(testdisplay_teardown, NULL);
GREATEST_SET_BREAKPOINT_CB(test_breakpoint, NULL);
// TESTS --------------------------
begin_video=!is_headless;
test_thread_running = true;
RUN_TESTp(test_boot_disk);
@ -464,13 +464,11 @@ void test_display(int argc, char **argv) {
pthread_t p;
pthread_create(&p, NULL, (void *)&test_thread, (void *)NULL);
while (begin_video < 0) {
while (!test_thread_running) {
struct timespec ts = { .tv_sec=0, .tv_nsec=33333333 };
nanosleep(&ts, NULL);
}
if (begin_video) {
video_main_loop();
}
video_main_loop();
//pthread_join(p, NULL);
}

View File

@ -14,6 +14,8 @@
#define RESET_INPUT() test_common_setup()
#define TESTING_DISK "testvm1.nib.gz"
static bool test_thread_running = false;
#define TYPE_TRIGGER_WATCHPT() \
test_type_input("POKE7987,255:REM TRIGGER DEBUGGER\r")
@ -3259,15 +3261,13 @@ TEST test_check_cxrom(bool flag_cxrom) {
// ----------------------------------------------------------------------------
// Test Suite
static int begin_video = -1;
GREATEST_SUITE(test_suite_vm) {
GREATEST_SET_SETUP_CB(testvm_setup, NULL);
GREATEST_SET_TEARDOWN_CB(testvm_teardown, NULL);
GREATEST_SET_BREAKPOINT_CB(test_breakpoint, NULL);
// TESTS --------------------------
begin_video=!is_headless;
test_thread_running=true;
RUN_TESTp(test_read_keyboard);
@ -3477,13 +3477,11 @@ void test_vm(int argc, char **argv) {
pthread_t p;
pthread_create(&p, NULL, (void *)&test_thread, (void *)NULL);
while (begin_video < 0) {
while (!test_thread_running) {
struct timespec ts = { .tv_sec=0, .tv_nsec=33333333 };
nanosleep(&ts, NULL);
}
if (begin_video) {
video_main_loop();
}
video_main_loop();
//pthread_join(p, NULL);
}

View File

@ -437,9 +437,6 @@ static void c_flash_cursor(int on) {
}
void video_driver_sync(void) {
if (is_headless) {
return;
}
static int flash_count = 0;
// post the image and loop waiting for it to finish and