summaryrefslogtreecommitdiff
path: root/blastem.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2015-10-31 13:49:27 -0700
committerMichael Pavone <pavone@retrodev.com>2015-10-31 13:49:27 -0700
commit90e6a4b13a7afc6e035dc645bc89c86a951391ed (patch)
tree8c99f94d4cb00fb8e2905c9a3205407b466f36c5 /blastem.c
parent8ae568bd4afc5d9ce5a3a6e8fe98b0bfa30b4130 (diff)
Small tweaks to timing of 68K/Z80 interactions based on latest tests
Diffstat (limited to 'blastem.c')
-rw-r--r--blastem.c4
1 files changed, 4 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) {