From ccb85b19f91b59d22475d4b8ab2225ff819c3e53 Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Sat, 12 Dec 2020 11:00:36 +0100 Subject: [PATCH] marble: The slapstic seems to trigger on more than the banking zone. --- src/mame/drivers/atarisy1.cpp | 5 +++++ src/mame/machine/slapstic.cpp | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/mame/drivers/atarisy1.cpp b/src/mame/drivers/atarisy1.cpp index cf99a47a4e0..4fdde89a957 100644 --- a/src/mame/drivers/atarisy1.cpp +++ b/src/mame/drivers/atarisy1.cpp @@ -2491,6 +2491,11 @@ void atarisy1_state::init_slapstic() m_maincpu->space(AS_PROGRAM).install_readwrite_tap(0x80000, 0x87fff, 0, "slapstic", [this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(offset >> 1); }, [this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(offset >> 1); }); + + // The slaptic seems to trigger on the whole rom, but that slows things down too much. limit to the range marble madness actually needs + m_maincpu->space(AS_PROGRAM).install_readwrite_tap(0x2ff5a, 0x2ff5b, 0, "slapstic", + [this](offs_t offset, u16 &data, u16 mem_mask) { logerror("!! %x\n", offset); m_slapstic->tweak(offset >> 1); }, + [this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(offset >> 1); }); } void atarisy1_state::init_marble() diff --git a/src/mame/machine/slapstic.cpp b/src/mame/machine/slapstic.cpp index 314769b5879..e090721248c 100644 --- a/src/mame/machine/slapstic.cpp +++ b/src/mame/machine/slapstic.cpp @@ -867,11 +867,16 @@ int atari_slapstic_device::tweak(offs_t offset) break; /* ALTERNATE1 state: look for alternate2 offset, or else fall back to ENABLED */ + /* Can also go to ADDITIVE1. Not a hack, it's real. */ case ALTERNATE1: if (MATCHES_MASK_VALUE(offset, slapstic.alt2)) { state = ALTERNATE2; } + else if (MATCHES_MASK_VALUE(offset, slapstic.add1)) + { + state = ADDITIVE1; + } else { state = ENABLED; @@ -994,10 +999,9 @@ int atari_slapstic_device::tweak(offs_t offset) } break; - /* ADDITIVE3 state: waiting for a bank to seal the deal */ + /* ADDITIVE3 state: waiting for the commit, which is common with alt, but can be delayed */ case ADDITIVE3: - if (offset == slapstic.bank[0] || offset == slapstic.bank[1] || - offset == slapstic.bank[2] || offset == slapstic.bank[3]) + if (MATCHES_MASK_VALUE(offset, slapstic.alt4)) { state = DISABLED; current_bank = add_bank;