mirror of
https://github.com/holub/mame
synced 2025-04-24 17:30:55 +03:00
Fixed chqflag save state problem (nw)
This commit is contained in:
parent
2a02bb0f75
commit
858ec85f74
@ -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 )
|
||||
|
@ -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();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user