--- BasiliskII/src/uae_cpu/newcpu.cpp 2002/09/17 16:05:39 1.16 +++ BasiliskII/src/uae_cpu/newcpu.cpp 2004/11/01 16:01:51 1.19 @@ -34,8 +34,7 @@ B2_mutex *spcflags_lock = NULL; #include "mon_disass.h" #endif -int quit_program = 0; -const int debugging = 0; +bool quit_program = false; struct flag_struct regflags; /* Opcode of faulting instruction */ @@ -164,11 +163,11 @@ static __inline__ unsigned int cft_map ( #endif } -cpuop_rettype REGPARAM2 op_illg_1 (uae_u32 opcode) REGPARAM; +void REGPARAM2 op_illg_1 (uae_u32 opcode) REGPARAM; -cpuop_rettype REGPARAM2 op_illg_1 (uae_u32 opcode) +void REGPARAM2 op_illg_1 (uae_u32 opcode) { - cpuop_return( op_illg (cft_map (opcode)) ); + op_illg (cft_map (opcode)); } static void build_cpufunctbl (void) @@ -1167,7 +1166,7 @@ void m68k_reset (void) void m68k_emulop_return(void) { SPCFLAGS_SET( SPCFLAG_BRK ); - quit_program = 1; + quit_program = true; } void m68k_emulop(uae_u32 opcode) @@ -1190,18 +1189,18 @@ void m68k_emulop(uae_u32 opcode) MakeFromSR(); } -cpuop_rettype REGPARAM2 op_illg (uae_u32 opcode) +void REGPARAM2 op_illg (uae_u32 opcode) { uaecptr pc = m68k_getpc (); if ((opcode & 0xF000) == 0xA000) { Exception(0xA,0); - cpuop_return(CFLOW_TRAP); + return; } if ((opcode & 0xF000) == 0xF000) { Exception(0xB,0); - cpuop_return(CFLOW_TRAP); + return; } write_log ("Illegal instruction: %04x at %08lx\n", opcode, pc); @@ -1210,7 +1209,7 @@ cpuop_rettype REGPARAM2 op_illg (uae_u32 #endif Exception (4,0); - cpuop_return(CFLOW_TRAP); + return; } void mmu_op(uae_u32 opcode, uae_u16 extra) @@ -1308,7 +1307,7 @@ int m68k_do_specialties (void) } if (SPCFLAGS_TEST( SPCFLAG_BRK )) { SPCFLAGS_CLEAR( SPCFLAG_BRK ); - return CFLOW_EXEC_RETURN; + return 1; } return 0; } @@ -1320,36 +1319,21 @@ void m68k_do_execute (void) #if FLIGHT_RECORDER m68k_record_step(m68k_getpc()); #endif -#ifdef X86_ASSEMBLY - __asm__ __volatile__("\tpushl %%ebp\n\tcall *%%ebx\n\tpopl %%ebp" /* FIXME */ - : : "b" (cpufunctbl[opcode]), "a" (opcode) - : "%edx", "%ecx", "%esi", "%edi", "%ebp", "memory", "cc"); -#else (*cpufunctbl[opcode])(opcode); -#endif - if (SPCFLAGS_TEST(SPCFLAG_ALL_BUT_EXEC_RETURN)) { - if (m68k_do_specialties()) + if (SPCFLAGS_TEST(SPCFLAG_ALL_BUT_EXEC_RETURN)) { + if (m68k_do_specialties()) return; } } } -#if USE_JIT +#if USE_JIT && !(defined(X86_ASSEMBLY) || defined(X86_64_ASSEMBLY)) void m68k_compile_execute (void) { for (;;) { - if (quit_program > 0) { - if (quit_program == 1) + if (quit_program) break; - quit_program = 0; - m68k_reset (); - } - m68k_do_compile_execute(); - } - if (debugging) { - uaecptr nextpc; - m68k_dumpstate(&nextpc); - exit(1); + m68k_do_compile_execute(); } } #endif @@ -1359,22 +1343,11 @@ void m68k_execute (void) #if USE_JIT ++m68k_execute_depth; #endif - for (;;) { - if (quit_program > 0) { - if (quit_program == 1) + if (quit_program) break; - quit_program = 0; - m68k_reset (); - } - m68k_do_execute(); + m68k_do_execute(); } - if (debugging) { - uaecptr nextpc; - m68k_dumpstate(&nextpc); - exit(1); - } - #if USE_JIT --m68k_execute_depth; #endif