From 1e94e03b7894e2bf22cdfc20e9ef3bab874b151d Mon Sep 17 00:00:00 2001 From: Fabio Priuli Date: Sun, 10 Mar 2013 18:24:39 +0000 Subject: [PATCH] (MESS) snes: more accurate mapping of the seta DSP chip for snesnew. nw --- src/mess/drivers/snes.c | 20 ++++++++++---------- src/mess/machine/sns_upd.c | 19 +++++++++++-------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/mess/drivers/snes.c b/src/mess/drivers/snes.c index 8d51ba0a903..6b05a63098b 100644 --- a/src/mess/drivers/snes.c +++ b/src/mess/drivers/snes.c @@ -2215,11 +2215,11 @@ READ8_MEMBER( snsnew_state::snesnew_lo_r ) else if (m_slotcart->get_type() == SNES_OBC1 && (offset < 0x400000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000)) return m_slotcart->m_cart->chip_read(space, offset); - else if ((m_slotcart->get_type() == SNES_ST010 || m_slotcart->get_type() == SNES_ST011) - && (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x1000)) + else if ((m_slotcart->get_type() == SNES_ST010 /*|| m_slotcart->get_type() == SNES_ST011*/) // why does this break moritash? + && (offset >= 0x600000 && offset < 0x680000 && (offset & 0xffff) < 0x4000)) return m_slotcart->m_cart->chip_read(space, offset); - else if ((m_slotcart->get_type() == SNES_ST010 /*|| m_slotcart->get_type() == SNES_ST011*/) // why does this freeze moritash? - && (offset == 0x600000 || offset == 0x600001)) + else if ((m_slotcart->get_type() == SNES_ST010 || m_slotcart->get_type() == SNES_ST011) + && (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x8000)) return m_slotcart->m_cart->chip_read(space, offset); else if (m_slotcart->get_type() == SNES_SRTC && (offset < 0x400000 && (offset & 0xffff) == 0x2800)) @@ -2280,10 +2280,10 @@ READ8_MEMBER( snsnew_state::snesnew_hi_r ) && (offset < 0x400000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000)) return m_slotcart->m_cart->chip_read(space, offset); else if ((m_slotcart->get_type() == SNES_ST010 || m_slotcart->get_type() == SNES_ST011) - && (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x1000)) + && (offset >= 0x600000 && offset < 0x680000 && (offset & 0xffff) < 0x4000)) return m_slotcart->m_cart->chip_read(space, offset); else if ((m_slotcart->get_type() == SNES_ST010 || m_slotcart->get_type() == SNES_ST011) - && (offset == 0x600000 || offset == 0x600001)) + && (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x8000)) return m_slotcart->m_cart->chip_read(space, offset); else if (m_slotcart->get_type() == SNES_SRTC && (offset < 0x400000 && (offset & 0xffff) == 0x2800)) @@ -2350,10 +2350,10 @@ WRITE8_MEMBER( snsnew_state::snesnew_lo_w ) && (offset < 0x400000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000)) m_slotcart->m_cart->chip_write(space, offset, data); else if ((m_slotcart->get_type() == SNES_ST010 || m_slotcart->get_type() == SNES_ST011) - && (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x1000)) + && (offset >= 0x600000 && offset < 0x680000 && (offset & 0xffff) < 0x4000)) m_slotcart->m_cart->chip_write(space, offset, data); else if ((m_slotcart->get_type() == SNES_ST010 || m_slotcart->get_type() == SNES_ST011) - && (offset == 0x600000 || offset == 0x600001)) + && (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x8000)) m_slotcart->m_cart->chip_write(space, offset, data); else if (m_slotcart->get_type() == SNES_SRTC && (offset < 0x400000 && (offset & 0xffff) == 0x2801)) @@ -2425,10 +2425,10 @@ WRITE8_MEMBER( snsnew_state::snesnew_hi_w ) && (offset < 0x400000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000)) return m_slotcart->m_cart->chip_write(space, offset, data); else if ((m_slotcart->get_type() == SNES_ST010 || m_slotcart->get_type() == SNES_ST011) - && (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x1000)) + && (offset >= 0x600000 && offset < 0x680000 && (offset & 0xffff) < 0x4000)) m_slotcart->m_cart->chip_write(space, offset, data); else if ((m_slotcart->get_type() == SNES_ST010 || m_slotcart->get_type() == SNES_ST011) - && (offset == 0x600000 || offset == 0x600001)) + && (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x8000)) m_slotcart->m_cart->chip_write(space, offset, data); else if (m_slotcart->get_type() == SNES_SRTC && (offset < 0x400000 && (offset & 0xffff) == 0x2801)) diff --git a/src/mess/machine/sns_upd.c b/src/mess/machine/sns_upd.c index eaa8839616c..f6b3054a501 100644 --- a/src/mess/machine/sns_upd.c +++ b/src/mess/machine/sns_upd.c @@ -214,7 +214,10 @@ WRITE8_MEMBER( sns_rom21_necdsp_device::chip_write ) READ8_MEMBER( sns_rom_setadsp_device::chip_read ) { - if (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x1000) + if (offset >= 0x600000 && offset < 0x680000 && (offset & 0xffff) < 0x4000) + m_upd96050->snesdsp_read((offset & 0x01) ? FALSE : TRUE); + + if (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x8000) { UINT16 address = offset & 0xffff; UINT16 temp = m_upd96050->dataram_r(address/2); @@ -223,8 +226,6 @@ READ8_MEMBER( sns_rom_setadsp_device::chip_read ) else return temp & 0xff; } - if (offset == 0x600000 || offset == 0x600001) - return (offset & 1) ? m_upd96050->snesdsp_read(FALSE) : m_upd96050->snesdsp_read(TRUE); return 0xff; } @@ -232,7 +233,13 @@ READ8_MEMBER( sns_rom_setadsp_device::chip_read ) WRITE8_MEMBER( sns_rom_setadsp_device::chip_write ) { - if (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x1000) + if (offset >= 0x600000 && offset < 0x680000 && (offset & 0xffff) < 0x4000) + { + m_upd96050->snesdsp_write((offset & 0x01) ? FALSE : TRUE, data); + return; + } + + if (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x8000) { UINT16 address = offset & 0xffff; UINT16 temp = m_upd96050->dataram_r(address/2); @@ -251,10 +258,6 @@ WRITE8_MEMBER( sns_rom_setadsp_device::chip_write ) m_upd96050->dataram_w(address/2, temp); return; } - if (offset == 0x600000) - m_upd96050->snesdsp_write(TRUE, data); - if (offset == 0x600001) - m_upd96050->snesdsp_write(FALSE, data); }