Skip to content

Commit 6a95f30

Browse files
committed
i8257: make the driver handle verify cycles since the dmac only does an address strobe
pc8801: treat verify dma transfers as io write
1 parent e424829 commit 6a95f30

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

src/devices/machine/i8257.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ inline void i8257_device::dma_read()
158158
switch (MODE_TRANSFER_MASK)
159159
{
160160
case MODE_TRANSFER_VERIFY:
161+
break;
161162
case MODE_TRANSFER_WRITE:
162163
LOGTFR(" - MODE TRANSFER VERIFY/WRITE");
163164
m_temp = m_in_ior_cb[m_current_channel](offset);
@@ -185,9 +186,7 @@ inline void i8257_device::dma_write()
185186
{
186187
case MODE_TRANSFER_VERIFY: {
187188
LOGTFR(" - MODE TRANSFER VERIFY");
188-
uint8_t v1 = m_in_memr_cb(offset);
189-
if(0 && m_temp != v1)
190-
logerror("verify error %02x vs. %02x\n", m_temp, v1);
189+
m_verify_cb[m_current_channel](offset);
191190
break;
192191
}
193192

@@ -273,6 +272,7 @@ i8257_device::i8257_device(const machine_config &mconfig, const char *tag, devic
273272
, m_out_memw_cb(*this)
274273
, m_in_ior_cb(*this, 0)
275274
, m_out_iow_cb(*this)
275+
, m_verify_cb(*this, 0)
276276
, m_out_dack_cb(*this)
277277
{
278278
}

src/devices/machine/i8257.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class i8257_device : public device_t, public device_execute_interface
5858
template <unsigned Ch> auto in_ior_cb() { return m_in_ior_cb[Ch].bind(); }
5959
template <unsigned Ch> auto out_iow_cb() { return m_out_iow_cb[Ch].bind(); }
6060
template <unsigned Ch> auto out_dack_cb() { return m_out_dack_cb[Ch].bind(); }
61+
template <unsigned Ch> auto verify_cb() { return m_verify_cb[Ch].bind(); }
6162

6263
// This should be set for systems that map the DMAC registers into the memory space rather than as I/O ports (e.g. radio86)
6364
void set_reverse_rw_mode(bool flag) { m_reverse_rw = flag; }
@@ -105,6 +106,7 @@ class i8257_device : public device_t, public device_execute_interface
105106
// channel accessors
106107
devcb_read8::array<4> m_in_ior_cb;
107108
devcb_write8::array<4> m_out_iow_cb;
109+
devcb_read8::array<4> m_verify_cb; // verify sets no rw lines so just pass the address for the driver to handle
108110
devcb_write_line::array<4> m_out_dack_cb;
109111

110112
struct

src/mame/nec/pc8801.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,13 @@ void pc8801_state::dma_mem_w(offs_t offset, u8 data)
289289
m_work_ram[offset & 0xffff] = data;
290290
}
291291

292+
// the pc8801 appears to just to dma memr and iow cycles if verify mode is set
293+
uint8_t pc8801_state::dackv(offs_t offset)
294+
{
295+
m_crtc->dack_w(dma_mem_r(offset));
296+
return 0;
297+
}
298+
292299
uint8_t pc8801_state::alu_r(offs_t offset)
293300
{
294301
uint8_t b, r, g;
@@ -1701,6 +1708,7 @@ void pc8801_state::pc8801(machine_config &config)
17011708
// CH0: 5-inch floppy DMA
17021709
// CH1: 8-inch floppy DMA, SCSI CD-ROM interface (on MA/MC)
17031710
m_dma->out_iow_cb<2>().set(m_crtc, FUNC(upd3301_device::dack_w));
1711+
m_dma->verify_cb<2>().set(FUNC(pc8801_state::dackv));
17041712
// CH3: <autoload only?>
17051713

17061714
TIMER(config, "rtc_timer").configure_periodic(FUNC(pc8801_state::clock_irq_w), attotime::from_hz(600));

src/mame/nec/pc8801.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class pc8801_state : public pc8001_base_state
7575

7676
virtual uint8_t dma_mem_r(offs_t offset) override;
7777
void dma_mem_w(offs_t offset, u8 data);
78+
uint8_t dackv(offs_t offset);
7879

7980
virtual uint8_t dictionary_rom_r(offs_t offset);
8081
virtual bool dictionary_rom_enable();

0 commit comments

Comments
 (0)