From 857c566cb3a12b24c74e28e6efe6d9a84e740ddc Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 25 Feb 2025 11:30:16 +0100 Subject: [PATCH] kinst: add eprom waitstates --- src/mame/rare/kinst.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/mame/rare/kinst.cpp b/src/mame/rare/kinst.cpp index 488a2314482..fae98c70126 100644 --- a/src/mame/rare/kinst.cpp +++ b/src/mame/rare/kinst.cpp @@ -18,9 +18,8 @@ TODO: - The SRAM test fails in diagnostics; this is due to the fact that the test relies on executing out of the cache while it tromps over (and eventually restores) the instructions it is executing; this will likely never be fixed. -- Bootup sequence (the blue color fill) is too fast, which in turn causes - attract mode music not to play. Maybe the main CPU is running at a lower - clockspeed at boot (50MHz/4 seems plausible), but then, what toggles it? +- Verify waitstates on memory access, currently it's only added for EPROMs + during the blue screen boot up sequence. **************************************************************************** @@ -244,6 +243,7 @@ private: uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); uint32_t ide_extra_r(); void ide_extra_w(uint32_t data); + uint32_t rom_r(offs_t offset); void vram_control_w(offs_t offset, uint32_t data, uint32_t mem_mask); void sound_reset_w(offs_t offset, uint32_t data, uint32_t mem_mask); @@ -300,7 +300,6 @@ void kinst_state::machine_start() // configure fast RAM regions m_maincpu->add_fastram(0x08000000, 0x087fffff, false, m_rambase2); m_maincpu->add_fastram(0x00000000, 0x0007ffff, false, m_rambase); - m_maincpu->add_fastram(0x1fc00000, 0x1fc7ffff, true, m_rombase); // register for savestates save_item(NAME(m_vram_control)); @@ -502,6 +501,16 @@ void kinst_state::coin_control_w(offs_t offset, uint32_t data, uint32_t mem_mask } +uint32_t kinst_state::rom_r(offs_t offset) +{ + // add RdRdy clocks on EPROM access + // bootup sequence takes approx. 6 seconds, and it's not a CPU clock divider + m_maincpu->adjust_icount(-128); + + return m_rombase[offset]; +} + + /************************************* * @@ -524,7 +533,7 @@ void kinst_state::kinst_map(address_map &map) map(0x10000100, 0x1000013f).rw(FUNC(kinst_state::ide_r), FUNC(kinst_state::ide_w)); map(0x10000170, 0x10000173).rw(FUNC(kinst_state::ide_extra_r), FUNC(kinst_state::ide_extra_w)); - map(0x1fc00000, 0x1fc7ffff).rom().region("user1", 0); + map(0x1fc00000, 0x1fc7ffff).r(FUNC(kinst_state::rom_r)); }