diff options
Diffstat (limited to 'src/devices/bus/electron/cart/ap34.cpp')
-rw-r--r-- | src/devices/bus/electron/cart/ap34.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/devices/bus/electron/cart/ap34.cpp b/src/devices/bus/electron/cart/ap34.cpp index 694df390266..30847c55aa4 100644 --- a/src/devices/bus/electron/cart/ap34.cpp +++ b/src/devices/bus/electron/cart/ap34.cpp @@ -47,7 +47,7 @@ void ap34_floppies(device_slot_interface &device) void electron_ap34_device::device_add_mconfig(machine_config &config) { /* fdc */ - WD1770(config, m_fdc, DERIVED_CLOCK(1, 2)); + WD1770(config, m_fdc, 16_MHz_XTAL / 2); FLOPPY_CONNECTOR(config, m_floppy0, ap34_floppies, "525qd", electron_ap34_device::floppy_formats).enable_sound(true); FLOPPY_CONNECTOR(config, m_floppy1, ap34_floppies, nullptr, electron_ap34_device::floppy_formats).enable_sound(true); } @@ -81,9 +81,9 @@ void electron_ap34_device::device_start() // read - cartridge data read //------------------------------------------------- -uint8_t electron_ap34_device::read(offs_t offset, int infc, int infd, int romqa, int oe, int oe2) +uint8_t electron_ap34_device::read(address_space &space, offs_t offset, int infc, int infd, int romqa) { - uint8_t data = 0xff; + uint8_t data = 0xfe; if (infc) { @@ -97,15 +97,17 @@ uint8_t electron_ap34_device::read(offs_t offset, int infc, int infd, int romqa, break; } } - else if (oe) + + if (!infc && !infd) { - if (m_ram.size() != 0 && romqa == 0 && offset >= 0x3000) + if (offset >= 0x0000 && offset < 0x4000) { - data = m_ram[offset & 0x0fff]; + data = m_rom[(offset & 0x3fff) + (romqa * 0x4000)]; } - else + + if (m_ram.size() != 0 && romqa == 0 && offset >= 0x3000) { - data = m_rom[(offset & 0x3fff) | (romqa << 14)]; + data = m_ram[offset & 0x0fff]; } } @@ -116,14 +118,14 @@ uint8_t electron_ap34_device::read(offs_t offset, int infc, int infd, int romqa, // write - cartridge data write //------------------------------------------------- -void electron_ap34_device::write(offs_t offset, uint8_t data, int infc, int infd, int romqa, int oe, int oe2) +void electron_ap34_device::write(address_space &space, offs_t offset, uint8_t data, int infc, int infd, int romqa) { if (infc) { switch (offset & 0xff) { case 0xc0: - wd1770_control_w(data); + wd1770_control_w(space, 0, data); break; case 0xc4: case 0xc5: @@ -133,7 +135,8 @@ void electron_ap34_device::write(offs_t offset, uint8_t data, int infc, int infd break; } } - else if (oe) + + if (!infc && !infd) { if (m_ram.size() != 0 && romqa == 0 && offset >= 0x3000) { @@ -147,7 +150,7 @@ void electron_ap34_device::write(offs_t offset, uint8_t data, int infc, int infd // IMPLEMENTATION //************************************************************************** -void electron_ap34_device::wd1770_control_w(uint8_t data) +WRITE8_MEMBER(electron_ap34_device::wd1770_control_w) { floppy_image_device *floppy = nullptr; @@ -164,7 +167,6 @@ void electron_ap34_device::wd1770_control_w(uint8_t data) m_fdc->dden_w(BIT(data, 3)); // bit 4: NMI - not connected - //m_slot->nmi_w(!BIT(data, 4)); // bit 5: reset if (!BIT(data, 5)) m_fdc->soft_reset(); |