--- hatari/src/uae-cpu/newcpu.c 2019/04/01 07:09:48 1.1.1.3 +++ hatari/src/uae-cpu/newcpu.c 2019/04/01 07:10:06 1.1.1.4 @@ -19,8 +19,9 @@ #include "../includes/tos.h" -int quit_program = 0; -int debugging = 0; +extern int bQuitProgram; /* Declared in main.c */ + + struct flag_struct regflags; int lastInstructionCycles; /* how many cycles last instruction took to execute */ @@ -116,7 +117,8 @@ static unsigned long REGPARAM2 op_illg_1 return 4; } -static void build_cpufunctbl (void) + +void build_cpufunctbl(void) { int i; unsigned long opcode; @@ -163,23 +165,6 @@ static void build_cpufunctbl (void) -/* -void check_prefs_changed_cpu (void) -{ - if (currprefs.cpu_level != changed_prefs.cpu_level - || currprefs.cpu_compatible != changed_prefs.cpu_compatible) { - currprefs.cpu_level = changed_prefs.cpu_level; - currprefs.cpu_compatible = changed_prefs.cpu_compatible; - build_cpufunctbl (); - } - if (currprefs.m68k_speed != changed_prefs.m68k_speed) { - currprefs.m68k_speed = changed_prefs.m68k_speed; - reset_frame_rate_hack (); - update_68k_cycles (); - } -} -*/ - void init_m68k (void) { int i; @@ -251,6 +236,7 @@ void init_m68k (void) build_cpufunctbl (); } + struct regstruct regs, lastint_regs; static struct regstruct regs_backup[16]; static int backup_pointer = 0; @@ -1107,8 +1093,8 @@ static char* ccnames[] = void m68k_reset (void) { - m68k_areg (regs, 7) = get_long (ROMmem_start); - m68k_setpc (get_long (ROMmem_start+4)); + m68k_areg(regs, 7) = get_long(0); + m68k_setpc(get_long(4)); fill_prefetch_0 (); regs.s = 1; regs.m = 0; @@ -1143,7 +1129,7 @@ unsigned long REGPARAM2 op_illg (uae_u32 write_log ("This program requires a 68020 CPU!\n"); broken_in = 1; set_special (SPCFLAG_BRK); - quit_program = 1; + bQuitProgram = 1; } /* if (opcode == 0xFF0D) { @@ -1295,7 +1281,7 @@ static void m68k_run_1 (void) uae_u8 saved_bytes[20]; uae_u16 *oldpcp; #endif - while(!quit_program) { + while(!bQuitProgram) { int cycles; uae_u32 opcode = get_iword_prefetch (0); #ifdef DEBUG_PREFETCH @@ -1338,12 +1324,11 @@ static void m68k_run_1 (void) } } -#define DEBUG_PREFETCH /* Same thing, but don't use prefetch to get opcode. */ static void m68k_run_2 (void) { - while(!quit_program) { + while(!bQuitProgram) { int cycles; #ifdef HAVE_GET_WORD_UNSWAPPED uae_u32 opcode = do_get_mem_word_unswapped (regs.pc_p); @@ -1384,11 +1369,7 @@ void m68k_go (int may_quit) } in_m68k_go++; - while(!quit_program) { -/* - if (debugging) - debug (); -*/ + while(!bQuitProgram) { if(cpu_compatible) m68k_run_1(); else