From 04da61a4c536d5d70434424af36c22b42e2fff67 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Mon, 7 May 2018 22:41:52 +1000 Subject: (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 --- src/devices/sound/okim6295.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/devices/sound/okim6295.cpp') 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(); } -- cgit v1.2.3-70-g09d2