From ad5d4ba44184af2759443a6755457536ebd5f0d9 Mon Sep 17 00:00:00 2001 From: Fabio Priuli Date: Sat, 6 Sep 2014 10:30:13 +0000 Subject: [PATCH] (MESS) a7800: more accurate POKEY accesses make Beef Drop happier. nw. --- src/emu/bus/a7800/rom.c | 30 +++++++++++++++++++++++++++--- src/emu/bus/a7800/rom.h | 2 ++ 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/emu/bus/a7800/rom.c b/src/emu/bus/a7800/rom.c index ca05895bebe..0796756fea3 100644 --- a/src/emu/bus/a7800/rom.c +++ b/src/emu/bus/a7800/rom.c @@ -7,8 +7,11 @@ - pokey or not - 9 banks or not etc... - But we might merge many of these if they become too many (e.g. could there be banked 32L RAM also - in a 9banks cart or in a cart with no bankswitch?) + But we might merge many of these if they become too many + + TODO: + - Are POKEY regs readable somewhere in SG 144K + POKEY homebrew? How do they detect + the POKEY otherwise?!? ***********************************************************************************************************/ @@ -182,6 +185,17 @@ READ8_MEMBER(a78_rom_device::read_40xx) -------------------------------------------------*/ +READ8_MEMBER(a78_rom_pokey_device::read_40xx) +{ + if (offset < 0x4000) + return m_pokey->read(space, offset & 0x0f); + + if (offset + 0x4000 < m_base_rom) + return 0xff; + else + return m_rom[offset + 0x4000 - m_base_rom]; +} + WRITE8_MEMBER(a78_rom_pokey_device::write_40xx) { if (offset < 0x4000) @@ -233,10 +247,20 @@ WRITE8_MEMBER(a78_rom_sg_device::write_40xx) Carts with SuperGame bankswitch + POKEY chip As above + Pokey chip access - GAMES: Commando + GAMES: Commando and Barnyard Blaster -------------------------------------------------*/ +READ8_MEMBER(a78_rom_sg_pokey_device::read_40xx) +{ + if (offset < 0x4000) + return m_pokey->read(space, offset & 0x0f); + else if (offset < 0x8000) + return m_rom[(offset & 0x3fff) + (m_bank * 0x4000)]; + else + return m_rom[(offset & 0x3fff) + (m_bank_mask * 0x4000)]; // last bank +} + WRITE8_MEMBER(a78_rom_sg_pokey_device::write_40xx) { if (offset < 0x4000) diff --git a/src/emu/bus/a7800/rom.h b/src/emu/bus/a7800/rom.h index 335c8aba1d9..0a67d6d0de2 100644 --- a/src/emu/bus/a7800/rom.h +++ b/src/emu/bus/a7800/rom.h @@ -36,6 +36,7 @@ public: virtual machine_config_constructor device_mconfig_additions() const; // reading and writing + virtual DECLARE_READ8_MEMBER(read_40xx); virtual DECLARE_WRITE8_MEMBER(write_40xx); protected: @@ -77,6 +78,7 @@ public: virtual machine_config_constructor device_mconfig_additions() const; // reading and writing + virtual DECLARE_READ8_MEMBER(read_40xx); virtual DECLARE_WRITE8_MEMBER(write_40xx); protected: