Fixed williams regression (no whatsnew)

This commit is contained in:
Miodrag Milanovic 2012-05-27 14:04:26 +00:00
parent 2d622ef31b
commit 2e003a90c1
3 changed files with 14 additions and 7 deletions

View File

@ -1690,7 +1690,7 @@ static MACHINE_CONFIG_DERIVED( tshoot, williams2 )
MACHINE_CONFIG_END MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( joust2, williams2 ) static MACHINE_CONFIG_DERIVED_CLASS( joust2, williams2, joust2_state )
/* basic machine hardware */ /* basic machine hardware */
MCFG_WILLIAMS_CVSD_SOUND_ADD("cvsd") MCFG_WILLIAMS_CVSD_SOUND_ADD("cvsd")

View File

@ -13,7 +13,6 @@ class williams_state : public driver_device
public: public:
williams_state(const machine_config &mconfig, device_type type, const char *tag) williams_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag), : driver_device(mconfig, type, tag),
m_cvsd_sound(*this, "cvsd"),
m_nvram(*this, "nvram"), m_nvram(*this, "nvram"),
m_videoram(*this, "videoram"), m_videoram(*this, "videoram"),
m_blaster_palette_0(*this, "blaster_pal0"), m_blaster_palette_0(*this, "blaster_pal0"),
@ -21,8 +20,6 @@ public:
m_williams2_tileram(*this, "williams2_tile") m_williams2_tileram(*this, "williams2_tile")
{ } { }
optional_device<williams_cvsd_sound_device> m_cvsd_sound;
required_shared_ptr<UINT8> m_nvram; required_shared_ptr<UINT8> m_nvram;
UINT8 *m_mayday_protection; UINT8 *m_mayday_protection;
required_shared_ptr<UINT8> m_videoram; required_shared_ptr<UINT8> m_videoram;
@ -78,6 +75,16 @@ public:
}; };
class joust2_state : public williams_state
{
public:
joust2_state(const machine_config &mconfig, device_type type, const char *tag)
: williams_state(mconfig, type, tag),
m_cvsd_sound(*this, "cvsd") { }
required_device<williams_cvsd_sound_device> m_cvsd_sound;
};
/*----------- defined in drivers/williams.c -----------*/ /*----------- defined in drivers/williams.c -----------*/
void defender_install_io_space(address_space *space); void defender_install_io_space(address_space *space);

View File

@ -985,7 +985,7 @@ static WRITE8_DEVICE_HANDLER( tshoot_lamp_w )
MACHINE_START( joust2 ) MACHINE_START( joust2 )
{ {
williams_state *state = machine.driver_data<williams_state>(); joust2_state *state = machine.driver_data<joust2_state>();
MACHINE_START_CALL(williams2); MACHINE_START_CALL(williams2);
state_save_register_global(machine, state->m_joust2_current_sound_data); state_save_register_global(machine, state->m_joust2_current_sound_data);
} }
@ -1006,7 +1006,7 @@ static TIMER_CALLBACK( joust2_deferred_snd_cmd_w )
static WRITE8_DEVICE_HANDLER( joust2_pia_3_cb1_w ) static WRITE8_DEVICE_HANDLER( joust2_pia_3_cb1_w )
{ {
williams_state *state = device->machine().driver_data<williams_state>(); joust2_state *state = device->machine().driver_data<joust2_state>();
state->m_joust2_current_sound_data = (state->m_joust2_current_sound_data & ~0x100) | ((data << 8) & 0x100); state->m_joust2_current_sound_data = (state->m_joust2_current_sound_data & ~0x100) | ((data << 8) & 0x100);
state->m_cvsd_sound->write(*device->machine().memory().first_space(), 0, state->m_joust2_current_sound_data); state->m_cvsd_sound->write(*device->machine().memory().first_space(), 0, state->m_joust2_current_sound_data);
} }
@ -1014,7 +1014,7 @@ static WRITE8_DEVICE_HANDLER( joust2_pia_3_cb1_w )
static WRITE8_DEVICE_HANDLER( joust2_snd_cmd_w ) static WRITE8_DEVICE_HANDLER( joust2_snd_cmd_w )
{ {
williams_state *state = device->machine().driver_data<williams_state>(); joust2_state *state = device->machine().driver_data<joust2_state>();
state->m_joust2_current_sound_data = (state->m_joust2_current_sound_data & ~0xff) | (data & 0xff); state->m_joust2_current_sound_data = (state->m_joust2_current_sound_data & ~0xff) | (data & 0xff);
state->m_cvsd_sound->write(*device->machine().memory().first_space(), 0, state->m_joust2_current_sound_data); state->m_cvsd_sound->write(*device->machine().memory().first_space(), 0, state->m_joust2_current_sound_data);
device->machine().scheduler().synchronize(FUNC(joust2_deferred_snd_cmd_w), state->m_joust2_current_sound_data); device->machine().scheduler().synchronize(FUNC(joust2_deferred_snd_cmd_w), state->m_joust2_current_sound_data);