summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/mc68901.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/mc68901.cpp')
-rw-r--r--src/devices/machine/mc68901.cpp124
1 files changed, 62 insertions, 62 deletions
diff --git a/src/devices/machine/mc68901.cpp b/src/devices/machine/mc68901.cpp
index 975bd26dfb2..4d35d2a2c44 100644
--- a/src/devices/machine/mc68901.cpp
+++ b/src/devices/machine/mc68901.cpp
@@ -294,11 +294,11 @@ inline void mc68901_device::gpio_input(int bit, int state)
{
if (state == BIT(m_aer, bit))
{
- if (LOG) logerror("MC68901 '%s' Edge Transition Detected on GPIO%u\n", tag().c_str(), bit);
+ if (LOG) logerror("MC68901 '%s' Edge Transition Detected on GPIO%u\n", tag(), bit);
if (m_ier & INT_MASK_GPIO[bit]) // AND interrupt enabled bit is set...
{
- if (LOG) logerror("MC68901 '%s' Interrupt Pending for GPIO%u\n", tag().c_str(), bit);
+ if (LOG) logerror("MC68901 '%s' Interrupt Pending for GPIO%u\n", tag(), bit);
take_interrupt(INT_MASK_GPIO[bit]); // set interrupt pending bit
}
@@ -332,7 +332,7 @@ void mc68901_device::gpio_output()
// mc68901_device - constructor
//-------------------------------------------------
-mc68901_device::mc68901_device(const machine_config &mconfig, std::string tag, device_t *owner, UINT32 clock)
+mc68901_device::mc68901_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, MC68901, "MC68901 MFP", tag, owner, clock, "mc68901", __FILE__),
device_serial_interface(mconfig, *this),
m_timer_clock(0),
@@ -596,84 +596,84 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
switch (offset)
{
case REGISTER_GPIP:
- if (LOG) logerror("MC68901 '%s' General Purpose I/O : %x\n", tag().c_str(), data);
+ if (LOG) logerror("MC68901 '%s' General Purpose I/O : %x\n", tag(), data);
m_gpip = data;
gpio_output();
break;
case REGISTER_AER:
- if (LOG) logerror("MC68901 '%s' Active Edge Register : %x\n", tag().c_str(), data);
+ if (LOG) logerror("MC68901 '%s' Active Edge Register : %x\n", tag(), data);
m_aer = data;
break;
case REGISTER_DDR:
- if (LOG) logerror("MC68901 '%s' Data Direction Register : %x\n", tag().c_str(), data);
+ if (LOG) logerror("MC68901 '%s' Data Direction Register : %x\n", tag(), data);
m_ddr = data;
gpio_output();
break;
case REGISTER_IERA:
- if (LOG) logerror("MC68901 '%s' Interrupt Enable Register A : %x\n", tag().c_str(), data);
+ if (LOG) logerror("MC68901 '%s' Interrupt Enable Register A : %x\n", tag(), data);
m_ier = (data << 8) | (m_ier & 0xff);
m_ipr &= m_ier;
check_interrupts();
break;
case REGISTER_IERB:
- if (LOG) logerror("MC68901 '%s' Interrupt Enable Register B : %x\n", tag().c_str(), data);
+ if (LOG) logerror("MC68901 '%s' Interrupt Enable Register B : %x\n", tag(), data);
m_ier = (m_ier & 0xff00) | data;
m_ipr &= m_ier;
check_interrupts();
break;
case REGISTER_IPRA:
- if (LOG) logerror("MC68901 '%s' Interrupt Pending Register A : %x\n", tag().c_str(), data);
+ if (LOG) logerror("MC68901 '%s' Interrupt Pending Register A : %x\n", tag(), data);
m_ipr &= (data << 8) | (m_ipr & 0xff);
check_interrupts();
break;
case REGISTER_IPRB:
- if (LOG) logerror("MC68901 '%s' Interrupt Pending Register B : %x\n", tag().c_str(), data);
+ if (LOG) logerror("MC68901 '%s' Interrupt Pending Register B : %x\n", tag(), data);
m_ipr &= (m_ipr & 0xff00) | data;
check_interrupts();
break;
case REGISTER_ISRA:
- if (LOG) logerror("MC68901 '%s' Interrupt In-Service Register A : %x\n", tag().c_str(), data);
+ if (LOG) logerror("MC68901 '%s' Interrupt In-Service Register A : %x\n", tag(), data);
m_isr &= (data << 8) | (m_isr & 0xff);
break;
case REGISTER_ISRB:
- if (LOG) logerror("MC68901 '%s' Interrupt In-Service Register B : %x\n", tag().c_str(), data);
+ if (LOG) logerror("MC68901 '%s' Interrupt In-Service Register B : %x\n", tag(), data);
m_isr &= (m_isr & 0xff00) | data;
break;
case REGISTER_IMRA:
- if (LOG) logerror("MC68901 '%s' Interrupt Mask Register A : %x\n", tag().c_str(), data);
+ if (LOG) logerror("MC68901 '%s' Interrupt Mask Register A : %x\n", tag(), data);
m_imr = (data << 8) | (m_imr & 0xff);
m_isr &= m_imr;
check_interrupts();
break;
case REGISTER_IMRB:
- if (LOG) logerror("MC68901 '%s' Interrupt Mask Register B : %x\n", tag().c_str(), data);
+ if (LOG) logerror("MC68901 '%s' Interrupt Mask Register B : %x\n", tag(), data);
m_imr = (m_imr & 0xff00) | data;
m_isr &= m_imr;
check_interrupts();
break;
case REGISTER_VR:
- if (LOG) logerror("MC68901 '%s' Interrupt Vector : %x\n", tag().c_str(), data & 0xf0);
+ if (LOG) logerror("MC68901 '%s' Interrupt Vector : %x\n", tag(), data & 0xf0);
m_vr = data & 0xf8;
if (m_vr & VR_S)
{
- if (LOG) logerror("MC68901 '%s' Software End-Of-Interrupt Mode\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Software End-Of-Interrupt Mode\n", tag());
}
else
{
- if (LOG) logerror("MC68901 '%s' Automatic End-Of-Interrupt Mode\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Automatic End-Of-Interrupt Mode\n", tag());
m_isr = 0;
}
@@ -685,7 +685,7 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
switch (m_tacr & 0x0f)
{
case TCR_TIMER_STOPPED:
- if (LOG) logerror("MC68901 '%s' Timer A Stopped\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Timer A Stopped\n", tag());
m_timer[TIMER_A]->enable(false);
break;
@@ -698,13 +698,13 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
case TCR_TIMER_DELAY_200:
{
int divisor = PRESCALER[m_tacr & 0x07];
- if (LOG) logerror("MC68901 '%s' Timer A Delay Mode : %u Prescale\n", tag().c_str(), divisor);
+ if (LOG) logerror("MC68901 '%s' Timer A Delay Mode : %u Prescale\n", tag(), divisor);
m_timer[TIMER_A]->adjust(attotime::from_hz(m_timer_clock / divisor), 0, attotime::from_hz(m_timer_clock / divisor));
}
break;
case TCR_TIMER_EVENT:
- if (LOG) logerror("MC68901 '%s' Timer A Event Count Mode\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Timer A Event Count Mode\n", tag());
m_timer[TIMER_A]->enable(false);
break;
@@ -717,7 +717,7 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
case TCR_TIMER_PULSE_200:
{
int divisor = PRESCALER[m_tacr & 0x07];
- if (LOG) logerror("MC68901 '%s' Timer A Pulse Width Mode : %u Prescale\n", tag().c_str(), divisor);
+ if (LOG) logerror("MC68901 '%s' Timer A Pulse Width Mode : %u Prescale\n", tag(), divisor);
m_timer[TIMER_A]->adjust(attotime::never, 0, attotime::from_hz(m_timer_clock / divisor));
m_timer[TIMER_A]->enable(false);
}
@@ -726,7 +726,7 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
if (m_tacr & TCR_TIMER_RESET)
{
- if (LOG) logerror("MC68901 '%s' Timer A Reset\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Timer A Reset\n", tag());
m_to[TIMER_A] = 0;
@@ -740,7 +740,7 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
switch (m_tbcr & 0x0f)
{
case TCR_TIMER_STOPPED:
- if (LOG) logerror("MC68901 '%s' Timer B Stopped\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Timer B Stopped\n", tag());
m_timer[TIMER_B]->enable(false);
break;
@@ -753,13 +753,13 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
case TCR_TIMER_DELAY_200:
{
int divisor = PRESCALER[m_tbcr & 0x07];
- if (LOG) logerror("MC68901 '%s' Timer B Delay Mode : %u Prescale\n", tag().c_str(), divisor);
+ if (LOG) logerror("MC68901 '%s' Timer B Delay Mode : %u Prescale\n", tag(), divisor);
m_timer[TIMER_B]->adjust(attotime::from_hz(m_timer_clock / divisor), 0, attotime::from_hz(m_timer_clock / divisor));
}
break;
case TCR_TIMER_EVENT:
- if (LOG) logerror("MC68901 '%s' Timer B Event Count Mode\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Timer B Event Count Mode\n", tag());
m_timer[TIMER_B]->enable(false);
break;
@@ -772,7 +772,7 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
case TCR_TIMER_PULSE_200:
{
int divisor = PRESCALER[m_tbcr & 0x07];
- if (LOG) logerror("MC68901 '%s' Timer B Pulse Width Mode : %u Prescale\n", tag().c_str(), DIVISOR);
+ if (LOG) logerror("MC68901 '%s' Timer B Pulse Width Mode : %u Prescale\n", tag(), DIVISOR);
m_timer[TIMER_B]->adjust(attotime::never, 0, attotime::from_hz(m_timer_clock / divisor));
m_timer[TIMER_B]->enable(false);
}
@@ -781,7 +781,7 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
if (m_tacr & TCR_TIMER_RESET)
{
- if (LOG) logerror("MC68901 '%s' Timer B Reset\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Timer B Reset\n", tag());
m_to[TIMER_B] = 0;
@@ -795,7 +795,7 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
switch (m_tcdcr & 0x07)
{
case TCR_TIMER_STOPPED:
- if (LOG) logerror("MC68901 '%s' Timer D Stopped\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Timer D Stopped\n", tag());
m_timer[TIMER_D]->enable(false);
break;
@@ -808,7 +808,7 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
case TCR_TIMER_DELAY_200:
{
int divisor = PRESCALER[m_tcdcr & 0x07];
- if (LOG) logerror("MC68901 '%s' Timer D Delay Mode : %u Prescale\n", tag().c_str(), divisor);
+ if (LOG) logerror("MC68901 '%s' Timer D Delay Mode : %u Prescale\n", tag(), divisor);
m_timer[TIMER_D]->adjust(attotime::from_hz(m_timer_clock / divisor), 0, attotime::from_hz(m_timer_clock / divisor));
}
break;
@@ -817,7 +817,7 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
switch ((m_tcdcr >> 4) & 0x07)
{
case TCR_TIMER_STOPPED:
- if (LOG) logerror("MC68901 '%s' Timer C Stopped\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Timer C Stopped\n", tag());
m_timer[TIMER_C]->enable(false);
break;
@@ -830,7 +830,7 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
case TCR_TIMER_DELAY_200:
{
int divisor = PRESCALER[(m_tcdcr >> 4) & 0x07];
- if (LOG) logerror("MC68901 '%s' Timer C Delay Mode : %u Prescale\n", tag().c_str(), divisor);
+ if (LOG) logerror("MC68901 '%s' Timer C Delay Mode : %u Prescale\n", tag(), divisor);
m_timer[TIMER_C]->adjust(attotime::from_hz(m_timer_clock / divisor), 0, attotime::from_hz(m_timer_clock / divisor));
}
break;
@@ -838,7 +838,7 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
break;
case REGISTER_TADR:
- if (LOG) logerror("MC68901 '%s' Timer A Data Register : %x\n", tag().c_str(), data);
+ if (LOG) logerror("MC68901 '%s' Timer A Data Register : %x\n", tag(), data);
m_tdr[TIMER_A] = data;
@@ -849,7 +849,7 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
break;
case REGISTER_TBDR:
- if (LOG) logerror("MC68901 '%s' Timer B Data Register : %x\n", tag().c_str(), data);
+ if (LOG) logerror("MC68901 '%s' Timer B Data Register : %x\n", tag(), data);
m_tdr[TIMER_B] = data;
@@ -860,7 +860,7 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
break;
case REGISTER_TCDR:
- if (LOG) logerror("MC68901 '%s' Timer C Data Register : %x\n", tag().c_str(), data);
+ if (LOG) logerror("MC68901 '%s' Timer C Data Register : %x\n", tag(), data);
m_tdr[TIMER_C] = data;
@@ -871,7 +871,7 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
break;
case REGISTER_TDDR:
- if (LOG) logerror("MC68901 '%s' Timer D Data Register : %x\n", tag().c_str(), data);
+ if (LOG) logerror("MC68901 '%s' Timer D Data Register : %x\n", tag(), data);
m_tdr[TIMER_D] = data;
@@ -882,7 +882,7 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
break;
case REGISTER_SCR:
- if (LOG) logerror("MC68901 '%s' Sync Character : %x\n", tag().c_str(), data);
+ if (LOG) logerror("MC68901 '%s' Sync Character : %x\n", tag(), data);
m_scr = data;
break;
@@ -905,25 +905,25 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
{
if (data & UCR_PARITY_EVEN)
{
- if (LOG) logerror("MC68901 '%s' Parity : Even\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Parity : Even\n", tag());
parity = PARITY_EVEN;
}
else
{
- if (LOG) logerror("MC68901 '%s' Parity : Odd\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Parity : Odd\n", tag());
parity = PARITY_ODD;
}
}
else
{
- if (LOG) logerror("MC68901 '%s' Parity : Disabled\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Parity : Disabled\n", tag());
parity = PARITY_NONE;
}
- if (LOG) logerror("MC68901 '%s' Word Length : %u bits\n", tag().c_str(), data_bit_count);
+ if (LOG) logerror("MC68901 '%s' Word Length : %u bits\n", tag(), data_bit_count);
int start_bits;
@@ -935,35 +935,35 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
default:
start_bits = 0;
stop_bits = STOP_BITS_0;
- if (LOG) logerror("MC68901 '%s' Start Bits : 0, Stop Bits : 0, Format : synchronous\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Start Bits : 0, Stop Bits : 0, Format : synchronous\n", tag());
break;
case UCR_START_STOP_1_1:
start_bits = 1;
stop_bits = STOP_BITS_1;
- if (LOG) logerror("MC68901 '%s' Start Bits : 1, Stop Bits : 1, Format : asynchronous\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Start Bits : 1, Stop Bits : 1, Format : asynchronous\n", tag());
break;
case UCR_START_STOP_1_15:
start_bits = 1;
stop_bits = STOP_BITS_1_5;
- if (LOG) logerror("MC68901 '%s' Start Bits : 1, Stop Bits : 1.5, Format : asynchronous\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Start Bits : 1, Stop Bits : 1.5, Format : asynchronous\n", tag());
break;
case UCR_START_STOP_1_2:
start_bits = 1;
stop_bits = STOP_BITS_2;
- if (LOG) logerror("MC68901 '%s' Start Bits : 1, Stop Bits : 2, Format : asynchronous\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Start Bits : 1, Stop Bits : 2, Format : asynchronous\n", tag());
break;
}
if (data & UCR_CLOCK_DIVIDE_16)
{
- if (LOG) logerror("MC68901 '%s' Rx/Tx Clock Divisor : 16\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Rx/Tx Clock Divisor : 16\n", tag());
}
else
{
- if (LOG) logerror("MC68901 '%s' Rx/Tx Clock Divisor : 1\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Rx/Tx Clock Divisor : 1\n", tag());
}
set_data_frame(start_bits, data_bit_count, parity, stop_bits);
@@ -975,24 +975,24 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
case REGISTER_RSR:
if ((data & RSR_RCV_ENABLE) == 0)
{
- if (LOG) logerror("MC68901 '%s' Receiver Disabled\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Receiver Disabled\n", tag());
m_rsr = 0;
}
else
{
- if (LOG) logerror("MC68901 '%s' Receiver Enabled\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Receiver Enabled\n", tag());
if (data & RSR_SYNC_STRIP_ENABLE)
{
- if (LOG) logerror("MC68901 '%s' Sync Strip Enabled\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Sync Strip Enabled\n", tag());
}
else
{
- if (LOG) logerror("MC68901 '%s' Sync Strip Disabled\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Sync Strip Disabled\n", tag());
}
if (data & RSR_FOUND_SEARCH)
- if (LOG) logerror("MC68901 '%s' Receiver Search Mode Enabled\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Receiver Search Mode Enabled\n", tag());
m_rsr = data & 0x0b;
}
@@ -1003,7 +1003,7 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
if ((data & TSR_XMIT_ENABLE) == 0)
{
- if (LOG) logerror("MC68901 '%s' Transmitter Disabled\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Transmitter Disabled\n", tag());
m_tsr &= ~TSR_UNDERRUN_ERROR;
@@ -1012,40 +1012,40 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
}
else
{
- if (LOG) logerror("MC68901 '%s' Transmitter Enabled\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Transmitter Enabled\n", tag());
switch (data & 0x06)
{
case TSR_OUTPUT_HI_Z:
- if (LOG) logerror("MC68901 '%s' Transmitter Disabled Output State : Hi-Z\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Transmitter Disabled Output State : Hi-Z\n", tag());
break;
case TSR_OUTPUT_LOW:
- if (LOG) logerror("MC68901 '%s' Transmitter Disabled Output State : 0\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Transmitter Disabled Output State : 0\n", tag());
break;
case TSR_OUTPUT_HIGH:
- if (LOG) logerror("MC68901 '%s' Transmitter Disabled Output State : 1\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Transmitter Disabled Output State : 1\n", tag());
break;
case TSR_OUTPUT_LOOP:
- if (LOG) logerror("MC68901 '%s' Transmitter Disabled Output State : Loop\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Transmitter Disabled Output State : Loop\n", tag());
break;
}
if (data & TSR_BREAK)
{
- if (LOG) logerror("MC68901 '%s' Transmitter Break Enabled\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Transmitter Break Enabled\n", tag());
}
else
{
- if (LOG) logerror("MC68901 '%s' Transmitter Break Disabled\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Transmitter Break Disabled\n", tag());
}
if (data & TSR_AUTO_TURNAROUND)
{
- if (LOG) logerror("MC68901 '%s' Transmitter Auto Turnaround Enabled\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Transmitter Auto Turnaround Enabled\n", tag());
}
else
{
- if (LOG) logerror("MC68901 '%s' Transmitter Auto Turnaround Disabled\n", tag().c_str());
+ if (LOG) logerror("MC68901 '%s' Transmitter Auto Turnaround Disabled\n", tag());
}
m_tsr &= ~TSR_END_OF_XMIT;
@@ -1060,7 +1060,7 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
break;
case REGISTER_UDR:
- if (LOG) logerror("MC68901 '%s' UDR %x\n", tag().c_str(), data);
+ if (LOG) logerror("MC68901 '%s' UDR %x\n", tag(), data);
m_transmit_buffer = data;
m_transmit_pending = 1;
m_tsr &= ~TSR_BUFFER_EMPTY;