From 6fe7eb6b4da15c20734bcb20187d6b735f2b2df0 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sat, 1 Feb 2020 14:19:45 +0200 Subject: [PATCH] Assume TAS is supported if not chip bus access. --- cputest.cpp | 2 +- custom.cpp | 10 +++++++--- gencpu.cpp | 4 ++-- include/events.h | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/cputest.cpp b/cputest.cpp index 6bd63b37..ce3ba0d7 100644 --- a/cputest.cpp +++ b/cputest.cpp @@ -679,7 +679,7 @@ bool mmu_op30(uaecptr pc, uae_u32 opcode, uae_u16 extra, uaecptr extraa) return true; } -int is_cycle_ce(void) +bool is_cycle_ce(uaecptr addr) { return 0; } diff --git a/custom.cpp b/custom.cpp index 98276913..cad7516e 100644 --- a/custom.cpp +++ b/custom.cpp @@ -11843,10 +11843,14 @@ void do_cycles_ce020 (unsigned long cycles) } -int is_cycle_ce (void) +bool is_cycle_ce(uaecptr addr) { - int hpos = current_hpos (); - return cycle_line[hpos] & CYCLE_MASK; + addrbank *ab = get_mem_bank_real(addr); + if ((ab->flags & ABFLAG_CHIPRAM) || ab == &custom_bank) { + int hpos = current_hpos(); + return (cycle_line[hpos] & CYCLE_MASK) != 0; + } + return 0; } #endif diff --git a/gencpu.cpp b/gencpu.cpp index 8e4218af..1f25fc7a 100644 --- a/gencpu.cpp +++ b/gencpu.cpp @@ -8025,7 +8025,7 @@ bccl_not68020: if (isreg(curi->smode) || !using_ce) { genastore_tas("src", curi->smode, "srcreg", curi->size, "src"); } else { - out("if (!is_cycle_ce()) {\n"); + out("if (!is_cycle_ce(srca)) {\n"); genastore("src", curi->smode, "srcreg", curi->size, "src"); out("} else {\n"); out("%s(4);\n", do_cycles); @@ -8048,7 +8048,7 @@ bccl_not68020: if (isreg(curi->smode) || !using_ce) { genastore_tas("src", curi->smode, "srcreg", curi->size, "src"); } else { - out("if (!is_cycle_ce()) {\n"); + out("if (!is_cycle_ce(srca)) {\n"); genastore("src", curi->smode, "srcreg", curi->size, "src"); out("} else {\n"); out("%s(4);\n", do_cycles); diff --git a/include/events.h b/include/events.h index ee580416..1ea2eda5 100644 --- a/include/events.h +++ b/include/events.h @@ -35,7 +35,7 @@ extern void events_schedule (void); extern void do_cycles_slow (unsigned long cycles_to_add); extern void events_reset_syncline(void); -extern int is_cycle_ce (void); +extern bool is_cycle_ce(uaecptr); extern unsigned long currcycle, nextevent; extern int is_syncline, is_syncline_end; -- 2.47.3