From d5c565493198b5f0d67d02bcd1757607e95219bd Mon Sep 17 00:00:00 2001 From: Aaron Culliney Date: Wed, 12 Jun 2013 00:31:26 -0700 Subject: [PATCH] debugger is mandatory, you *will* like it! --- src/cpu.S | 30 ------------------------------ src/debugger.c | 2 -- src/keys.c | 7 ------- src/misc.c | 6 ------ 4 files changed, 45 deletions(-) diff --git a/src/cpu.S b/src/cpu.S index d4e8a259..f16ff9ff 100644 --- a/src/cpu.S +++ b/src/cpu.S @@ -75,7 +75,6 @@ (,EffectiveAddr_E,8); \ /* h means hooked */ -#ifdef DEBUGGER #define GetFromEA_Bh orb $1, SN(cpu65_debug)+3; \ GetFromEA_B @@ -87,12 +86,6 @@ * is zero, and is inserted into Continue */ #define ZeroOp mov %al, SN(cpu65_debug)+3; -#else /* !DEBUGGER */ -#define GetFromEA_Bh GetFromEA_B -#define PutToEA_Bh PutToEA_B -#define ZeroOp -#endif /* !DEBUGGER */ - /* The OR actually functions as a move, but we * want to set the flags and we know %ah is zero */ #define Continue movl SN(cpu65_delay), %eax; \ @@ -2470,8 +2463,6 @@ op_XMA_imm: /* Exception handler */ -#ifdef DEBUGGER - exception: cmpb $RebootSig, %ah jz ex_reboot cmpb $ResetSig, %ah @@ -2507,24 +2498,6 @@ ex_reset: movb $0, SN(cpu65__signal) GetFromPC_B jmp *cpu65__opcodes(,%eax,4) -#else /* !DEBUGGER */ - -exception: cmpb $RebootSig, %ah - jz ex_reboot -ex_reset: movb $0, SN(cpu65__signal) - movw $0xfffc, EffectiveAddr - GetFromEA_W - movw %ax, PC_Reg - xorb %ah, %ah - GetFromPC_B - jmp *cpu65__opcodes(,%eax,4) - -ex_reboot: popal - movb $0, SN(cpu65__signal) - ret; - -#endif /* !DEBUGGER */ - /* ----------------------------------------------------------------- * Begin emulation. * ----------------------------------------------------------------- */ @@ -2542,8 +2515,6 @@ E(cpu65_run) movl $0x1FF, %edx # Stack pointer jmp ex_reset -#ifdef DEBUGGER - E (cpu65_direct_write) /* NB: dependent on register choices */ pushl %edi @@ -2562,7 +2533,6 @@ E(cpu65_step) ReplaceState GetFromPC_B jmp *cpu65__opcodes(,%eax,4) -#endif /* Tables */ diff --git a/src/debugger.c b/src/debugger.c index 535b699c..0a904070 100644 --- a/src/debugger.c +++ b/src/debugger.c @@ -14,7 +14,6 @@ * */ -#ifdef DEBUGGER #include "debug.h" #include "misc.h" #include "keys.h" @@ -1132,4 +1131,3 @@ void c_do_debugging() { } } -#endif /* DEBUGGER */ diff --git a/src/keys.c b/src/keys.c index 1a928041..7e99e772 100644 --- a/src/keys.c +++ b/src/keys.c @@ -30,11 +30,8 @@ /* from misc.c */ extern uid_t user, privileged; -#ifdef DEBUGGER /* from debugger.c */ extern void c_do_debugging(); -#endif - /* parameters for generic and keyboard-simulated joysticks */ short joy_x = 127; @@ -254,11 +251,9 @@ void c_periodic_update(int dummysig) { case kF5: c_interface_keyboard_layout(); break; -#ifdef DEBUGGER case kF7: cpu65_interrupt(EnterDebugSig); break; -#endif #if 0 case kF8: c_interface_words(); @@ -350,7 +345,6 @@ void c_periodic_update(int dummysig) { joy_x = joy_y = 256; } -#ifdef DEBUGGER /* Called from cpu code. Perhaps should be moved to misc.c, but was * abstracted from function above... */ @@ -360,7 +354,6 @@ void enter_debugger(void) c_do_debugging(); setitimer(ITIMER_VIRTUAL,&timer_on,0); } -#endif /* DEBUGGER */ /* ------------------------------------------------------------------------- void c_read_raw_key() : handle a scancode diff --git a/src/misc.c b/src/misc.c index 22827e59..c6203611 100644 --- a/src/misc.c +++ b/src/misc.c @@ -28,9 +28,7 @@ #include "disk.h" #include "interface.h" #include "keys.h" -#ifdef DEBUGGER #include "debug.h" -#endif #include "cpu.h" #include "glue.h" #include "prefs.h" @@ -47,12 +45,10 @@ static unsigned char apple_ii_rom[12288]; static unsigned char apple_iie_rom[32768]; /* //e */ #endif -#ifdef DEBUGGER /* in debugger.c */ extern int breakpoints[]; extern int watchpoints[]; extern int op_breakpoints[256]; -#endif GLUE_FIXED_READ(read_ram_default,apple_ii_64k) GLUE_FIXED_WRITE(write_ram_default,apple_ii_64k) @@ -658,7 +654,6 @@ static void reinitialize(void) { int i; -#ifdef DEBUGGER /* reset the watchpoints and breakpoints */ for (i=0; i