summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/audio/taitosnd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/audio/taitosnd.cpp')
-rw-r--r--src/mame/audio/taitosnd.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/mame/audio/taitosnd.cpp b/src/mame/audio/taitosnd.cpp
index 920350d54ae..c0625ada6ed 100644
--- a/src/mame/audio/taitosnd.cpp
+++ b/src/mame/audio/taitosnd.cpp
@@ -26,10 +26,10 @@
**********************************************************************************************/
-#define TC0140SYT_PORT01_FULL (0x01)
-#define TC0140SYT_PORT23_FULL (0x02)
-#define TC0140SYT_PORT01_FULL_MASTER (0x04)
-#define TC0140SYT_PORT23_FULL_MASTER (0x08)
+static constexpr u8 TC0140SYT_PORT01_FULL = 0x01;
+static constexpr u8 TC0140SYT_PORT23_FULL = 0x02;
+static constexpr u8 TC0140SYT_PORT01_FULL_MASTER = 0x04;
+static constexpr u8 TC0140SYT_PORT23_FULL_MASTER = 0x08;
// device type definition
@@ -45,7 +45,7 @@ DEFINE_DEVICE_TYPE(PC060HA, pc060ha_device, "pc060ha", "Taito PC060HA CIU")
// tc0140syt_device - constructor
//-------------------------------------------------
-tc0140syt_device::tc0140syt_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+tc0140syt_device::tc0140syt_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, type, tag, owner, clock)
, m_mainmode(0)
, m_submode(0)
@@ -54,11 +54,11 @@ tc0140syt_device::tc0140syt_device(const machine_config &mconfig, device_type ty
, m_mastercpu(*this, finder_base::DUMMY_TAG)
, m_slavecpu(*this, finder_base::DUMMY_TAG)
{
- memset(m_slavedata, 0, sizeof(uint8_t)*4);
- memset(m_masterdata, 0, sizeof(uint8_t)*4);
+ std::fill(std::begin(m_slavedata), std::end(m_slavedata), 0);
+ std::fill(std::begin(m_masterdata), std::end(m_masterdata), 0);
}
-tc0140syt_device::tc0140syt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+tc0140syt_device::tc0140syt_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: tc0140syt_device(mconfig, TC0140SYT, tag, owner, clock)
{
}
@@ -90,7 +90,7 @@ void tc0140syt_device::device_reset()
m_status = 0;
m_nmi_enabled = 0;
- for (uint32_t i = 0; i < 4; i++)
+ for (u8 i = 0; i < 4; i++)
{
m_slavedata[i] = 0;
m_masterdata[i] = 0;
@@ -104,8 +104,8 @@ void tc0140syt_device::device_reset()
void tc0140syt_device::update_nmi()
{
- uint32_t nmi_pending = m_status & (TC0140SYT_PORT23_FULL | TC0140SYT_PORT01_FULL);
- uint32_t state = (nmi_pending && m_nmi_enabled) ? ASSERT_LINE : CLEAR_LINE;
+ u32 nmi_pending = m_status & (TC0140SYT_PORT23_FULL | TC0140SYT_PORT01_FULL);
+ u32 state = (nmi_pending && m_nmi_enabled) ? ASSERT_LINE : CLEAR_LINE;
m_slavecpu->set_input_line(INPUT_LINE_NMI, state);
}
@@ -115,7 +115,7 @@ void tc0140syt_device::update_nmi()
// MASTER SIDE
//-------------------------------------------------
-WRITE8_MEMBER( tc0140syt_device::master_port_w )
+void tc0140syt_device::master_port_w(u8 data)
{
data &= 0x0f;
m_mainmode = data;
@@ -126,7 +126,7 @@ WRITE8_MEMBER( tc0140syt_device::master_port_w )
}
}
-WRITE8_MEMBER( tc0140syt_device::master_comm_w )
+void tc0140syt_device::master_comm_w(u8 data)
{
machine().scheduler().synchronize(); // let slavecpu catch up (after we return and the main cpu finishes what it's doing)
data &= 0x0f; /* this is important, otherwise ballbros won't work */
@@ -163,10 +163,10 @@ WRITE8_MEMBER( tc0140syt_device::master_comm_w )
}
}
-READ8_MEMBER( tc0140syt_device::master_comm_r )
+u8 tc0140syt_device::master_comm_r()
{
machine().scheduler().synchronize(); // let slavecpu catch up (after we return and the main cpu finishes what it's doing)
- uint8_t res = 0;
+ u8 res = 0;
switch (m_mainmode)
{
@@ -204,7 +204,7 @@ READ8_MEMBER( tc0140syt_device::master_comm_r )
// SLAVE SIDE
//-------------------------------------------------
-WRITE8_MEMBER( tc0140syt_device::slave_port_w )
+void tc0140syt_device::slave_port_w(u8 data)
{
data &= 0x0f;
m_submode = data;
@@ -215,7 +215,7 @@ WRITE8_MEMBER( tc0140syt_device::slave_port_w )
}
}
-WRITE8_MEMBER( tc0140syt_device::slave_comm_w )
+void tc0140syt_device::slave_comm_w(u8 data)
{
data &= 0x0f;
@@ -258,9 +258,9 @@ WRITE8_MEMBER( tc0140syt_device::slave_comm_w )
}
}
-READ8_MEMBER( tc0140syt_device::slave_comm_r )
+u8 tc0140syt_device::slave_comm_r()
{
- uint8_t res = 0;
+ u8 res = 0;
switch (m_submode)
{
@@ -300,7 +300,7 @@ READ8_MEMBER( tc0140syt_device::slave_comm_r )
// pc060ha_device - constructor
//-------------------------------------------------
-pc060ha_device::pc060ha_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+pc060ha_device::pc060ha_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: tc0140syt_device(mconfig, PC060HA, tag, owner, clock)
{
}