summaryrefslogtreecommitdiffstats
path: root/src/mame
diff options
context:
space:
mode:
authorGravatarGravatar Ivan Vangelista <mesgnet@yahoo.it>2016-09-19 18:38:54 +0200
committerGravatarGravatar Ivan Vangelista <mesgnet@yahoo.it>2016-09-19 18:38:54 +0200
commitb07bedcc4ea7333628aa5e94734eeac81ce844ee (patch) (github)
treebbbcabb60d48a9e2b3cefcc7430eaed3a7046de5 /src/mame
parent6c66854f7e7907a66fb7b1d459188b9c047f7a87 (diff)
downloadmame-b07bedcc4ea7333628aa5e94734eeac81ce844ee.tar.bz2
mame-b07bedcc4ea7333628aa5e94734eeac81ce844ee.zip
stfight.cpp: switched to configured bankins, fixes save state problem with cshootert (nw)
Diffstat (limited to 'src/mame')
-rw-r--r--src/mame/drivers/stfight.cpp2
-rw-r--r--src/mame/machine/stfight.cpp16
2 files changed, 7 insertions, 11 deletions
diff --git a/src/mame/drivers/stfight.cpp b/src/mame/drivers/stfight.cpp
index 3d548b97d15..fb4f03df47f 100644
--- a/src/mame/drivers/stfight.cpp
+++ b/src/mame/drivers/stfight.cpp
@@ -263,7 +263,7 @@ TODO:
static ADDRESS_MAP_START( cpu1_map, AS_PROGRAM, 8, stfight_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
- AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") /* sf02.bin */
+ AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("mainbank") /* sf02.bin */
AM_RANGE(0xc000, 0xc0ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0xc100, 0xc1ff) AM_RAM_DEVWRITE("palette", palette_device, write_ext) AM_SHARE("palette_ext")
AM_RANGE(0xc200, 0xc200) AM_READ_PORT("P1")
diff --git a/src/mame/machine/stfight.cpp b/src/mame/machine/stfight.cpp
index 0f88a0801ec..0b10d2bc43e 100644
--- a/src/mame/machine/stfight.cpp
+++ b/src/mame/machine/stfight.cpp
@@ -75,6 +75,8 @@ DRIVER_INIT_MEMBER(stfight_state,cshooter)
void stfight_state::machine_start()
{
+ membank("mainbank")->configure_entries(0, 4, memregion("maincpu")->base() + 0x10000, 0x4000);
+
save_item(NAME(m_fm_data));
save_item(NAME(m_cpu_to_mcu_data));
save_item(NAME(m_cpu_to_mcu_empty));
@@ -102,27 +104,21 @@ void stfight_state::machine_reset()
// Coin signals are active low
m_coin_state = 3;
-
- // initialise ROM bank
- stfight_bank_w(m_maincpu->space(AS_PROGRAM), 0, 0);
}
// It's entirely possible that this bank is never switched out
// - in fact I don't even know how/where it's switched in!
WRITE8_MEMBER(stfight_state::stfight_bank_w)
{
- UINT8 *ROM2 = memregion("maincpu")->base() + 0x10000;
- UINT16 bank_num;
-
- bank_num = 0;
+ UINT8 bank_num = 0;
if(data & 0x80)
- bank_num |= 0x8000;
+ bank_num |= 2;
if(data & 0x04)
- bank_num |= 0x4000;
+ bank_num |= 1;
- membank("bank1")->set_base(&ROM2[bank_num]);
+ membank("mainbank")->set_entry(bank_num);
}
/*