diff options
Diffstat (limited to 'src/mame/sinclair/specnext_dma.cpp')
| -rw-r--r-- | src/mame/sinclair/specnext_dma.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/mame/sinclair/specnext_dma.cpp b/src/mame/sinclair/specnext_dma.cpp index 7fbcae4f9cf..5266c070e19 100644 --- a/src/mame/sinclair/specnext_dma.cpp +++ b/src/mame/sinclair/specnext_dma.cpp @@ -20,10 +20,13 @@ DEFINE_DEVICE_TYPE(SPECNEXT_DMA, specnext_dma_device, "specnext_dma", "Spectrum // TODO: this stuff is copy/pasted from machine/z80dma.cpp - ideally it wouldn't need to be +#define GET_REGNUM(_r) (&(_r) - &(WR0)) #define WR0 REG(0, 0) #define WR1 REG(1, 0) #define WR2 REG(2, 0) +#define ZXN_PRESCALER REG(2,2) + #define PORTA_INC (WR1 & 0x10) #define PORTB_INC (WR2 & 0x10) #define PORTA_FIXED (((WR1 >> 4) & 0x02) == 0x02) @@ -39,10 +42,9 @@ specnext_dma_device::specnext_dma_device(const machine_config &mconfig, const ch void specnext_dma_device::write(u8 data) { - z80dma_device::write(data); - if (num_follow() == 0) { + z80dma_device::write(data); if ((data & 0x83) == 0x83) // WR6 { switch (data) @@ -55,6 +57,16 @@ void specnext_dma_device::write(u8 data) } } } + else + { + int nreg = m_regs_follow[m_cur_follow]; + z80dma_device::write(data); + if(nreg == REGNUM(2, 1)) + { + if (data & 0x20) + m_regs_follow[m_num_follow++] = GET_REGNUM(ZXN_PRESCALER); + } + } } void specnext_dma_device::do_write() |
