driver.cpp: removed the old soundlatch methods. (nw)

This commit is contained in:
Ivan Vangelista 2016-06-12 12:07:34 +02:00
parent 2fd969b16a
commit ab9d8aa8bf
2 changed files with 0 additions and 111 deletions

View File

@ -37,12 +37,9 @@ driver_device::driver_device(const machine_config &mconfig, device_type type, co
device_memory_interface(mconfig, *this),
m_space_config("generic", ENDIANNESS_LITTLE, 8, 32, 0, nullptr, *ADDRESS_MAP_NAME(generic)),
m_system(nullptr),
m_latch_clear_value(0),
m_flip_screen_x(0),
m_flip_screen_y(0)
{
memset(m_latched_value, 0, sizeof(m_latched_value));
memset(m_latch_read, 0, sizeof(m_latch_read));
}
@ -231,8 +228,6 @@ void driver_device::device_start()
video_start();
// save generic states
save_item(NAME(m_latch_clear_value));
save_item(NAME(m_latched_value));
save_item(NAME(m_flip_screen_x));
save_item(NAME(m_flip_screen_y));
}
@ -375,74 +370,6 @@ INTERRUPT_GEN_MEMBER( driver_device::irq7_line_hold ) { device.execute().set_i
INTERRUPT_GEN_MEMBER( driver_device::irq7_line_pulse ) { generic_pulse_irq_line(device.execute(), 7, 1); }
INTERRUPT_GEN_MEMBER( driver_device::irq7_line_assert ) { device.execute().set_input_line(7, ASSERT_LINE); }
//**************************************************************************
// GENERIC SOUND COMMAND LATCHING
//**************************************************************************
//-------------------------------------------------
// soundlatch_sync_callback - time-delayed
// callback to set a latch value
//-------------------------------------------------
void driver_device::soundlatch_sync_callback(void *ptr, INT32 param)
{
UINT16 value = param >> 8;
int which = param & 0xff;
// if the latch hasn't been read and the value is changed, log a warning
if (!m_latch_read[which] && m_latched_value[which] != value)
logerror("Warning: sound latch %d written before being read. Previous: %02x, new: %02x\n", which, m_latched_value[which], value);
// store the new value and mark it not read
m_latched_value[which] = value;
m_latch_read[which] = 0;
}
//-------------------------------------------------
// soundlatch_byte_w - global write handlers for
// writing to sound latches
//-------------------------------------------------
void driver_device::soundlatch_write(UINT8 index, UINT32 data) { machine().scheduler().synchronize(timer_expired_delegate(FUNC(driver_device::soundlatch_sync_callback), this), index | (data << 8)); }
WRITE8_MEMBER( driver_device::soundlatch_byte_w ) { soundlatch_write(0, data); }
WRITE16_MEMBER( driver_device::soundlatch_word_w ) { soundlatch_write(0, data); }
WRITE8_MEMBER( driver_device::soundlatch2_byte_w ) { soundlatch_write(1, data); }
WRITE16_MEMBER( driver_device::soundlatch2_word_w ) { soundlatch_write(1, data); }
WRITE8_MEMBER( driver_device::soundlatch3_byte_w ) { soundlatch_write(2, data); }
WRITE16_MEMBER( driver_device::soundlatch3_word_w ) { soundlatch_write(2, data); }
WRITE8_MEMBER( driver_device::soundlatch4_byte_w ) { soundlatch_write(3, data); }
WRITE16_MEMBER( driver_device::soundlatch4_word_w ) { soundlatch_write(3, data); }
//-------------------------------------------------
// soundlatch_byte_r - global read handlers for
// reading from sound latches
//-------------------------------------------------
UINT32 driver_device::soundlatch_read(UINT8 index) { m_latch_read[index] = 1; return m_latched_value[index]; }
READ8_MEMBER( driver_device::soundlatch_byte_r ) { return soundlatch_read(0); }
READ16_MEMBER( driver_device::soundlatch_word_r ) { return soundlatch_read(0); }
READ8_MEMBER( driver_device::soundlatch2_byte_r ) { return soundlatch_read(1); }
READ16_MEMBER( driver_device::soundlatch2_word_r ) { return soundlatch_read(1); }
READ8_MEMBER( driver_device::soundlatch3_byte_r ) { return soundlatch_read(2); }
READ16_MEMBER( driver_device::soundlatch3_word_r ) { return soundlatch_read(2); }
READ8_MEMBER( driver_device::soundlatch4_byte_r ) { return soundlatch_read(3); }
READ16_MEMBER( driver_device::soundlatch4_word_r ) { return soundlatch_read(3); }
//-------------------------------------------------
// soundlatch_clear_byte_w - global write handlers
// for clearing sound latches
//-------------------------------------------------
void driver_device::soundlatch_clear(UINT8 index) { m_latched_value[index] = m_latch_clear_value; }
WRITE8_MEMBER( driver_device::soundlatch_clear_byte_w ) { soundlatch_clear(0); }
WRITE8_MEMBER( driver_device::soundlatch2_clear_byte_w ) { soundlatch_clear(1); }
WRITE8_MEMBER( driver_device::soundlatch3_clear_byte_w ) { soundlatch_clear(2); }
WRITE8_MEMBER( driver_device::soundlatch4_clear_byte_w ) { soundlatch_clear(3); }
//**************************************************************************
// GENERIC FLIP SCREEN HANDLING

View File

@ -179,38 +179,6 @@ public:
INTERRUPT_GEN_MEMBER( irq7_line_pulse );
INTERRUPT_GEN_MEMBER( irq7_line_assert );
// generic audio
void soundlatch_setclearedvalue(UINT16 value) { m_latch_clear_value = value; }
// sound latch readers
UINT32 soundlatch_read(UINT8 index = 0);
DECLARE_READ8_MEMBER( soundlatch_byte_r );
DECLARE_READ8_MEMBER( soundlatch2_byte_r );
DECLARE_READ8_MEMBER( soundlatch3_byte_r );
DECLARE_READ8_MEMBER( soundlatch4_byte_r );
DECLARE_READ16_MEMBER( soundlatch_word_r );
DECLARE_READ16_MEMBER( soundlatch2_word_r );
DECLARE_READ16_MEMBER( soundlatch3_word_r );
DECLARE_READ16_MEMBER( soundlatch4_word_r );
// sound latch writers
void soundlatch_write(UINT8 index, UINT32 data);
void soundlatch_write(UINT32 data) { soundlatch_write(0, data); }
DECLARE_WRITE8_MEMBER( soundlatch_byte_w );
DECLARE_WRITE8_MEMBER( soundlatch2_byte_w );
DECLARE_WRITE8_MEMBER( soundlatch3_byte_w );
DECLARE_WRITE8_MEMBER( soundlatch4_byte_w );
DECLARE_WRITE16_MEMBER( soundlatch_word_w );
DECLARE_WRITE16_MEMBER( soundlatch2_word_w );
DECLARE_WRITE16_MEMBER( soundlatch3_word_w );
DECLARE_WRITE16_MEMBER( soundlatch4_word_w );
// sound latch clearers
void soundlatch_clear(UINT8 index = 0);
DECLARE_WRITE8_MEMBER( soundlatch_clear_byte_w );
DECLARE_WRITE8_MEMBER( soundlatch2_clear_byte_w );
DECLARE_WRITE8_MEMBER( soundlatch3_clear_byte_w );
DECLARE_WRITE8_MEMBER( soundlatch4_clear_byte_w );
// generic video
void flip_screen_set(UINT32 on);
@ -252,7 +220,6 @@ protected:
private:
// helpers
void irq_pulse_clear(void *ptr, INT32 param);
void soundlatch_sync_callback(void *ptr, INT32 param);
void updateflip();
// configuration state
@ -262,11 +229,6 @@ private:
const game_driver * m_system; // pointer to the game driver
driver_callback_delegate m_callbacks[CB_COUNT]; // start/reset callbacks
// generic audio
UINT16 m_latch_clear_value;
UINT16 m_latched_value[4];
UINT8 m_latch_read[4];
// generic video
UINT8 m_flip_screen_x;
UINT8 m_flip_screen_y;