]> git.sesse.net Git - pistorm/blobdiff - m68kcpu.c
Some RTG bug fixes, (inactive for now) P2C iRTG implementation
[pistorm] / m68kcpu.c
index 4cc48c5f75044fc636e4da876bd9b0a55f939fcf..ce9958e04cbca5d7416429dd06a225fd170dd81f 100644 (file)
--- a/m68kcpu.c
+++ b/m68kcpu.c
@@ -990,9 +990,6 @@ int m68k_execute(int num_cycles)
                /* Main loop.  Keep going until we run out of clock cycles */
                do
                {
-#ifdef M68K_BUSERR_THING
-                       int i;
-#endif
                        /* Set tracing accodring to T1. (T0 is done inside instruction) */
                        m68ki_trace_t1(); /* auto-disable (see m68kcpu.h) */
 
@@ -1006,8 +1003,9 @@ int m68k_execute(int num_cycles)
                        REG_PPC = REG_PC;
 
                        /* Record previous D/A register state (in case of bus error) */
+//#define M68K_BUSERR_THING
 #ifdef M68K_BUSERR_THING
-                       for (i = 15; i >= 0; i--){
+                       for (int i = 15; i >= 0; i--){
                                REG_DA_SAVE[i] = REG_DA[i];
                        }
 #endif
@@ -1161,9 +1159,6 @@ void m68k_pulse_reset(void)
 
        /* Read the initial stack pointer and program counter */
        m68ki_jump(0);
-       REG_SP = m68ki_read_imm_32();
-       REG_PC = m68ki_read_imm_32();
-       m68ki_jump(REG_PC);
 
        CPU_RUN_MODE = RUN_MODE_NORMAL;
 
@@ -1338,6 +1333,21 @@ void m68k_add_rom_range(uint32_t addr, uint32_t upper, unsigned char *ptr)
        }
 }
 
+void m68k_clear_ranges()
+{
+       printf("[MUSASHI] Clearing all reads/write memory ranges.\n");
+       for (int i = 0; i < 8; i++) {
+               read_upper[i] = 0;
+               read_addr[i] = 0;
+               read_data[i] = NULL;
+               write_upper[i] = 0;
+               write_addr[i] = 0;
+               write_data[i] = NULL;
+       }
+       write_ranges = 0;
+       read_ranges = 0;
+}
+
 /* ======================================================================== */
 /* ============================== MAME STUFF ============================== */
 /* ======================================================================== */