mirror of
https://github.com/holub/mame
synced 2025-04-24 01:11:11 +03:00
asteroid.c: fixed save state problem for astdelux1 (nw)
This commit is contained in:
parent
bfcbf9f5ab
commit
969616a043
@ -1013,7 +1013,11 @@ DRIVER_INIT_MEMBER(asteroid_state,asterock)
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x2000, 0x2007, read8_delegate(FUNC(asteroid_state::asterock_IN0_r),this));
|
||||
}
|
||||
|
||||
|
||||
DRIVER_INIT_MEMBER(asteroid_state,astdelux)
|
||||
{
|
||||
save_item(NAME(m_astdelux_bankswitch));
|
||||
machine().save().register_postload(save_prepost_delegate(FUNC(asteroid_state::astdelux_bankswitch_restore), this));
|
||||
}
|
||||
|
||||
/*************************************
|
||||
*
|
||||
@ -1032,9 +1036,9 @@ GAME( 1979, meteorts, asteroid, asteroid, asteroid, driver_device, 0,
|
||||
GAME( 1979, meteorho, asteroid, asteroid, asteroid, driver_device, 0, ROT0, "bootleg (Hoei)", "Meteor (bootleg of Asteroids)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1979, hyperspc, asteroid, asteroid, asteroid, driver_device, 0, ROT0, "bootleg (Rumiano)", "Hyperspace (bootleg of Asteroids)", GAME_SUPPORTS_SAVE )
|
||||
|
||||
GAMEL(1980, astdelux, 0, astdelux, astdelux, driver_device, 0, ROT0, "Atari", "Asteroids Deluxe (rev 3)", GAME_SUPPORTS_SAVE, layout_astdelux )
|
||||
GAMEL(1980, astdelux2, astdelux, astdelux, astdelux, driver_device, 0, ROT0, "Atari", "Asteroids Deluxe (rev 2)", GAME_SUPPORTS_SAVE, layout_astdelux )
|
||||
GAMEL(1980, astdelux1, astdelux, astdelux, astdelux, driver_device, 0, ROT0, "Atari", "Asteroids Deluxe (rev 1)", GAME_SUPPORTS_SAVE, layout_astdelux )
|
||||
GAMEL(1980, astdelux, 0, astdelux, astdelux, asteroid_state, astdelux, ROT0, "Atari", "Asteroids Deluxe (rev 3)", GAME_SUPPORTS_SAVE, layout_astdelux )
|
||||
GAMEL(1980, astdelux2, astdelux, astdelux, astdelux, asteroid_state, astdelux, ROT0, "Atari", "Asteroids Deluxe (rev 2)", GAME_SUPPORTS_SAVE, layout_astdelux )
|
||||
GAMEL(1980, astdelux1, astdelux, astdelux, astdelux, asteroid_state, astdelux, ROT0, "Atari", "Asteroids Deluxe (rev 1)", GAME_SUPPORTS_SAVE, layout_astdelux )
|
||||
|
||||
GAME( 1979, llander, 0, llander, llander, driver_device, 0, ROT0, "Atari", "Lunar Lander (rev 2)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1979, llander1, llander, llander, llander1, driver_device, 0, ROT0, "Atari", "Lunar Lander (rev 1)", GAME_SUPPORTS_SAVE )
|
||||
|
@ -12,15 +12,25 @@ class asteroid_state : public driver_device
|
||||
public:
|
||||
asteroid_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_ram1(*this, "ram1"),
|
||||
m_ram2(*this, "ram2"),
|
||||
m_discrete(*this, "discrete") ,
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_dvg(*this, "dvg") { }
|
||||
m_dvg(*this, "dvg"),
|
||||
m_discrete(*this, "discrete"),
|
||||
m_ram1(*this, "ram1"),
|
||||
m_ram2(*this, "ram2") { }
|
||||
|
||||
/* devices */
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<dvg_device> m_dvg;
|
||||
required_device<discrete_device> m_discrete;
|
||||
|
||||
/* memory pointers */
|
||||
optional_shared_ptr<UINT8> m_ram1;
|
||||
optional_shared_ptr<UINT8> m_ram2;
|
||||
required_device<discrete_device> m_discrete;
|
||||
|
||||
int m_astdelux_bankswitch; // for postload
|
||||
|
||||
void astdelux_bankswitch_restore();
|
||||
|
||||
DECLARE_WRITE8_MEMBER(astdelux_coin_counter_w);
|
||||
DECLARE_WRITE8_MEMBER(llander_led_w);
|
||||
DECLARE_READ8_MEMBER(asteroid_IN0_r);
|
||||
@ -30,13 +40,6 @@ public:
|
||||
DECLARE_WRITE8_MEMBER(asteroid_bank_switch_w);
|
||||
DECLARE_WRITE8_MEMBER(astdelux_bank_switch_w);
|
||||
DECLARE_WRITE8_MEMBER(astdelux_led_w);
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(clock_r);
|
||||
DECLARE_DRIVER_INIT(asterock);
|
||||
DECLARE_DRIVER_INIT(asteroidb);
|
||||
virtual void machine_reset();
|
||||
INTERRUPT_GEN_MEMBER(asteroid_interrupt);
|
||||
INTERRUPT_GEN_MEMBER(asterock_interrupt);
|
||||
INTERRUPT_GEN_MEMBER(llander_interrupt);
|
||||
DECLARE_WRITE8_MEMBER(asteroid_explode_w);
|
||||
DECLARE_WRITE8_MEMBER(asteroid_thump_w);
|
||||
DECLARE_WRITE8_MEMBER(asteroid_sounds_w);
|
||||
@ -44,9 +47,19 @@ public:
|
||||
DECLARE_WRITE8_MEMBER(asteroid_noise_reset_w);
|
||||
DECLARE_WRITE8_MEMBER(llander_snd_reset_w);
|
||||
DECLARE_WRITE8_MEMBER(llander_sounds_w);
|
||||
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(clock_r);
|
||||
|
||||
INTERRUPT_GEN_MEMBER(asteroid_interrupt);
|
||||
INTERRUPT_GEN_MEMBER(asterock_interrupt);
|
||||
INTERRUPT_GEN_MEMBER(llander_interrupt);
|
||||
|
||||
DECLARE_DRIVER_INIT(asterock);
|
||||
DECLARE_DRIVER_INIT(asteroidb);
|
||||
DECLARE_DRIVER_INIT(astdelux);
|
||||
|
||||
virtual void machine_reset();
|
||||
DECLARE_MACHINE_RESET(llander);
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<dvg_device> m_dvg;
|
||||
};
|
||||
|
||||
/*----------- defined in audio/asteroid.c -----------*/
|
||||
|
@ -112,7 +112,13 @@ WRITE8_MEMBER(asteroid_state::asteroid_bank_switch_w)
|
||||
|
||||
WRITE8_MEMBER(asteroid_state::astdelux_bank_switch_w)
|
||||
{
|
||||
if (data & 0x80)
|
||||
m_astdelux_bankswitch = data;
|
||||
astdelux_bankswitch_restore();
|
||||
}
|
||||
|
||||
void asteroid_state::astdelux_bankswitch_restore()
|
||||
{
|
||||
if (m_astdelux_bankswitch & 0x80)
|
||||
{
|
||||
membank("bank1")->set_base(m_ram2);
|
||||
membank("bank2")->set_base(m_ram1);
|
||||
@ -124,13 +130,11 @@ WRITE8_MEMBER(asteroid_state::astdelux_bank_switch_w)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(asteroid_state::astdelux_led_w)
|
||||
{
|
||||
set_led_status(machine(), offset, (data & 0x80) ? 0 : 1);
|
||||
}
|
||||
|
||||
|
||||
void asteroid_state::machine_reset()
|
||||
{
|
||||
asteroid_bank_switch_w(m_maincpu->space(AS_PROGRAM), 0, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user