summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2021-03-24 23:07:28 +0100
committer Olivier Galibert <galibert@pobox.com>2021-03-24 23:09:01 +0100
commit8a24c7dd711c8b98d58326135c551f455ddd99e2 (patch)
treebf73676e4d2d70e7836db2a9f2dc935a6b5a3f40
parenta3bee9faf709407cf69257a83cf44dd8244e0009 (diff)
swim3: Fix rddata, a little more contents
sonora: Allow reading the control register macpdm: Add floppy softlists
-rw-r--r--src/devices/machine/mv_sonora.cpp13
-rw-r--r--src/devices/machine/mv_sonora.h1
-rw-r--r--src/devices/machine/swim3.cpp55
-rw-r--r--src/devices/machine/swim3.h4
-rw-r--r--src/mame/drivers/macpdm.cpp4
5 files changed, 62 insertions, 15 deletions
diff --git a/src/devices/machine/mv_sonora.cpp b/src/devices/machine/mv_sonora.cpp
index 2e6e571b238..1d48cd24cad 100644
--- a/src/devices/machine/mv_sonora.cpp
+++ b/src/devices/machine/mv_sonora.cpp
@@ -222,6 +222,18 @@ void mac_video_sonora_device::vctrl_w(offs_t offset, uint8_t data)
}
}
+uint8_t mac_video_sonora_device::dac_r(offs_t offset)
+{
+ switch(offset) {
+ case 2:
+ return m_pal_control;
+
+ default:
+ logerror("dac_r %x\n", offset);
+ return 0;
+ }
+}
+
void mac_video_sonora_device::dac_w(offs_t offset, uint8_t data)
{
switch(offset) {
@@ -244,6 +256,7 @@ void mac_video_sonora_device::dac_w(offs_t offset, uint8_t data)
break;
case 2:
+ logerror("control = %02x\n", data);
m_pal_control = data;
break;
diff --git a/src/devices/machine/mv_sonora.h b/src/devices/machine/mv_sonora.h
index 1128fb24bc3..a9b17b969a2 100644
--- a/src/devices/machine/mv_sonora.h
+++ b/src/devices/machine/mv_sonora.h
@@ -22,6 +22,7 @@ public:
uint8_t vctrl_r(offs_t offset);
void vctrl_w(offs_t offset, uint8_t data);
+ uint8_t dac_r(offs_t offset);
void dac_w(offs_t offset, uint8_t data);
DECLARE_READ_LINE_MEMBER(vblank) const { return m_screen->vblank(); }
diff --git a/src/devices/machine/swim3.cpp b/src/devices/machine/swim3.cpp
index d57455e575e..c2f43abac33 100644
--- a/src/devices/machine/swim3.cpp
+++ b/src/devices/machine/swim3.cpp
@@ -21,18 +21,20 @@ void swim3_device::device_start()
applefdintf_device::device_start();
save_item(NAME(m_mode));
save_item(NAME(m_setup));
- save_item(NAME(m_param_idx));
save_item(NAME(m_param));
+ save_item(NAME(m_irq));
+ save_item(NAME(m_imask));
}
void swim3_device::device_reset()
{
applefdintf_device::device_reset();
- m_mode = 0x40;
+ m_mode = 0x00;
m_setup = 0x00;
- m_param_idx = 0;
- memset(m_param, 0, sizeof(m_param));
+ m_param = 0x77;
m_floppy = nullptr;
+ m_irq = 0;
+ m_imask = 0;
m_devsel_cb(0);
m_sel35_cb(true);
@@ -80,7 +82,11 @@ u8 swim3_device::read(offs_t offset)
"data", "timer", "error", "param", "phases", "setup", "?6", "handshake",
"interrupt", "step", "track", "sector", "gap", "sect1", "xfer", "imask"
};
+
switch(offset) {
+ case 0x3: // param
+ return m_param;
+
case 0x4: // phases
return m_phases & 0xf;
@@ -93,11 +99,20 @@ u8 swim3_device::read(offs_t offset)
case 0x7: { // handshake
u8 h = 0;
if(!m_floppy || m_floppy->wpt_r())
- h |= 0x08;
+ h |= 0x0c;
logerror("hand %02x\n", h);
return h;
};
+ case 0x8: {
+ u8 res = m_irq;
+ m_irq = 0;
+ return res;
+ }
+
+ case 0xf:
+ return m_imask;
+
default:
logerror("read %s\n", names[offset & 15]);
break;
@@ -114,14 +129,18 @@ void swim3_device::write(offs_t offset, u8 data)
"?8", "step", "track", "sector", "gap", "sect1", "xfer", "imask"
};
switch(offset) {
- case 4: { // phases
+ case 0x3: // param
+ m_param = data;
+ logerror("precompensation late=%x early=%x\n", m_param >> 4, m_param & 0xf);
+ break;
+
+ case 0x4: { // phases
m_phases = data | 0xf0;
- logerror("phases %x\n", data);
update_phases();
break;
}
- case 5: // setup
+ case 0x5: // setup
m_setup = data;
m_sel35_cb((m_setup >> 1) & 1);
logerror("setup write=%s %s nogcrconv=%s %s %s%s %s\n",
@@ -134,18 +153,30 @@ void swim3_device::write(offs_t offset, u8 data)
m_setup & 0x01 ? "wrinvert" : "wrdirect");
break;
- case 6: // mode clear
+ case 0x6: // mode clear
m_mode &= ~data;
- m_mode |= 0x40;
- m_param_idx = 0;
show_mode();
break;
- case 7: // mode set
+ case 0x7: // mode set
m_mode |= data;
show_mode();
break;
+ case 0x9: // step
+ m_step = data;
+ break;
+
+ case 0xf:
+ m_imask = data;
+ logerror("imask%s%s%s%s%s\n",
+ m_imask & 0x10 ? " sense" : " -",
+ m_imask & 0x08 ? " sector" : " -",
+ m_imask & 0x04 ? " id" : " -",
+ m_imask & 0x02 ? " step" : " -",
+ m_imask & 0x01 ? " timer" : " -");
+ break;
+
default:
logerror("write %s, %02x\n", names[offset], data);
break;
diff --git a/src/devices/machine/swim3.h b/src/devices/machine/swim3.h
index d9eec0e2bf3..3315c5d9887 100644
--- a/src/devices/machine/swim3.h
+++ b/src/devices/machine/swim3.h
@@ -39,8 +39,8 @@ protected:
private:
floppy_image_device *m_floppy;
- u8 m_param[4];
- u8 m_mode, m_setup, m_param_idx;
+ u8 m_param;
+ u8 m_mode, m_setup, m_irq, m_imask, m_step;
void show_mode() const;
};
diff --git a/src/mame/drivers/macpdm.cpp b/src/mame/drivers/macpdm.cpp
index 37b9e49a275..deb2da9375a 100644
--- a/src/mame/drivers/macpdm.cpp
+++ b/src/mame/drivers/macpdm.cpp
@@ -951,7 +951,7 @@ void macpdm_state::pdm_map(address_map &map)
map(0x50f14000, 0x50f1401f).rw(m_awacs, FUNC(awacs_device::read), FUNC(awacs_device::write));
map(0x50f16000, 0x50f16000).rw(FUNC(macpdm_state::fdc_r), FUNC(macpdm_state::fdc_w)).select(0x1e00);
- map(0x50f24000, 0x50f24003).w(m_video, FUNC(mac_video_sonora_device::dac_w));
+ map(0x50f24000, 0x50f24003).rw(m_video, FUNC(mac_video_sonora_device::dac_r), FUNC(mac_video_sonora_device::dac_w));
map(0x50f26002, 0x50f26002).rw(FUNC(macpdm_state::via2_sifr_r), FUNC(macpdm_state::via2_sifr_w)).mirror(0x1fe0);
map(0x50f26003, 0x50f26003).r(FUNC(macpdm_state::via2_ifr_r)).mirror(0x1fe0);
@@ -1028,6 +1028,8 @@ void macpdm_state::macpdm(machine_config &config)
ctrl.irq_handler_cb().set(*this, FUNC(macpdm_state::scsi_irq));
});
+ SOFTWARE_LIST(config, "flop35_list").set_original("mac_flop");
+ SOFTWARE_LIST(config, "flop35hd_list").set_original("mac_hdflop");
SOFTWARE_LIST(config, "hdd_list").set_original("mac_hdd");
SWIM3(config, m_fdc, IO_CLOCK/2);