summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2018-05-07 22:41:52 +1000
committer Vas Crabb <vas@vastheman.com>2018-05-07 22:41:52 +1000
commit04da61a4c536d5d70434424af36c22b42e2fff67 (patch)
tree599e991820fec0e4efc66f391d9ff6edcb0693ab /src/devices
parent21f535838cb8c71f4c4b807e0dad0c6aa7bbddc0 (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')
-rw-r--r--src/devices/sound/lc7535.h5
-rw-r--r--src/devices/sound/okim6258.h6
-rw-r--r--src/devices/sound/okim6295.cpp17
-rw-r--r--src/devices/sound/okim6295.h14
-rw-r--r--src/devices/sound/okim9810.h16
-rw-r--r--src/devices/sound/rf5c400.h10
-rw-r--r--src/devices/sound/rf5c68.h5
7 files changed, 24 insertions, 49 deletions
diff --git a/src/devices/sound/lc7535.h b/src/devices/sound/lc7535.h
index 6cc74d62b6d..bc3da9dc9c8 100644
--- a/src/devices/sound/lc7535.h
+++ b/src/devices/sound/lc7535.h
@@ -31,9 +31,6 @@
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
-#define MCFG_LC7535_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, LC7535, 0)
-
#define MCFG_LC7535_SELECT_CB(_read) \
devcb = &downcast<lc7535_device &>(*device).set_select_callback(DEVCB_##_read);
@@ -51,7 +48,7 @@ class lc7535_device : public device_t
{
public:
// construction/destruction
- lc7535_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ lc7535_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
typedef device_delegate<void (int attenuation_right, int attenuation_left, bool loudness)> volume_delegate;
diff --git a/src/devices/sound/okim6258.h b/src/devices/sound/okim6258.h
index 8194651f277..aa4d3df0cca 100644
--- a/src/devices/sound/okim6258.h
+++ b/src/devices/sound/okim6258.h
@@ -10,12 +10,6 @@
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
-#define MCFG_OKIM6258_ADD(tag, clock) \
- MCFG_DEVICE_ADD((tag), OKIM6258, (clock))
-
-#define MCFG_OKIM6258_REPLACE(tag, clock) \
- MCFG_DEVICE_REPLACE((tag), OKIM6258, (clock))
-
#define MCFG_OKIM6258_DIVIDER(div) \
downcast<okim6258_device &>(*device).set_start_div((okim6258_device::div));
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();
}
diff --git a/src/devices/sound/okim6295.h b/src/devices/sound/okim6295.h
index 0a467fe190a..40690932b86 100644
--- a/src/devices/sound/okim6295.h
+++ b/src/devices/sound/okim6295.h
@@ -21,10 +21,6 @@
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
-#define MCFG_OKIM6295_ADD(tag, clock, pin7) \
- MCFG_DEVICE_ADD((tag), OKIM6295, (clock)) \
- MCFG_OKIM6295_PIN7(pin7)
-
#define MCFG_OKIM6295_REPLACE(tag, clock, pin7) \
MCFG_DEVICE_REPLACE((tag), OKIM6295, (clock)) \
MCFG_OKIM6295_PIN7(pin7)
@@ -45,17 +41,22 @@ class okim6295_device : public device_t,
public device_rom_interface
{
public:
- enum
+ enum pin7_state
{
PIN7_LOW = 0,
PIN7_HIGH = 1
};
// construction/destruction
+ okim6295_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, pin7_state pin7)
+ : okim6295_device(mconfig, tag, owner, clock)
+ {
+ config_pin7(pin7);
+ }
okim6295_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration helpers
- void config_pin7(int pin7) { m_pin7_state = pin7; }
+ void config_pin7(pin7_state pin7) { m_pin7_state = pin7; }
// runtime configuration
void set_pin7(int pin7);
@@ -68,6 +69,7 @@ public:
protected:
// device-level overrides
+ virtual void device_validity_check(validity_checker &valid) const override;
virtual void device_start() override;
virtual void device_reset() override;
virtual void device_post_load() override;
diff --git a/src/devices/sound/okim9810.h b/src/devices/sound/okim9810.h
index 5db9b47c627..4475b90f29d 100644
--- a/src/devices/sound/okim9810.h
+++ b/src/devices/sound/okim9810.h
@@ -21,22 +21,6 @@
//**************************************************************************
-// CONSTANTS
-//**************************************************************************
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_OKIM9810_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, OKIM9810, _clock)
-
-#define MCFG_OKIM9810_REPLACE(_tag, _clock) \
- MCFG_DEVICE_REPLACE(_tag, OKIM9810, _clock)
-
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
diff --git a/src/devices/sound/rf5c400.h b/src/devices/sound/rf5c400.h
index 4d681db3a94..7b5d420049b 100644
--- a/src/devices/sound/rf5c400.h
+++ b/src/devices/sound/rf5c400.h
@@ -8,16 +8,6 @@
#pragma once
//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_RF5C400_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, RF5C400, _clock)
-#define MCFG_RF5C400_REPLACE(_tag, _clock) \
- MCFG_DEVICE_REPLACE(_tag, RF5C400, _clock)
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
diff --git a/src/devices/sound/rf5c68.h b/src/devices/sound/rf5c68.h
index 0638315d1dd..7e23cb263cc 100644
--- a/src/devices/sound/rf5c68.h
+++ b/src/devices/sound/rf5c68.h
@@ -14,11 +14,6 @@
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
-#define MCFG_RF5C68_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, RF5C68, _clock)
-#define MCFG_RF5C68_REPLACE(_tag, _clock) \
- MCFG_DEVICE_REPLACE(_tag, RF5C68, _clock)
-
#define MCFG_RF5C68_SAMPLE_END_CB(_class, _method) \
downcast<rf5c68_device &>(*device).set_end_callback(rf5c68_device::sample_end_cb_delegate(&_class::_method, #_class "::" #_method, this));