diff options
author | 2018-05-07 22:41:52 +1000 | |
---|---|---|
committer | 2018-05-07 22:41:52 +1000 | |
commit | 04da61a4c536d5d70434424af36c22b42e2fff67 (patch) | |
tree | 599e991820fec0e4efc66f391d9ff6edcb0693ab /src/devices/sound/okim6295.cpp | |
parent | 21f535838cb8c71f4c4b807e0dad0c6aa7bbddc0 (diff) |
(nw) checkpoint since Midway SSIO sound is fixed - periodic interrupt doesn't support derived clock, kill off some more low-value macros, add a validity check, fix changes to Okim M6295 pin 7 in vgmplay
Diffstat (limited to 'src/devices/sound/okim6295.cpp')
-rw-r--r-- | src/devices/sound/okim6295.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/devices/sound/okim6295.cpp b/src/devices/sound/okim6295.cpp index 447433a063e..af7ba14e34a 100644 --- a/src/devices/sound/okim6295.cpp +++ b/src/devices/sound/okim6295.cpp @@ -92,17 +92,30 @@ okim6295_device::okim6295_device(const machine_config &mconfig, const char *tag, m_region(*this, DEVICE_SELF), m_command(-1), m_stream(nullptr), - m_pin7_state(0) + m_pin7_state(~uint8_t(0)) { } //------------------------------------------------- +// device_validity_check - device-specific checks +//------------------------------------------------- + +void okim6295_device::device_validity_check(validity_checker &valid) const +{ + if ((PIN7_LOW != m_pin7_state) && (PIN7_HIGH != m_pin7_state)) + osd_printf_error("Initial pin 7 state not configured\n"); +} + +//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- void okim6295_device::device_start() { + if ((PIN7_LOW != m_pin7_state) && (PIN7_HIGH != m_pin7_state)) + m_pin7_state = 0; + // create the stream int divisor = m_pin7_state ? 132 : 165; m_stream = machine().sound().stream_alloc(*this, 0, 1, clock() / divisor); @@ -190,7 +203,7 @@ void okim6295_device::rom_bank_updated() void okim6295_device::set_pin7(int pin7) { - m_pin7_state = pin7; + m_pin7_state = pin7 ? 1 : 0; device_clock_changed(); } |