diff options
-rw-r--r-- | src/devices/bus/abcbus/abcbus.cpp | 24 | ||||
-rw-r--r-- | src/devices/bus/abcbus/abcbus.h | 7 | ||||
-rw-r--r-- | src/devices/bus/abcbus/lux4105.cpp | 139 | ||||
-rw-r--r-- | src/devices/bus/abcbus/lux4105.h | 2 | ||||
-rw-r--r-- | src/mame/drivers/abc1600.cpp | 55 | ||||
-rw-r--r-- | src/mame/includes/abc1600.h | 13 | ||||
-rw-r--r-- | src/mame/machine/abc1600mac.cpp | 62 | ||||
-rw-r--r-- | src/mame/machine/abc1600mac.h | 18 |
8 files changed, 191 insertions, 129 deletions
diff --git a/src/devices/bus/abcbus/abcbus.cpp b/src/devices/bus/abcbus/abcbus.cpp index 9b24210bd3b..5e0adb49c3f 100644 --- a/src/devices/bus/abcbus/abcbus.cpp +++ b/src/devices/bus/abcbus/abcbus.cpp @@ -52,14 +52,14 @@ abcbus_slot_device::abcbus_slot_device(const machine_config &mconfig, const char m_write_xint4(*this), m_write_xint5(*this), m_card(nullptr), - m_irq(CLEAR_LINE), - m_nmi(CLEAR_LINE), + m_irq(1), + m_nmi(1), m_pren(1), m_trrq(1), - m_xint2(CLEAR_LINE), - m_xint3(CLEAR_LINE), - m_xint4(CLEAR_LINE), - m_xint5(CLEAR_LINE) + m_xint2(1), + m_xint3(1), + m_xint4(1), + m_xint5(1) { } @@ -86,6 +86,18 @@ void abcbus_slot_device::device_start() } +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void abcbus_slot_device::device_reset() +{ + m_write_irq(1); + m_write_pren(1); + m_write_trrq(1); +} + + // slot devices #include "abc890.h" #include "cadmouse.h" diff --git a/src/devices/bus/abcbus/abcbus.h b/src/devices/bus/abcbus/abcbus.h index c25cc8b51f2..e8ce92a2d9b 100644 --- a/src/devices/bus/abcbus/abcbus.h +++ b/src/devices/bus/abcbus/abcbus.h @@ -223,12 +223,12 @@ public: DECLARE_READ_LINE_MEMBER( xint5_r ) { return m_xint5; } // card interface - DECLARE_WRITE_LINE_MEMBER( irq_w ) { m_irq = state; m_write_irq(state); } + DECLARE_WRITE_LINE_MEMBER( irq_w ) { if (m_irq != state) { m_irq = state; m_write_irq(state); } } DECLARE_WRITE_LINE_MEMBER( nmi_w ) { m_nmi = state; m_write_nmi(state); } DECLARE_WRITE_LINE_MEMBER( rdy_w ) { m_write_rdy(state); } DECLARE_WRITE_LINE_MEMBER( resin_w ) { m_write_resin(state); } - DECLARE_WRITE_LINE_MEMBER( pren_w ) { m_pren = state; m_write_pren(state); } - DECLARE_WRITE_LINE_MEMBER( trrq_w ) { m_trrq = state; m_write_trrq(state); } + DECLARE_WRITE_LINE_MEMBER( pren_w ) { if (m_pren != state) { m_pren = state; m_write_pren(state); } } + DECLARE_WRITE_LINE_MEMBER( trrq_w ) { if (m_trrq != state) { m_trrq = state; m_write_trrq(state); } } DECLARE_WRITE_LINE_MEMBER( xint2_w ) { m_xint2 = state; m_write_xint2(state); } DECLARE_WRITE_LINE_MEMBER( xint3_w ) { m_xint3 = state; m_write_xint3(state); } DECLARE_WRITE_LINE_MEMBER( xint4_w ) { m_xint4 = state; m_write_xint4(state); } @@ -237,6 +237,7 @@ public: protected: // device-level overrides virtual void device_start() override; + virtual void device_reset() override; devcb_write_line m_write_irq; devcb_write_line m_write_nmi; diff --git a/src/devices/bus/abcbus/lux4105.cpp b/src/devices/bus/abcbus/lux4105.cpp index a90dc4d630d..1dd961e08e9 100644 --- a/src/devices/bus/abcbus/lux4105.cpp +++ b/src/devices/bus/abcbus/lux4105.cpp @@ -37,21 +37,6 @@ Notes: */ -/* - - TODO - - - sector length error in read check after format (breakpoint @ 97ba) - - 0C xx INITIALIZE DRIVE CHARACTERISTICS - 01 00 00 00 00 02 RECALIBRATE - 04 00 00 00 05 02 FORMAT UNIT - 08 00 00 00 11 02 READ - ...transfer 8704 (17*512) bytes... - error - -*/ - #include "emu.h" #include "lux4105.h" #include "bus/scsi/scsihd.h" @@ -63,6 +48,8 @@ Notes: // MACROS / CONSTANTS //************************************************************************** +#define LOG 0 + #define SASIBUS_TAG "sasi" #define DMA_O1 BIT(m_dma, 0) #define DMA_O2 BIT(m_dma, 1) @@ -156,7 +143,10 @@ luxor_4105_device::luxor_4105_device(const machine_config &mconfig, const char * m_1e(*this, "1E"), m_5e(*this, "5E"), m_cs(false), - m_dma(0) + m_dma(0), + m_pren(1), + m_prac(1), + m_trrq(1) { } @@ -174,6 +164,7 @@ void luxor_4105_device::device_start() save_item(NAME(m_req)); save_item(NAME(m_drq)); save_item(NAME(m_pren)); + save_item(NAME(m_trrq)); } @@ -204,24 +195,43 @@ void luxor_4105_device::internal_reset() void luxor_4105_device::update_dma() { - // IRQ + // TRRQ + bool req = m_sasi->req_r() && !m_req; bool cd = m_sasi->cd_r(); + m_trrq = !(req && !cd); + if (DMA_O2) + { + if (m_prac && !m_trrq) + { + // set REQ FF + m_req = 1; + + update_ack(); + + req = m_sasi->req_r() && !m_req; + m_trrq = !(req && !cd); + } + } + m_slot->trrq_w(DMA_O2 ? m_trrq : 1); + + // DRQ bool io = m_sasi->io_r(); - bool req = m_sasi->req_r() && !m_req; m_drq = (!((!cd || !io) && !(!cd && !DMA_O2))) && req; - bool irq = !(DMA_O3 && m_pren) || !(DMA_O1 && m_drq); - m_slot->irq_w(irq); - // TRRQ + // IRQ + bool irq = 1; if (DMA_O2) { - bool trrq = !(!cd && req); - m_slot->trrq_w(trrq); + if (DMA_O1 && m_drq) + { + irq = 0; + } } - else + else if (DMA_O3) { - m_slot->trrq_w(1); + irq = 0; } + m_slot->irq_w(!irq); } @@ -249,6 +259,7 @@ void luxor_4105_device::write_dma_register(uint8_t data) */ m_dma = BIT(data, 5) << 2 | BIT(data, 6) << 1 | BIT(data, 7); + if (LOG) logerror("%s DMA O1 %u O2 %u O3 %u\n", machine().describe_context(), DMA_O1, DMA_O2, DMA_O3); // PREN m_pren = !DMA_O2; @@ -269,6 +280,7 @@ void luxor_4105_device::write_sasi_data(uint8_t data) // clock REQ FF m_req = m_sasi->req_r(); + update_ack(); update_dma(); } @@ -291,6 +303,8 @@ WRITE_LINE_MEMBER( luxor_4105_device::write_sasi_cd ) WRITE_LINE_MEMBER( luxor_4105_device::write_sasi_req ) { + if (LOG) logerror("%s REQ %u\n", machine().describe_context(), state); + if (!state) { // reset REQ FF @@ -390,19 +404,25 @@ uint8_t luxor_4105_device::abcbus_inp() { uint8_t data = 0xff; - if (m_sasi->bsy_r()) - { - data = m_sasi->read(); - } - else + if (m_cs) { - data = m_1e->read(); - } + if (m_sasi->bsy_r()) + { + data = m_sasi->read(); + } + else + { + data = m_1e->read(); + } + + // clock REQ FF + m_req = m_sasi->req_r(); - // clock REQ FF - m_req = m_sasi->req_r(); - update_ack(); - update_dma(); + update_ack(); + update_dma(); + + if (LOG) logerror("%s INP %02x\n", machine().describe_context(), data); + } return data; } @@ -416,6 +436,8 @@ void luxor_4105_device::abcbus_out(uint8_t data) { if (m_cs) { + if (LOG) logerror("%s OUT %02x\n", machine().describe_context(), data); + write_sasi_data(data); } } @@ -429,6 +451,8 @@ void luxor_4105_device::abcbus_c1(uint8_t data) { if (m_cs) { + if (LOG) logerror("%s SELECT\n", machine().describe_context()); + m_sasi->sel_w(1); } } @@ -442,6 +466,8 @@ void luxor_4105_device::abcbus_c3(uint8_t data) { if (m_cs) { + if (LOG) logerror("%s RESET\n", machine().describe_context()); + internal_reset(); } } @@ -455,6 +481,8 @@ void luxor_4105_device::abcbus_c4(uint8_t data) { if (m_cs) { + if (LOG) logerror("%s DMA %02x\n", machine().describe_context(), data); + write_dma_register(data); } } @@ -468,15 +496,21 @@ uint8_t luxor_4105_device::abcbus_tren() { uint8_t data = 0xff; - if (m_sasi->bsy_r()) + if (DMA_O2) { - data = m_sasi->read(); - } + if (m_sasi->bsy_r()) + { + data = m_sasi->read(); + } - // clock REQ FF - m_req = m_sasi->req_r(); - update_ack(); - update_dma(); + // clock REQ FF + m_req = m_sasi->req_r(); + + update_ack(); + update_dma(); + + if (LOG) logerror("%s TREN R %02x\n", machine().describe_context(), data); + } return data; } @@ -488,7 +522,12 @@ uint8_t luxor_4105_device::abcbus_tren() void luxor_4105_device::abcbus_tren(uint8_t data) { - write_sasi_data(data); + if (DMA_O2) + { + if (LOG) logerror("%s TREN W %02x\n", machine().describe_context(), data); + + write_sasi_data(data); + } } @@ -498,11 +537,9 @@ void luxor_4105_device::abcbus_tren(uint8_t data) void luxor_4105_device::abcbus_prac(int state) { - if ((state && DMA_O2) && !m_slot->trrq_r()) - { - // set REQ FF - m_req = 1; - update_ack(); - update_dma(); - } + if (LOG) logerror("%s PRAC %u\n", machine().describe_context(), state); + + m_prac = state; + + update_dma(); } diff --git a/src/devices/bus/abcbus/lux4105.h b/src/devices/bus/abcbus/lux4105.h index e6e9317ec70..dde20ad3075 100644 --- a/src/devices/bus/abcbus/lux4105.h +++ b/src/devices/bus/abcbus/lux4105.h @@ -77,6 +77,8 @@ private: bool m_req; bool m_drq; bool m_pren; + bool m_prac; + bool m_trrq; }; diff --git a/src/mame/drivers/abc1600.cpp b/src/mame/drivers/abc1600.cpp index 4a5369f606e..90d686a82dd 100644 --- a/src/mame/drivers/abc1600.cpp +++ b/src/mame/drivers/abc1600.cpp @@ -34,24 +34,7 @@ TODO: - - sas/format/format in abcenix tries to access the SASI card using a memory location mapped for task 0, when the process is run as task 1 - - MAC task/page/segment addressing failure? - - MAC page/segment RAM write strobe decoding failure? - - CPU does not enter supervisor mode when needed? - - [:mac] ':3f' (0009E) ff800:4f TASK 0 SEGMENT 15 PAGE 15 MEM 7f800-7ffff 1ff800 - [:mac] ':3f' (0009E) ff801:ff TASK 0 SEGMENT 15 PAGE 15 MEM 7f800-7ffff 1ff800 - [:mac] ':3f' (0009E) ff000:4f TASK 0 SEGMENT 15 PAGE 14 MEM 7f000-7f7ff 1ff000 - [:mac] ':3f' (0009E) ff001:fe TASK 0 SEGMENT 15 PAGE 14 MEM 7f000-7f7ff 1ff000 - [:mac] ':3f' (0009E) fe800:4f TASK 0 SEGMENT 15 PAGE 13 MEM 7e800-7efff 1fe800 - [:mac] ':3f' (0009E) fe801:fd TASK 0 SEGMENT 15 PAGE 13 MEM 7e800-7efff 1fe800 - [:mac] ':3f' (0009E) fe000:4f TASK 0 SEGMENT 15 PAGE 12 MEM 7e000-7e7ff 1fe000 - [:mac] ':3f' (0009E) fe001:fc TASK 0 SEGMENT 15 PAGE 12 MEM 7e000-7e7ff 1fe000 - - [:mac] ':3f' (08A98) MAC 7e4a2:0004a2 (SEGA 02f SEGD 09 PGA 09c PGD 8000 NONX 1 WP 0 TASK 1 FC 1) - should be - [:mac] ':3f' (089A8) MAC 7e4a2:1fe4a2 (SEGA 00f SEGD 0f PGA 0fc PGD 43fc NONX 0 WP 1 TASK 0 FC 5) - + - z80dma.cpp register read must return byte UP counter value (0x200 at end of block, not 0 as it does now) - short/long reset (RSTBUT) - CIO - optimize timers! @@ -890,29 +873,29 @@ void abc1600_state::abc1600(machine_config &config) Z80DMA(config, m_dma0, 64_MHz_XTAL / 16); m_dma0->out_busreq_callback().set(FUNC(abc1600_state::dbrq_w)); m_dma0->out_bao_callback().set(m_dma1, FUNC(z80dma_device::bai_w)); - m_dma0->in_mreq_callback().set(m_mac, FUNC(abc1600_mac_device::dma0_mreq_r)); - m_dma0->out_mreq_callback().set(m_mac, FUNC(abc1600_mac_device::dma0_mreq_w)); - m_dma0->out_ieo_callback().set(m_bus0i, FUNC(abcbus_slot_device::prac_w)); - //m_dma0->out_ieo_callback().set(m_bus0x, FUNC(abcbus_slot_device::prac_w)); - m_dma0->in_iorq_callback().set(FUNC(abc1600_state::dma0_iorq_r)); - m_dma0->out_iorq_callback().set(FUNC(abc1600_state::dma0_iorq_w)); + m_dma0->in_mreq_callback().set(FUNC(abc1600_state::dma0_mreq_r)); + m_dma0->out_mreq_callback().set(FUNC(abc1600_state::dma0_mreq_w)); + m_dma0->out_ieo_callback().set(m_bus0i, FUNC(abcbus_slot_device::prac_w)).exor(1); + //m_dma0->out_ieo_callback().set(m_bus0x, FUNC(abcbus_slot_device::prac_w)).exor(1); + m_dma0->in_iorq_callback().set(m_mac, FUNC(abc1600_mac_device::dma0_iorq_r)); + m_dma0->out_iorq_callback().set(m_mac, FUNC(abc1600_mac_device::dma0_iorq_w)); Z80DMA(config, m_dma1, 64_MHz_XTAL / 16); m_dma1->out_busreq_callback().set(FUNC(abc1600_state::dbrq_w)); m_dma1->out_bao_callback().set(m_dma2, FUNC(z80dma_device::bai_w)); - m_dma1->in_mreq_callback().set(m_mac, FUNC(abc1600_mac_device::dma1_mreq_r)); - m_dma1->out_mreq_callback().set(m_mac, FUNC(abc1600_mac_device::dma1_mreq_w)); - m_dma1->out_ieo_callback().set(m_bus1, FUNC(abcbus_slot_device::prac_w)); - m_dma1->in_iorq_callback().set(FUNC(abc1600_state::dma1_iorq_r)); - m_dma1->out_iorq_callback().set(FUNC(abc1600_state::dma1_iorq_w)); + m_dma1->in_mreq_callback().set(FUNC(abc1600_state::dma1_mreq_r)); + m_dma1->out_mreq_callback().set(FUNC(abc1600_state::dma1_mreq_w)); + m_dma1->out_ieo_callback().set(m_bus1, FUNC(abcbus_slot_device::prac_w)).exor(1); + m_dma1->in_iorq_callback().set(m_mac, FUNC(abc1600_mac_device::dma1_iorq_r)); + m_dma1->out_iorq_callback().set(m_mac, FUNC(abc1600_mac_device::dma1_iorq_w)); Z80DMA(config, m_dma2, 64_MHz_XTAL / 16); m_dma2->out_busreq_callback().set(FUNC(abc1600_state::dbrq_w)); - m_dma2->in_mreq_callback().set(m_mac, FUNC(abc1600_mac_device::dma2_mreq_r)); - m_dma2->out_mreq_callback().set(m_mac, FUNC(abc1600_mac_device::dma2_mreq_w)); - m_dma2->out_ieo_callback().set(m_bus2, FUNC(abcbus_slot_device::prac_w)); - m_dma2->in_iorq_callback().set(m_bus2, FUNC(abcbus_slot_device::read_tren)); - m_dma2->out_iorq_callback().set(m_bus2, FUNC(abcbus_slot_device::write_tren)); + m_dma2->in_mreq_callback().set(FUNC(abc1600_state::dma2_mreq_r)); + m_dma2->out_mreq_callback().set(FUNC(abc1600_state::dma2_mreq_w)); + m_dma2->out_ieo_callback().set(m_bus2, FUNC(abcbus_slot_device::prac_w)).exor(1); + m_dma2->in_iorq_callback().set(m_mac, FUNC(abc1600_mac_device::dma2_iorq_r)); + m_dma2->out_iorq_callback().set(m_mac, FUNC(abc1600_mac_device::dma2_iorq_w)); Z80DART(config, m_dart, 64_MHz_XTAL / 16); m_dart->out_int_callback().set(FUNC(abc1600_state::dart_irq_w)); @@ -996,7 +979,7 @@ void abc1600_state::abc1600(machine_config &config) ABCBUS_SLOT(config, m_bus2, 64_MHz_XTAL / 16, abc1600bus_cards, "4105"); m_bus2->irq_callback().set(m_cio, FUNC(z8536_device::pa0_w)); - m_bus2->pren_callback().set(m_dma2, FUNC(z80dma_device::iei_w)); + m_bus2->pren_callback().set(m_dma2, FUNC(z80dma_device::iei_w)).exor(1); m_bus2->trrq_callback().set(m_dma2, FUNC(z80dma_device::rdy_w)); // internal ram @@ -1032,4 +1015,4 @@ ROM_END //************************************************************************** // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS -COMP( 1985, abc1600, 0, 0, abc1600, abc1600, abc1600_state, empty_init, "Luxor", "ABC 1600", MACHINE_NOT_WORKING ) +COMP( 1985, abc1600, 0, 0, abc1600, abc1600, abc1600_state, empty_init, "Luxor", "ABC 1600", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/includes/abc1600.h b/src/mame/includes/abc1600.h index b6ecf970132..9422d715d62 100644 --- a/src/mame/includes/abc1600.h +++ b/src/mame/includes/abc1600.h @@ -121,10 +121,15 @@ public: void spec_contr_reg_w(uint8_t data); void dbrq_w(int state); - uint8_t dma0_iorq_r(offs_t offset) { return m_sysfs ? m_mac->dma0_iorq_r(offset) : (m_bus0i->read_tren() & m_bus0x->read_tren()); } - void dma0_iorq_w(offs_t offset, uint8_t data) { if (m_sysfs) m_mac->dma0_iorq_w(offset, data); else { m_bus0i->write_tren(data); m_bus0x->write_tren(data); }; } - uint8_t dma1_iorq_r(offs_t offset) { return m_sysscc ? m_mac->dma1_iorq_r(offset) : m_bus1->read_tren(); } - void dma1_iorq_w(offs_t offset, uint8_t data) { if (m_sysscc) m_mac->dma1_iorq_w(offset, data); else m_bus1->write_tren(data); } + + uint8_t dma0_mreq_r(offs_t offset) { return m_mac->dma0_mreq_r(offset, m_bus0i->read_tren() & m_bus0x->read_tren()); } + void dma0_mreq_w(offs_t offset, uint8_t data) { m_mac->dma0_mreq_w(offset, data); m_bus0i->write_tren(data); m_bus0x->write_tren(data); } + + uint8_t dma1_mreq_r(offs_t offset) { return m_mac->dma1_mreq_r(offset, m_bus1->read_tren()); } + void dma1_mreq_w(offs_t offset, uint8_t data) { m_mac->dma1_mreq_w(offset, data); m_bus1->write_tren(data); } + + uint8_t dma2_mreq_r(offs_t offset) { return m_mac->dma2_mreq_r(offset, m_bus2->read_tren()); } + void dma2_mreq_w(offs_t offset, uint8_t data) { m_mac->dma2_mreq_w(offset, data); m_bus2->write_tren(data); } uint8_t cio_pa_r(); uint8_t cio_pb_r(); diff --git a/src/mame/machine/abc1600mac.cpp b/src/mame/machine/abc1600mac.cpp index 7273e27bb47..98c1c03bd49 100644 --- a/src/mame/machine/abc1600mac.cpp +++ b/src/mame/machine/abc1600mac.cpp @@ -128,8 +128,8 @@ void abc1600_mac_device::device_start() save_item(NAME(m_cause)); // HACK fill segment RAM or abcenix won't boot - memset(m_segment_ram, 0xcd, 0x200); - memset(m_page_ram, 0xcd, 0x800); + memset(m_segment_ram, 0xff, 0x200); + memset(m_page_ram, 0xff, 0x800); } @@ -227,7 +227,8 @@ uint8_t abc1600_mac_device::read(offs_t offset) { if (nonx) { - logerror("NONX\n"); + logerror("%s BUS ERROR R %05x:%06x (NONX %u WP %u TASK %u FC %u MAGIC %u)\n", + machine().describe_context(), offset, virtual_offset, nonx, wp, task, fc, m_magic); dump(); m_write_buserr(offset, 1); } @@ -269,13 +270,15 @@ void abc1600_mac_device::write(offs_t offset, uint8_t data) { if (nonx) { - logerror("NONX\n"); + logerror("%s BUS ERROR W %05x:%06x (NONX %u WP %u TASK %u FC %u MAGIC %u)\n", + machine().describe_context(), offset, virtual_offset, nonx, wp, task, fc, m_magic); dump(); m_write_buserr(offset, 0); } if (!wp) { - logerror("WP\n"); + logerror("%s BUS ERROR W %05x:%06x (NONX %u WP %u TASK %u FC %u MAGIC %u)\n", + machine().describe_context(), offset, virtual_offset, nonx, wp, task, fc, m_magic); dump(); m_write_buserr(offset, 0); } @@ -543,7 +546,7 @@ void abc1600_mac_device::page_hi_w(offs_t offset, uint8_t data) // get_dma_address - //------------------------------------------------- -offs_t abc1600_mac_device::get_dma_address(int index, uint16_t offset) +offs_t abc1600_mac_device::get_dma_address(int index, offs_t offset, bool &rw) { // A0 = DMA15, A1 = BA1, A2 = BA2 uint8_t dmamap_addr = index | BIT(offset, 15); @@ -551,6 +554,8 @@ offs_t abc1600_mac_device::get_dma_address(int index, uint16_t offset) m_cause = (dmamap & 0x1f) << 3; + rw = BIT(dmamap, 7); + return ((dmamap & 0x1f) << 16) | offset; } @@ -559,13 +564,22 @@ offs_t abc1600_mac_device::get_dma_address(int index, uint16_t offset) // dma_mreq_r - DMA memory read //------------------------------------------------- -uint8_t abc1600_mac_device::dma_mreq_r(int index, uint16_t offset) +uint8_t abc1600_mac_device::dma_mreq_r(int index, offs_t offset, uint8_t data) { - offs_t virtual_offset = get_dma_address(index, offset); - - if (LOG_DMA) logerror("%s DMA MEM R %04x:%06x\n", machine().describe_context(), offset, virtual_offset); + bool rw; + offs_t virtual_offset = get_dma_address(index, offset, rw); - return space().read_byte(virtual_offset); + if (LOG_DMA) logerror("%s DMRQ R %04x:%06x %c\n", machine().describe_context(), offset, virtual_offset, rw ? 'R' : 'W'); + + if (rw) + { + return space().read_byte(virtual_offset); + } + else + { + space().write_byte(virtual_offset, data); + return data; + } } @@ -573,13 +587,17 @@ uint8_t abc1600_mac_device::dma_mreq_r(int index, uint16_t offset) // dma_mreq_w - DMA memory write //------------------------------------------------- -void abc1600_mac_device::dma_mreq_w(int index, uint16_t offset, uint8_t data) +void abc1600_mac_device::dma_mreq_w(int index, offs_t offset, uint8_t data) { - offs_t virtual_offset = get_dma_address(index, offset); + bool rw; + offs_t virtual_offset = get_dma_address(index, offset, rw); - if (LOG_DMA) logerror("%s DMA MEM W %04x:%06x\n", machine().describe_context(), offset, virtual_offset); + if (LOG_DMA) logerror("%s DMRQ W %04x:%06x %c\n", machine().describe_context(), offset, virtual_offset, rw ? 'R' : 'W'); - space().write_byte(virtual_offset, data); + if (!rw) + { + space().write_byte(virtual_offset, data); + } } @@ -587,11 +605,12 @@ void abc1600_mac_device::dma_mreq_w(int index, uint16_t offset, uint8_t data) // dma_iorq_r - DMA I/O read //------------------------------------------------- -uint8_t abc1600_mac_device::dma_iorq_r(int index, uint16_t offset) +uint8_t abc1600_mac_device::dma_iorq_r(int index, offs_t offset) { - offs_t virtual_offset = 0x1fe000 | get_dma_address(index, offset); + bool rw; + offs_t virtual_offset = 0x1fe000 | get_dma_address(index, offset, rw); - if (LOG_DMA) logerror("%s DMA I/O R %04x:%06x\n", machine().describe_context(), offset, virtual_offset); + if (LOG_DMA) logerror("%s DIORQ R %04x:%06x\n", machine().describe_context(), offset, virtual_offset); return space().read_byte(virtual_offset); } @@ -601,11 +620,12 @@ uint8_t abc1600_mac_device::dma_iorq_r(int index, uint16_t offset) // dma_iorq_w - DMA I/O write //------------------------------------------------- -void abc1600_mac_device::dma_iorq_w(int index, uint16_t offset, uint8_t data) +void abc1600_mac_device::dma_iorq_w(int index, offs_t offset, uint8_t data) { - offs_t virtual_offset = 0x1fe000 | get_dma_address(index, offset); + bool rw; + offs_t virtual_offset = 0x1fe000 | get_dma_address(index, offset, rw); - if (LOG_DMA) logerror("%s DMA I/O W %04x:%06x\n", machine().describe_context(), offset, virtual_offset); + if (LOG_DMA) logerror("%s DIORQ W %04x:%06x\n", machine().describe_context(), offset, virtual_offset); space().write_byte(virtual_offset, data); } diff --git a/src/mame/machine/abc1600mac.h b/src/mame/machine/abc1600mac.h index ad375378c96..a3ca68f5370 100644 --- a/src/mame/machine/abc1600mac.h +++ b/src/mame/machine/abc1600mac.h @@ -51,15 +51,17 @@ public: void page_hi_w(offs_t offset, uint8_t data); void dmamap_w(offs_t offset, uint8_t data); - uint8_t dma0_mreq_r(offs_t offset) { return dma_mreq_r(DMAMAP_R0_LO, offset); } + uint8_t dma0_mreq_r(offs_t offset, uint8_t data) { return dma_mreq_r(DMAMAP_R0_LO, offset, data); } void dma0_mreq_w(offs_t offset, uint8_t data) { dma_mreq_w(DMAMAP_R0_LO, offset, data); } uint8_t dma0_iorq_r(offs_t offset) { return dma_iorq_r(DMAMAP_R0_LO, offset); } void dma0_iorq_w(offs_t offset, uint8_t data) { dma_iorq_w(DMAMAP_R0_LO, offset, data); } - uint8_t dma1_mreq_r(offs_t offset) { return dma_mreq_r(DMAMAP_R1_LO, offset); } + + uint8_t dma1_mreq_r(offs_t offset, uint8_t data) { return dma_mreq_r(DMAMAP_R1_LO, offset, data); } void dma1_mreq_w(offs_t offset, uint8_t data) { dma_mreq_w(DMAMAP_R1_LO, offset, data); } uint8_t dma1_iorq_r(offs_t offset) { return dma_iorq_r(DMAMAP_R1_LO, offset); } void dma1_iorq_w(offs_t offset, uint8_t data) { dma_iorq_w(DMAMAP_R1_LO, offset, data); } - uint8_t dma2_mreq_r(offs_t offset) { return dma_mreq_r(DMAMAP_R2_LO, offset); } + + uint8_t dma2_mreq_r(offs_t offset, uint8_t data) { return dma_mreq_r(DMAMAP_R2_LO, offset, data); } void dma2_mreq_w(offs_t offset, uint8_t data) { dma_mreq_w(DMAMAP_R2_LO, offset, data); } uint8_t dma2_iorq_r(offs_t offset) { return dma_iorq_r(DMAMAP_R2_LO, offset); } void dma2_iorq_w(offs_t offset, uint8_t data) { dma_iorq_w(DMAMAP_R2_LO, offset, data); } @@ -91,11 +93,11 @@ private: offs_t get_physical_offset(offs_t offset, int task, bool &nonx, bool &wp); - offs_t get_dma_address(int index, uint16_t offset); - uint8_t dma_mreq_r(int index, uint16_t offset); - void dma_mreq_w(int index, uint16_t offset, uint8_t data); - uint8_t dma_iorq_r(int index, uint16_t offset); - void dma_iorq_w(int index, uint16_t offset, uint8_t data); + offs_t get_dma_address(int index, offs_t offset, bool &rw); + uint8_t dma_mreq_r(int index, offs_t offset, uint8_t data); + void dma_mreq_w(int index, offs_t offset, uint8_t data); + uint8_t dma_iorq_r(int index, offs_t offset); + void dma_iorq_w(int index, offs_t offset, uint8_t data); void program_map(address_map &map); void mac_map(address_map &map); |