mirror of
https://github.com/holub/mame
synced 2025-04-20 15:32:45 +03:00
swim3: Fix rddata, a little more contents
sonora: Allow reading the control register macpdm: Add floppy softlists
This commit is contained in:
parent
a3bee9faf7
commit
8a24c7dd71
@ -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;
|
||||
|
||||
|
@ -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(); }
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user