summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/devices/machine/swim1.cpp37
1 files changed, 20 insertions, 17 deletions
diff --git a/src/devices/machine/swim1.cpp b/src/devices/machine/swim1.cpp
index 2d0adc04c60..ba5eba16037 100644
--- a/src/devices/machine/swim1.cpp
+++ b/src/devices/machine/swim1.cpp
@@ -9,6 +9,9 @@
#include "emu.h"
#include "swim1.h"
+#define VERBOSE 0
+#include "logmacro.h"
+
DEFINE_DEVICE_TYPE(SWIM1, swim1_device, "swim1", "Apple SWIM1 (Sander/Wozniak Integrated Machine) version 1 floppy controller")
swim1_device::swim1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
@@ -112,7 +115,7 @@ void swim1_device::set_floppy(floppy_image_device *floppy)
sync();
flush_write();
- logerror("floppy %s\n", floppy ? floppy->tag() : "-");
+ LOG("floppy %s\n", floppy ? floppy->tag() : "-");
m_floppy = floppy;
update_phases();
@@ -127,7 +130,7 @@ floppy_image_device *swim1_device::get_floppy() const
void swim1_device::ism_show_mode() const
{
- logerror("ism mode%s %s hdsel=%c %c%s %c%c%s\n",
+ LOG("ism mode%s %s hdsel=%c %c%s %c%c%s\n",
m_ism_mode & 0x80 ? " motoron" : "",
m_ism_mode & 0x40 ? "ism" : "iwm",
m_ism_mode & 0x20 ? '1' : '0',
@@ -175,7 +178,7 @@ u8 swim1_device::ism_read(offs_t offset)
// "data", "mark", "crc", "param", "phases", "setup", "status", "handshake"
// };
- // logerror("read ism %s\n", names[offset & 7]);
+ // LOG("read ism %s\n", names[offset & 7]);
switch(offset & 7) {
case 0x0: { // data
u16 r = ism_fifo_pop();
@@ -282,14 +285,14 @@ void swim1_device::ism_write(offs_t offset, u8 data)
"minct", "mult", "ssl", "sss", "sll", "sls", "rpt", "csls",
"lsl", "lss", "lll", "lls", "late", "time0", "early", "time1"
};
- logerror("param[%s] = %02x\n", pname[m_ism_param_idx], data);
+ LOG("param[%s] = %02x\n", pname[m_ism_param_idx], data);
m_ism_param[m_ism_param_idx] = data;
m_ism_param_idx = (m_ism_param_idx + 1) & 15;
break;
}
case 0x4: {
- logerror("ism phases %02x\n", data);
+ LOG("ism phases %02x\n", data);
m_phases = data;
update_phases();
break;
@@ -297,7 +300,7 @@ void swim1_device::ism_write(offs_t offset, u8 data)
case 0x5:
m_ism_setup = data;
- logerror("setup timer=%s tsm=%s %s ecm=%s %s %s 3.5=%s %s\n",
+ LOG("setup timer=%s tsm=%s %s ecm=%s %s %s 3.5=%s %s\n",
m_ism_setup & 0x80 ? "on" : "off",
m_ism_setup & 0x40 ? "off" : "on",
m_ism_setup & 0x20 ? "ibm" : "apple",
@@ -315,7 +318,7 @@ void swim1_device::ism_write(offs_t offset, u8 data)
if(data & 0x10)
m_dat1byte_cb((m_ism_fifo_pos != 0) ? 1 : 0);
if(!(m_ism_mode & 0x40)) {
- logerror("switch to iwm\n");
+ LOG("switch to iwm\n");
u8 ism_devsel = m_ism_mode & 0x80 ? (m_ism_mode >> 1) & 3 : 0;
if(ism_devsel != m_iwm_devsel)
m_devsel_cb(m_iwm_devsel);
@@ -345,7 +348,7 @@ void swim1_device::ism_write(offs_t offset, u8 data)
if((m_ism_mode & 0x18) == 0x18 && ((prev_mode & 0x18) != 0x18)) {
// Entering write mode
m_ism_current_bit = 0;
- logerror("%s write start %s %s floppy=%p\n", machine().time().to_string(), m_ism_setup & 0x40 ? "gcr" : "mfm", m_ism_setup & 0x08 ? "fclk/2" : "fclk", m_floppy);
+ LOG("%s write start %s %s floppy=%p\n", machine().time().to_string(), m_ism_setup & 0x40 ? "gcr" : "mfm", m_ism_setup & 0x08 ? "fclk/2" : "fclk", m_floppy);
m_flux_write_start = m_last_sync;
m_flux_write_count = 0;
@@ -355,7 +358,7 @@ void swim1_device::ism_write(offs_t offset, u8 data)
m_flux_write_start = 0;
m_ism_current_bit = 0xff;
m_ism_half_cycles_before_change = 0;
- logerror("%s write end\n", machine().time().to_string());
+ LOG("%s write end\n", machine().time().to_string());
}
if((m_ism_mode & 0x18) == 0x08 && ((prev_mode & 0x18) != 0x08)) {
@@ -370,14 +373,14 @@ void swim1_device::ism_write(offs_t offset, u8 data)
m_ism_csm_pair_side = 0;
m_ism_csm_min_count = 0;
- logerror("%s read start %s %s floppy=%p\n", machine().time().to_string(), m_ism_setup & 0x04 ? "gcr" : "mfm", m_ism_setup & 0x08 ? "fclk/2" : "fclk", m_floppy);
+ LOG("%s read start %s %s floppy=%p\n", machine().time().to_string(), m_ism_setup & 0x04 ? "gcr" : "mfm", m_ism_setup & 0x08 ? "fclk/2" : "fclk", m_floppy);
} else if((prev_mode & 0x18) == 0x08 && (m_ism_mode & 0x18) != 0x08) {
// Exiting read mode
flush_write();
m_ism_current_bit = 0xff;
m_ism_half_cycles_before_change = 0;
- logerror("%s read end\n", machine().time().to_string());
+ LOG("%s read end\n", machine().time().to_string());
}
}
@@ -522,7 +525,7 @@ void swim1_device::iwm_control(int offset, u8 data)
if(s == 0xc0 && m_iwm_active)
slot = "write load / write data";
- logerror("%s control %c%c %c%c %c%c%c%c (%s) [%s, %s] whd=%02x data=%02x\n",
+ LOG("%s control %c%c %c%c %c%c%c%c (%s) [%s, %s] whd=%02x data=%02x\n",
machine().time().to_string(),
m_iwm_control & 0x80 ? '1' : '0',
m_iwm_control & 0x40 ? '1' : '0',
@@ -554,7 +557,7 @@ void swim1_device::iwm_control(int offset, u8 data)
case 3:
if(data & 0x40) {
m_ism_mode |= 0x40;
- logerror("switch to ism\n");
+ LOG("switch to ism\n");
u8 ism_devsel = m_ism_mode & 0x80 ? (m_ism_mode >> 1) & 3 : 0;
if(ism_devsel != m_iwm_devsel)
m_devsel_cb(ism_devsel);
@@ -565,7 +568,7 @@ void swim1_device::iwm_control(int offset, u8 data)
if(m_iwm_to_ism_counter != prev_iwm_to_ism_counter+1)
m_iwm_to_ism_counter = 0;
else
- logerror("iwm counter = %d\n", m_iwm_to_ism_counter);
+ LOG("iwm counter = %d\n", m_iwm_to_ism_counter);
if((m_iwm_control & 0xc0) == 0xc0 && (offset & 1))
{
@@ -648,7 +651,7 @@ void swim1_device::iwm_mode_w(u8 data)
{
m_iwm_mode = data;
m_iwm_status = (m_iwm_status & 0xe0) | (data & 0x1f);
- logerror("mode %02x%s%s%s%s%s%s%s\n", m_iwm_mode,
+ LOG("mode %02x%s%s%s%s%s%s%s\n", m_iwm_mode,
m_iwm_mode & 0x80 ? " b7" : "",
m_iwm_mode & 0x40 ? " mz-reset" : "",
m_iwm_mode & 0x20 ? " test" : " normal",
@@ -806,7 +809,7 @@ void swim1_device::iwm_sync()
case SW_WINDOW_LOAD:
if(m_iwm_whd & 0x80) {
- logerror("underrun\n");
+ LOG("underrun\n");
flush_write();
m_flux_write_start = 0;
m_iwm_whd &= ~0x40;
@@ -916,7 +919,7 @@ void swim1_device::ism_sync()
m_ism_current_bit = 0xff;
m_ism_half_cycles_before_change = 0;
m_ism_mode &= ~8;
- logerror("write end on underrun\n");
+ LOG("write end on underrun\n");
break;
}
if(r & M_CRC)