summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/msm5232.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/sound/msm5232.h')
-rw-r--r--src/devices/sound/msm5232.h53
1 files changed, 26 insertions, 27 deletions
diff --git a/src/devices/sound/msm5232.h b/src/devices/sound/msm5232.h
index da94899ccd9..44ab63e46e3 100644
--- a/src/devices/sound/msm5232.h
+++ b/src/devices/sound/msm5232.h
@@ -6,8 +6,7 @@
#pragma once
-class msm5232_device : public device_t,
- public device_sound_interface
+class msm5232_device : public device_t, public device_sound_interface
{
public:
msm5232_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
@@ -15,18 +14,18 @@ public:
void set_capacitors(double cap1, double cap2, double cap3, double cap4, double cap5, double cap6, double cap7, double cap8);
auto gate() { return m_gate_handler_cb.bind(); }
- DECLARE_WRITE8_MEMBER( write );
+ void write(offs_t offset, uint8_t data);
void set_clock(int clock);
protected:
// device-level overrides
- virtual void device_start() override;
- virtual void device_stop() override;
- virtual void device_reset() override;
+ virtual void device_start() override ATTR_COLD;
+ virtual void device_stop() override ATTR_COLD;
+ virtual void device_reset() override ATTR_COLD;
virtual void device_post_load() override;
// 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 sound_stream_update(sound_stream &stream) override;
private:
struct VOICE {
@@ -35,24 +34,24 @@ private:
int TG_count_period;
int TG_count;
- uint8_t TG_cnt; /* 7 bits binary counter (frequency output) */
- uint8_t TG_out16; /* bit number (of TG_cnt) for 16' output */
- uint8_t TG_out8; /* bit number (of TG_cnt) for 8' output */
- uint8_t TG_out4; /* bit number (of TG_cnt) for 4' output */
- uint8_t TG_out2; /* bit number (of TG_cnt) for 2' output */
+ uint8_t TG_cnt; // 7 bits binary counter (frequency output)
+ uint8_t TG_out16; // bit number (of TG_cnt) for 16' output
+ uint8_t TG_out8; // bit number (of TG_cnt) for 8' output
+ uint8_t TG_out4; // bit number (of TG_cnt) for 4' output
+ uint8_t TG_out2; // bit number (of TG_cnt) for 2' output
int egvol;
int eg_sect;
int counter;
int eg;
- uint8_t eg_arm; /* attack/release mode */
+ uint8_t eg_arm; // attack/release mode
double ar_rate;
double dr_rate;
double rr_rate;
- int pitch; /* current pitch data */
+ int pitch; // current pitch data
int GF;
};
@@ -62,32 +61,32 @@ private:
VOICE m_voi[8];
- uint32_t m_EN_out16[2]; /* enable 16' output masks for both groups (0-disabled ; ~0 -enabled) */
- uint32_t m_EN_out8[2]; /* enable 8' output masks */
- uint32_t m_EN_out4[2]; /* enable 4' output masks */
- uint32_t m_EN_out2[2]; /* enable 2' output masks */
+ uint32_t m_EN_out16[2]; // enable 16' output masks for both groups (0-disabled ; ~0 -enabled)
+ uint32_t m_EN_out8[2]; // enable 8' output masks
+ uint32_t m_EN_out4[2]; // enable 4' output masks
+ uint32_t m_EN_out2[2]; // enable 2' output masks
int m_noise_cnt;
int m_noise_step;
int m_noise_rng;
- int m_noise_clocks; /* number of the noise_rng (output) level changes */
+ int m_noise_clocks; // number of the noise_rng (output) level changes
unsigned int m_UpdateStep;
- /* rate tables */
+ // rate tables
double m_ar_tbl[8];
double m_dr_tbl[16];
- uint8_t m_control1;
- uint8_t m_control2;
+ uint8_t m_control1;
+ uint8_t m_control2;
- int m_gate; /* current state of the GATE output */
+ int m_gate; // current state of the GATE output
- int m_chip_clock; /* chip clock in Hz */
- int m_rate; /* sample rate in Hz */
+ int m_chip_clock; // chip clock in Hz
+ int m_rate; // sample rate in Hz
- double m_external_capacity[8]; /* in Farads, eg 0.39e-6 = 0.36 uF (microFarads) */
- devcb_write_line m_gate_handler_cb;/* callback called when the GATE output pin changes state */
+ double m_external_capacitance[8]; // in Farads, eg 0.39e-6 = 0.36 uF (microFarads)
+ devcb_write_line m_gate_handler_cb;// callback called when the GATE output pin changes state
void init_tables();
void init_voice(int i);