From e7fbab4002650e5e77ac2800cd00f4114ef6eb1f Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Wed, 12 Aug 2015 19:18:17 +0300 Subject: [PATCH] 68020/030 prefetch pipeline update. --- gencpu.cpp | 7 ++++--- newcpu.cpp | 10 +++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/gencpu.cpp b/gencpu.cpp index 67773c4f..911b5060 100644 --- a/gencpu.cpp +++ b/gencpu.cpp @@ -3848,7 +3848,7 @@ static void gen_opcode (unsigned int opcode) clear_m68k_offset(); tail_ce020_done = true; fill_prefetch_full (); - branch_inst = 2; + branch_inst = 1; break; case i_RTD: addop_ce020 (curi, 0); @@ -3871,7 +3871,7 @@ static void gen_opcode (unsigned int opcode) tail_ce020_done = true; fill_prefetch_full (); need_endlabel = 1; - branch_inst = 2; + branch_inst = 1; break; case i_LINK: // ce confirmed @@ -3939,7 +3939,7 @@ static void gen_opcode (unsigned int opcode) clear_m68k_offset(); fill_prefetch_full (); need_endlabel = 1; - branch_inst = 2; + branch_inst = 1; break; case i_TRAPV: sync_m68k_pc (); @@ -3968,6 +3968,7 @@ static void gen_opcode (unsigned int opcode) clear_m68k_offset(); fill_prefetch_full (); need_endlabel = 1; + branch_inst = 1; tail_ce020_done = true; break; case i_JSR: diff --git a/newcpu.cpp b/newcpu.cpp index 79bae779..753f38d6 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -1284,7 +1284,7 @@ static void build_cpufunctbl (void) if (f == op_illg_1) abort (); cpufunctbl[opcode] = f; - memcpy(&cpudatatbl[opcode], &cpudatatbl[idx], sizeof cputbl_data); + memcpy(&cpudatatbl[opcode], &cpudatatbl[idx], sizeof(struct cputbl_data)); opcnt++; } } @@ -2877,7 +2877,7 @@ static void m68k_reset2(bool hardreset) regs.halted = 0; gui_data.cpu_halted = 0; - gui_led (LED_CPU, 0); + gui_led (LED_CPU, 0, -1); regs.spcflags = 0; m68k_reset_delay = 0; @@ -4391,7 +4391,7 @@ void cpu_halt (int id) write_log (_T("CPU halted: reason = %d PC=%08x\n"), id, M68K_GETPC); regs.halted = id; gui_data.cpu_halted = id; - gui_led(LED_CPU, 0); + gui_led(LED_CPU, 0, -1); if (id >= 0) { regs.intmask = 7; MakeSR (); @@ -6712,6 +6712,7 @@ static void pipeline_020(uae_u16 w, uaecptr pc) int branch = cpudatatbl[w].branch; if (regs.pipeline_pos > 0 && branch) { // Short branches (Bcc.s) still do one more prefetch. +#if 0 // RTS and other unconditional single opcode instruction stop immediately. if (branch == 2) { // Immediate stop @@ -6720,6 +6721,9 @@ static void pipeline_020(uae_u16 w, uaecptr pc) // Stop 1 word early than normally regs.pipeline_stop = 1; } +#else + regs.pipeline_stop = 1; +#endif } } -- 2.47.3