From 86fb011122bae796824d0c58e16b69a95af12130 Mon Sep 17 00:00:00 2001 From: MetalliC <0vetal0@gmail.com> Date: Sat, 25 Jan 2020 19:45:13 +0200 Subject: konmedal.cpp added hackfix for mariourou scrolling, documented observed row/col scroll K052109 tilemaps issues --- src/mame/drivers/konmedal.cpp | 14 +++++++++++++- src/mame/video/k052109.cpp | 3 +++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/mame/drivers/konmedal.cpp b/src/mame/drivers/konmedal.cpp index 7b0c7bccc7f..991a363b912 100644 --- a/src/mame/drivers/konmedal.cpp +++ b/src/mame/drivers/konmedal.cpp @@ -42,7 +42,8 @@ Konami PWB 402218 boards Notes and TODOs: - Priorities not understood and wrong in places of GX-based games, apparently controlled by PROM - - Column scroll not correct in TMNT-based games + - X/Y scroll effects not handled well by current K052109(TMNT tilemaps) emulation. + Mario Roulette glitches "resolved" using hack, Fuusen Pentai still have issues with column scroll (not OK with -6 added to column index). ***************************************************************************/ @@ -124,6 +125,7 @@ private: DECLARE_WRITE8_MEMBER(shuri_bank_w); DECLARE_READ8_MEMBER(shuri_irq_r); DECLARE_WRITE8_MEMBER(shuri_irq_w); + DECLARE_WRITE8_MEMBER(mario_scrollhack_w); void ddboy_main(address_map &map); void medal_main(address_map &map); @@ -422,6 +424,7 @@ void konmedal_state::shuriboy_main(address_map &map) map(0xa000, 0xbfff).bankr("bank1"); map(0xc000, 0xffff).rw(m_k052109, FUNC(k052109_device::read), FUNC(k052109_device::write)); map(0xdd00, 0xdd00).rw(FUNC(konmedal_state::shuri_irq_r), FUNC(konmedal_state::shuri_irq_w)); + map(0xdc80, 0xdc80).w(FUNC(konmedal_state::mario_scrollhack_w)); } static INPUT_PORTS_START( konmedal ) @@ -800,6 +803,15 @@ TIMER_DEVICE_CALLBACK_MEMBER(konmedal_state::shuri_scanline) } } +WRITE8_MEMBER(konmedal_state::mario_scrollhack_w) +{ + // Mario Roulette enable X and Y scroll in the same time for both layers, which is currently not supported by emulated K052109. + // here we hacky disable Y scroll for layer A and X scroll for layer B. + if (data == 0x36) + data = 0x22; + m_k052109->write(0x1c80, data); +} + void konmedal_state::shuriboy(machine_config &config) { /* basic machine hardware */ diff --git a/src/mame/video/k052109.cpp b/src/mame/video/k052109.cpp index 6d5d66af66e..a14cde4e2c0 100644 --- a/src/mame/video/k052109.cpp +++ b/src/mame/video/k052109.cpp @@ -89,6 +89,9 @@ address lines), and then reading it from the 051962. surpratk sets this register to 70 during the second boss. There is nothing obviously wrong so it's not clear what should happen. glfgreat sets it to 30 when showing the leader board + mariorou sets it to 36 when ingame, while actually does per-row scroll for layer A and per-collumn scroll for layer B. + such usage not supported by current implementation, hacked in game driver instead. + fuusenpn sets this to 20 but not happy with -6 added to column index, apparently current logic is not entirely correct. 1d00 : bits 0 & 1 might enable NMI and FIRQ, not sure : bit 2 = IRQ enable 1d80 : ROM bank selector bits 0-3 = bank 0 bits 4-7 = bank 1 -- cgit v1.2.3