summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/pcd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/pcd.cpp')
-rw-r--r--src/mame/drivers/pcd.cpp32
1 files changed, 29 insertions, 3 deletions
diff --git a/src/mame/drivers/pcd.cpp b/src/mame/drivers/pcd.cpp
index dce3bd79b43..65c8328b54a 100644
--- a/src/mame/drivers/pcd.cpp
+++ b/src/mame/drivers/pcd.cpp
@@ -50,6 +50,7 @@ public:
, m_scsi_data_out(*this, "scsi_data_out")
, m_scsi_data_in(*this, "scsi_data_in")
, m_ram(*this, "ram")
+ , m_req_hack(nullptr)
{ }
void pcx(machine_config &config);
@@ -62,6 +63,8 @@ private:
DECLARE_READ8_MEMBER( nmi_io_r );
DECLARE_WRITE8_MEMBER( nmi_io_w );
+ DECLARE_READ8_MEMBER( rtc_r );
+ DECLARE_WRITE8_MEMBER( rtc_w );
DECLARE_READ8_MEMBER( stat_r );
DECLARE_WRITE8_MEMBER( stat_w );
DECLARE_READ8_MEMBER( led_r );
@@ -90,6 +93,7 @@ private:
// driver_device overrides
virtual void machine_start() override;
virtual void machine_reset() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
required_device<i80186_cpu_device> m_maincpu;
required_device<pic8259_device> m_pic1;
@@ -104,6 +108,7 @@ private:
required_device<ram_device> m_ram;
uint8_t m_stat, m_led;
int m_msg, m_bsy, m_io, m_cd, m_req, m_rst;
+ emu_timer *m_req_hack;
uint16_t m_dskctl;
struct {
uint16_t ctl;
@@ -120,8 +125,16 @@ private:
// MACHINE EMULATION
//**************************************************************************
+void pcd_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+{
+ // TODO: remove this hack
+ if(m_req)
+ m_maincpu->drq0_w(1);
+}
+
void pcd_state::machine_start()
{
+ m_req_hack = timer_alloc();
save_item(NAME(m_mmu.ctl));
save_item(NAME(m_mmu.regs));
}
@@ -176,6 +189,18 @@ WRITE8_MEMBER( pcd_state::nmi_io_w )
m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero);
}
+READ8_MEMBER( pcd_state::rtc_r )
+{
+ m_rtc->write(space, 0, offset);
+ return m_rtc->read(space, 1);
+}
+
+WRITE8_MEMBER( pcd_state::rtc_w )
+{
+ m_rtc->write(space, 0, offset);
+ m_rtc->write(space, 1, data);
+}
+
READ8_MEMBER( pcd_state::stat_r )
{
return m_stat;
@@ -352,6 +377,7 @@ WRITE_LINE_MEMBER(pcd_state::write_scsi_req)
if(!m_cd)
{
m_maincpu->drq0_w(1);
+ m_req_hack->adjust(attotime::from_msec(10)); // poke the dmac
}
else if(m_msg)
{
@@ -361,6 +387,8 @@ WRITE_LINE_MEMBER(pcd_state::write_scsi_req)
}
else
{
+ if(m_req_hack) // this might be called before machine_start
+ m_req_hack->adjust(attotime::never);
m_scsi->write_ack(0);
}
check_scsi_irq();
@@ -429,7 +457,7 @@ void pcd_state::pcd_io(address_map &map)
map(0xf820, 0xf821).rw(m_pic2, FUNC(pic8259_device::read), FUNC(pic8259_device::write));
map(0xf840, 0xf840).rw(FUNC(pcd_state::stat_r), FUNC(pcd_state::stat_w));
map(0xf841, 0xf841).rw(FUNC(pcd_state::led_r), FUNC(pcd_state::led_w));
- map(0xf880, 0xf8bf).rw(m_rtc, FUNC(mc146818_device::read_direct), FUNC(mc146818_device::write_direct));
+ map(0xf880, 0xf8bf).rw(FUNC(pcd_state::rtc_r), FUNC(pcd_state::rtc_w));
map(0xf900, 0xf903).rw(m_fdc, FUNC(wd2793_device::read), FUNC(wd2793_device::write));
map(0xf904, 0xf905).rw(FUNC(pcd_state::dskctl_r), FUNC(pcd_state::dskctl_w));
map(0xf940, 0xf943).rw(FUNC(pcd_state::scsi_r), FUNC(pcd_state::scsi_w));
@@ -567,8 +595,6 @@ void pcd_state::pcx(machine_config &config)
subdevice<pcd_keyboard_device>("keyboard")->out_tx_handler().set("video", FUNC(pcx_video_device::rx_w));
m_usart[1]->txd_handler().set_nop();
-
- SOFTWARE_LIST(config, "flop_ls").set_original("pcx_flop");
}
//**************************************************************************