summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/ym2151.h
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2020-03-04 10:07:56 -0500
committer AJR <ajrhacker@users.noreply.github.com>2020-03-04 10:07:56 -0500
commit81cccebb1fa12ecd338d014d5f5c6308b5ad2b7f (patch)
treef0e2e12d68066e1f5c7380d43378034ea9aa0155 /src/devices/sound/ym2151.h
parent245b2106b7d343630a5a64836826908de47b577e (diff)
ym2151: Add YM2164 variant and emulate some known differences
Diffstat (limited to 'src/devices/sound/ym2151.h')
-rw-r--r--src/devices/sound/ym2151.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/devices/sound/ym2151.h b/src/devices/sound/ym2151.h
index 562c6bb10a2..ee32c6f3ed6 100644
--- a/src/devices/sound/ym2151.h
+++ b/src/devices/sound/ym2151.h
@@ -66,6 +66,8 @@ public:
protected:
// device-level overrides
+ ym2151_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
virtual void device_start() override;
virtual void device_reset() override;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
@@ -75,6 +77,9 @@ protected:
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override;
+ virtual void calculate_timers();
+ virtual void write_reg(int r, int v);
+
private:
enum {
TIMER_IRQ_A_OFF,
@@ -208,8 +213,11 @@ private:
emu_timer *timer_A, *timer_A_irq_off;
emu_timer *timer_B, *timer_B_irq_off;
+protected:
attotime timer_A_time[1024]; /* timer A times for MAME */
attotime timer_B_time[256]; /* timer B times for MAME */
+
+private:
int irqlinestate;
uint32_t timer_A_index; /* timer A index */
@@ -250,12 +258,10 @@ private:
bool m_reset_active;
void init_tables();
- void calculate_timers();
void envelope_KONKOFF(YM2151Operator * op, int v);
void set_connect(YM2151Operator *om1, int cha, int v);
void advance();
void advance_eg();
- void write_reg(int r, int v);
void chan_calc(unsigned int chan);
void chan7_calc();
int op_calc(YM2151Operator * OP, unsigned int env, signed int pm);
@@ -263,9 +269,23 @@ private:
void refresh_EG(YM2151Operator * op);
};
+// ======================> ym2164_device
+
+class ym2164_device : public ym2151_device
+{
+public:
+ // construction/destruction
+ ym2164_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ virtual void calculate_timers() override;
+ virtual void write_reg(int r, int v) override;
+};
+
// device type definition
DECLARE_DEVICE_TYPE(YM2151, ym2151_device)
+DECLARE_DEVICE_TYPE(YM2164, ym2164_device)
#endif // MAME_SOUND_YM2151_H