diff options
author | 2019-03-10 13:23:23 +0000 | |
---|---|---|
committer | 2019-03-10 16:03:40 +0000 | |
commit | 09f698ddc8f1e0ee0196f1069a3dc44a2e13b863 (patch) | |
tree | e69a6c2cad7b96856c35f4ecd4a933a7957dd609 /src/devices/bus/spectrum/uspeech.cpp | |
parent | d62970843f793810da8a8bf245f00eed5c611d5c (diff) |
spectrum: Improved expansion interface to allow devices to act on opcode fetches.
- Added Multiface One/128/3, and MultiPrint devices.
Diffstat (limited to 'src/devices/bus/spectrum/uspeech.cpp')
-rw-r--r-- | src/devices/bus/spectrum/uspeech.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/devices/bus/spectrum/uspeech.cpp b/src/devices/bus/spectrum/uspeech.cpp index 0de1f5ff946..e3d5fca54d2 100644 --- a/src/devices/bus/spectrum/uspeech.cpp +++ b/src/devices/bus/spectrum/uspeech.cpp @@ -76,6 +76,7 @@ spectrum_uspeech_device::spectrum_uspeech_device(const machine_config &mconfig, void spectrum_uspeech_device::device_start() { + save_item(NAME(m_romcs)); } @@ -98,24 +99,26 @@ READ_LINE_MEMBER(spectrum_uspeech_device::romcs) return m_romcs; } - -uint8_t spectrum_uspeech_device::mreq_r(offs_t offset) +void spectrum_uspeech_device::opcode_fetch(offs_t offset) { - uint8_t data; - - if (!machine().side_effects_disabled() && (offset == 0x38)) + if (!machine().side_effects_disabled() && (offset == 0x0038)) { m_romcs = !m_romcs; } +} - switch (offset) +uint8_t spectrum_uspeech_device::mreq_r(offs_t offset) +{ + uint8_t data = 0xff; + + switch (offset & 0xf000) { + case 0x0000: + data = m_rom->base()[offset & 0x7ff]; + break; case 0x1000: data = !m_nsp->lrq_r(); // (m_nsp->lrq_r() && (m_nsp->sby_r() != 0)) ? 0x00 : 0x01; break; - default: - data = m_rom->base()[offset & 0x7ff]; - break; } return data; @@ -123,7 +126,7 @@ uint8_t spectrum_uspeech_device::mreq_r(offs_t offset) void spectrum_uspeech_device::mreq_w(offs_t offset, uint8_t data) { - switch (offset) + switch (offset & 0xf001) { case 0x1000: // allophone |