[Core/VDP] added some 68k cycles delay on invalid VRAM writes to simulate periodical 68k wait-states (fixes "Microcosm" intro loop)

This commit is contained in:
EkeEke 2013-10-21 00:32:39 +02:00 committed by twinaphex
parent cf6081fb69
commit 3aa1529aa1

View File

@ -2188,7 +2188,6 @@ static void vdp_fifo_update(unsigned int cycles)
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/* Internal 16-bit data bus access function (Mode 5 only) */ /* Internal 16-bit data bus access function (Mode 5 only) */
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
static void vdp_bus_w(unsigned int data) static void vdp_bus_w(unsigned int data)
{ {
/* write data to next FIFO entry */ /* write data to next FIFO entry */
@ -2304,6 +2303,8 @@ static void vdp_bus_w(unsigned int data)
default: default:
{ {
/* add some delay until 68k periodical wait-states (RAM refresh ?) are accurately emulated (needed by "Clue" & "Microcosm") */
m68k.cycles += 2;
#ifdef LOGERROR #ifdef LOGERROR
error("[%d(%d)][%d(%d)] Invalid (%d) 0x%x write -> 0x%x (%x)\n", v_counter, m68k.cycles/MCYCLES_PER_LINE-1, m68k.cycles, m68k.cycles%MCYCLES_PER_LINE, code, addr, data, m68k_get_reg(M68K_REG_PC)); error("[%d(%d)][%d(%d)] Invalid (%d) 0x%x write -> 0x%x (%x)\n", v_counter, m68k.cycles/MCYCLES_PER_LINE-1, m68k.cycles, m68k.cycles%MCYCLES_PER_LINE, code, addr, data, m68k_get_reg(M68K_REG_PC));
#endif #endif