diff options
Diffstat (limited to 'src/mame/drivers/ts816.cpp')
-rw-r--r-- | src/mame/drivers/ts816.cpp | 82 |
1 files changed, 42 insertions, 40 deletions
diff --git a/src/mame/drivers/ts816.cpp b/src/mame/drivers/ts816.cpp index 4de66497282..88c9298501a 100644 --- a/src/mame/drivers/ts816.cpp +++ b/src/mame/drivers/ts816.cpp @@ -58,47 +58,49 @@ private: required_device<generic_terminal_device> m_terminal; }; -ADDRESS_MAP_START(ts816_state::ts816_mem) - ADDRESS_MAP_UNMAP_HIGH - AM_RANGE(0x0000, 0x3fff ) AM_READ_BANK("bankr0") AM_WRITE_BANK("bankw0") - AM_RANGE(0x4000, 0xdfff ) AM_RAMBANK("bank1") - AM_RANGE(0xe000, 0xffff ) AM_RAMBANK("bank2") -ADDRESS_MAP_END - -ADDRESS_MAP_START(ts816_state::ts816_io) - ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00, 0x00) // Tape status byte 1 - AM_RANGE(0x01, 0x01) // Tape status byte 2 and diagnostics mode - AM_RANGE(0x02, 0x02) // Hard Disk status - AM_RANGE(0x03, 0x03) // Hard Disk output latch - AM_RANGE(0x04, 0x04) // Tape output latch byte 2 - AM_RANGE(0x05, 0x05) // Tape output latch byte 1 - AM_RANGE(0x07, 0x07) // Indicator load (LED) - AM_RANGE(0x10, 0x13) AM_DEVREADWRITE("sio1", z80sio_device, cd_ba_r, cd_ba_w) // SIO 1 for user 1 & 2 - AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE("sio5", z80sio_device, cd_ba_r, cd_ba_w) // SIO 5 for user 9 & 10 - AM_RANGE(0x20, 0x23) AM_DEVREADWRITE("sio2", z80sio_device, cd_ba_r, cd_ba_w) // SIO 2 for user 3 & 4 - AM_RANGE(0x28, 0x2b) AM_DEVREADWRITE("sio6", z80sio_device, cd_ba_r, cd_ba_w) // SIO 6 for user 11 & 12 - AM_RANGE(0x30, 0x33) AM_DEVREADWRITE("sio3", z80sio_device, cd_ba_r, cd_ba_w) // SIO 3 for user 5 & 6 - AM_RANGE(0x38, 0x3b) AM_DEVREADWRITE("sio7", z80sio_device, cd_ba_r, cd_ba_w) // SIO 7 for user 13 & 14 - AM_RANGE(0x40, 0x43) AM_DEVREADWRITE("sio4", z80sio_device, cd_ba_r, cd_ba_w) // SIO 4 for user 7 & 8 - AM_RANGE(0x48, 0x4b) AM_DEVREADWRITE("sio8", z80sio_device, cd_ba_r, cd_ba_w) // SIO 8 for user 15 & 16 +void ts816_state::ts816_mem(address_map &map) +{ + map.unmap_value_high(); + map(0x0000, 0x3fff).bankr("bankr0").bankw("bankw0"); + map(0x4000, 0xdfff).bankrw("bank1"); + map(0xe000, 0xffff).bankrw("bank2"); +} + +void ts816_state::ts816_io(address_map &map) +{ + map.global_mask(0xff); + map(0x00, 0x00); // Tape status byte 1 + map(0x01, 0x01); // Tape status byte 2 and diagnostics mode + map(0x02, 0x02); // Hard Disk status + map(0x03, 0x03); // Hard Disk output latch + map(0x04, 0x04); // Tape output latch byte 2 + map(0x05, 0x05); // Tape output latch byte 1 + map(0x07, 0x07); // Indicator load (LED) + map(0x10, 0x13).rw("sio1", FUNC(z80sio_device::cd_ba_r), FUNC(z80sio_device::cd_ba_w)); // SIO 1 for user 1 & 2 + map(0x18, 0x1b).rw("sio5", FUNC(z80sio_device::cd_ba_r), FUNC(z80sio_device::cd_ba_w)); // SIO 5 for user 9 & 10 + map(0x20, 0x23).rw("sio2", FUNC(z80sio_device::cd_ba_r), FUNC(z80sio_device::cd_ba_w)); // SIO 2 for user 3 & 4 + map(0x28, 0x2b).rw("sio6", FUNC(z80sio_device::cd_ba_r), FUNC(z80sio_device::cd_ba_w)); // SIO 6 for user 11 & 12 + map(0x30, 0x33).rw("sio3", FUNC(z80sio_device::cd_ba_r), FUNC(z80sio_device::cd_ba_w)); // SIO 3 for user 5 & 6 + map(0x38, 0x3b).rw("sio7", FUNC(z80sio_device::cd_ba_r), FUNC(z80sio_device::cd_ba_w)); // SIO 7 for user 13 & 14 + map(0x40, 0x43).rw("sio4", FUNC(z80sio_device::cd_ba_r), FUNC(z80sio_device::cd_ba_w)); // SIO 4 for user 7 & 8 + map(0x48, 0x4b).rw("sio8", FUNC(z80sio_device::cd_ba_r), FUNC(z80sio_device::cd_ba_w)); // SIO 8 for user 15 & 16 //AM_RANGE(0x50, 0x53) // SIO 0 for RS232 1 and part of tape interface - AM_RANGE(0x50, 0x50) AM_READ(keyin_r) AM_DEVWRITE("terminal", generic_terminal_device, write) - AM_RANGE(0x52, 0x52) AM_READ(status_r) - AM_RANGE(0x58, 0x5b) AM_DEVREADWRITE("sio9", z80sio_device, cd_ba_r, cd_ba_w) // SIO 9 for RS232 2 & 3 - AM_RANGE(0x60, 0x60) AM_READ_PORT("DSW") - AM_RANGE(0x68, 0x68) AM_WRITE(port68_w) // set 2nd bank latch - AM_RANGE(0x70, 0x78) AM_WRITE(port78_w) // reset 2nd bank latch (manual can't decide between 70 and 78, so we take both) - AM_RANGE(0x80, 0x83) AM_DEVREADWRITE("ctc1", z80ctc_device, read, write) // CTC 1 (ch 0 baud A) - AM_RANGE(0x90, 0x93) AM_DEVREADWRITE("dma", z80dma_device, read, write) // DMA - AM_RANGE(0xA0, 0xA0) // WDC status / command - AM_RANGE(0xA1, 0xA1) // WDC data - AM_RANGE(0xB0, 0xB0) AM_NOP // undocumented, written to at @0707 and @0710 - AM_RANGE(0xC0, 0xC3) AM_DEVREADWRITE("ctc2", z80ctc_device, read, write) // CTC 2 (ch 0 baud B, ch 1 baud C) - AM_RANGE(0xD0, 0xD3) AM_DEVREADWRITE("pio", z80pio_device, read, write) - AM_RANGE(0xE0, 0xE0) AM_WRITE(porte0_w) // set ENDRAM memory banking - AM_RANGE(0xF0, 0xF0) AM_WRITE(portf0_w) // reset ENDRAM memory banking -ADDRESS_MAP_END + map(0x50, 0x50).r(this, FUNC(ts816_state::keyin_r)).w(m_terminal, FUNC(generic_terminal_device::write)); + map(0x52, 0x52).r(this, FUNC(ts816_state::status_r)); + map(0x58, 0x5b).rw("sio9", FUNC(z80sio_device::cd_ba_r), FUNC(z80sio_device::cd_ba_w)); // SIO 9 for RS232 2 & 3 + map(0x60, 0x60).portr("DSW"); + map(0x68, 0x68).w(this, FUNC(ts816_state::port68_w)); // set 2nd bank latch + map(0x70, 0x78).w(this, FUNC(ts816_state::port78_w)); // reset 2nd bank latch (manual can't decide between 70 and 78, so we take both) + map(0x80, 0x83).rw("ctc1", FUNC(z80ctc_device::read), FUNC(z80ctc_device::write)); // CTC 1 (ch 0 baud A) + map(0x90, 0x93).rw("dma", FUNC(z80dma_device::read), FUNC(z80dma_device::write)); // DMA + map(0xA0, 0xA0); // WDC status / command + map(0xA1, 0xA1); // WDC data + map(0xB0, 0xB0).noprw(); // undocumented, written to at @0707 and @0710 + map(0xC0, 0xC3).rw("ctc2", FUNC(z80ctc_device::read), FUNC(z80ctc_device::write)); // CTC 2 (ch 0 baud B, ch 1 baud C) + map(0xD0, 0xD3).rw("pio", FUNC(z80pio_device::read), FUNC(z80pio_device::write)); + map(0xE0, 0xE0).w(this, FUNC(ts816_state::porte0_w)); // set ENDRAM memory banking + map(0xF0, 0xF0).w(this, FUNC(ts816_state::portf0_w)); // reset ENDRAM memory banking +} /* Input ports */ |