odyssey2/voice: add more cartridge pin passthroughs

This commit is contained in:
hap 2020-08-03 23:36:58 +02:00
parent 0c548843e9
commit 7318829686
2 changed files with 21 additions and 5 deletions

View File

@ -49,7 +49,7 @@ void o2_voice_device::device_add_mconfig(machine_config &config)
{
SPEAKER(config, "mono").front_center();
SP0256(config, m_speech, 3120000);
SP0256(config, m_speech, 3.12_MHz_XTAL);
m_speech->data_request_callback().set(FUNC(o2_voice_device::lrq_callback));
// The Voice uses a speaker with its own volume control so the relative volumes to use are subjective, these sound good
m_speech->add_route(ALL_OUTPUTS, "mono", 1.00);
@ -83,11 +83,23 @@ const tiny_rom_entry *o2_voice_device::device_rom_region() const
return ROM_NAME( o2voice );
}
//-------------------------------------------------
// mapper specific handlers
//-------------------------------------------------
WRITE_LINE_MEMBER(o2_voice_device::lrq_callback)
{
m_lrq_state = state;
}
READ_LINE_MEMBER(o2_voice_device::t0_read)
{
// conflict with subslot T0
int state = (m_subslot->exists()) ? m_subslot->t0_read() : 0;
return state | (m_speech->lrq_r() ? 0 : 1);
}
void o2_voice_device::io_write(offs_t offset, uint8_t data)
{
if (offset & 0x80 && ~m_control & 0x10)
@ -97,4 +109,8 @@ void o2_voice_device::io_write(offs_t offset, uint8_t data)
else
m_speech->reset();
}
// possible conflict with subslot IO (work ok with 4in1, not with chess)
if (m_subslot->exists())
m_subslot->io_write(offset, data);
}

View File

@ -19,19 +19,19 @@ public:
o2_voice_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// reading and writing
virtual uint8_t read_rom04(offs_t offset) override { if (m_subslot->exists()) return m_subslot->read_rom04(offset); else return 0xff; }
virtual uint8_t read_rom0c(offs_t offset) override { if (m_subslot->exists()) return m_subslot->read_rom0c(offset); else return 0xff; }
virtual uint8_t read_rom04(offs_t offset) override { return (m_subslot->exists()) ? m_subslot->read_rom04(offset) : 0xff; }
virtual uint8_t read_rom0c(offs_t offset) override { return (m_subslot->exists()) ? m_subslot->read_rom0c(offset) : 0xff; }
virtual void write_p1(uint8_t data) override { m_control = data; if (m_subslot->exists()) m_subslot->write_p1(data); }
virtual void write_p2(uint8_t data) override { if (m_subslot->exists()) m_subslot->write_p2(data); }
virtual void io_write(offs_t offset, uint8_t data) override;
virtual DECLARE_READ_LINE_MEMBER(t0_read) override { return m_speech->lrq_r() ? 0 : 1; }
virtual uint8_t io_read(offs_t offset) override { return (m_subslot->exists()) ? m_subslot->io_read(offset) : 0xff; }
virtual DECLARE_READ_LINE_MEMBER(t0_read) override;
protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override { }
virtual void device_add_mconfig(machine_config &config) override;
virtual const tiny_rom_entry *device_rom_region() const override;