diff options
Diffstat (limited to 'src/devices/bus/electron/cart/peg400.cpp')
-rw-r--r-- | src/devices/bus/electron/cart/peg400.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/devices/bus/electron/cart/peg400.cpp b/src/devices/bus/electron/cart/peg400.cpp index abca703474a..8d92131aa04 100644 --- a/src/devices/bus/electron/cart/peg400.cpp +++ b/src/devices/bus/electron/cart/peg400.cpp @@ -44,7 +44,7 @@ void peg400_floppies(device_slot_interface &device) void electron_peg400_device::device_add_mconfig(machine_config &config) { /* fdc */ - WD1770(config, m_fdc, DERIVED_CLOCK(1, 2)); + WD1770(config, m_fdc, 16_MHz_XTAL / 2); m_fdc->drq_wr_callback().set(FUNC(electron_peg400_device::fdc_drq_w)); FLOPPY_CONNECTOR(config, m_floppy0, peg400_floppies, "525qd", electron_peg400_device::floppy_formats).enable_sound(true); FLOPPY_CONNECTOR(config, m_floppy1, peg400_floppies, nullptr, electron_peg400_device::floppy_formats).enable_sound(true); @@ -79,7 +79,7 @@ void electron_peg400_device::device_start() // read - cartridge data read //------------------------------------------------- -uint8_t electron_peg400_device::read(offs_t offset, int infc, int infd, int romqa, int oe, int oe2) +uint8_t electron_peg400_device::read(address_space &space, offs_t offset, int infc, int infd, int romqa) { uint8_t data = 0xff; @@ -95,14 +95,15 @@ uint8_t electron_peg400_device::read(offs_t offset, int infc, int infd, int romq break; } } - else if (oe) + + if (!infc && !infd) { switch (romqa) { case 0: if (offset < 0x3800) { - data = m_rom[(offset & 0x3fff) | (romqa << 14)]; + data = m_rom[(offset & 0x3fff) + (romqa * 0x4000)]; } else { @@ -110,7 +111,7 @@ uint8_t electron_peg400_device::read(offs_t offset, int infc, int infd, int romq } break; case 1: - data = m_rom[(offset & 0x3fff) | (romqa << 14)]; + data = m_rom[(offset & 0x3fff) + (romqa * 0x4000)]; break; } } @@ -122,14 +123,14 @@ uint8_t electron_peg400_device::read(offs_t offset, int infc, int infd, int romq // write - cartridge data write //------------------------------------------------- -void electron_peg400_device::write(offs_t offset, uint8_t data, int infc, int infd, int romqa, int oe, int oe2) +void electron_peg400_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: @@ -139,7 +140,8 @@ void electron_peg400_device::write(offs_t offset, uint8_t data, int infc, int in break; } } - else if (oe) + + if (!infc && !infd) { if (romqa == 0 && offset >= 0x3800) { @@ -153,7 +155,7 @@ void electron_peg400_device::write(offs_t offset, uint8_t data, int infc, int in // IMPLEMENTATION //************************************************************************** -void electron_peg400_device::wd1770_control_w(uint8_t data) +WRITE8_MEMBER(electron_peg400_device::wd1770_control_w) { floppy_image_device *floppy = nullptr; |