summaryrefslogtreecommitdiffstats
path: root/src/devices/machine/68230pit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/68230pit.cpp')
-rw-r--r--src/devices/machine/68230pit.cpp110
1 files changed, 55 insertions, 55 deletions
diff --git a/src/devices/machine/68230pit.cpp b/src/devices/machine/68230pit.cpp
index 725d6fa42cd..14add04b023 100644
--- a/src/devices/machine/68230pit.cpp
+++ b/src/devices/machine/68230pit.cpp
@@ -53,7 +53,7 @@ const device_type PIT68230 = &device_creator<pit68230_device>;
//-------------------------------------------------
// pit68230_device - constructors
//-------------------------------------------------
-pit68230_device::pit68230_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source)
+pit68230_device::pit68230_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source)
: device_t (mconfig, type, name, tag, owner, clock, shortname, source)
, m_pa_out_cb(*this)
, m_pa_in_cb(*this)
@@ -89,7 +89,7 @@ pit68230_device::pit68230_device(const machine_config &mconfig, device_type type
}
-pit68230_device::pit68230_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+pit68230_device::pit68230_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t (mconfig, PIT68230, "PIT68230", tag, owner, clock, "pit68230", __FILE__)
, m_pa_out_cb (*this)
, m_pa_in_cb(*this)
@@ -192,7 +192,7 @@ void pit68230_device::device_reset ()
//-------------------------------------------------
// device_timer - handler timer events
//-------------------------------------------------
-void pit68230_device::device_timer (emu_timer &timer, device_timer_id id, INT32 param, void *ptr)
+void pit68230_device::device_timer (emu_timer &timer, device_timer_id id, int32_t param, void *ptr)
{
switch(id)
{
@@ -212,14 +212,14 @@ void pit68230_device::device_timer (emu_timer &timer, device_timer_id id, INT32
}
}
-void pit68230_device::h1_set (UINT8 state)
+void pit68230_device::h1_set (uint8_t state)
{
LOG(("%s %s %d @ m_psr %2x => ",tag(), FUNCNAME, state, m_psr));
if (state) m_psr |= 1; else m_psr &= ~1;
LOG(("%02x %lld\n", m_psr, machine ().firstcpu->total_cycles ()));
}
-void pit68230_device::portb_setbit (UINT8 bit, UINT8 state)
+void pit68230_device::portb_setbit (uint8_t bit, uint8_t state)
{
LOG(("%s %s %d/%d @ m_pbdr %2x => ", tag(), FUNCNAME, bit, state, m_pbdr));
if (state) m_pbdr |= (1 << bit); else m_pbdr &= ~(1 << bit);
@@ -227,47 +227,47 @@ void pit68230_device::portb_setbit (UINT8 bit, UINT8 state)
}
#if VERBOSE > 2
-static INT32 ow_cnt = 0;
-static INT32 ow_data = 0;
-static INT32 ow_ofs = 0;
+static int32_t ow_cnt = 0;
+static int32_t ow_data = 0;
+static int32_t ow_ofs = 0;
#endif
-void pit68230_device::wr_pitreg_pgcr(UINT8 data)
+void pit68230_device::wr_pitreg_pgcr(uint8_t data)
{
LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
m_pgcr = data;
}
-void pit68230_device::wr_pitreg_psrr(UINT8 data)
+void pit68230_device::wr_pitreg_psrr(uint8_t data)
{
LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
m_psrr = data;
}
-void pit68230_device::wr_pitreg_paddr(UINT8 data)
+void pit68230_device::wr_pitreg_paddr(uint8_t data)
{
LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
m_paddr = data;
}
-void pit68230_device::wr_pitreg_pbddr(UINT8 data)
+void pit68230_device::wr_pitreg_pbddr(uint8_t data)
{
LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
m_pbddr = data;
}
-void pit68230_device::wr_pitreg_pcddr(UINT8 data)
+void pit68230_device::wr_pitreg_pcddr(uint8_t data)
{
LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
m_pcddr = data;
}
-void pit68230_device::wr_pitreg_pivr(UINT8 data)
+void pit68230_device::wr_pitreg_pivr(uint8_t data)
{
LOG(("%s(%02x) \"%s\": Not implemented yet\n", FUNCNAME, data, tag()));
}
-void pit68230_device::wr_pitreg_pacr(UINT8 data)
+void pit68230_device::wr_pitreg_pacr(uint8_t data)
{
LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
m_pacr = data;
@@ -290,13 +290,13 @@ void pit68230_device::wr_pitreg_pacr(UINT8 data)
m_h2_out_cb (m_pacr & 0x08 ? 1 : 0); // TODO: Check mode and submodes
}
-void pit68230_device::wr_pitreg_pbcr(UINT8 data)
+void pit68230_device::wr_pitreg_pbcr(uint8_t data)
{
LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
m_pbcr = data;
}
-void pit68230_device::wr_pitreg_padr(UINT8 data)
+void pit68230_device::wr_pitreg_padr(uint8_t data)
{
LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
m_padr |= (data & m_paddr);
@@ -304,7 +304,7 @@ void pit68230_device::wr_pitreg_padr(UINT8 data)
m_pa_out_cb ((offs_t)0, m_padr);
}
-void pit68230_device::wr_pitreg_pbdr(UINT8 data)
+void pit68230_device::wr_pitreg_pbdr(uint8_t data)
{
LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
m_pbdr |= (data & m_pbddr);
@@ -312,7 +312,7 @@ void pit68230_device::wr_pitreg_pbdr(UINT8 data)
m_pb_out_cb ((offs_t)0, m_pbdr & m_pbddr);
}
-void pit68230_device::wr_pitreg_pcdr(UINT8 data)
+void pit68230_device::wr_pitreg_pcdr(uint8_t data)
{
LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
m_pcdr |= (data & m_pcddr);
@@ -320,7 +320,7 @@ void pit68230_device::wr_pitreg_pcdr(UINT8 data)
m_pc_out_cb ((offs_t)0, m_pcdr);
}
-void pit68230_device::wr_pitreg_psr(UINT8 data)
+void pit68230_device::wr_pitreg_psr(uint8_t data)
{
LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
m_psr = data;
@@ -388,7 +388,7 @@ TCR bit 0 - Timer Enable
0 Disabled
1 Enabled
*/
-void pit68230_device::wr_pitreg_tcr(UINT8 data)
+void pit68230_device::wr_pitreg_tcr(uint8_t data)
{
int tout = 0;
int tiack = 0;
@@ -441,34 +441,34 @@ void pit68230_device::wr_pitreg_tcr(UINT8 data)
}
}
-void pit68230_device::wr_pitreg_tivr(UINT8 data)
+void pit68230_device::wr_pitreg_tivr(uint8_t data)
{
LOG(("%s(%02x) \"%s\": \n", FUNCNAME, data, tag()));
m_tivr = data;
}
-void pit68230_device::wr_pitreg_cprh(UINT8 data)
+void pit68230_device::wr_pitreg_cprh(uint8_t data)
{
LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
m_cpr &= ~0xff0000;
m_cpr |= ((data << 16) & 0xff0000);
}
-void pit68230_device::wr_pitreg_cprm(UINT8 data)
+void pit68230_device::wr_pitreg_cprm(uint8_t data)
{
LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
m_cpr &= ~0x00ff00;
m_cpr |= ((data << 8) & 0x00ff00);
}
-void pit68230_device::wr_pitreg_cprl(UINT8 data)
+void pit68230_device::wr_pitreg_cprl(uint8_t data)
{
LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
m_cpr &= ~0x0000ff;
m_cpr |= ((data << 0) & 0x0000ff);
}
-void pit68230_device::wr_pitreg_tsr(UINT8 data)
+void pit68230_device::wr_pitreg_tsr(uint8_t data)
{
LOG(("%s(%02x) \"%s\": \n", FUNCNAME, data, tag()));
m_tsr = data;
@@ -521,60 +521,60 @@ WRITE8_MEMBER (pit68230_device::write)
}
#if VERBOSE > 2
-static INT32 or_cnt = 0;
-static INT32 or_data = 0;
-static INT32 or_ofs = 0;
+static int32_t or_cnt = 0;
+static int32_t or_data = 0;
+static int32_t or_ofs = 0;
#endif
-UINT8 pit68230_device::rr_pitreg_pgcr()
+uint8_t pit68230_device::rr_pitreg_pgcr()
{
LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_pgcr));
return m_pgcr;
}
-UINT8 pit68230_device::rr_pitreg_psrr()
+uint8_t pit68230_device::rr_pitreg_psrr()
{
LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_psrr));
return m_psrr;
}
-UINT8 pit68230_device::rr_pitreg_paddr()
+uint8_t pit68230_device::rr_pitreg_paddr()
{
LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_paddr));
return m_paddr;
}
-UINT8 pit68230_device::rr_pitreg_pbddr()
+uint8_t pit68230_device::rr_pitreg_pbddr()
{
LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_pbddr));
return m_pbddr;
}
-UINT8 pit68230_device::rr_pitreg_pcddr()
+uint8_t pit68230_device::rr_pitreg_pcddr()
{
LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_pcddr));
return m_pcddr;
}
-UINT8 pit68230_device::rr_pitreg_pivr()
+uint8_t pit68230_device::rr_pitreg_pivr()
{
LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_pivr));
return m_pivr;
}
-UINT8 pit68230_device::rr_pitreg_pacr()
+uint8_t pit68230_device::rr_pitreg_pacr()
{
LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_pacr));
return m_pacr;
}
-UINT8 pit68230_device::rr_pitreg_pbcr()
+uint8_t pit68230_device::rr_pitreg_pbcr()
{
LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_pbcr));
return m_pbcr;
}
-UINT8 pit68230_device::rr_pitreg_padr()
+uint8_t pit68230_device::rr_pitreg_padr()
{
m_padr &= m_paddr;
m_padr |= (m_pa_in_cb() & ~m_paddr);
@@ -589,7 +589,7 @@ UINT8 pit68230_device::rr_pitreg_padr()
* mode/submode, reading or writing may affect the double-buffered handshake
* mechanism. The port B data register is not affected by the assertion of the
* RESET pin. PB0-PB7 sits on pins 17-24 on a 48 pin DIP package */
-UINT8 pit68230_device::rr_pitreg_pbdr()
+uint8_t pit68230_device::rr_pitreg_pbdr()
{
m_pbdr &= m_pbddr;
m_pbdr |= (m_pb_in_cb() & ~m_pbddr);
@@ -597,7 +597,7 @@ UINT8 pit68230_device::rr_pitreg_pbdr()
return m_pbdr;
}
-UINT8 pit68230_device::rr_pitreg_pcdr()
+uint8_t pit68230_device::rr_pitreg_pcdr()
{
m_pcdr &= m_pcddr;
m_pcdr |= (m_pc_in_cb() & ~m_pcddr);
@@ -609,10 +609,10 @@ UINT8 pit68230_device::rr_pitreg_pcdr()
It is a read-only address and no other PI/T condition is affected. In all modes,
the instantaneous pin level is read and no input latching is performed except at the
data bus interface. Writes to this address are answered with DTACK, but the data is ignored.*/
-UINT8 pit68230_device::rr_pitreg_paar()
+uint8_t pit68230_device::rr_pitreg_paar()
{
// NOTE: no side effect emulated so using ..padr
- UINT8 ret;
+ uint8_t ret;
ret = m_pa_in_cb();
LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, ret));
return ret;
@@ -622,10 +622,10 @@ UINT8 pit68230_device::rr_pitreg_paar()
It is a read-only address and no other PI/T condition is affected. In all modes,
the instantaneous pin level is read and no input latching is performed except at the
data bus interface.Writes to this address are answered with DTACK, but the data is ignored.*/
-UINT8 pit68230_device::rr_pitreg_pbar()
+uint8_t pit68230_device::rr_pitreg_pbar()
{
// NOTE: no side effect emulated so using ..pbdr
- UINT8 ret;
+ uint8_t ret;
ret = m_pb_in_cb();
LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, ret));
return ret;
@@ -637,68 +637,68 @@ UINT8 pit68230_device::rr_pitreg_pbar()
* register. Bits 3-0 are the respective status bits referred to throughout this document.
* Their interpretation depends on the programmed mode/submode of the PI/T. For bits
* 3-0 a one is the active or asserted state. */
-UINT8 pit68230_device::rr_pitreg_psr()
+uint8_t pit68230_device::rr_pitreg_psr()
{
LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_psr));
return m_psr;
}
-UINT8 pit68230_device::rr_pitreg_tcr()
+uint8_t pit68230_device::rr_pitreg_tcr()
{
LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_tcr));
return m_tcr;
}
-UINT8 pit68230_device::rr_pitreg_tivr()
+uint8_t pit68230_device::rr_pitreg_tivr()
{
LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_tivr));
return m_tivr;
}
-UINT8 pit68230_device::rr_pitreg_cprh()
+uint8_t pit68230_device::rr_pitreg_cprh()
{
LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, (m_cpr >> 16) & 0xff));
return (m_cpr >> 16) & 0xff;
}
-UINT8 pit68230_device::rr_pitreg_cprm()
+uint8_t pit68230_device::rr_pitreg_cprm()
{
LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, (m_cpr >> 8) & 0xff));
return (m_cpr >> 8) & 0xff;
}
-UINT8 pit68230_device::rr_pitreg_cprl()
+uint8_t pit68230_device::rr_pitreg_cprl()
{
LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, (m_cpr >> 0) & 0xff));
return (m_cpr >> 0) & 0xff;
}
-UINT8 pit68230_device::rr_pitreg_cntrh()
+uint8_t pit68230_device::rr_pitreg_cntrh()
{
LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, (m_cntr >> 16) & 0xff));
return (m_cntr >> 16) & 0xff;
}
-UINT8 pit68230_device::rr_pitreg_cntrm()
+uint8_t pit68230_device::rr_pitreg_cntrm()
{
LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, (m_cntr >> 8) & 0xff));
return (m_cntr >> 8) & 0xff;
}
-UINT8 pit68230_device::rr_pitreg_cntrl()
+uint8_t pit68230_device::rr_pitreg_cntrl()
{
LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, (m_cntr >> 0) & 0xff));
return (m_cntr >> 0) & 0xff;
}
-UINT8 pit68230_device::rr_pitreg_tsr()
+uint8_t pit68230_device::rr_pitreg_tsr()
{
LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_tsr));
return m_tsr;
}
READ8_MEMBER (pit68230_device::read){
- UINT8 data;
+ uint8_t data;
switch (offset) {
case PIT_68230_PGCR: data = rr_pitreg_pgcr(); break;