(MESS) snes: Added support for DSP-1 games with ROM larger than 1MB. nw.

This commit is contained in:
Fabio Priuli 2013-03-10 18:46:03 +00:00
parent 39cd95f6e0
commit 4f6c20fff8
3 changed files with 38 additions and 6 deletions

View File

@ -2204,8 +2204,11 @@ READ8_MEMBER( snsnew_state::snesnew_lo_r )
{
// take care of add-on IO
if (m_slotcart->get_type() == SNES_DSP
&& (offset >= 0x200000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
&& (offset >= 0x200000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
return m_slotcart->m_cart->chip_read(space, offset & 0x7fff);
else if (m_slotcart->get_type() == SNES_DSP_2MB
&& (offset >= 0x600000 && offset < 0x700000 && (offset & 0x8000) == 0x0000))
return m_slotcart->m_cart->chip_read(space, offset & 0x7fff);
else if (m_slotcart->get_type() == SNES_DSP_MODE21
&& (offset < 0x200000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
return m_slotcart->m_cart->chip_read(space, offset & 0x1fff);
@ -2232,6 +2235,7 @@ READ8_MEMBER( snsnew_state::snesnew_lo_r )
case SNES_ST010:
case SNES_ST011:
case SNES_DSP:
case SNES_DSP_2MB:
case SNES_DSP4:
case SNES_OBC1:
case SNES_SUFAMITURBO:
@ -2268,8 +2272,11 @@ READ8_MEMBER( snsnew_state::snesnew_hi_r )
{
// take care of add-on IO
if (m_slotcart->get_type() == SNES_DSP
&& (offset >= 0x200000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
&& (offset >= 0x200000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
return m_slotcart->m_cart->chip_read(space, offset & 0x7fff);
else if (m_slotcart->get_type() == SNES_DSP_2MB
&& (offset >= 0x600000 && offset < 0x700000 && (offset & 0x8000) == 0x0000))
return m_slotcart->m_cart->chip_read(space, offset & 0x7fff);
else if (m_slotcart->get_type() == SNES_DSP_MODE21
&& (offset < 0x200000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
return m_slotcart->m_cart->chip_read(space, offset & 0x1fff);
@ -2302,6 +2309,7 @@ READ8_MEMBER( snsnew_state::snesnew_hi_r )
case SNES_ST010:
case SNES_ST011:
case SNES_DSP:
case SNES_DSP_2MB:
case SNES_DSP4:
case SNES_OBC1:
case SNES_SUFAMITURBO:
@ -2338,7 +2346,10 @@ WRITE8_MEMBER( snsnew_state::snesnew_lo_w )
{
// take care of add-on IO
if (m_slotcart->get_type() == SNES_DSP
&& (offset >= 0x200000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
&& (offset >= 0x200000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
m_slotcart->m_cart->chip_write(space, offset & 0x7fff, data);
else if (m_slotcart->get_type() == SNES_DSP_2MB
&& (offset >= 0x600000 && offset < 0x700000 && (offset & 0x8000) == 0x0000))
m_slotcart->m_cart->chip_write(space, offset & 0x7fff, data);
else if (m_slotcart->get_type() == SNES_DSP_MODE21
&& (offset < 0x200000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
@ -2372,6 +2383,7 @@ WRITE8_MEMBER( snsnew_state::snesnew_lo_w )
case SNES_ST010:
case SNES_ST011:
case SNES_DSP:
case SNES_DSP_2MB:
case SNES_DSP4:
case SNES_OBC1:
case SNES_SUFAMITURBO:
@ -2413,7 +2425,10 @@ WRITE8_MEMBER( snsnew_state::snesnew_hi_w )
{
// take care of add-on IO
if (m_slotcart->get_type() == SNES_DSP
&& (offset >= 0x200000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
&& (offset >= 0x200000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
m_slotcart->m_cart->chip_write(space, offset & 0x7fff, data);
else if (m_slotcart->get_type() == SNES_DSP_2MB
&& (offset >= 0x600000 && offset < 0x700000 && (offset & 0x8000) == 0x0000))
m_slotcart->m_cart->chip_write(space, offset & 0x7fff, data);
else if (m_slotcart->get_type() == SNES_DSP_MODE21
&& (offset < 0x200000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
@ -2447,6 +2462,7 @@ WRITE8_MEMBER( snsnew_state::snesnew_hi_w )
case SNES_ST010:
case SNES_ST011:
case SNES_DSP:
case SNES_DSP_2MB:
case SNES_DSP4:
case SNES_OBC1:
case SNES_SUFAMITURBO:

View File

@ -620,6 +620,9 @@ bool base_sns_cart_slot_device::call_load()
m_type = SNES_MODE20;
else
m_type = sns_get_pcb_id(slot_name);
if (m_type == SNES_DSP && len > 0x100000)
m_type = SNES_DSP_2MB;
}
setup_custom_mappers();
@ -780,7 +783,12 @@ int base_sns_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len)
if (addon != -1)
{
if (type == SNES_MODE20 && addon == SNES_DSP)
type = SNES_DSP;
{
if (len > 0x100000)
type = SNES_DSP_2MB;
else
type = SNES_DSP;
}
else if (type == SNES_MODE21 && addon == SNES_DSP)
type = SNES_DSP_MODE21;
else
@ -791,6 +799,7 @@ int base_sns_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len)
switch (type)
{
case SNES_DSP:
case SNES_DSP_2MB:
case SNES_DSP4:
case SNES_ST010:
case SNES_ST011:
@ -944,6 +953,7 @@ void base_sns_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len)
"ROM (ExHiROM)",
"ROM, CX4",
"ROM, DSP-1,2,3 (LoROM)",
"ROM, DSP-1 (LoROM 2MB)",
"ROM, DSP-1 (HiROM)",
"ROM, DSP-4",
"ROM, OBC-1",
@ -1064,7 +1074,12 @@ void base_sns_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len)
if (addon != -1)
{
if (type == SNES_MODE20 && addon == SNES_DSP)
type = SNES_DSP;
{
if (len > 0x100000)
type = SNES_DSP_2MB;
else
type = SNES_DSP;
}
else if (type == SNES_MODE21 && addon == SNES_DSP)
type = SNES_DSP_MODE21;
else

View File

@ -15,6 +15,7 @@ enum
SNES_MODE25, // ExHiROM - not used anymore in emulation (only to log info), will be removed
SNES_CX4,
SNES_DSP,
SNES_DSP_2MB,
SNES_DSP_MODE21,
SNES_DSP4,
SNES_OBC1,