diff options
Diffstat (limited to 'src/devices/bus/spectrum/uspeech.cpp')
-rw-r--r-- | src/devices/bus/spectrum/uspeech.cpp | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/src/devices/bus/spectrum/uspeech.cpp b/src/devices/bus/spectrum/uspeech.cpp index 87f66ca0182..60374fd3c2c 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,46 +99,59 @@ READ_LINE_MEMBER(spectrum_uspeech_device::romcs) return m_romcs; } - -READ8_MEMBER(spectrum_uspeech_device::mreq_r) +void spectrum_uspeech_device::opcode_fetch(offs_t offset) { - uint8_t data; + if (!machine().side_effects_disabled() && (offset == 0x0038)) + { + m_romcs = !m_romcs; + } +} - if (!machine().side_effects_disabled() && (offset == 0x38)) +uint8_t spectrum_uspeech_device::iorq_r(offs_t offset) +{ + if (!machine().side_effects_disabled() && (offset == 0x0038)) { m_romcs = !m_romcs; } - switch (offset) + return 0xff; +} + +uint8_t spectrum_uspeech_device::mreq_r(offs_t offset) +{ + uint8_t data = 0xff; + + switch (offset & 0xf000) { - case 0x1000: - data = !m_nsp->lrq_r(); // (m_nsp->lrq_r() && (m_nsp->sby_r() != 0)) ? 0x00 : 0x01; - break; - default: + case 0x0000: data = m_rom->base()[offset & 0x7ff]; break; + case 0x1000: + data = !m_nsp->lrq_r(); + break; } return data; } -WRITE8_MEMBER(spectrum_uspeech_device::mreq_w) +void spectrum_uspeech_device::mreq_w(offs_t offset, uint8_t data) { - switch (offset) + switch (offset & 0xf001) { case 0x1000: + case 0x1001: // allophone m_nsp->ald_w(data & 0x3f); break; case 0x3000: // intonation low - m_nsp->set_clock(3500000); // CK / 4 ?? + m_nsp->set_clock(3050000); // oscillator frequency read from hardware break; case 0x3001: // intonation high - m_nsp->set_clock(3800000); // TODO: the exact frequency is unknown + m_nsp->set_clock(3260000); // oscillator frequency read from hardware break; } } |