summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--blastem.c4
-rw-r--r--z80_to_x86.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/blastem.c b/blastem.c
index e4645eb..aaed215 100644
--- a/blastem.c
+++ b/blastem.c
@@ -473,6 +473,8 @@ m68k_context * io_write(uint32_t location, m68k_context * context, uint8_t value
{
genesis_context * gen = context->system;
if (location < 0x10000) {
+ //Access to Z80 memory incurs a one 68K cycle wait state
+ context->current_cycle += MCLKS_PER_68K;
if (!z80_enabled || z80_get_busack(gen->z80, context->current_cycle)) {
location &= 0x7FFF;
if (location < 0x4000) {
@@ -591,6 +593,8 @@ uint8_t io_read(uint32_t location, m68k_context * context)
uint8_t value;
genesis_context *gen = context->system;
if (location < 0x10000) {
+ //Access to Z80 memory incurs a one 68K cycle wait state
+ context->current_cycle += MCLKS_PER_68K;
if (!z80_enabled || z80_get_busack(gen->z80, context->current_cycle)) {
location &= 0x7FFF;
if (location < 0x4000) {
diff --git a/z80_to_x86.c b/z80_to_x86.c
index 215a7cb..54f4c6e 100644
--- a/z80_to_x86.c
+++ b/z80_to_x86.c
@@ -2630,6 +2630,9 @@ void z80_clear_busreq(z80_context * context, uint32_t cycle)
z80_run(context, cycle);
context->busreq = 0;
context->busack = 0;
+ //there appears to be at least a 1 Z80 cycle delay between busreq
+ //being released and resumption of execution
+ context->current_cycle += context->options->gen.clock_divider;
}
uint8_t z80_get_busack(z80_context * context, uint32_t cycle)