diff options
author | AJR <ajrhacker@users.noreply.github.com> | 2020-03-11 15:19:23 -0400 |
---|---|---|
committer | AJR <ajrhacker@users.noreply.github.com> | 2020-03-11 15:19:23 -0400 |
commit | 1d38a4cc19af9b487fd0d83a8c111ace4bf3181a (patch) | |
tree | de4bacb81517509a9ba5c53b8c87f9a31d4b883b | |
parent | 59337f9e503618cf287a1888da376010d6611682 (diff) |
cxd1095, msm6242: Simplify handler signatures; use shorter type names (nw)
-rw-r--r-- | src/devices/bus/coco/coco_fdc.cpp | 4 | ||||
-rw-r--r-- | src/devices/machine/cxd1095.cpp | 4 | ||||
-rw-r--r-- | src/devices/machine/cxd1095.h | 4 | ||||
-rw-r--r-- | src/devices/machine/msm6242.cpp | 54 | ||||
-rw-r--r-- | src/devices/machine/msm6242.h | 44 | ||||
-rw-r--r-- | src/mame/drivers/amiga.cpp | 12 | ||||
-rw-r--r-- | src/mame/drivers/hng64.cpp | 6 | ||||
-rw-r--r-- | src/mame/drivers/royalmah.cpp | 4 | ||||
-rw-r--r-- | src/mame/drivers/segas16a.cpp | 4 | ||||
-rw-r--r-- | src/mame/drivers/segas16b.cpp | 4 | ||||
-rw-r--r-- | src/mame/drivers/vlc.cpp | 12 | ||||
-rw-r--r-- | src/mame/machine/model3.cpp | 4 | ||||
-rw-r--r-- | src/mame/machine/samcoupe.cpp | 6 |
13 files changed, 80 insertions, 82 deletions
diff --git a/src/devices/bus/coco/coco_fdc.cpp b/src/devices/bus/coco/coco_fdc.cpp index eded4ed4306..c0f8295716b 100644 --- a/src/devices/bus/coco/coco_fdc.cpp +++ b/src/devices/bus/coco/coco_fdc.cpp @@ -351,7 +351,7 @@ READ8_MEMBER(coco_fdc_device_base::scs_read) { case 0x10: /* FF50 */ if (real_time_clock() == rtc_type::DISTO) - result = m_disto_msm6242->read(space, m_msm6242_rtc_address); + result = m_disto_msm6242->read(m_msm6242_rtc_address); break; case 0x38: /* FF78 */ @@ -404,7 +404,7 @@ WRITE8_MEMBER(coco_fdc_device_base::scs_write) { case 0x10: /* FF50 */ if (real_time_clock() == rtc_type::DISTO) - m_disto_msm6242->write(space,m_msm6242_rtc_address, data); + m_disto_msm6242->write(m_msm6242_rtc_address, data); break; case 0x11: /* FF51 */ diff --git a/src/devices/machine/cxd1095.cpp b/src/devices/machine/cxd1095.cpp index 042ba04a986..1f78ca628a1 100644 --- a/src/devices/machine/cxd1095.cpp +++ b/src/devices/machine/cxd1095.cpp @@ -70,7 +70,7 @@ void cxd1095_device::device_reset() // read - read from an input port //------------------------------------------------- -READ8_MEMBER(cxd1095_device::read) +u8 cxd1095_device::read(offs_t offset) { if (offset < 5) { @@ -98,7 +98,7 @@ READ8_MEMBER(cxd1095_device::read) // control registers //------------------------------------------------- -WRITE8_MEMBER(cxd1095_device::write) +void cxd1095_device::write(offs_t offset, u8 data) { if (offset < 5) { diff --git a/src/devices/machine/cxd1095.h b/src/devices/machine/cxd1095.h index 3c7d6ce46bc..f5decf3def7 100644 --- a/src/devices/machine/cxd1095.h +++ b/src/devices/machine/cxd1095.h @@ -65,8 +65,8 @@ public: auto out_porte_cb() { return out_port_cb<4>(); } // memory handlers - DECLARE_READ8_MEMBER(read); - DECLARE_WRITE8_MEMBER(write); + u8 read(offs_t offset); + void write(offs_t offset, u8 data); protected: // device-level overrides diff --git a/src/devices/machine/msm6242.cpp b/src/devices/machine/msm6242.cpp index 62cb24b641f..0cfe458ed08 100644 --- a/src/devices/machine/msm6242.cpp +++ b/src/devices/machine/msm6242.cpp @@ -77,12 +77,12 @@ DEFINE_DEVICE_TYPE(RTC72423, rtc72423_device, "rtc72423", "Epson RTC-72423 RTC") // msm6242_device - constructor //------------------------------------------------- -msm6242_device::msm6242_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +msm6242_device::msm6242_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : msm6242_device(mconfig, MSM6242, tag, owner, clock) { } -msm6242_device::msm6242_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) +msm6242_device::msm6242_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, type, tag, owner, clock) , device_rtc_interface(mconfig, *this) , m_out_int_handler(*this) @@ -199,7 +199,7 @@ void msm6242_device::set_irq(bool active) // irq //------------------------------------------------- -void msm6242_device::irq(uint8_t irq_type) +void msm6242_device::irq(u8 irq_type) { // are we actually raising this particular IRQ? if (m_irq_flag == 1 && m_irq_type == irq_type) @@ -218,28 +218,28 @@ void msm6242_device::irq(uint8_t irq_type) // bump //------------------------------------------------- -uint64_t msm6242_device::bump(int rtc_register, uint64_t delta, uint64_t register_min, uint64_t register_range) +u64 msm6242_device::bump(int rtc_register, u64 delta, u64 register_min, u64 register_range) { - uint64_t carry = 0; + u64 carry = 0; if (delta > 0) { // get the register value - uint64_t register_value = (rtc_register == RTC_TICKS) + u64 register_value = (rtc_register == RTC_TICKS) ? m_tick : get_clock_register(rtc_register); // increment the value - uint64_t new_register_value = ((register_value - register_min + delta) % register_range) + register_min; + u64 new_register_value = ((register_value - register_min + delta) % register_range) + register_min; // calculate the cary carry = ((register_value - register_min) + delta) / register_range; // store the new register value if (rtc_register == RTC_TICKS) - m_tick = (uint16_t) new_register_value; + m_tick = u16(new_register_value); else - set_clock_register(rtc_register, (int) new_register_value); + set_clock_register(rtc_register, int(new_register_value)); } return carry; @@ -251,7 +251,7 @@ uint64_t msm6242_device::bump(int rtc_register, uint64_t delta, uint64_t registe // current_time //------------------------------------------------- -uint64_t msm6242_device::current_time() +u64 msm6242_device::current_time() { return machine().time().as_ticks(clock()); } @@ -265,10 +265,10 @@ uint64_t msm6242_device::current_time() void msm6242_device::update_rtc_registers() { // get the absolute current time, in ticks - uint64_t curtime = current_time(); + u64 curtime = current_time(); // how long as it been since we last updated? - uint64_t delta = curtime - m_last_update_time; + u64 delta = curtime - m_last_update_time; // set current time m_last_update_time = curtime; @@ -278,7 +278,7 @@ void msm6242_device::update_rtc_registers() return; // ticks - if ((m_tick % 200) != (int)((delta + m_tick) % 0x200)) + if ((m_tick % 200) != int((delta + m_tick) % 0x200)) irq(IRQ_64THSECOND); delta = bump(RTC_TICKS, delta, 0, 0x8000); if (delta == 0) @@ -315,7 +315,7 @@ void msm6242_device::update_rtc_registers() void msm6242_device::update_timer() { - uint64_t callback_ticks = 0; + u64 callback_ticks = 0; attotime callback_time = attotime::never; // we only need to call back if the IRQ flag is on, and we have a handler @@ -345,10 +345,10 @@ void msm6242_device::update_timer() if (callback_ticks > 0) { // get the current time - uint64_t curtime = current_time(); + u64 curtime = current_time(); // we need the absolute callback time, in ticks - uint64_t absolute_callback_ticks = curtime + callback_ticks; + u64 absolute_callback_ticks = curtime + callback_ticks; // convert that to an attotime attotime absolute_callback_time = attotime::from_ticks(absolute_callback_ticks, clock()); @@ -389,11 +389,11 @@ void msm6242_device::rtc_timer_callback() // get_clock_nibble //------------------------------------------------- -uint8_t msm6242_device::get_clock_nibble(int rtc_register, bool high) +u8 msm6242_device::get_clock_nibble(int rtc_register, bool high) { int value = get_clock_register(rtc_register); value /= high ? 10 : 1; - return (uint8_t) ((value % 10) & 0x0F); + return u8((value % 10) & 0x0F); } @@ -402,7 +402,7 @@ uint8_t msm6242_device::get_clock_nibble(int rtc_register, bool high) // get_clock_nibble //------------------------------------------------- -const char *msm6242_device::irq_type_string(uint8_t irq_type) +const char *msm6242_device::irq_type_string(u8 irq_type) { switch(irq_type) { @@ -424,10 +424,10 @@ const char *msm6242_device::irq_type_string(uint8_t irq_type) // read //------------------------------------------------- -READ8_MEMBER( msm6242_device::read ) +u8 msm6242_device::read(offs_t offset) { int hour, pm; - uint8_t result; + u8 result; // update the registers; they may have changed update_rtc_registers(); @@ -498,7 +498,7 @@ READ8_MEMBER( msm6242_device::read ) break; case MSM6242_REG_W: - result = (uint8_t) (get_clock_register(RTC_DAY_OF_WEEK) - 1); + result = u8(get_clock_register(RTC_DAY_OF_WEEK) - 1); break; case MSM6242_REG_CD: @@ -522,7 +522,7 @@ READ8_MEMBER( msm6242_device::read ) // write //------------------------------------------------- -WRITE8_MEMBER( msm6242_device::write ) +void msm6242_device::write(offs_t offset, u8 data) { switch(offset) { @@ -587,7 +587,7 @@ WRITE8_MEMBER( msm6242_device::write ) // rtc62421_device - constructor //------------------------------------------------- -rtc62421_device::rtc62421_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +rtc62421_device::rtc62421_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : msm6242_device(mconfig, RTC62421, tag, owner, clock) { } @@ -597,7 +597,7 @@ rtc62421_device::rtc62421_device(const machine_config &mconfig, const char *tag, // rtc62423_device - constructor //------------------------------------------------- -rtc62423_device::rtc62423_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +rtc62423_device::rtc62423_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : msm6242_device(mconfig, RTC62423, tag, owner, clock) { } @@ -607,7 +607,7 @@ rtc62423_device::rtc62423_device(const machine_config &mconfig, const char *tag, // rtc72421_device - constructor //------------------------------------------------- -rtc72421_device::rtc72421_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +rtc72421_device::rtc72421_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : msm6242_device(mconfig, RTC72421, tag, owner, clock) { } @@ -617,7 +617,7 @@ rtc72421_device::rtc72421_device(const machine_config &mconfig, const char *tag, // rtc72423_device - constructor //------------------------------------------------- -rtc72423_device::rtc72423_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +rtc72423_device::rtc72423_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : msm6242_device(mconfig, RTC72423, tag, owner, clock) { } diff --git a/src/devices/machine/msm6242.h b/src/devices/machine/msm6242.h index 430bbbc10f0..6ee5929a641 100644 --- a/src/devices/machine/msm6242.h +++ b/src/devices/machine/msm6242.h @@ -46,16 +46,16 @@ class msm6242_device : public device_t, public device_rtc_interface { public: // construction/destruction - msm6242_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + msm6242_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); auto out_int_handler() { return m_out_int_handler.bind(); } // I/O operations - DECLARE_WRITE8_MEMBER( write ); - DECLARE_READ8_MEMBER( read ); + void write(offs_t offset, u8 data); + u8 read(offs_t offset); protected: - msm6242_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + msm6242_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); // device-level overrides virtual void device_start() override; @@ -70,32 +70,32 @@ protected: private: static constexpr int RTC_TICKS = ~0; - static constexpr uint8_t IRQ_64THSECOND = 0; - static constexpr uint8_t IRQ_SECOND = 1; - static constexpr uint8_t IRQ_MINUTE = 2; - static constexpr uint8_t IRQ_HOUR = 3; + static constexpr u8 IRQ_64THSECOND = 0; + static constexpr u8 IRQ_SECOND = 1; + static constexpr u8 IRQ_MINUTE = 2; + static constexpr u8 IRQ_HOUR = 3; // state - uint8_t m_reg[3]; - uint8_t m_irq_flag; - uint8_t m_irq_type; - uint16_t m_tick; + u8 m_reg[3]; + u8 m_irq_flag; + u8 m_irq_type; + u16 m_tick; // incidentals devcb_write_line m_out_int_handler; emu_timer * m_timer; - uint64_t m_last_update_time; // last update time, in clock cycles + u64 m_last_update_time; // last update time, in clock cycles // methods void rtc_timer_callback(); - uint64_t current_time(); + u64 current_time(); void set_irq(bool active); - void irq(uint8_t irq_type); - uint64_t bump(int rtc_register, uint64_t delta, uint64_t register_min, uint64_t register_range); + void irq(u8 irq_type); + u64 bump(int rtc_register, u64 delta, u64 register_min, u64 register_range); void update_rtc_registers(); void update_timer(); - uint8_t get_clock_nibble(int rtc_register, bool high); - static const char *irq_type_string(uint8_t irq_type); + u8 get_clock_nibble(int rtc_register, bool high); + static const char *irq_type_string(u8 irq_type); }; // ======================> rtc62421_device @@ -104,7 +104,7 @@ class rtc62421_device : public msm6242_device { public: // construction/destruction - rtc62421_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + rtc62421_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); }; // ======================> rtc62423_device @@ -113,7 +113,7 @@ class rtc62423_device : public msm6242_device { public: // construction/destruction - rtc62423_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + rtc62423_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); }; // ======================> rtc72421_device @@ -122,7 +122,7 @@ class rtc72421_device : public msm6242_device { public: // construction/destruction - rtc72421_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + rtc72421_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); }; // ======================> rtc72423_device @@ -131,7 +131,7 @@ class rtc72423_device : public msm6242_device { public: // construction/destruction - rtc72423_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + rtc72423_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); }; diff --git a/src/mame/drivers/amiga.cpp b/src/mame/drivers/amiga.cpp index f8aed0bf07c..96a34d3af46 100644 --- a/src/mame/drivers/amiga.cpp +++ b/src/mame/drivers/amiga.cpp @@ -580,32 +580,32 @@ private: READ16_MEMBER( cdtv_state::clock_r ) { - return m_rtc->read(space, offset / 2); + return m_rtc->read(offset / 2); } WRITE16_MEMBER( cdtv_state::clock_w ) { - m_rtc->write(space, offset / 2, data); + m_rtc->write(offset / 2, data); } READ16_MEMBER( a2000_state::clock_r ) { - return m_rtc->read(space, offset / 2); + return m_rtc->read(offset / 2); } WRITE16_MEMBER( a2000_state::clock_w ) { - m_rtc->write(space, offset / 2, data); + m_rtc->write(offset / 2, data); } READ16_MEMBER( a500p_state::clock_r ) { - return m_rtc->read(space, offset / 2); + return m_rtc->read(offset / 2); } WRITE16_MEMBER( a500p_state::clock_w ) { - m_rtc->write(space, offset / 2, data); + m_rtc->write(offset / 2, data); } diff --git a/src/mame/drivers/hng64.cpp b/src/mame/drivers/hng64.cpp index 73b12202363..bb0bdd6406f 100644 --- a/src/mame/drivers/hng64.cpp +++ b/src/mame/drivers/hng64.cpp @@ -496,9 +496,9 @@ READ32_MEMBER(hng64_state::hng64_rtc_r) // bit 4 disables "system log reader" (the device is 4-bit? so this bit is not from the device?) if ((rtc_addr & 0xf) == 0xd) - return m_rtc->read(space, (rtc_addr) & 0xf) | 0x10; + return m_rtc->read((rtc_addr) & 0xf) | 0x10; - return m_rtc->read(space, (rtc_addr) & 0xf); + return m_rtc->read((rtc_addr) & 0xf); } else { @@ -566,7 +566,7 @@ WRITE32_MEMBER(hng64_state::hng64_rtc_w) if (offset & 1) { // RTC is mapped to 1 byte (4-bits used) in every 8 bytes so we can't even install this with a umask - m_rtc->write(space, (offset >> 1) & 0xf, data); + m_rtc->write((offset >> 1) & 0xf, data); } else { diff --git a/src/mame/drivers/royalmah.cpp b/src/mame/drivers/royalmah.cpp index adf39076d85..3502ecc4d29 100644 --- a/src/mame/drivers/royalmah.cpp +++ b/src/mame/drivers/royalmah.cpp @@ -1351,7 +1351,7 @@ READ8_MEMBER(royalmah_state::mjvegasa_rom_io_r) if((offset & 0xfff0) == 0x8000) { - return m_rtc->read(space, offset & 0xf); + return m_rtc->read(offset & 0xf); } logerror("%04X: unmapped IO read at %04X\n", m_maincpu->pc(), offset); @@ -1370,7 +1370,7 @@ WRITE8_MEMBER(royalmah_state::mjvegasa_rom_io_w) if((offset & 0xfff0) == 0x8000) { - m_rtc->write(space, offset & 0xf,data); + m_rtc->write(offset & 0xf, data); return; } diff --git a/src/mame/drivers/segas16a.cpp b/src/mame/drivers/segas16a.cpp index c9035089afa..0ae90194e4f 100644 --- a/src/mame/drivers/segas16a.cpp +++ b/src/mame/drivers/segas16a.cpp @@ -747,7 +747,7 @@ READ16_MEMBER( segas16a_state::aceattaca_custom_io_r ) case 0x3000/2: if (BIT(offset, 4)) - return m_cxdio->read(space, offset & 0x0f); + return m_cxdio->read(offset & 0x0f); break; } return standard_io_r(space, offset, mem_mask); @@ -760,7 +760,7 @@ WRITE16_MEMBER( segas16a_state::aceattaca_custom_io_w ) case 0x3000/2: if (BIT(offset, 4)) { - m_cxdio->write(space, offset & 0x0f, data); + m_cxdio->write(offset & 0x0f, data); return; } break; diff --git a/src/mame/drivers/segas16b.cpp b/src/mame/drivers/segas16b.cpp index b967893b91c..16fa2544b50 100644 --- a/src/mame/drivers/segas16b.cpp +++ b/src/mame/drivers/segas16b.cpp @@ -1446,7 +1446,7 @@ READ16_MEMBER( segas16b_state::aceattac_custom_io_r ) case 0x3000/2: if (BIT(offset, 4)) - return m_cxdio->read(space, offset & 0x0f); + return m_cxdio->read(offset & 0x0f); else // TODO: use uPD4701A device switch (offset & 0x1b) { @@ -1473,7 +1473,7 @@ WRITE16_MEMBER( segas16b_state::aceattac_custom_io_w ) case 0x3000/2: if (BIT(offset, 4)) { - m_cxdio->write(space, offset & 0x0f, data); + m_cxdio->write(offset & 0x0f, data); return; } break; diff --git a/src/mame/drivers/vlc.cpp b/src/mame/drivers/vlc.cpp index 68445951dd4..870130bf8df 100644 --- a/src/mame/drivers/vlc.cpp +++ b/src/mame/drivers/vlc.cpp @@ -202,8 +202,8 @@ private: template<int N> uint8_t duart_r(offs_t offset); template<int N> void duart_w(offs_t offset, uint8_t data); - DECLARE_READ8_MEMBER(rtc_r); - DECLARE_WRITE8_MEMBER(rtc_w); + uint8_t rtc_r(offs_t offset); + void rtc_w(offs_t offset, uint8_t data); DECLARE_READ16_MEMBER(io_board_r); DECLARE_WRITE16_MEMBER(io_board_w); DECLARE_WRITE16_MEMBER (io_board_x); @@ -361,14 +361,14 @@ void nevada_state::duart_w(offs_t offset, uint8_t data) /********************* RTC SECTION ********************************/ /***************************************************************************/ -READ8_MEMBER(nevada_state::rtc_r) +uint8_t nevada_state::rtc_r(offs_t offset) { - return m_rtc->read(space, offset >> 3); + return m_rtc->read(offset >> 3); } -WRITE8_MEMBER(nevada_state::rtc_w) +void nevada_state::rtc_w(offs_t offset, uint8_t data) { - m_rtc->write(space, offset >> 3, data); + m_rtc->write(offset >> 3, data); } diff --git a/src/mame/machine/model3.cpp b/src/mame/machine/model3.cpp index 4c13264c150..c2b3f3ec63a 100644 --- a/src/mame/machine/model3.cpp +++ b/src/mame/machine/model3.cpp @@ -294,12 +294,12 @@ READ32_MEMBER(model3_state::rtc72421_r) { int reg = offset; uint32_t data; - data = m_rtc->read(space, reg) << 24; + data = m_rtc->read(reg) << 24; data |= 0x30000; /* these bits are set to pass the battery voltage test */ return data; } WRITE32_MEMBER(model3_state::rtc72421_w) { - m_rtc->write(space, offset, data >> 24); + m_rtc->write(offset, data >> 24); } diff --git a/src/mame/machine/samcoupe.cpp b/src/mame/machine/samcoupe.cpp index 530fafe2ec9..24ccaae77ea 100644 --- a/src/mame/machine/samcoupe.cpp +++ b/src/mame/machine/samcoupe.cpp @@ -225,15 +225,13 @@ WRITE8_MEMBER(samcoupe_state::samcoupe_ext_mem_w) READ8_MEMBER(samcoupe_state::samcoupe_rtc_r) { - address_space &spaceio = m_maincpu->space(AS_IO); - return m_rtc->read(spaceio, offset >> 12); + return m_rtc->read(offset >> 12); } WRITE8_MEMBER(samcoupe_state::samcoupe_rtc_w) { - address_space &spaceio = m_maincpu->space(AS_IO); - m_rtc->write(spaceio, offset >> 12, data); + m_rtc->write(offset >> 12, data); } |