Fixed chqflag save state problem (nw)

This commit is contained in:
Ivan Vangelista 2014-08-20 16:13:58 +00:00
parent 2a02bb0f75
commit 858ec85f74
2 changed files with 12 additions and 0 deletions

View File

@ -33,6 +33,8 @@ TIMER_DEVICE_CALLBACK_MEMBER(chqflag_state::chqflag_scanline)
WRITE8_MEMBER(chqflag_state::chqflag_bankswitch_w)
{
m_bank = data; //needed to restore the bankswitch post load
int bankaddress;
UINT8 *RAM = memregion("maincpu")->base();
@ -61,6 +63,11 @@ WRITE8_MEMBER(chqflag_state::chqflag_bankswitch_w)
/* other bits unknown/unused */
}
void chqflag_state::bankswitch_restore()
{
chqflag_bankswitch_w(m_maincpu->space(AS_PROGRAM), 0, m_bank);
}
WRITE8_MEMBER(chqflag_state::chqflag_vreg_w)
{
/* bits 0 & 1 = coin counters */
@ -281,6 +288,8 @@ void chqflag_state::machine_start()
save_item(NAME(m_analog_ctrl));
save_item(NAME(m_accel));
save_item(NAME(m_wheel));
save_item(NAME(m_bank));
machine().save().register_postload(save_prepost_delegate(FUNC(chqflag_state::bankswitch_restore), this));
}
void chqflag_state::machine_reset()
@ -290,6 +299,7 @@ void chqflag_state::machine_reset()
m_analog_ctrl = 0;
m_accel = 0;
m_wheel = 0;
m_bank = 0;
}
static MACHINE_CONFIG_START( chqflag, chqflag_state )

View File

@ -37,6 +37,7 @@ public:
int m_analog_ctrl;
int m_accel;
int m_wheel;
int m_bank;
/* devices */
required_device<cpu_device> m_maincpu;
@ -65,4 +66,5 @@ public:
K051316_CB_MEMBER(zoom_callback_1);
K051316_CB_MEMBER(zoom_callback_2);
K051960_CB_MEMBER(sprite_callback);
void bankswitch_restore();
};