mirror of
https://github.com/holub/mame
synced 2025-05-25 23:35:26 +03:00
srccleaned + minor fixes. nw.
This commit is contained in:
parent
24837775a4
commit
aa2b3bb471
@ -165,7 +165,7 @@ static READ8_HANDLER( snes_lo_r )
|
||||
{
|
||||
if (address >= 0x3000 && address < 0x3300)
|
||||
return superfx_mmio_read(state->m_superfx, address);
|
||||
if (address >= 0x6000 && address < 0x8000) // here it should be snes_ram[0xe00000+...] but there are mirroring issues
|
||||
if (address >= 0x6000 && address < 0x8000) // here it should be snes_ram[0xe00000+...] but there are mirroring issues
|
||||
return superfx_access_ram(state->m_superfx) ? snes_ram[0xf00000 + (offset & 0x1fff)] : snes_open_bus_r(space, 0);
|
||||
}
|
||||
if (state->m_has_addon_chip == HAS_SUPERFX && state->m_superfx != NULL
|
||||
@ -257,7 +257,7 @@ static READ8_HANDLER( snes_hi_r )
|
||||
&& offset >= 0x500000)
|
||||
return spc7110_bank7_read(space, offset - 0x400000);
|
||||
if (state->m_has_addon_chip == HAS_SUPERFX && state->m_superfx != NULL)
|
||||
return space.read_byte(offset); // [80-ff] same as [00-7f]
|
||||
return space.read_byte(offset); // [80-ff] same as [00-7f]
|
||||
|
||||
// base cart access
|
||||
if (offset < 0x400000)
|
||||
@ -274,47 +274,47 @@ static WRITE8_HANDLER( snes_lo_w )
|
||||
// take care of add-on chip access
|
||||
if (state->m_has_addon_chip == HAS_OBC1
|
||||
&& (offset < 0x400000 && address >= 0x6000 && address < 0x8000))
|
||||
{ obc1_write(space, offset, data, mem_mask); return; }
|
||||
{ obc1_write(space, offset, data, mem_mask); return; }
|
||||
if (state->m_has_addon_chip == HAS_CX4
|
||||
&& (offset < 0x400000 && address >= 0x6000 && address < 0x8000))
|
||||
{ CX4_write(space.machine(), address - 0x6000, data); return; }
|
||||
{ CX4_write(space.machine(), address - 0x6000, data); return; }
|
||||
if (state->m_has_addon_chip == HAS_RTC
|
||||
&& (offset < 0x400000 && (address == 0x2800 || address == 0x2801)))
|
||||
{ srtc_write(space.machine(), offset, data); return; }
|
||||
{ srtc_write(space.machine(), offset, data); return; }
|
||||
if (state->m_has_addon_chip == HAS_ST010 || state->m_has_addon_chip == HAS_ST011)
|
||||
{
|
||||
if (offset >= 0x680000 && offset < 0x700000 && address < 0x1000)
|
||||
{ st010_write_ram(state, address, data); return; }
|
||||
{ st010_write_ram(state, address, data); return; }
|
||||
if (offset == 0x600000)
|
||||
{ st010_set_dr(data); return; }
|
||||
{ st010_set_dr(data); return; }
|
||||
if (offset == 0x600001)
|
||||
{ st010_set_sr(data); return; }
|
||||
{ st010_set_sr(data); return; }
|
||||
}
|
||||
if (state->m_cart[0].mode == SNES_MODE_21 && state->m_has_addon_chip == HAS_DSP1
|
||||
&& (offset < 0x200000 && address >= 0x6000 && address < 0x8000))
|
||||
{ dsp_set_dr(data); return; }
|
||||
{ dsp_set_dr(data); return; }
|
||||
if (state->m_cart[0].mode == SNES_MODE_20 && state->m_has_addon_chip == HAS_DSP1)
|
||||
{
|
||||
if (offset >= 0x200000 && offset < 0x400000 && (offset & 0x8000) == 0x8000)
|
||||
{ dsp_set_dr(data); return; }
|
||||
{ dsp_set_dr(data); return; }
|
||||
if (offset >= 0x600000 && offset < 0x700000 && (offset & 0x8000) == 0x0000)
|
||||
{ dsp_set_dr(data); return; }
|
||||
{ dsp_set_dr(data); return; }
|
||||
}
|
||||
if ((state->m_has_addon_chip == HAS_DSP2 || state->m_has_addon_chip == HAS_DSP3)
|
||||
&& (offset >= 0x200000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
|
||||
{
|
||||
if (address < 0xc000)
|
||||
{ dsp_set_dr(data); return; }
|
||||
{ dsp_set_dr(data); return; }
|
||||
else
|
||||
{ dsp_set_sr(data); return; }
|
||||
{ dsp_set_sr(data); return; }
|
||||
}
|
||||
if (state->m_has_addon_chip == HAS_DSP4
|
||||
&& (offset >= 0x300000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
|
||||
{
|
||||
if (address < 0xc000)
|
||||
{ dsp_set_dr(data); return; }
|
||||
{ dsp_set_dr(data); return; }
|
||||
else
|
||||
{ dsp_set_sr(data); return; }
|
||||
{ dsp_set_sr(data); return; }
|
||||
}
|
||||
if (state->m_has_addon_chip == HAS_SDD1 && offset < 0x400000)
|
||||
{
|
||||
@ -328,23 +328,23 @@ static WRITE8_HANDLER( snes_lo_w )
|
||||
{
|
||||
UINT16 limit = (state->m_has_addon_chip == HAS_SPC7110_RTC) ? 0x4842 : 0x483f;
|
||||
if (address >= 0x4800 && address <= limit)
|
||||
{ spc7110_mmio_write(space.machine(), (UINT32)address, data); return; }
|
||||
{ spc7110_mmio_write(space.machine(), (UINT32)address, data); return; }
|
||||
if (offset < 0x10000 && address >= 0x6000 && address < 0x8000)
|
||||
{ snes_ram[0x306000 + (address & 0x1fff)] = data; return; }
|
||||
{ snes_ram[0x306000 + (address & 0x1fff)] = data; return; }
|
||||
if (offset >= 0x300000 && offset < 0x310000 && address >= 0x6000 && address < 0x8000)
|
||||
{ snes_ram[0x306000 + (address & 0x1fff)] = data; return; }
|
||||
{ snes_ram[0x306000 + (address & 0x1fff)] = data; return; }
|
||||
}
|
||||
if (state->m_has_addon_chip == HAS_SUPERFX && state->m_superfx != NULL
|
||||
&& offset < 0x400000)
|
||||
&& offset < 0x400000)
|
||||
{
|
||||
if (address >= 0x3000 && address < 0x3300)
|
||||
{ superfx_mmio_write(state->m_superfx, address, data); return; }
|
||||
if (address >= 0x6000 && address < 0x8000) // here it should be snes_ram[0xe00000+...] but there are mirroring issues
|
||||
{ snes_ram[0xf00000 + (offset & 0x1fff)] = data; return; }
|
||||
{ superfx_mmio_write(state->m_superfx, address, data); return; }
|
||||
if (address >= 0x6000 && address < 0x8000) // here it should be snes_ram[0xe00000+...] but there are mirroring issues
|
||||
{ snes_ram[0xf00000 + (offset & 0x1fff)] = data; return; }
|
||||
}
|
||||
if (state->m_has_addon_chip == HAS_SUPERFX && state->m_superfx != NULL
|
||||
&& offset >= 0x600000)
|
||||
{ snes_ram[0x800000 + offset] = data; return; }
|
||||
{ snes_ram[0x800000 + offset] = data; return; }
|
||||
|
||||
// base cart access
|
||||
if (offset < 0x300000)
|
||||
@ -367,47 +367,47 @@ static WRITE8_HANDLER( snes_hi_w )
|
||||
// take care of add-on chip access
|
||||
if (state->m_has_addon_chip == HAS_OBC1
|
||||
&& (offset < 0x400000 && address >= 0x6000 && address < 0x8000))
|
||||
{ obc1_write(space, offset, data, mem_mask); return; }
|
||||
{ obc1_write(space, offset, data, mem_mask); return; }
|
||||
if (state->m_has_addon_chip == HAS_CX4
|
||||
&& (offset < 0x400000 && address >= 0x6000 && address < 0x8000))
|
||||
{ CX4_write(space.machine(), address - 0x6000, data); return; }
|
||||
{ CX4_write(space.machine(), address - 0x6000, data); return; }
|
||||
if (state->m_has_addon_chip == HAS_RTC
|
||||
&& (offset < 0x400000 && (address == 0x2800 || address == 0x2801)))
|
||||
{ srtc_write(space.machine(), offset, data); return; }
|
||||
{ srtc_write(space.machine(), offset, data); return; }
|
||||
if (state->m_has_addon_chip == HAS_ST010 || state->m_has_addon_chip == HAS_ST011)
|
||||
{
|
||||
if (offset >= 0x680000 && offset < 0x700000 && address < 0x1000)
|
||||
{ st010_write_ram(state, address, data); return; }
|
||||
{ st010_write_ram(state, address, data); return; }
|
||||
if (offset == 0x600000)
|
||||
{ st010_set_dr(data); return; }
|
||||
{ st010_set_dr(data); return; }
|
||||
if (offset == 0x600001)
|
||||
{ st010_set_sr(data); return; }
|
||||
{ st010_set_sr(data); return; }
|
||||
}
|
||||
if (state->m_cart[0].mode == SNES_MODE_21 && state->m_has_addon_chip == HAS_DSP1
|
||||
&& (offset < 0x200000 && address >= 0x6000 && address < 0x8000))
|
||||
{ dsp_set_dr(data); return; }
|
||||
{ dsp_set_dr(data); return; }
|
||||
if (state->m_cart[0].mode == SNES_MODE_20 && state->m_has_addon_chip == HAS_DSP1)
|
||||
{
|
||||
if (offset >= 0x200000 && offset < 0x400000 && (offset & 0x8000) == 0x8000)
|
||||
{ dsp_set_dr(data); return; }
|
||||
{ dsp_set_dr(data); return; }
|
||||
if (offset >= 0x600000 && offset < 0x700000 && (offset & 0x8000) == 0x0000)
|
||||
{ dsp_set_dr(data); return; }
|
||||
{ dsp_set_dr(data); return; }
|
||||
}
|
||||
if ((state->m_has_addon_chip == HAS_DSP2 || state->m_has_addon_chip == HAS_DSP3)
|
||||
&& (offset >= 0x200000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
|
||||
{
|
||||
if (address < 0xc000)
|
||||
{ dsp_set_dr(data); return; }
|
||||
{ dsp_set_dr(data); return; }
|
||||
else
|
||||
{ dsp_set_sr(data); return; }
|
||||
{ dsp_set_sr(data); return; }
|
||||
}
|
||||
if (state->m_has_addon_chip == HAS_DSP4
|
||||
&& (offset >= 0x300000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
|
||||
{
|
||||
if (address < 0xc000)
|
||||
{ dsp_set_dr(data); return; }
|
||||
{ dsp_set_dr(data); return; }
|
||||
else
|
||||
{ dsp_set_sr(data); return; }
|
||||
{ dsp_set_sr(data); return; }
|
||||
}
|
||||
if (state->m_has_addon_chip == HAS_SDD1 && offset < 0x400000)
|
||||
{
|
||||
@ -421,14 +421,14 @@ static WRITE8_HANDLER( snes_hi_w )
|
||||
{
|
||||
UINT16 limit = (state->m_has_addon_chip == HAS_SPC7110_RTC) ? 0x4842 : 0x483f;
|
||||
if (address >= 0x4800 && address <= limit)
|
||||
{ spc7110_mmio_write(space.machine(), (UINT32)address, data); return; }
|
||||
{ spc7110_mmio_write(space.machine(), (UINT32)address, data); return; }
|
||||
if (offset < 0x10000 && address >= 0x6000 && address < 0x8000)
|
||||
{ snes_ram[0x306000 + (address & 0x1fff)] = data; return; }
|
||||
{ snes_ram[0x306000 + (address & 0x1fff)] = data; return; }
|
||||
if (offset >= 0x300000 && offset < 0x310000 && address >= 0x6000 && address < 0x8000)
|
||||
{ snes_ram[0x306000 + (address & 0x1fff)] = data; return; }
|
||||
{ snes_ram[0x306000 + (address & 0x1fff)] = data; return; }
|
||||
}
|
||||
if (state->m_has_addon_chip == HAS_SUPERFX && state->m_superfx != NULL)
|
||||
{ space.write_byte(offset, data); return; } // [80-ff] same as [00-7f]
|
||||
{ space.write_byte(offset, data); return; } // [80-ff] same as [00-7f]
|
||||
|
||||
// base cart access
|
||||
if (offset < 0x400000)
|
||||
@ -1524,7 +1524,7 @@ static WRITE8_HANDLER( snes20_hi_w )
|
||||
if (address >= 0x2000 && address < 0x6000)
|
||||
snes_w_io(space, address, data);
|
||||
}
|
||||
else if (offset >= 0x700000) // NVRAM access
|
||||
else if (offset >= 0x700000) // NVRAM access
|
||||
{
|
||||
state->m_slotcart->m_cart->write_h(space, offset, data);
|
||||
}
|
||||
@ -1615,7 +1615,7 @@ static WRITE8_HANDLER( snes21_lo_w )
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (offset >= 0x700000) // NVRAM access
|
||||
else if (offset >= 0x700000) // NVRAM access
|
||||
state->m_slotcart->m_cart->write_l(space, offset, data);
|
||||
}
|
||||
|
||||
@ -1668,7 +1668,7 @@ static WRITE8_HANDLER( snes21_hi_w )
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (offset >= 0x700000) // NVRAM access
|
||||
else if (offset >= 0x700000) // NVRAM access
|
||||
state->m_slotcart->m_cart->write_h(space, offset, data);
|
||||
}
|
||||
|
||||
@ -1692,15 +1692,15 @@ static READ8_HANDLER( snesfx_hi_r )
|
||||
}
|
||||
if (address >= 0x6000 && address < 0x8000)
|
||||
{
|
||||
return state->m_slotcart->m_cart->read_h(space, offset); //RAM
|
||||
return state->m_slotcart->m_cart->read_h(space, offset); //RAM
|
||||
}
|
||||
if (address >= 0x8000)
|
||||
return state->m_slotcart->m_cart->read_h(space, offset); //ROM
|
||||
return state->m_slotcart->m_cart->read_h(space, offset); //ROM
|
||||
}
|
||||
else if (offset < 0x600000)
|
||||
return state->m_slotcart->m_cart->read_h(space, offset); //ROM
|
||||
return state->m_slotcart->m_cart->read_h(space, offset); //ROM
|
||||
|
||||
return state->m_slotcart->m_cart->read_h(space, offset); //RAM
|
||||
return state->m_slotcart->m_cart->read_h(space, offset); //RAM
|
||||
}
|
||||
|
||||
static READ8_HANDLER( snesfx_lo_r )
|
||||
@ -1721,15 +1721,15 @@ static READ8_HANDLER( snesfx_lo_r )
|
||||
}
|
||||
if (address >= 0x6000 && address < 0x8000)
|
||||
{
|
||||
return state->m_slotcart->m_cart->read_l(space, offset); //RAM
|
||||
return state->m_slotcart->m_cart->read_l(space, offset); //RAM
|
||||
}
|
||||
if (address >= 0x8000)
|
||||
return state->m_slotcart->m_cart->read_l(space, offset); //ROM
|
||||
return state->m_slotcart->m_cart->read_l(space, offset); //ROM
|
||||
}
|
||||
else if (offset < 0x600000)
|
||||
return state->m_slotcart->m_cart->read_l(space, offset); //ROM
|
||||
return state->m_slotcart->m_cart->read_l(space, offset); //ROM
|
||||
|
||||
return state->m_slotcart->m_cart->read_l(space, offset); //RAM
|
||||
return state->m_slotcart->m_cart->read_l(space, offset); //RAM
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( snesfx_hi_w )
|
||||
@ -2054,19 +2054,19 @@ static READ8_HANDLER( snesnew_lo_r )
|
||||
&& (offset >= 0x200000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
|
||||
return state->m_slotcart->m_cart->chip_read(space, offset & 0x7fff);
|
||||
else if (state->m_slotcart->get_type() == SNES_DSP_MODE21
|
||||
&& (offset < 0x200000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
|
||||
&& (offset < 0x200000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
|
||||
return state->m_slotcart->m_cart->chip_read(space, offset & 0x1fff);
|
||||
else if (state->m_slotcart->get_type() == SNES_DSP4
|
||||
&& (offset >= 0x300000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
|
||||
&& (offset >= 0x300000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
|
||||
return state->m_slotcart->m_cart->chip_read(space, offset & 0x7fff);
|
||||
else if (state->m_slotcart->get_type() == SNES_OBC1
|
||||
&& (offset < 0x400000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
|
||||
&& (offset < 0x400000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
|
||||
return state->m_slotcart->m_cart->chip_read(space, offset);
|
||||
else if ((state->m_slotcart->get_type() == SNES_ST010 || state->m_slotcart->get_type() == SNES_ST011)
|
||||
&& (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x1000))
|
||||
&& (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x1000))
|
||||
return state->m_slotcart->m_cart->chip_read(space, offset);
|
||||
else if (state->m_slotcart->get_type() == SNES_SRTC
|
||||
&& (offset < 0x400000 && (offset & 0xffff) == 0x2800))
|
||||
&& (offset < 0x400000 && (offset & 0xffff) == 0x2800))
|
||||
return state->m_slotcart->m_cart->chip_read(space, offset & 0xffff);
|
||||
else
|
||||
{
|
||||
@ -2117,24 +2117,27 @@ static READ8_HANDLER( snesnew_hi_r )
|
||||
&& (offset >= 0x200000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
|
||||
return state->m_slotcart->m_cart->chip_read(space, offset & 0x7fff);
|
||||
else if (state->m_slotcart->get_type() == SNES_DSP_MODE21
|
||||
&& (offset < 0x200000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
|
||||
&& (offset < 0x200000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
|
||||
return state->m_slotcart->m_cart->chip_read(space, offset & 0x1fff);
|
||||
else if (state->m_slotcart->get_type() == SNES_DSP4
|
||||
&& (offset >= 0x300000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
|
||||
&& (offset >= 0x300000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
|
||||
return state->m_slotcart->m_cart->chip_read(space, offset & 0x7fff);
|
||||
else if (state->m_slotcart->get_type() == SNES_OBC1
|
||||
&& (offset < 0x400000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
|
||||
&& (offset < 0x400000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
|
||||
return state->m_slotcart->m_cart->chip_read(space, offset);
|
||||
else if ((state->m_slotcart->get_type() == SNES_ST010 || state->m_slotcart->get_type() == SNES_ST011)
|
||||
&& (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x1000))
|
||||
&& (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x1000))
|
||||
return state->m_slotcart->m_cart->chip_read(space, offset);
|
||||
else if ((state->m_slotcart->get_type() == SNES_ST010 || state->m_slotcart->get_type() == SNES_ST011)
|
||||
&& (offset == 0x600000 || offset == 0x600001))
|
||||
return state->m_slotcart->m_cart->chip_read(space, offset);
|
||||
else if (state->m_slotcart->get_type() == SNES_SRTC
|
||||
&& (offset < 0x400000 && (offset & 0xffff) == 0x2800))
|
||||
&& (offset < 0x400000 && (offset & 0xffff) == 0x2800))
|
||||
return state->m_slotcart->m_cart->chip_read(space, offset & 0xffff);
|
||||
else if ((state->m_slotcart->get_type() == SNES_POKEMON || state->m_slotcart->get_type() == SNES_BANANA)
|
||||
&& (offset & 0x70000) == 0x0000)
|
||||
&& (offset & 0x70000) == 0x0000)
|
||||
{
|
||||
// printf("hi read %x\n", offset);
|
||||
// printf("hi read %x\n", offset);
|
||||
return state->m_slotcart->m_cart->chip_read(space, offset);
|
||||
}
|
||||
else
|
||||
@ -2186,24 +2189,27 @@ static WRITE8_HANDLER( snesnew_lo_w )
|
||||
&& (offset >= 0x200000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
|
||||
state->m_slotcart->m_cart->chip_write(space, offset & 0x7fff, data);
|
||||
else if (state->m_slotcart->get_type() == SNES_DSP_MODE21
|
||||
&& (offset < 0x200000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
|
||||
&& (offset < 0x200000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
|
||||
state->m_slotcart->m_cart->chip_write(space, offset & 0x1fff, data);
|
||||
else if (state->m_slotcart->get_type() == SNES_DSP4
|
||||
&& (offset >= 0x300000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
|
||||
&& (offset >= 0x300000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
|
||||
state->m_slotcart->m_cart->chip_write(space, offset & 0x7fff, data);
|
||||
else if (state->m_slotcart->get_type() == SNES_OBC1
|
||||
&& (offset < 0x400000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
|
||||
&& (offset < 0x400000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
|
||||
state->m_slotcart->m_cart->chip_write(space, offset, data);
|
||||
else if ((state->m_slotcart->get_type() == SNES_ST010 || state->m_slotcart->get_type() == SNES_ST011)
|
||||
&& (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x1000))
|
||||
&& (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x1000))
|
||||
state->m_slotcart->m_cart->chip_write(space, offset, data);
|
||||
else if ((state->m_slotcart->get_type() == SNES_ST010 || state->m_slotcart->get_type() == SNES_ST011)
|
||||
&& (offset == 0x600000 || offset == 0x600001))
|
||||
state->m_slotcart->m_cart->chip_write(space, offset, data);
|
||||
else if (state->m_slotcart->get_type() == SNES_SRTC
|
||||
&& (offset < 0x400000 && (offset & 0xffff) == 0x2801))
|
||||
&& (offset < 0x400000 && (offset & 0xffff) == 0x2801))
|
||||
state->m_slotcart->m_cart->chip_write(space, offset & 0xffff, data);
|
||||
else if (state->m_slotcart->get_type() == SNES_BANANA
|
||||
&& (offset & 0x78000) == 0x8000)
|
||||
&& (offset & 0x78000) == 0x8000)
|
||||
{
|
||||
// printf("lo write %x\n", offset);
|
||||
// printf("lo write %x\n", offset);
|
||||
state->m_slotcart->m_cart->chip_write(space, offset, data);
|
||||
}
|
||||
else
|
||||
@ -2260,24 +2266,27 @@ static WRITE8_HANDLER( snesnew_hi_w )
|
||||
&& (offset >= 0x200000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
|
||||
state->m_slotcart->m_cart->chip_write(space, offset & 0x7fff, data);
|
||||
else if (state->m_slotcart->get_type() == SNES_DSP_MODE21
|
||||
&& (offset < 0x200000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
|
||||
&& (offset < 0x200000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
|
||||
state->m_slotcart->m_cart->chip_write(space, offset & 0x1fff, data);
|
||||
else if (state->m_slotcart->get_type() == SNES_DSP4
|
||||
&& (offset >= 0x300000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
|
||||
&& (offset >= 0x300000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
|
||||
state->m_slotcart->m_cart->chip_write(space, offset & 0x7fff, data);
|
||||
else if (state->m_slotcart->get_type() == SNES_OBC1
|
||||
&& (offset < 0x400000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
|
||||
&& (offset < 0x400000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
|
||||
return state->m_slotcart->m_cart->chip_write(space, offset, data);
|
||||
else if ((state->m_slotcart->get_type() == SNES_ST010 || state->m_slotcart->get_type() == SNES_ST011)
|
||||
&& (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x1000))
|
||||
&& (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x1000))
|
||||
state->m_slotcart->m_cart->chip_write(space, offset, data);
|
||||
else if ((state->m_slotcart->get_type() == SNES_ST010 || state->m_slotcart->get_type() == SNES_ST011)
|
||||
&& (offset == 0x600000 || offset == 0x600001))
|
||||
state->m_slotcart->m_cart->chip_write(space, offset, data);
|
||||
else if (state->m_slotcart->get_type() == SNES_SRTC
|
||||
&& (offset < 0x400000 && (offset & 0xffff) == 0x2801))
|
||||
&& (offset < 0x400000 && (offset & 0xffff) == 0x2801))
|
||||
state->m_slotcart->m_cart->chip_write(space, offset & 0xffff, data);
|
||||
else if ((state->m_slotcart->get_type() == SNES_POKEMON)
|
||||
&& (offset & 0x70000) == 0x0000)
|
||||
&& (offset & 0x70000) == 0x0000)
|
||||
{
|
||||
// printf("hi write %x\n", offset);
|
||||
// printf("hi write %x\n", offset);
|
||||
state->m_slotcart->m_cart->chip_write(space, offset, data);
|
||||
}
|
||||
else
|
||||
@ -2334,26 +2343,26 @@ ADDRESS_MAP_END
|
||||
|
||||
static SLOT_INTERFACE_START(snes_cart)
|
||||
SLOT_INTERFACE_INTERNAL("lorom", SNS_LOROM)
|
||||
SLOT_INTERFACE_INTERNAL("lorom_bsx", SNS_LOROM_BSX) // LoROM + BS-X slot - unsupported
|
||||
SLOT_INTERFACE_INTERNAL("lorom_cx4", SNS_LOROM) // Cart + CX4 - unsupported
|
||||
SLOT_INTERFACE_INTERNAL("lorom_bsx", SNS_LOROM_BSX) // LoROM + BS-X slot - unsupported
|
||||
SLOT_INTERFACE_INTERNAL("lorom_cx4", SNS_LOROM) // Cart + CX4 - unsupported
|
||||
SLOT_INTERFACE_INTERNAL("lorom_dsp", SNS_LOROM_NECDSP)
|
||||
SLOT_INTERFACE_INTERNAL("lorom_dsp4", SNS_LOROM_NECDSP)
|
||||
SLOT_INTERFACE_INTERNAL("lorom_obc1", SNS_LOROM_OBC1)
|
||||
SLOT_INTERFACE_INTERNAL("lorom_sa1", SNS_LOROM) // Cart + SA1 - unsupported
|
||||
SLOT_INTERFACE_INTERNAL("lorom_sa1", SNS_LOROM) // Cart + SA1 - unsupported
|
||||
SLOT_INTERFACE_INTERNAL("lorom_sdd1", SNS_LOROM_SDD1)
|
||||
SLOT_INTERFACE_INTERNAL("lorom_sfx", SNS_LOROM_SUPERFX)
|
||||
SLOT_INTERFACE_INTERNAL("lorom_sgb", SNS_LOROM) // SuperGB base cart - unsupported
|
||||
SLOT_INTERFACE_INTERNAL("lorom_sgb", SNS_LOROM) // SuperGB base cart - unsupported
|
||||
SLOT_INTERFACE_INTERNAL("lorom_st010", SNS_LOROM_SETA10)
|
||||
SLOT_INTERFACE_INTERNAL("lorom_st011", SNS_LOROM_SETA11)
|
||||
SLOT_INTERFACE_INTERNAL("lorom_st018", SNS_LOROM) // Cart + ST018 - unsupported
|
||||
SLOT_INTERFACE_INTERNAL("lorom_sufami", SNS_LOROM_SUFAMI) // Sufami Turbo base cart
|
||||
SLOT_INTERFACE_INTERNAL("lorom_st018", SNS_LOROM) // Cart + ST018 - unsupported
|
||||
SLOT_INTERFACE_INTERNAL("lorom_sufami", SNS_LOROM_SUFAMI) // Sufami Turbo base cart
|
||||
SLOT_INTERFACE_INTERNAL("hirom", SNS_HIROM)
|
||||
SLOT_INTERFACE_INTERNAL("hirom_bsx", SNS_HIROM_BSX) // HiROM + BS-X slot - unsupported
|
||||
SLOT_INTERFACE_INTERNAL("hirom_bsx", SNS_HIROM_BSX) // HiROM + BS-X slot - unsupported
|
||||
SLOT_INTERFACE_INTERNAL("hirom_dsp", SNS_HIROM_NECDSP)
|
||||
SLOT_INTERFACE_INTERNAL("hirom_spc7110", SNS_HIROM_SPC7110)
|
||||
SLOT_INTERFACE_INTERNAL("hirom_spcrtc", SNS_HIROM_SPC7110_RTC)
|
||||
SLOT_INTERFACE_INTERNAL("hirom_srtc", SNS_HIROM_SRTC)
|
||||
SLOT_INTERFACE_INTERNAL("bsxrom", SNS_ROM_BSX) // BS-X base cart - partial support only
|
||||
SLOT_INTERFACE_INTERNAL("bsxrom", SNS_ROM_BSX) // BS-X base cart - partial support only
|
||||
// pirate carts
|
||||
SLOT_INTERFACE_INTERNAL("lorom_poke", SNS_LOROM_POKEMON)
|
||||
SLOT_INTERFACE_END
|
||||
@ -2365,18 +2374,30 @@ static MACHINE_START( snesnew )
|
||||
|
||||
state->m_type = state->m_slotcart->get_type();
|
||||
|
||||
MACHINE_START_CALL(snes);
|
||||
MACHINE_START_CALL(snes_mess);
|
||||
|
||||
// FIXME: why installing handlers here does not work? it would allow to clean up handlers above...
|
||||
// in progress...
|
||||
switch (state->m_type)
|
||||
{
|
||||
case SNES_MODE21:
|
||||
case SNES_MODE25:
|
||||
case SNES_DSP_MODE21:
|
||||
machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x000000, 0x7dffff, FUNC(snes21_lo_r), FUNC(snes21_lo_w));
|
||||
machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x800000, 0xffffff, FUNC(snes21_hi_r), FUNC(snes21_hi_w));
|
||||
set_5a22_map(*state->m_maincpu);
|
||||
break;
|
||||
case SNES_DSP_MODE21:
|
||||
// machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x000000, 0x7dffff, FUNC(snes21_lo_r), FUNC(snes21_lo_w));
|
||||
// machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x800000, 0xffffff, FUNC(snes21_hi_r), FUNC(snes21_hi_w));
|
||||
// machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x006000, 0x007fff, 0x1f0000, 0, read8_delegate(FUNC(device_sns_cart_interface::chip_read),state->m_slotcart->m_cart));
|
||||
// machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x006000, 0x007fff, 0x1f0000, 0, write8_delegate(FUNC(device_sns_cart_interface::chip_write),state->m_slotcart->m_cart));
|
||||
// set_5a22_map(*state->m_maincpu);
|
||||
break;
|
||||
case SNES_SRTC:
|
||||
// machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x000000, 0x7dffff, FUNC(snes21_lo_r), FUNC(snes21_lo_w));
|
||||
// machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x800000, 0xffffff, FUNC(snes21_hi_r), FUNC(snes21_hi_w));
|
||||
// machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x002800, 0x002800, 0x3f0000, 0, read8_delegate(FUNC(device_sns_cart_interface::chip_read),state->m_slotcart->m_cart));
|
||||
// machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x002801, 0x002801, 0x3f0000, 0, write8_delegate(FUNC(device_sns_cart_interface::chip_write),state->m_slotcart->m_cart));
|
||||
// set_5a22_map(*state->m_maincpu);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1312,4 +1312,3 @@ DRIVER_INIT_MEMBER(snes_state,snesst)
|
||||
#include "machine/snesrtc.c"
|
||||
#include "machine/snessdd1.c"
|
||||
#include "machine/snes7110.c"
|
||||
|
||||
|
@ -196,9 +196,9 @@ void BSX_base::write(UINT32 offset, UINT8 data)
|
||||
{
|
||||
// no 218d? no 2190? no 2195? no 2196? no 2198? no 219a-219f?
|
||||
case 0x218f:
|
||||
regs[6] >>= 1; // 0x218e
|
||||
regs[6] = regs[7] - regs[6]; // 0x218f - 0x218e
|
||||
regs[7] >>= 1; // 0x218f
|
||||
regs[6] >>= 1; // 0x218e
|
||||
regs[6] = regs[7] - regs[6]; // 0x218f - 0x218e
|
||||
regs[7] >>= 1; // 0x218f
|
||||
break;
|
||||
|
||||
case 0x2191:
|
||||
@ -207,7 +207,7 @@ void BSX_base::write(UINT32 offset, UINT8 data)
|
||||
break;
|
||||
|
||||
case 0x2192:
|
||||
regs[8] = data; // sets 0x2190
|
||||
regs[8] = data; // sets 0x2190
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -266,8 +266,8 @@ void sns_rom_bsx_device::access_update()
|
||||
rom_access = 0;
|
||||
else
|
||||
{
|
||||
// rom_access = BIT(m_cart_regs[0x02], 7) + 1;
|
||||
rom_access = 1; // for whatever reason bsxsore changes access mode here and then fails to read the ROM properly!
|
||||
// rom_access = BIT(m_cart_regs[0x02], 7) + 1;
|
||||
rom_access = 1; // for whatever reason bsxsore changes access mode here and then fails to read the ROM properly!
|
||||
printf("rom_access %s\n", !BIT(m_cart_regs[0x02], 7) ? "Lo" : "Hi");
|
||||
}
|
||||
}
|
||||
@ -408,13 +408,13 @@ READ8_MEMBER(sns_rom_bsx_device::chip_read)
|
||||
if ((offset & 0xffff) >= 0x2188 && (offset & 0xffff) < 0x21a0)
|
||||
return m_base_unit->read(offset & 0xffff);
|
||||
|
||||
if ((offset & 0xf0ffff) == 0x005000) //$[00-0f]:5000 reg access
|
||||
if ((offset & 0xf0ffff) == 0x005000) //$[00-0f]:5000 reg access
|
||||
{
|
||||
UINT8 n = (offset >> 16) & 0x0f;
|
||||
return m_cart_regs[n];
|
||||
}
|
||||
|
||||
if ((offset & 0xf8f000) == 0x105000) //$[10-17]:[5000-5fff] SRAM access
|
||||
if ((offset & 0xf8f000) == 0x105000) //$[10-17]:[5000-5fff] SRAM access
|
||||
{
|
||||
return m_nvram[((offset >> 16) & 7) * 0x1000 + (offset & 0xfff)];
|
||||
}
|
||||
@ -427,7 +427,7 @@ WRITE8_MEMBER(sns_rom_bsx_device::chip_write)
|
||||
if ((offset & 0xffff) >= 0x2188 && (offset & 0xffff) < 0x21a0)
|
||||
m_base_unit->write(offset & 0xffff, data);
|
||||
|
||||
if ((offset & 0xf0ffff) == 0x005000) //$[00-0f]:5000 reg access
|
||||
if ((offset & 0xf0ffff) == 0x005000) //$[00-0f]:5000 reg access
|
||||
{
|
||||
UINT8 n = (offset >> 16) & 0x0f;
|
||||
m_cart_regs[n] = data;
|
||||
@ -435,7 +435,7 @@ WRITE8_MEMBER(sns_rom_bsx_device::chip_write)
|
||||
access_update();
|
||||
}
|
||||
|
||||
if ((offset & 0xf8f000) == 0x105000) //$[10-17]:[5000-5fff] SRAM access
|
||||
if ((offset & 0xf8f000) == 0x105000) //$[10-17]:[5000-5fff] SRAM access
|
||||
{
|
||||
m_nvram[((offset >> 16) & 7) * 0x1000 + (offset & 0xfff)] = data;
|
||||
}
|
||||
@ -583,4 +583,3 @@ READ8_MEMBER(sns_rom_bsmempak_device::read_h)
|
||||
WRITE8_MEMBER(sns_rom_bsmempak_device::write_l)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ public:
|
||||
|
||||
private:
|
||||
// regs
|
||||
UINT8 regs[0x18]; // 0x2188-0x219f
|
||||
UINT8 regs[0x18]; // 0x2188-0x219f
|
||||
|
||||
// counter + clock
|
||||
UINT8 r2192_counter;
|
||||
@ -53,12 +53,12 @@ public:
|
||||
|
||||
// cart regs
|
||||
UINT8 m_cart_regs[16];
|
||||
UINT8 access_00_1f; // 1 = CART, 0 = NOTHING
|
||||
UINT8 access_80_9f; // 1 = CART, 0 = NOTHING
|
||||
UINT8 access_40_4f; // 1 = NOTHING, 0 = PRAM
|
||||
UINT8 access_50_5f; // 1 = NOTHING, 0 = PRAM
|
||||
UINT8 access_60_6f; // 1 = PRAM, 0 = NOTHING
|
||||
UINT8 rom_access; // 2 = HiROM, 1 = LoROM, 0 = PRAM
|
||||
UINT8 access_00_1f; // 1 = CART, 0 = NOTHING
|
||||
UINT8 access_80_9f; // 1 = CART, 0 = NOTHING
|
||||
UINT8 access_40_4f; // 1 = NOTHING, 0 = PRAM
|
||||
UINT8 access_50_5f; // 1 = NOTHING, 0 = PRAM
|
||||
UINT8 access_60_6f; // 1 = PRAM, 0 = NOTHING
|
||||
UINT8 rom_access; // 2 = HiROM, 1 = LoROM, 0 = PRAM
|
||||
void access_update();
|
||||
|
||||
|
||||
@ -84,10 +84,10 @@ public:
|
||||
// additional reading and writing
|
||||
virtual DECLARE_READ8_MEMBER(read_l);
|
||||
virtual DECLARE_READ8_MEMBER(read_h);
|
||||
// virtual DECLARE_WRITE8_MEMBER(write_l);
|
||||
// virtual DECLARE_WRITE8_MEMBER(write_h);
|
||||
// virtual DECLARE_READ8_MEMBER(chip_read);
|
||||
// virtual DECLARE_WRITE8_MEMBER(chip_write);
|
||||
// virtual DECLARE_WRITE8_MEMBER(write_l);
|
||||
// virtual DECLARE_WRITE8_MEMBER(write_h);
|
||||
// virtual DECLARE_READ8_MEMBER(chip_read);
|
||||
// virtual DECLARE_WRITE8_MEMBER(chip_write);
|
||||
|
||||
private:
|
||||
required_device<sns_bsx_cart_slot_device> m_slot;
|
||||
@ -111,8 +111,8 @@ public:
|
||||
virtual DECLARE_READ8_MEMBER(read_h);
|
||||
virtual DECLARE_WRITE8_MEMBER(write_l);
|
||||
virtual DECLARE_WRITE8_MEMBER(write_h);
|
||||
// virtual DECLARE_READ8_MEMBER(chip_read);
|
||||
// virtual DECLARE_WRITE8_MEMBER(chip_write);
|
||||
// virtual DECLARE_READ8_MEMBER(chip_read);
|
||||
// virtual DECLARE_WRITE8_MEMBER(chip_write);
|
||||
|
||||
private:
|
||||
required_device<sns_bsx_cart_slot_device> m_slot;
|
||||
@ -135,9 +135,9 @@ public:
|
||||
virtual DECLARE_READ8_MEMBER(read_l);
|
||||
virtual DECLARE_READ8_MEMBER(read_h);
|
||||
virtual DECLARE_WRITE8_MEMBER(write_l);
|
||||
// virtual DECLARE_WRITE8_MEMBER(write_h);
|
||||
// virtual DECLARE_READ8_MEMBER(chip_read);
|
||||
// virtual DECLARE_WRITE8_MEMBER(chip_write);
|
||||
// virtual DECLARE_WRITE8_MEMBER(write_h);
|
||||
// virtual DECLARE_READ8_MEMBER(chip_read);
|
||||
// virtual DECLARE_WRITE8_MEMBER(chip_write);
|
||||
|
||||
// flash regs
|
||||
UINT32 m_command;
|
||||
|
@ -107,7 +107,7 @@ READ8_MEMBER(sns_rom_device::read_h)
|
||||
value = m_nvram[offset & mask];
|
||||
}
|
||||
else
|
||||
value = 0xff; // this should never happened...
|
||||
value = 0xff; // this should never happened...
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -125,7 +125,7 @@ WRITE8_MEMBER(sns_rom_device::write_l)
|
||||
|
||||
WRITE8_MEMBER(sns_rom_device::write_h)
|
||||
{
|
||||
if (offset >= 0x700000) // SRAM
|
||||
if (offset >= 0x700000) // SRAM
|
||||
{
|
||||
if (m_nvram_size > 0x8000)
|
||||
{
|
||||
@ -257,4 +257,3 @@ WRITE8_MEMBER( sns_rom_obc1_device::chip_write )
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
// ======================> sns_rom_device
|
||||
|
||||
class sns_rom_device : public device_t,
|
||||
public device_sns_cart_interface
|
||||
public device_sns_cart_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
@ -38,8 +38,8 @@ public:
|
||||
virtual void device_config_complete() { m_shortname = "sns_rom_pokemon"; }
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ8_MEMBER(chip_read); // protection device
|
||||
virtual DECLARE_WRITE8_MEMBER(chip_write); // protection device
|
||||
virtual DECLARE_READ8_MEMBER(chip_read); // protection device
|
||||
virtual DECLARE_WRITE8_MEMBER(chip_write); // protection device
|
||||
UINT8 m_latch;
|
||||
};
|
||||
|
||||
|
@ -51,7 +51,7 @@ void sns_rom21_srtc_device::device_start()
|
||||
m_index = -1;
|
||||
|
||||
// at this stage, rtc_ram is not yet allocated. this will be fixed when converting RTC to be a separate device.
|
||||
// update_time();
|
||||
// update_time();
|
||||
|
||||
save_item(NAME(m_mode));
|
||||
save_item(NAME(m_index));
|
||||
@ -303,4 +303,3 @@ WRITE8_MEMBER(sns_rom21_srtc_device::chip_write)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
// ======================> sns_rom21_device
|
||||
|
||||
class sns_rom21_device : public device_t,
|
||||
public device_sns_cart_interface
|
||||
public device_sns_cart_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
|
@ -381,7 +381,7 @@ SDD1__emu::SDD1__emu(running_machine &machine)
|
||||
m_BG6 = auto_alloc(machine, SDD1__BG(m_GCD, 6));
|
||||
m_BG7 = auto_alloc(machine, SDD1__BG(m_GCD, 7));
|
||||
m_PEM = auto_alloc(machine, SDD1__PEM(m_BG0, m_BG1, m_BG2, m_BG3,
|
||||
m_BG4, m_BG5, m_BG6, m_BG7));
|
||||
m_BG4, m_BG5, m_BG6, m_BG7));
|
||||
m_CM = auto_alloc(machine, SDD1__CM(m_PEM));
|
||||
m_OL = auto_alloc(machine, SDD1__OL(m_CM));
|
||||
}
|
||||
@ -474,7 +474,7 @@ READ8_MEMBER( sns_rom_sdd1_device::chip_read )
|
||||
return (m_mmc[3] >> 20) & 7;
|
||||
}
|
||||
|
||||
// we should never get here, but...
|
||||
// we should never get here, but...
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -597,6 +597,6 @@ READ8_MEMBER(sns_rom_sdd1_device::read_h)
|
||||
|
||||
WRITE8_MEMBER(sns_rom_sdd1_device::write_l)
|
||||
{
|
||||
if (offset >= 0x700000 && (offset & 0xffff) < 0x8000 && m_nvram_size > 0) // SRAM
|
||||
if (offset >= 0x700000 && (offset & 0xffff) < 0x8000 && m_nvram_size > 0) // SRAM
|
||||
m_nvram[offset & 0x1fff] = data;
|
||||
}
|
||||
|
@ -54,10 +54,10 @@ class SDD1__PEM //Probability Estimation Module
|
||||
{
|
||||
public:
|
||||
SDD1__PEM(
|
||||
SDD1__BG* associatedBG0, SDD1__BG* associatedBG1,
|
||||
SDD1__BG* associatedBG2, SDD1__BG* associatedBG3,
|
||||
SDD1__BG* associatedBG4, SDD1__BG* associatedBG5,
|
||||
SDD1__BG* associatedBG6, SDD1__BG* associatedBG7)
|
||||
SDD1__BG* associatedBG0, SDD1__BG* associatedBG1,
|
||||
SDD1__BG* associatedBG2, SDD1__BG* associatedBG3,
|
||||
SDD1__BG* associatedBG4, SDD1__BG* associatedBG5,
|
||||
SDD1__BG* associatedBG6, SDD1__BG* associatedBG7)
|
||||
{
|
||||
m_BG[0] = associatedBG0;
|
||||
m_BG[1] = associatedBG1;
|
||||
@ -136,7 +136,7 @@ private:
|
||||
// ======================> sns_rom_sdd1_device
|
||||
|
||||
class sns_rom_sdd1_device : public device_t,
|
||||
public device_sns_cart_interface
|
||||
public device_sns_cart_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
|
@ -116,7 +116,7 @@ READ8_MEMBER( sns_rom_superfx_device::read_l )
|
||||
if (address >= 0x6000 && address < 0x8000)
|
||||
{
|
||||
if (superfx_access_ram(m_superfx))
|
||||
return sfx_ram[offset & 0x1fff];
|
||||
return sfx_ram[offset & 0x1fff];
|
||||
}
|
||||
if (address >= 0x8000)
|
||||
return m_rom[rom_bank_map[offset / 0x10000] * 0x8000 + (offset & 0x7fff)];
|
||||
@ -139,10 +139,10 @@ READ8_MEMBER( sns_rom_superfx_device::read_l )
|
||||
else
|
||||
{
|
||||
if (superfx_access_ram(m_superfx))
|
||||
return sfx_ram[offset & 0xfffff];
|
||||
return sfx_ram[offset & 0xfffff];
|
||||
}
|
||||
|
||||
return 0xff; // should be open bus...
|
||||
return 0xff; // should be open bus...
|
||||
}
|
||||
|
||||
|
||||
@ -173,7 +173,7 @@ READ8_MEMBER(sns_rom_superfx_device::read_h)
|
||||
if (address >= 0x6000 && address < 0x8000)
|
||||
{
|
||||
if (superfx_access_ram(m_superfx))
|
||||
return sfx_ram[offset & 0x1fff];
|
||||
return sfx_ram[offset & 0x1fff];
|
||||
}
|
||||
if (address >= 0x8000)
|
||||
return m_rom[rom_bank_map[offset / 0x10000] * 0x8000 + (offset & 0x7fff)];
|
||||
@ -196,10 +196,10 @@ READ8_MEMBER(sns_rom_superfx_device::read_h)
|
||||
else
|
||||
{
|
||||
if (superfx_access_ram(m_superfx))
|
||||
return sfx_ram[offset & 0xfffff];
|
||||
return sfx_ram[offset & 0xfffff];
|
||||
}
|
||||
|
||||
return 0xff; // should be open bus...
|
||||
return 0xff; // should be open bus...
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( sns_rom_superfx_device::write_h )
|
||||
@ -219,4 +219,3 @@ WRITE8_MEMBER( sns_rom_superfx_device::write_h )
|
||||
sfx_ram[offset & 0xfffff] = data;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -135,12 +135,12 @@ void device_sns_cart_interface::rom_map_setup(UINT32 size)
|
||||
}
|
||||
|
||||
// check bank map!
|
||||
// for (i = 0; i < 256; i++)
|
||||
// {
|
||||
// printf("bank %3d = %3d\t", i, rom_bank_map[i]);
|
||||
// if ((i%8) == 7)
|
||||
// printf("\n");
|
||||
// }
|
||||
// for (i = 0; i < 256; i++)
|
||||
// {
|
||||
// printf("bank %3d = %3d\t", i, rom_bank_map[i]);
|
||||
// if ((i%8) == 7)
|
||||
// printf("\n");
|
||||
// }
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
@ -244,8 +244,8 @@ static const sns_slot slot_list[] =
|
||||
{ SNES_STROM, "strom"},
|
||||
// pirate carts
|
||||
{ SNES_POKEMON, "lorom_poke"},
|
||||
{ SNES_BANANA, "lorom_paja"}, // wip
|
||||
{ SNES_SOULBLAD, "lorom_sbld"} // wip
|
||||
{ SNES_BANANA, "lorom_paja"}, // wip
|
||||
{ SNES_SOULBLAD, "lorom_sbld"} // wip
|
||||
};
|
||||
|
||||
static int sns_get_pcb_id(const char *slot)
|
||||
@ -454,10 +454,10 @@ static UINT32 snes_find_hilo_mode( UINT8 *buffer, UINT32 buf_len )
|
||||
retvalue = 0x40ffc0;
|
||||
|
||||
logerror( "\t HiROM/LoROM id: %s (LoROM: %d , HiROM: %d, ExHiROM: %d)\n",
|
||||
(retvalue == 0x007fc0) ? "LoROM" :
|
||||
(retvalue == 0x00ffc0) ? "HiROM" :
|
||||
(retvalue == 0x40ffc0) ? "ExHiROM" : "Other",
|
||||
valid_mode20, valid_mode21, valid_mode25);
|
||||
(retvalue == 0x007fc0) ? "LoROM" :
|
||||
(retvalue == 0x00ffc0) ? "HiROM" :
|
||||
(retvalue == 0x40ffc0) ? "ExHiROM" : "Other",
|
||||
valid_mode20, valid_mode21, valid_mode25);
|
||||
|
||||
return retvalue;
|
||||
}
|
||||
@ -676,7 +676,7 @@ void base_sns_cart_slot_device::setup_nvram()
|
||||
UINT8 sram_size = (m_type == SNES_SFX) ? (ROM[0x00ffbd] & 0x07) : (ROM[hilo_mode + 0x18] & 0x07);
|
||||
if (sram_size)
|
||||
{
|
||||
UINT32 max = (hilo_mode == 0x007fc0) ? 0x80000 : 0x20000; // MODE20 vs MODE21
|
||||
UINT32 max = (hilo_mode == 0x007fc0) ? 0x80000 : 0x20000; // MODE20 vs MODE21
|
||||
size = 1024 << (ROM[0x00ffbd] & 0x07);
|
||||
if (size > max)
|
||||
size = max;
|
||||
@ -1074,10 +1074,10 @@ void base_sns_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len)
|
||||
logerror( "===========\n\n" );
|
||||
logerror( "\tTotal blocks: 0x%x\n", len);
|
||||
logerror( "\tROM bank size: %s \n",
|
||||
(type == SNES_MODE20) ? "LoROM" :
|
||||
(type == SNES_MODE21) ? "HiROM" :
|
||||
(type == SNES_MODE22) ? "ExLoROM" :
|
||||
(type == SNES_MODE25) ? "ExHiROM" : "Other (BSX or ST)" );
|
||||
(type == SNES_MODE20) ? "LoROM" :
|
||||
(type == SNES_MODE21) ? "HiROM" :
|
||||
(type == SNES_MODE22) ? "ExLoROM" :
|
||||
(type == SNES_MODE25) ? "ExHiROM" : "Other (BSX or ST)" );
|
||||
logerror( "\tCompany: %s [%.2s]\n", companies[company], company_id );
|
||||
logerror( "\tROM ID: %.4s\n\n", rom_id );
|
||||
|
||||
|
@ -11,8 +11,8 @@ enum
|
||||
{
|
||||
SNES_MODE20 = 0,
|
||||
SNES_MODE21,
|
||||
SNES_MODE22, // ExLoROM - not used anymore in emulation (only to log info), will be removed
|
||||
SNES_MODE25, // ExHiROM - not used anymore in emulation (only to log info), will be removed
|
||||
SNES_MODE22, // ExLoROM - not used anymore in emulation (only to log info), will be removed
|
||||
SNES_MODE25, // ExHiROM - not used anymore in emulation (only to log info), will be removed
|
||||
SNES_CX4,
|
||||
SNES_DSP,
|
||||
SNES_DSP_MODE21,
|
||||
@ -36,8 +36,8 @@ enum
|
||||
SNES_STROM,
|
||||
// pirate carts
|
||||
SNES_POKEMON,
|
||||
SNES_BANANA, // wip
|
||||
SNES_SOULBLAD // wip
|
||||
SNES_BANANA, // wip
|
||||
SNES_SOULBLAD // wip
|
||||
};
|
||||
|
||||
|
||||
@ -84,13 +84,13 @@ public:
|
||||
UINT8 *m_rom;
|
||||
UINT8 *m_nvram;
|
||||
UINT8 *m_bios;
|
||||
UINT8 *m_rtc_ram; // temp pointer to save RTC ram to nvram (will disappear when RTCs become devices)
|
||||
UINT8 *m_rtc_ram; // temp pointer to save RTC ram to nvram (will disappear when RTCs become devices)
|
||||
UINT32 m_rom_size;
|
||||
UINT32 m_nvram_size;
|
||||
UINT32 m_bios_size;
|
||||
UINT32 m_rtc_ram_size; // temp
|
||||
UINT32 m_rtc_ram_size; // temp
|
||||
|
||||
UINT8 rom_bank_map[256]; // 32K chunks of rom
|
||||
UINT8 rom_bank_map[256]; // 32K chunks of rom
|
||||
};
|
||||
|
||||
|
||||
@ -146,7 +146,7 @@ public:
|
||||
// this should be private, but then there is some problem installing delegates in the driver...
|
||||
//private:
|
||||
|
||||
device_sns_cart_interface* m_cart;
|
||||
device_sns_cart_interface* m_cart;
|
||||
|
||||
int m_type;
|
||||
};
|
||||
|
@ -92,11 +92,11 @@ void sns_rom_spc7110_device::spc7110_start()
|
||||
|
||||
m_r4830 = 0x00;
|
||||
m_r4831 = 0;
|
||||
m_dx_offset = spc7110_datarom_addr(0 * 0x100000, 0x200000); // we would need the rom length here...
|
||||
m_dx_offset = spc7110_datarom_addr(0 * 0x100000, 0x200000); // we would need the rom length here...
|
||||
m_r4832 = 1;
|
||||
m_ex_offset = spc7110_datarom_addr(1 * 0x100000, 0x200000); // we would need the rom length here...
|
||||
m_ex_offset = spc7110_datarom_addr(1 * 0x100000, 0x200000); // we would need the rom length here...
|
||||
m_r4833 = 2;
|
||||
m_fx_offset = spc7110_datarom_addr(2 * 0x100000, 0x200000); // we would need the rom length here...
|
||||
m_fx_offset = spc7110_datarom_addr(2 * 0x100000, 0x200000); // we would need the rom length here...
|
||||
m_r4834 = 0x00;
|
||||
|
||||
m_r4840 = 0x00;
|
||||
@ -179,7 +179,7 @@ void sns_rom_spc7110rtc_device::device_start()
|
||||
m_rtc_offset = 0;
|
||||
|
||||
// at this stage, rtc_ram is not yet allocated. this will be fixed when converting RTC to be a separate device.
|
||||
// spc7110_update_time(0);
|
||||
// spc7110_update_time(0);
|
||||
|
||||
save_item(NAME(m_rtc_state));
|
||||
save_item(NAME(m_rtc_mode));
|
||||
@ -1640,4 +1640,3 @@ WRITE8_MEMBER(sns_rom_spc7110_device::chip_write)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -196,12 +196,12 @@ public:
|
||||
// reading and writing
|
||||
|
||||
// we just use the spc7110 ones for the moment, pending the split of regs 0x4840-0x4842 (RTC) from the base add-on
|
||||
// virtual DECLARE_READ8_MEMBER(read_l);
|
||||
// virtual DECLARE_READ8_MEMBER(read_h);
|
||||
// virtual DECLARE_WRITE8_MEMBER(write_l);
|
||||
// virtual DECLARE_READ8_MEMBER(read_l);
|
||||
// virtual DECLARE_READ8_MEMBER(read_h);
|
||||
// virtual DECLARE_WRITE8_MEMBER(write_l);
|
||||
|
||||
// virtual DECLARE_READ8_MEMBER(chip_read);
|
||||
// virtual DECLARE_WRITE8_MEMBER(chip_write);
|
||||
// virtual DECLARE_READ8_MEMBER(chip_read);
|
||||
// virtual DECLARE_WRITE8_MEMBER(chip_write);
|
||||
};
|
||||
|
||||
// device type definition
|
||||
|
@ -81,27 +81,27 @@ READ8_MEMBER(sns_rom_sufami_device::read_l)
|
||||
|
||||
READ8_MEMBER(sns_rom_sufami_device::read_h)
|
||||
{
|
||||
if (offset < 0x200000) // SUFAMI TURBO ROM
|
||||
if (offset < 0x200000) // SUFAMI TURBO ROM
|
||||
{
|
||||
int bank = offset / 0x10000;
|
||||
return m_rom[rom_bank_map[bank] * 0x8000 + (offset & 0x7fff)];
|
||||
}
|
||||
if (offset >= 0x200000 && offset < 0x400000) // SLOT1 STROM
|
||||
if (offset >= 0x200000 && offset < 0x400000) // SLOT1 STROM
|
||||
{
|
||||
if (m_slot1->m_cart)
|
||||
return m_slot1->m_cart->read_l(space, offset - 0x200000);
|
||||
}
|
||||
if (offset >= 0x400000 && offset < 0x600000) // SLOT2 STROM
|
||||
if (offset >= 0x400000 && offset < 0x600000) // SLOT2 STROM
|
||||
{
|
||||
if (m_slot2->m_cart)
|
||||
return m_slot2->m_cart->read_l(space, offset - 0x400000);
|
||||
}
|
||||
if (offset >= 0x600000 && offset < 0x640000) // SLOT1 RAM
|
||||
if (offset >= 0x600000 && offset < 0x640000) // SLOT1 RAM
|
||||
{
|
||||
if (m_slot1->m_cart && (offset & 0xffff) > 0x8000)
|
||||
return m_slot1->m_cart->read_h(space, offset - 0x600000);
|
||||
}
|
||||
if (offset >= 0x700000 && offset < 0x740000) // SLOT2 RAM
|
||||
if (offset >= 0x700000 && offset < 0x740000) // SLOT2 RAM
|
||||
{
|
||||
if (m_slot2->m_cart && (offset & 0xffff) > 0x8000)
|
||||
return m_slot2->m_cart->read_h(space, offset - 0x700000);
|
||||
@ -117,13 +117,13 @@ WRITE8_MEMBER(sns_rom_sufami_device::write_l)
|
||||
|
||||
WRITE8_MEMBER(sns_rom_sufami_device::write_h)
|
||||
{
|
||||
if (offset >= 0x600000 && offset < 0x640000) // SLOT1 RAM
|
||||
if (offset >= 0x600000 && offset < 0x640000) // SLOT1 RAM
|
||||
{
|
||||
if (m_slot1->m_cart && (offset & 0xffff) > 0x8000)
|
||||
return m_slot1->m_cart->write_h(space, offset - 0x600000, data);
|
||||
}
|
||||
|
||||
if (offset >= 0x700000 && offset < 0x740000) // SLOT2 RAM
|
||||
if (offset >= 0x700000 && offset < 0x740000) // SLOT2 RAM
|
||||
{
|
||||
if (m_slot2->m_cart && (offset & 0xffff) > 0x8000)
|
||||
return m_slot2->m_cart->write_h(space, offset - 0x700000, data);
|
||||
@ -172,5 +172,3 @@ WRITE8_MEMBER(sns_rom_strom_device::write_h)
|
||||
m_nvram[bank * 0x8000 + (offset & 0x7fff)] = data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -42,10 +42,10 @@ public:
|
||||
virtual void device_config_complete() { m_shortname = "sns_strom"; }
|
||||
|
||||
// additional reading and writing
|
||||
virtual DECLARE_READ8_MEMBER(read_l); // used for ROM
|
||||
virtual DECLARE_READ8_MEMBER(read_h); // used for ROM
|
||||
virtual DECLARE_WRITE8_MEMBER(write_l); // used for RAM
|
||||
virtual DECLARE_WRITE8_MEMBER(write_h); // used for RAM
|
||||
virtual DECLARE_READ8_MEMBER(read_l); // used for ROM
|
||||
virtual DECLARE_READ8_MEMBER(read_h); // used for ROM
|
||||
virtual DECLARE_WRITE8_MEMBER(write_l); // used for RAM
|
||||
virtual DECLARE_WRITE8_MEMBER(write_h); // used for RAM
|
||||
};
|
||||
|
||||
|
||||
|
@ -24,19 +24,19 @@ const device_type SNS_LOROM_SETA11 = &device_creator<sns_rom_seta11dsp_device>;
|
||||
|
||||
sns_rom20_necdsp_device::sns_rom20_necdsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: sns_rom_device(mconfig, SNS_LOROM_NECDSP, "SNES Cart (LoROM) + NEC DSP", tag, owner, clock),
|
||||
m_upd7725(*this, "dsp")
|
||||
m_upd7725(*this, "dsp")
|
||||
{
|
||||
}
|
||||
|
||||
sns_rom21_necdsp_device::sns_rom21_necdsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: sns_rom21_device(mconfig, SNS_HIROM_NECDSP, "SNES Cart (HiROM) + NEC DSP", tag, owner, clock),
|
||||
m_upd7725(*this, "dsp")
|
||||
m_upd7725(*this, "dsp")
|
||||
{
|
||||
}
|
||||
|
||||
sns_rom_setadsp_device::sns_rom_setadsp_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
|
||||
: sns_rom_device(mconfig, type, name, tag, owner, clock),
|
||||
m_upd96050(*this, "dsp")
|
||||
m_upd96050(*this, "dsp")
|
||||
{
|
||||
}
|
||||
|
||||
@ -223,6 +223,9 @@ 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;
|
||||
}
|
||||
|
||||
@ -248,6 +251,10 @@ 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);
|
||||
}
|
||||
|
||||
|
||||
@ -316,4 +323,3 @@ machine_config_constructor sns_rom_seta11dsp_device::device_mconfig_additions()
|
||||
{
|
||||
return MACHINE_CONFIG_NAME( snes_st011 );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user