From 107acd25457b56c7b6d8e4ce391bacfd2a439752 Mon Sep 17 00:00:00 2001 From: cam900 Date: Wed, 20 Feb 2019 18:57:26 +0900 Subject: timekpr.cpp : Remove unnecessary arguments in handlers Use shorter / correct type values, Fix code styles --- src/devices/machine/timekpr.cpp | 260 ++++++++++++++++++++-------------------- src/devices/machine/timekpr.h | 68 +++++------ src/mame/drivers/atlantis.cpp | 6 +- src/mame/drivers/cps1.cpp | 4 +- src/mame/drivers/itech32.cpp | 2 +- src/mame/drivers/konamim2.cpp | 4 +- src/mame/drivers/midzeus.cpp | 4 +- src/mame/drivers/multfish.cpp | 8 +- src/mame/drivers/vegas.cpp | 18 +-- src/mame/machine/harddriv.cpp | 4 +- 10 files changed, 190 insertions(+), 188 deletions(-) diff --git a/src/devices/machine/timekpr.cpp b/src/devices/machine/timekpr.cpp index 7dddede2c05..66c83ab2046 100644 --- a/src/devices/machine/timekpr.cpp +++ b/src/devices/machine/timekpr.cpp @@ -37,51 +37,51 @@ DEFINE_DEVICE_TYPE(MK48T12, mk48t12_device, "mk48t12", "MK48T12 Timekeeper") MACROS ***************************************************************************/ -#define MASK_SECONDS ( 0x7f ) -#define MASK_MINUTES ( 0x7f ) -#define MASK_HOURS ( 0x3f ) -#define MASK_DAY ( 0x07 ) -#define MASK_DATE ( 0x3f ) -#define MASK_MONTH ( 0x1f ) -#define MASK_YEAR ( 0xff ) -#define MASK_CENTURY ( 0xff ) +#define MASK_SECONDS (0x7f) +#define MASK_MINUTES (0x7f) +#define MASK_HOURS (0x3f) +#define MASK_DAY (0x07) +#define MASK_DATE (0x3f) +#define MASK_MONTH (0x1f) +#define MASK_YEAR (0xff) +#define MASK_CENTURY (0xff) -#define CONTROL_W ( 0x80 ) -#define CONTROL_R ( 0x40 ) -#define CONTROL_S ( 0x20 ) /* not emulated */ -#define CONTROL_CALIBRATION ( 0x1f ) /* not emulated */ +#define CONTROL_W (0x80) +#define CONTROL_R (0x40) +#define CONTROL_S (0x20) /* not emulated */ +#define CONTROL_CALIBRATION (0x1f) /* not emulated */ -#define SECONDS_ST ( 0x80 ) +#define SECONDS_ST (0x80) -#define DAY_FT ( 0x40 ) /* M48T37 - not emulated */ -#define DAY_CEB ( 0x20 ) /* M48T35/M48T58 */ -#define DAY_CB ( 0x10 ) /* M48T35/M48T58 */ +#define DAY_FT (0x40) /* M48T37 - not emulated */ +#define DAY_CEB (0x20) /* M48T35/M48T58 */ +#define DAY_CB (0x10) /* M48T35/M48T58 */ -#define DATE_BLE ( 0x80 ) /* M48T58: not emulated */ -#define DATE_BL ( 0x40 ) /* M48T58: not emulated */ +#define DATE_BLE (0x80) /* M48T58: not emulated */ +#define DATE_BL (0x40) /* M48T58: not emulated */ -#define FLAGS_BL ( 0x10 ) /* MK48T08/M48T37: not emulated */ -#define FLAGS_AF ( 0x40 ) /* M48T37: not emulated */ -#define FLAGS_WDF ( 0x80 ) /* M48T37 */ +#define FLAGS_BL (0x10) /* MK48T08/M48T37: not emulated */ +#define FLAGS_AF (0x40) /* M48T37: not emulated */ +#define FLAGS_WDF (0x80) /* M48T37 */ /*************************************************************************** INLINE FUNCTIONS ***************************************************************************/ -static void counter_to_ram( uint8_t *data, int offset, int counter ) +static void counter_to_ram(u8 *data, u32 offset, u8 counter) { - if( offset >= 0 ) + if (offset >= 0) { - data[ offset ] = counter; + data[offset] = counter; } } -static int counter_from_ram( uint8_t *data, int offset ) +static int counter_from_ram(u8 *data, u32 offset) { - if( offset >= 0 ) + if (offset >= 0) { - return data[ offset ]; + return data[offset]; } return 0; } @@ -94,7 +94,7 @@ static int counter_from_ram( uint8_t *data, int offset ) // timekeeper_device_config - constructor //------------------------------------------------- -timekeeper_device::timekeeper_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int size) +timekeeper_device::timekeeper_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 size) : device_t(mconfig, type, tag, owner, clock) , device_nvram_interface(mconfig, *this) , m_reset_cb(*this) @@ -104,7 +104,7 @@ timekeeper_device::timekeeper_device(const machine_config &mconfig, device_type { } -m48t02_device::m48t02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +m48t02_device::m48t02_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : timekeeper_device(mconfig, M48T02, tag, owner, clock, 0x800) { m_offset_watchdog = -1; @@ -120,7 +120,7 @@ m48t02_device::m48t02_device(const machine_config &mconfig, const char *tag, dev m_offset_flags = -1; } -m48t35_device::m48t35_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +m48t35_device::m48t35_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : timekeeper_device(mconfig, M48T35, tag, owner, clock, 0x8000) { m_offset_watchdog = -1; @@ -136,7 +136,7 @@ m48t35_device::m48t35_device(const machine_config &mconfig, const char *tag, dev m_offset_flags = -1; } -m48t37_device::m48t37_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +m48t37_device::m48t37_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : timekeeper_device(mconfig, M48T37, tag, owner, clock, 0x8000) { m_offset_watchdog = 0x7ff7; @@ -152,7 +152,7 @@ m48t37_device::m48t37_device(const machine_config &mconfig, const char *tag, dev m_offset_flags = 0x7ff0; } -m48t58_device::m48t58_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +m48t58_device::m48t58_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : timekeeper_device(mconfig, M48T58, tag, owner, clock, 0x2000) { m_offset_watchdog = -1; @@ -168,7 +168,7 @@ m48t58_device::m48t58_device(const machine_config &mconfig, const char *tag, dev m_offset_flags = -1; } -mk48t08_device::mk48t08_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +mk48t08_device::mk48t08_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : timekeeper_device(mconfig, MK48T08, tag, owner, clock, 0x2000) { m_offset_watchdog = -1; @@ -184,7 +184,7 @@ mk48t08_device::mk48t08_device(const machine_config &mconfig, const char *tag, d m_offset_flags = 0x1ff0; } -mk48t12_device::mk48t12_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +mk48t12_device::mk48t12_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : timekeeper_device(mconfig, MK48T12, tag, owner, clock, 0x800) { m_offset_watchdog = -1; @@ -214,27 +214,27 @@ void timekeeper_device::device_start() machine().base_datetime(systime); m_control = 0; - m_seconds = time_helper::make_bcd( systime.local_time.second ); - m_minutes = time_helper::make_bcd( systime.local_time.minute ); - m_hours = time_helper::make_bcd( systime.local_time.hour ); - m_day = time_helper::make_bcd( systime.local_time.weekday + 1 ); - m_date = time_helper::make_bcd( systime.local_time.mday ); - m_month = time_helper::make_bcd( systime.local_time.month + 1 ); - m_year = time_helper::make_bcd( systime.local_time.year % 100 ); - m_century = time_helper::make_bcd( systime.local_time.year / 100 ); - m_data.resize( m_size ); - - save_item( NAME(m_control) ); - save_item( NAME(m_seconds) ); - save_item( NAME(m_minutes) ); - save_item( NAME(m_hours) ); - save_item( NAME(m_day) ); - save_item( NAME(m_date) ); - save_item( NAME(m_month) ); - save_item( NAME(m_year) ); - save_item( NAME(m_century) ); - save_item( NAME(m_data) ); - save_item( NAME(m_watchdog_delay)); + m_seconds = time_helper::make_bcd(systime.local_time.second); + m_minutes = time_helper::make_bcd(systime.local_time.minute); + m_hours = time_helper::make_bcd(systime.local_time.hour); + m_day = time_helper::make_bcd(systime.local_time.weekday + 1); + m_date = time_helper::make_bcd(systime.local_time.mday); + m_month = time_helper::make_bcd(systime.local_time.month + 1); + m_year = time_helper::make_bcd(systime.local_time.year % 100); + m_century = time_helper::make_bcd(systime.local_time.year / 100); + m_data.resize(m_size); + + save_item(NAME(m_control)); + save_item(NAME(m_seconds)); + save_item(NAME(m_minutes)); + save_item(NAME(m_hours)); + save_item(NAME(m_day)); + save_item(NAME(m_date)); + save_item(NAME(m_month)); + save_item(NAME(m_year)); + save_item(NAME(m_century)); + save_item(NAME(m_data)); + save_item(NAME(m_watchdog_delay)); emu_timer *timer = timer_alloc(); timer->adjust(attotime::from_seconds(1), 0, attotime::from_seconds(1)); @@ -254,98 +254,98 @@ void timekeeper_device::device_reset() { } void timekeeper_device::counters_to_ram() { - counter_to_ram( &m_data[0], m_offset_control, m_control ); - counter_to_ram( &m_data[0], m_offset_seconds, m_seconds ); - counter_to_ram( &m_data[0], m_offset_minutes, m_minutes ); - counter_to_ram( &m_data[0], m_offset_hours, m_hours ); - counter_to_ram( &m_data[0], m_offset_day, m_day ); - counter_to_ram( &m_data[0], m_offset_date, m_date ); - counter_to_ram( &m_data[0], m_offset_month, m_month ); - counter_to_ram( &m_data[0], m_offset_year, m_year ); - counter_to_ram( &m_data[0], m_offset_century, m_century ); + counter_to_ram(&m_data[0], m_offset_control, m_control); + counter_to_ram(&m_data[0], m_offset_seconds, m_seconds); + counter_to_ram(&m_data[0], m_offset_minutes, m_minutes); + counter_to_ram(&m_data[0], m_offset_hours, m_hours); + counter_to_ram(&m_data[0], m_offset_day, m_day); + counter_to_ram(&m_data[0], m_offset_date, m_date); + counter_to_ram(&m_data[0], m_offset_month, m_month); + counter_to_ram(&m_data[0], m_offset_year, m_year); + counter_to_ram(&m_data[0], m_offset_century, m_century); } void timekeeper_device::counters_from_ram() { - m_control = counter_from_ram( &m_data[0], m_offset_control ); - m_seconds = counter_from_ram( &m_data[0], m_offset_seconds ); - m_minutes = counter_from_ram( &m_data[0], m_offset_minutes ); - m_hours = counter_from_ram( &m_data[0], m_offset_hours ); - m_day = counter_from_ram( &m_data[0], m_offset_day ); - m_date = counter_from_ram( &m_data[0], m_offset_date ); - m_month = counter_from_ram( &m_data[0], m_offset_month ); - m_year = counter_from_ram( &m_data[0], m_offset_year ); - m_century = counter_from_ram( &m_data[0], m_offset_century ); + m_control = counter_from_ram(&m_data[0], m_offset_control); + m_seconds = counter_from_ram(&m_data[0], m_offset_seconds); + m_minutes = counter_from_ram(&m_data[0], m_offset_minutes); + m_hours = counter_from_ram(&m_data[0], m_offset_hours); + m_day = counter_from_ram(&m_data[0], m_offset_day); + m_date = counter_from_ram(&m_data[0], m_offset_date); + m_month = counter_from_ram(&m_data[0], m_offset_month); + m_year = counter_from_ram(&m_data[0], m_offset_year); + m_century = counter_from_ram(&m_data[0], m_offset_century); } void timekeeper_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { LOGMASKED(LOG_TICKS, "Tick\n"); - if( ( m_seconds & SECONDS_ST ) != 0 || - ( m_control & CONTROL_W ) != 0 ) + if ((m_seconds & SECONDS_ST) != 0 || + (m_control & CONTROL_W) != 0) { logerror("No Tick\n"); return; } - int carry = time_helper::inc_bcd( &m_seconds, MASK_SECONDS, 0x00, 0x59 ); - if( carry ) + int carry = time_helper::inc_bcd(&m_seconds, MASK_SECONDS, 0x00, 0x59); + if (carry) { - carry = time_helper::inc_bcd( &m_minutes, MASK_MINUTES, 0x00, 0x59 ); + carry = time_helper::inc_bcd(&m_minutes, MASK_MINUTES, 0x00, 0x59); } - if( carry ) + if (carry) { - carry = time_helper::inc_bcd( &m_hours, MASK_HOURS, 0x00, 0x23 ); + carry = time_helper::inc_bcd(&m_hours, MASK_HOURS, 0x00, 0x23); } - if( carry ) + if (carry) { - uint8_t maxdays; - static const uint8_t daysinmonth[] = { 0x31, 0x28, 0x31, 0x30, 0x31, 0x30, 0x31, 0x31, 0x30, 0x31, 0x30, 0x31 }; + u8 maxdays; + static const u8 daysinmonth[] = { 0x31, 0x28, 0x31, 0x30, 0x31, 0x30, 0x31, 0x31, 0x30, 0x31, 0x30, 0x31 }; - time_helper::inc_bcd( &m_day, MASK_DAY, 0x01, 0x07 ); + time_helper::inc_bcd(&m_day, MASK_DAY, 0x01, 0x07); - uint8_t month = time_helper::from_bcd( m_month ); - uint8_t year = time_helper::from_bcd( m_year ); + u8 month = time_helper::from_bcd(m_month); + u8 year = time_helper::from_bcd(m_year); - if( month == 2 && ( year % 4 ) == 0 ) + if (month == 2 && (year % 4) == 0) { maxdays = 0x29; } - else if( month >= 1 && month <= 12 ) + else if (month >= 1 && month <= 12) { - maxdays = daysinmonth[ month - 1 ]; + maxdays = daysinmonth[month - 1]; } else { maxdays = 0x31; } - carry = time_helper::inc_bcd( &m_date, MASK_DATE, 0x01, maxdays ); + carry = time_helper::inc_bcd(&m_date, MASK_DATE, 0x01, maxdays); } - if( carry ) + if (carry) { - carry = time_helper::inc_bcd( &m_month, MASK_MONTH, 0x01, 0x12 ); + carry = time_helper::inc_bcd(&m_month, MASK_MONTH, 0x01, 0x12); } - if( carry ) + if (carry) { - carry = time_helper::inc_bcd( &m_year, MASK_YEAR, 0x00, 0x99 ); + carry = time_helper::inc_bcd(&m_year, MASK_YEAR, 0x00, 0x99); } - if( carry ) + if (carry) { - carry = time_helper::inc_bcd( &m_century, MASK_CENTURY, 0x00, 0x99 ); + carry = time_helper::inc_bcd(&m_century, MASK_CENTURY, 0x00, 0x99); - if( type() == M48T35 || - type() == M48T58 ) + if (type() == M48T35 || + type() == M48T58) { - if( ( m_day & DAY_CEB ) != 0 ) + if ((m_day & DAY_CEB) != 0) { m_day ^= DAY_CB; } } } - if( ( m_control & CONTROL_R ) == 0 ) + if ((m_control & CONTROL_R) == 0) { counters_to_ram(); } @@ -356,57 +356,59 @@ TIMER_CALLBACK_MEMBER(timekeeper_device::watchdog_callback) // Set Flag m_data[m_offset_flags] |= FLAGS_WDF; // WDS (bit 7) selects callback - if (m_data[m_offset_watchdog] & 0x80) { + if (m_data[m_offset_watchdog] & 0x80) + { // Clear watchdog register m_data[m_offset_watchdog] = 0; m_reset_cb(ASSERT_LINE); } - else { + else m_irq_cb(ASSERT_LINE); - } + logerror("watchdog_callback: WD Control: %02x WD Flags: %02x\n", m_data[m_offset_watchdog], m_data[m_offset_flags]); } -WRITE8_MEMBER(timekeeper_device::watchdog_write) +void timekeeper_device::watchdog_write(u8 data) { - if ((m_data[m_offset_watchdog] & 0x7f) != 0) { + if ((m_data[m_offset_watchdog] & 0x7f) != 0) m_watchdog_timer->adjust(m_watchdog_delay); - } } -WRITE8_MEMBER( timekeeper_device::write ) +void timekeeper_device::write(offs_t offset, u8 data) { LOGMASKED(LOG_GENERAL, "timekeeper_device::write: %04x = %02x\n", offset, data); - if( offset == m_offset_control ) + if (offset == m_offset_control) { - if( ( m_control & CONTROL_W ) != 0 && - ( data & CONTROL_W ) == 0 ) + if ((m_control & CONTROL_W) != 0 && + (data & CONTROL_W) == 0) { counters_from_ram(); } - if( ( m_control & CONTROL_R ) != 0 && - ( data & CONTROL_W ) == 0 ) + if ((m_control & CONTROL_R) != 0 && + (data & CONTROL_W) == 0) { counters_to_ram(); } m_control = data; } - else if( offset == m_offset_day ) + else if (offset == m_offset_day) { - if( type() == M48T35 || - type() == M48T58 ) + if (type() == M48T35 || + type() == M48T58) { - m_day = ( m_day & ~DAY_CEB ) | ( data & DAY_CEB ); + m_day = (m_day & ~DAY_CEB) | (data & DAY_CEB); } } else if (offset == m_offset_watchdog && type() == M48T37) { - if ((data & 0x7f) == 0) { + if ((data & 0x7f) == 0) + { m_watchdog_timer->adjust(attotime::never); } - else { + else + { // Calculate the time unit m_watchdog_delay = attotime::from_usec(62500 << (2 * (data & 0x3))); // Adjust by multiplier @@ -416,17 +418,17 @@ WRITE8_MEMBER( timekeeper_device::write ) } } - m_data[ offset ] = data; + m_data[offset] = data; } -READ8_MEMBER( timekeeper_device::read ) +u8 timekeeper_device::read(offs_t offset) { - uint8_t result = m_data[ offset ]; - if( offset == m_offset_date && type() == M48T58 ) + u8 result = m_data[offset]; + if (offset == m_offset_date && type() == M48T58) { result &= ~DATE_BL; } - else if( offset == m_offset_flags && type() == M48T37 ) + else if (offset == m_offset_flags && type() == M48T37) { // Clear the watchdog flag m_data[m_offset_flags] &= ~FLAGS_WDF; @@ -447,15 +449,15 @@ void timekeeper_device::nvram_default() { if (m_default_data.found()) { - memcpy( &m_data[0], m_default_data, m_size ); + memcpy(&m_data[0], m_default_data, m_size); } else { - memset( &m_data[0], 0xff, m_data.size()); + memset(&m_data[0], 0xff, m_data.size()); } - if ( m_offset_flags >= 0 ) - m_data[ m_offset_flags ] = 0; + if (m_offset_flags >= 0) + m_data[m_offset_flags] = 0; counters_to_ram(); } @@ -467,7 +469,7 @@ void timekeeper_device::nvram_default() void timekeeper_device::nvram_read(emu_file &file) { - file.read( &m_data[0], m_size ); + file.read(&m_data[0], m_size); counters_to_ram(); } @@ -480,5 +482,5 @@ void timekeeper_device::nvram_read(emu_file &file) void timekeeper_device::nvram_write(emu_file &file) { - file.write( &m_data[0], m_size ); + file.write(&m_data[0], m_size); } diff --git a/src/devices/machine/timekpr.h b/src/devices/machine/timekpr.h index 4742a1b1ae8..e4e1803b5a4 100644 --- a/src/devices/machine/timekpr.h +++ b/src/devices/machine/timekpr.h @@ -32,16 +32,16 @@ class timekeeper_device : public device_t, public device_nvram_interface { public: - DECLARE_WRITE8_MEMBER( write ); - DECLARE_READ8_MEMBER( read ); - DECLARE_WRITE8_MEMBER(watchdog_write); + void write(offs_t offset, u8 data); + u8 read(offs_t offset); + void watchdog_write(u8 data = 0); auto reset_cb() { return m_reset_cb.bind(); } auto irq_cb() { return m_irq_cb.bind(); } protected: // construction/destruction - timekeeper_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int size); + timekeeper_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 size); // device-level overrides virtual void device_start() override; @@ -62,70 +62,70 @@ private: void counters_from_ram(); // internal state - uint8_t m_control; - uint8_t m_seconds; - uint8_t m_minutes; - uint8_t m_hours; - uint8_t m_day; - uint8_t m_date; - uint8_t m_month; - uint8_t m_year; - uint8_t m_century; - - std::vector m_data; - optional_region_ptr m_default_data; + u8 m_control; + u8 m_seconds; + u8 m_minutes; + u8 m_hours; + u8 m_day; + u8 m_date; + u8 m_month; + u8 m_year; + u8 m_century; + + std::vector m_data; + optional_region_ptr m_default_data; emu_timer* m_watchdog_timer; attotime m_watchdog_delay; protected: - int const m_size; - int m_offset_watchdog; - int m_offset_control; - int m_offset_seconds; - int m_offset_minutes; - int m_offset_hours; - int m_offset_day; - int m_offset_date; - int m_offset_month; - int m_offset_year; - int m_offset_century; - int m_offset_flags; + u32 const m_size; + u32 m_offset_watchdog; + u32 m_offset_control; + u32 m_offset_seconds; + u32 m_offset_minutes; + u32 m_offset_hours; + u32 m_offset_day; + u32 m_offset_date; + u32 m_offset_month; + u32 m_offset_year; + u32 m_offset_century; + u32 m_offset_flags; }; class m48t02_device : public timekeeper_device { public: - m48t02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + m48t02_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); }; class m48t35_device : public timekeeper_device { public: - m48t35_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + m48t35_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); }; class m48t37_device : public timekeeper_device { public: - m48t37_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + m48t37_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); }; class m48t58_device : public timekeeper_device { public: - m48t58_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + m48t58_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); }; class mk48t08_device : public timekeeper_device { public: - mk48t08_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + mk48t08_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); }; class mk48t12_device : public timekeeper_device { public: - mk48t12_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + mk48t12_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); }; // device type definition diff --git a/src/mame/drivers/atlantis.cpp b/src/mame/drivers/atlantis.cpp index 0ad435ef004..87d344b0d0d 100644 --- a/src/mame/drivers/atlantis.cpp +++ b/src/mame/drivers/atlantis.cpp @@ -333,7 +333,7 @@ WRITE32_MEMBER(atlantis_state::board_ctrl_w) m_cmos_write_enabled = true; break; case WDOG: - m_rtc->watchdog_write(space, offset, data); + m_rtc->watchdog_write(); break; default: if (LOG_IRQ) @@ -345,7 +345,7 @@ WRITE32_MEMBER(atlantis_state::board_ctrl_w) READ8_MEMBER(atlantis_state::cmos_r) { - uint8_t result = m_rtc->read(space, offset); + uint8_t result = m_rtc->read(offset); // Initial RTC check expects reads to the RTC to take some time if (offset == 0x7ff9) m_maincpu->eat_cycles(30); @@ -367,7 +367,7 @@ WRITE8_MEMBER(atlantis_state::cmos_w) m_serial_count = 0; } else if (m_cmos_write_enabled) { - m_rtc->write(space, offset, data); + m_rtc->write(offset, data); m_cmos_write_enabled = false; if (LOG_RTC || offset >= 0x7ff0) logerror("%s:RTC write to offset %04X = %08X & %08X\n", machine().describe_context(), offset, data, mem_mask); diff --git a/src/mame/drivers/cps1.cpp b/src/mame/drivers/cps1.cpp index 28481c68ba5..62a69adce98 100644 --- a/src/mame/drivers/cps1.cpp +++ b/src/mame/drivers/cps1.cpp @@ -13167,7 +13167,7 @@ READ16_MEMBER(cps_state::ganbare_ram_r) uint16_t result = 0xffff; if (ACCESSING_BITS_0_7) - result = (result & ~0x00ff) | m_m48t35->read(space, offset, 0xff); + result = (result & ~0x00ff) | m_m48t35->read(offset); if (ACCESSING_BITS_8_15) result = (result & ~0xff00) | (m_mainram[offset] & 0xff00); @@ -13179,7 +13179,7 @@ WRITE16_MEMBER(cps_state::ganbare_ram_w) COMBINE_DATA(&m_mainram[offset]); if (ACCESSING_BITS_0_7) - m_m48t35->write(space, offset, data & 0xff, 0xff); + m_m48t35->write(offset, data & 0xff); } void cps_state::init_ganbare() diff --git a/src/mame/drivers/itech32.cpp b/src/mame/drivers/itech32.cpp index be6b5d6b9fa..144e43ad5d8 100644 --- a/src/mame/drivers/itech32.cpp +++ b/src/mame/drivers/itech32.cpp @@ -4559,7 +4559,7 @@ void itech32_state::init_wcbowln() void itech32_state::install_timekeeper() { - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x681000, 0x6817ff, read8_delegate(FUNC(timekeeper_device::read), &(*m_timekeeper)), write8_delegate(FUNC(timekeeper_device::write), &(*m_timekeeper)), 0xffffffff); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x681000, 0x6817ff, read8sm_delegate(FUNC(timekeeper_device::read), &(*m_timekeeper)), write8sm_delegate(FUNC(timekeeper_device::write), &(*m_timekeeper)), 0xffffffff); } void itech32_state::init_wcbowlt() diff --git a/src/mame/drivers/konamim2.cpp b/src/mame/drivers/konamim2.cpp index b837e8219bf..a8228df1359 100644 --- a/src/mame/drivers/konamim2.cpp +++ b/src/mame/drivers/konamim2.cpp @@ -1453,8 +1453,8 @@ ROM_END void konamim2_state::install_m48t58() { - read8_delegate read_delegate(FUNC(m48t58_device::read), &(*m_m48t58)); - write8_delegate write_delegate(FUNC(m48t58_device::write), &(*m_m48t58)); + read8sm_delegate read_delegate(FUNC(m48t58_device::read), &(*m_m48t58)); + write8sm_delegate write_delegate(FUNC(m48t58_device::write), &(*m_m48t58)); m_ppc1->space(AS_PROGRAM).install_readwrite_handler(0x36c00000, 0x36c03fff, read_delegate, write_delegate, 0xff00ff00ff00ff00ULL); m_ppc2->space(AS_PROGRAM).install_readwrite_handler(0x36c00000, 0x36c03fff, read_delegate, write_delegate, 0xff00ff00ff00ff00ULL); diff --git a/src/mame/drivers/midzeus.cpp b/src/mame/drivers/midzeus.cpp index 1beb25f7071..9264ba1fd1e 100644 --- a/src/mame/drivers/midzeus.cpp +++ b/src/mame/drivers/midzeus.cpp @@ -187,13 +187,13 @@ WRITE32_MEMBER(midzeus_state::cmos_protect_w) READ32_MEMBER(midzeus2_state::zeus2_timekeeper_r) { - return m_m48t35->read(space, offset, 0xff) | 0xffffff00; + return m_m48t35->read(offset) | 0xffffff00; } WRITE32_MEMBER(midzeus2_state::zeus2_timekeeper_w) { if (disk_asic_jr[2] && !cmos_protected) - m_m48t35->write(space, offset, data, 0xff); + m_m48t35->write(offset, data); else logerror("%s:zeus2_timekeeper_w with disk_asic_jr[2] = %d, cmos_protected = %d\n", machine().describe_context(), disk_asic_jr[2], cmos_protected); cmos_protected = true; diff --git a/src/mame/drivers/multfish.cpp b/src/mame/drivers/multfish.cpp index b8a1401012d..cc29ec855ce 100644 --- a/src/mame/drivers/multfish.cpp +++ b/src/mame/drivers/multfish.cpp @@ -309,19 +309,19 @@ WRITE8_MEMBER(igrosoft_gamble_state::igrosoft_gamble_bank_w) READ8_MEMBER(igrosoft_gamble_state::igrosoft_gamble_timekeeper_r) { - return m_m48t35->read(space, offset + 0x6000, 0xff); + return m_m48t35->read(offset + 0x6000); } WRITE8_MEMBER(igrosoft_gamble_state::igrosoft_gamble_timekeeper_w) { - m_m48t35->write(space, offset + 0x6000, data, 0xff); + m_m48t35->write(offset + 0x6000, data); } READ8_MEMBER(igrosoft_gamble_state::bankedram_r) { if ((m_rambk & 0x80) == 0x00) { - return m_m48t35->read(space, offset + 0x2000*(m_rambk & 0x03), 0xff); + return m_m48t35->read(offset + 0x2000*(m_rambk & 0x03)); } else { @@ -334,7 +334,7 @@ WRITE8_MEMBER(igrosoft_gamble_state::bankedram_w) { if ((m_rambk & 0x80) == 0x00) { - m_m48t35->write(space, offset + 0x2000*(m_rambk & 0x03), data, 0xff); + m_m48t35->write(offset + 0x2000*(m_rambk & 0x03), data); } else { diff --git a/src/mame/drivers/vegas.cpp b/src/mame/drivers/vegas.cpp index 12a398e2b6e..24055d8d194 100644 --- a/src/mame/drivers/vegas.cpp +++ b/src/mame/drivers/vegas.cpp @@ -570,13 +570,13 @@ WRITE32_MEMBER( vegas_state::timekeeper_w ) if (m_cmos_unlocked) { if (ACCESSING_BITS_0_7) - m_timekeeper->write(space, offset * 4 + 0, data >> 0, 0xff); + m_timekeeper->write(offset * 4 + 0, data >> 0); if (ACCESSING_BITS_8_15) - m_timekeeper->write(space, offset * 4 + 1, data >> 8, 0xff); + m_timekeeper->write(offset * 4 + 1, data >> 8); if (ACCESSING_BITS_16_23) - m_timekeeper->write(space, offset * 4 + 2, data >> 16, 0xff); + m_timekeeper->write(offset * 4 + 2, data >> 16); if (ACCESSING_BITS_24_31) - m_timekeeper->write(space, offset * 4 + 3, data >> 24, 0xff); + m_timekeeper->write(offset * 4 + 3, data >> 24); if (offset*4 >= 0x7ff0) if (LOG_TIMEKEEPER) logerror("%s timekeeper_w(%04X & %08X) = %08X\n", machine().describe_context(), offset*4, mem_mask, data); m_cmos_unlocked = 0; @@ -590,13 +590,13 @@ READ32_MEMBER( vegas_state::timekeeper_r ) { uint32_t result = 0xffffffff; if (ACCESSING_BITS_0_7) - result = (result & ~0x000000ff) | (m_timekeeper->read(space, offset * 4 + 0, 0xff) << 0); + result = (result & ~0x000000ff) | (m_timekeeper->read(offset * 4 + 0) << 0); if (ACCESSING_BITS_8_15) - result = (result & ~0x0000ff00) | (m_timekeeper->read(space, offset * 4 + 1, 0xff) << 8); + result = (result & ~0x0000ff00) | (m_timekeeper->read(offset * 4 + 1) << 8); if (ACCESSING_BITS_16_23) - result = (result & ~0x00ff0000) | (m_timekeeper->read(space, offset * 4 + 2, 0xff) << 16); + result = (result & ~0x00ff0000) | (m_timekeeper->read(offset * 4 + 2) << 16); if (ACCESSING_BITS_24_31) - result = (result & ~0xff000000) | (m_timekeeper->read(space, offset * 4 + 3, 0xff) << 24); + result = (result & ~0xff000000) | (m_timekeeper->read(offset * 4 + 3) << 24); if (offset * 4 >= 0x7ff0) { // Initial RTC check expects reads to the RTC to take some time m_maincpu->eat_cycles(30); @@ -822,7 +822,7 @@ WRITE8_MEMBER(vegas_state::sio_w) break; case 7: // Watchdog - m_timekeeper->watchdog_write(space, offset, data); + m_timekeeper->watchdog_write(); if (0 && LOG_SIO) logerror("sio_w: Watchdog: %08x index: %d data: %02X\n", offset, index, data); //m_maincpu->eat_cycles(100); diff --git a/src/mame/machine/harddriv.cpp b/src/mame/machine/harddriv.cpp index 12732e7191a..5ef10fbb81d 100644 --- a/src/mame/machine/harddriv.cpp +++ b/src/mame/machine/harddriv.cpp @@ -464,7 +464,7 @@ READ16_MEMBER( harddriv_state::hd68k_zram_r ) data |= m_210e->read(space, offset, mem_mask); if (ACCESSING_BITS_8_15) - data |= m_200e->read(space, offset, mem_mask >> 8) << 8; + data |= m_200e->read(offset) << 8; return data; } @@ -478,7 +478,7 @@ WRITE16_MEMBER( harddriv_state::hd68k_zram_w ) m_210e->write(space, offset, data, mem_mask); if (ACCESSING_BITS_8_15) - m_200e->write(space, offset, data >> 8, mem_mask >> 8); + m_200e->write(offset, data >> 8); } } -- cgit v1.2.3