srccleaned + minor fixes. nw.

This commit is contained in:
Fabio Priuli 2013-03-05 12:01:47 +00:00
parent 24837775a4
commit aa2b3bb471
20 changed files with 845 additions and 826 deletions

View File

@ -2128,6 +2128,9 @@ static READ8_HANDLER( snesnew_hi_r )
else if ((state->m_slotcart->get_type() == SNES_ST010 || state->m_slotcart->get_type() == SNES_ST011)
&& (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))
return state->m_slotcart->m_cart->chip_read(space, offset & 0xffff);
@ -2197,6 +2200,9 @@ static WRITE8_HANDLER( snesnew_lo_w )
else if ((state->m_slotcart->get_type() == SNES_ST010 || state->m_slotcart->get_type() == SNES_ST011)
&& (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))
state->m_slotcart->m_cart->chip_write(space, offset & 0xffff, data);
@ -2271,6 +2277,9 @@ static WRITE8_HANDLER( snesnew_hi_w )
else if ((state->m_slotcart->get_type() == SNES_ST010 || state->m_slotcart->get_type() == SNES_ST011)
&& (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))
state->m_slotcart->m_cart->chip_write(space, offset & 0xffff, data);
@ -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;
}
}

View File

@ -1312,4 +1312,3 @@ DRIVER_INIT_MEMBER(snes_state,snesst)
#include "machine/snesrtc.c"
#include "machine/snessdd1.c"
#include "machine/snes7110.c"

View File

@ -583,4 +583,3 @@ READ8_MEMBER(sns_rom_bsmempak_device::read_h)
WRITE8_MEMBER(sns_rom_bsmempak_device::write_l)
{
}

View File

@ -257,4 +257,3 @@ WRITE8_MEMBER( sns_rom_obc1_device::chip_write )
break;
}
}

View File

@ -303,4 +303,3 @@ WRITE8_MEMBER(sns_rom21_srtc_device::chip_write)
}
}
}

View File

@ -219,4 +219,3 @@ WRITE8_MEMBER( sns_rom_superfx_device::write_h )
sfx_ram[offset & 0xfffff] = data;
}
}

View File

@ -1640,4 +1640,3 @@ WRITE8_MEMBER(sns_rom_spc7110_device::chip_write)
break;
}
}

View File

@ -172,5 +172,3 @@ WRITE8_MEMBER(sns_rom_strom_device::write_h)
m_nvram[bank * 0x8000 + (offset & 0x7fff)] = data;
}
}

View File

@ -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 );
}