Mercurial > repos > blastem
comparison blastem.c @ 844:74e161fe7d39
Small tweaks to timing of 68K/Z80 interactions based on latest tests
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 31 Oct 2015 13:49:27 -0700 |
parents | f2cd380adebe |
children | 98d7b6073163 |
comparison
equal
deleted
inserted
replaced
843:715475788e93 | 844:74e161fe7d39 |
---|---|
471 | 471 |
472 m68k_context * io_write(uint32_t location, m68k_context * context, uint8_t value) | 472 m68k_context * io_write(uint32_t location, m68k_context * context, uint8_t value) |
473 { | 473 { |
474 genesis_context * gen = context->system; | 474 genesis_context * gen = context->system; |
475 if (location < 0x10000) { | 475 if (location < 0x10000) { |
476 //Access to Z80 memory incurs a one 68K cycle wait state | |
477 context->current_cycle += MCLKS_PER_68K; | |
476 if (!z80_enabled || z80_get_busack(gen->z80, context->current_cycle)) { | 478 if (!z80_enabled || z80_get_busack(gen->z80, context->current_cycle)) { |
477 location &= 0x7FFF; | 479 location &= 0x7FFF; |
478 if (location < 0x4000) { | 480 if (location < 0x4000) { |
479 z80_ram[location & 0x1FFF] = value; | 481 z80_ram[location & 0x1FFF] = value; |
480 #ifndef NO_Z80 | 482 #ifndef NO_Z80 |
589 uint8_t io_read(uint32_t location, m68k_context * context) | 591 uint8_t io_read(uint32_t location, m68k_context * context) |
590 { | 592 { |
591 uint8_t value; | 593 uint8_t value; |
592 genesis_context *gen = context->system; | 594 genesis_context *gen = context->system; |
593 if (location < 0x10000) { | 595 if (location < 0x10000) { |
596 //Access to Z80 memory incurs a one 68K cycle wait state | |
597 context->current_cycle += MCLKS_PER_68K; | |
594 if (!z80_enabled || z80_get_busack(gen->z80, context->current_cycle)) { | 598 if (!z80_enabled || z80_get_busack(gen->z80, context->current_cycle)) { |
595 location &= 0x7FFF; | 599 location &= 0x7FFF; |
596 if (location < 0x4000) { | 600 if (location < 0x4000) { |
597 value = z80_ram[location & 0x1FFF]; | 601 value = z80_ram[location & 0x1FFF]; |
598 } else if (location < 0x6000) { | 602 } else if (location < 0x6000) { |