summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/wd11c00_17.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/wd11c00_17.cpp')
-rw-r--r--src/devices/machine/wd11c00_17.cpp75
1 files changed, 37 insertions, 38 deletions
diff --git a/src/devices/machine/wd11c00_17.cpp b/src/devices/machine/wd11c00_17.cpp
index d6b21f43330..499601c943f 100644
--- a/src/devices/machine/wd11c00_17.cpp
+++ b/src/devices/machine/wd11c00_17.cpp
@@ -9,15 +9,14 @@
#include "emu.h"
#include "machine/wd11c00_17.h"
+#define VERBOSE 1
+#include "logmacro.h"
//**************************************************************************
// MACROS / CONSTANTS
//**************************************************************************
-#define LOG 1
-
-
// status register
#define STATUS_IRQ 0x20
#define STATUS_DRQ 0x10
@@ -37,7 +36,7 @@
// DEVICE DEFINITIONS
//**************************************************************************
-const device_type WD11C00_17 = device_creator<wd11c00_17_device>;
+DEFINE_DEVICE_TYPE(WD11C00_17, wd11c00_17_device, "wd11c00_17", "Western Digital WD11C00-17")
//**************************************************************************
@@ -177,25 +176,25 @@ inline void wd11c00_17_device::select()
//-------------------------------------------------
wd11c00_17_device::wd11c00_17_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, WD11C00_17, "Western Digital WD11C00-17", tag, owner, clock, "wd11c00_17", __FILE__),
- m_out_irq5_cb(*this),
- m_out_drq3_cb(*this),
- m_out_mr_cb(*this),
- m_out_busy_cb(*this),
- m_out_req_cb(*this),
- m_out_ra3_cb(*this),
- m_in_rd322_cb(*this),
- m_in_ramcs_cb(*this),
- m_out_ramwr_cb(*this),
- m_in_cs1010_cb(*this),
- m_out_cs1010_cb(*this),
- m_status(0),
- m_ra(0),
- m_irq5(CLEAR_LINE),
- m_drq3(CLEAR_LINE),
- m_busy(1),
- m_req(0),
- m_ra3(0)
+ : device_t(mconfig, WD11C00_17, tag, owner, clock)
+ , m_out_irq5_cb(*this)
+ , m_out_drq3_cb(*this)
+ , m_out_mr_cb(*this)
+ , m_out_busy_cb(*this)
+ , m_out_req_cb(*this)
+ , m_out_ra3_cb(*this)
+ , m_in_rd322_cb(*this)
+ , m_in_ramcs_cb(*this)
+ , m_out_ramwr_cb(*this)
+ , m_in_cs1010_cb(*this)
+ , m_out_cs1010_cb(*this)
+ , m_status(0)
+ , m_ra(0)
+ , m_irq5(CLEAR_LINE)
+ , m_drq3(CLEAR_LINE)
+ , m_busy(1)
+ , m_req(0)
+ , m_ra3(0)
{
}
@@ -246,9 +245,9 @@ READ8_MEMBER( wd11c00_17_device::io_r )
switch (offset)
{
case 0: // Read Data, Board to Host
- if (LOG) logerror("%s WD11C00-17 '%s' Read Data %03x:", machine().describe_context(), tag(), m_ra);
+ LOG("%s WD11C00-17 Read Data %03x:", machine().describe_context(), m_ra);
data = read_data();
- if (LOG) logerror("%02x\n", data);
+ LOG("%02x\n", data);
break;
case 1: // Read Board Hardware Status
@@ -277,23 +276,23 @@ WRITE8_MEMBER( wd11c00_17_device::io_w )
switch (offset)
{
case 0: // Write Data, Host to Board
- if (LOG) logerror("%s WD11C00-17 '%s' Write Data %03x:%02x\n", machine().describe_context(), tag(), m_ra, data);
+ LOG("%s WD11C00-17 Write Data %03x:%02x\n", machine().describe_context(), m_ra, data);
write_data(data);
break;
case 1: // Board Software Reset
- if (LOG) logerror("%s WD11C00-17 '%s' Software Reset\n", machine().describe_context(), tag());
+ LOG("%s WD11C00-17 Software Reset\n", machine().describe_context());
software_reset();
break;
case 2: // Board Select
- if (LOG) logerror("%s WD11C00-17 '%s' Select\n", machine().describe_context(), tag());
+ LOG("%s WD11C00-17 Select\n", machine().describe_context());
increment_address(); // HACK
select();
break;
case 3: // Set/Reset DMA, IRQ Masks
- if (LOG) logerror("%s WD11C00-17 '%s' Mask IRQ %u DMA %u\n", machine().describe_context(), tag(), BIT(data, 1), BIT(data, 0));
+ LOG("%s WD11C00-17 Mask IRQ %u DMA %u\n", machine().describe_context(), BIT(data, 1), BIT(data, 0));
m_mask = data;
check_interrupt();
break;
@@ -332,9 +331,9 @@ READ8_MEMBER( wd11c00_17_device::read )
switch (offset)
{
case 0x00:
- if (LOG) logerror("%s WD11C00-17 '%s' Read RAM %03x:", machine().describe_context(), tag(), m_ra);
+ LOG("%s WD11C00-17 Read RAM %03x:", machine().describe_context(), m_ra);
data = read_data();
- if (LOG) logerror("%02x\n", data);
+ LOG("%02x\n", data);
break;
case 0x20:
@@ -355,7 +354,7 @@ WRITE8_MEMBER( wd11c00_17_device::write )
switch (offset)
{
case 0x00:
- if (LOG) logerror("%s WD11C00-17 '%s' Write RAM %03x:%02x\n", machine().describe_context(), tag(), m_ra, data);
+ LOG("%s WD11C00-17 Write RAM %03x:%02x\n", machine().describe_context(), m_ra, data);
write_data(data);
if (m_ra > 0x400) m_ecc_not_0 = 0; // HACK
break;
@@ -366,7 +365,7 @@ WRITE8_MEMBER( wd11c00_17_device::write )
case 0x60:
m_ra = (data & 0x07) << 8;
- if (LOG) logerror("%s WD11C00-17 '%s' RA %03x\n", machine().describe_context(), tag(), m_ra);
+ LOG("%s WD11C00-17 RA %03x\n", machine().describe_context(), m_ra);
check_interrupt();
break;
}
@@ -379,7 +378,7 @@ WRITE8_MEMBER( wd11c00_17_device::write )
WRITE_LINE_MEMBER( wd11c00_17_device::ireq_w )
{
- if (LOG) logerror("%s WD11C00-17 '%s' IREQ %u\n", machine().describe_context(), tag(), state);
+ LOG("%s WD11C00-17 IREQ %u\n", machine().describe_context(), state);
if (state) m_status |= STATUS_REQ; else m_status &= ~STATUS_REQ;
@@ -408,7 +407,7 @@ WRITE_LINE_MEMBER( wd11c00_17_device::ireq_w )
WRITE_LINE_MEMBER( wd11c00_17_device::io_w )
{
- if (LOG) logerror("%s WD11C00-17 '%s' I/O %u\n", machine().describe_context(), tag(), state);
+ LOG("%s WD11C00-17 I/O %u\n", machine().describe_context(), state);
if (state) m_status |= STATUS_I_O; else m_status &= ~STATUS_I_O;
}
@@ -420,7 +419,7 @@ WRITE_LINE_MEMBER( wd11c00_17_device::io_w )
WRITE_LINE_MEMBER( wd11c00_17_device::cd_w )
{
- if (LOG) logerror("%s WD11C00-17 '%s' C/D %u\n", machine().describe_context(), tag(), state);
+ LOG("%s WD11C00-17 C/D %u\n", machine().describe_context(), state);
if (state) m_status |= STATUS_C_D; else m_status &= ~STATUS_C_D;
}
@@ -432,7 +431,7 @@ WRITE_LINE_MEMBER( wd11c00_17_device::cd_w )
WRITE_LINE_MEMBER( wd11c00_17_device::clct_w )
{
- if (LOG) logerror("%s WD11C00-17 '%s' CLCT %u\n", machine().describe_context(), tag(), state);
+ LOG("%s WD11C00-17 CLCT %u\n", machine().describe_context(), state);
if (state)
{
@@ -448,7 +447,7 @@ WRITE_LINE_MEMBER( wd11c00_17_device::clct_w )
WRITE_LINE_MEMBER( wd11c00_17_device::mode_w )
{
- if (LOG) logerror("%s WD11C00-17 '%s' MODE %u\n", machine().describe_context(), tag(), state);
+ LOG("%s WD11C00-17 MODE %u\n", machine().describe_context(), state);
m_mode = state;
m_ecc_not_0 = state; // HACK