apple2ix/src/test/testcommon.c
2014-04-26 14:01:26 -07:00

76 lines
1.9 KiB
C

/*
* Apple // emulator for *nix
*
* This software package is subject to the GNU General Public License
* version 2 or later (your choice) as published by the Free Software
* Foundation.
*
* THERE ARE NO WARRANTIES WHATSOEVER.
*
*/
#include "testcommon.h"
// ----------------------------------------------------------------------------
// Stub functions because I've reached diminishing returns with the build system ...
//
// NOTE: You'd think the commandline CFLAGS set specifically for this test program would pass down to the sources in
// subdirectories, but it apparently isn't. GNU buildsystem bug? Also see HACK FIXME TODO NOTE in Makefile.am
//
uint8_t c_MB_Read(uint16_t addr) {
return 0x0;
}
void c_MB_Write(uint16_t addr, uint8_t byte) {
}
uint8_t c_PhasorIO(uint16_t addr) {
return 0x0;
}
void SpkrToggle() {
}
void c_interface_print(int x, int y, const int cs, const char *s) {
}
// ----------------------------------------------------------------------------
void test_breakpoint(void *arg) {
fprintf(GREATEST_STDOUT, "set breakpoint on test_breakpoint to check for problems...\n");
#if !HEADLESS
if (!is_headless) {
video_sync(0);
}
#endif
}
void test_common_init(bool do_cputhread) {
GREATEST_SET_BREAKPOINT_CB(test_breakpoint, NULL);
do_logging = false;// silence regular emulator logging
setenv("APPLE2IXCFG", "nosuchconfigfile", 1);
load_settings();
c_initialize_firsttime();
// kludgey set max CPU speed...
cpu_scale_factor = CPU_SCALE_FASTEST;
cpu_altscale_factor = CPU_SCALE_FASTEST;
g_bFullSpeed = true;
caps_lock = true;
if (do_cputhread) {
// spin off cpu thread
pthread_create(&cpu_thread_id, NULL, (void *) &cpu_thread, (void *)NULL);
c_debugger_set_watchpoint(WATCHPOINT_ADDR);
if (is_headless) {
c_debugger_set_timeout(5);
} else {
c_debugger_set_timeout(0);
}
}
}