summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/msm5205.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/sound/msm5205.h')
-rw-r--r--src/devices/sound/msm5205.h37
1 files changed, 15 insertions, 22 deletions
diff --git a/src/devices/sound/msm5205.h b/src/devices/sound/msm5205.h
index a6830a6ab60..9aba7ea6f98 100644
--- a/src/devices/sound/msm5205.h
+++ b/src/devices/sound/msm5205.h
@@ -32,44 +32,38 @@ public:
auto vck_legacy_callback() { return m_vck_legacy_cb.bind(); }
// reset signal should keep for 2cycle of VCLK
- DECLARE_WRITE_LINE_MEMBER(reset_w);
+ void reset_w(int state);
// adpcmata is latched after vclk_interrupt callback
- void write_data(int data);
- DECLARE_WRITE8_MEMBER(data_w) { write_data(data); }
+ void data_w(uint8_t data);
// VCLK slave mode option
// if VCLK and reset or data is changed at the same time,
// call vclk_w after data_w and reset_w.
- DECLARE_WRITE_LINE_MEMBER(vclk_w);
+ void vclk_w(int state);
// option , selected pin selector
void playmode_w(int select);
- DECLARE_WRITE_LINE_MEMBER(s1_w);
- DECLARE_WRITE_LINE_MEMBER(s2_w);
+ void s1_w(int state);
+ void s2_w(int state);
protected:
- enum
- {
- TIMER_VCK,
- TIMER_ADPCM_CAPTURE
- };
-
- msm5205_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock);
+ msm5205_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 dac_bits);
// device-level overrides
- virtual void device_start() override;
- virtual void device_reset() override;
+ virtual void device_start() override ATTR_COLD;
+ virtual void device_reset() override ATTR_COLD;
virtual void device_clock_changed() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
- void update_adpcm();
+ TIMER_CALLBACK_MEMBER(toggle_vck);
+ TIMER_CALLBACK_MEMBER(update_adpcm);
// 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;
void compute_tables();
virtual int get_prescaler() const;
+ virtual double adpcm_capture_divisor() const { return 6.0; }
// internal state
sound_stream *m_stream; // number of stream system
@@ -83,6 +77,7 @@ protected:
u8 m_bitwidth; // bit width selector -3B/4B
s32 m_signal; // current ADPCM signal
s32 m_step; // current ADPCM step
+ u8 m_dac_bits; // DAC output bits (10 for MSM5205, 12 for MSM6585)
int m_diff_lookup[49*16];
devcb_write_line m_vck_cb;
@@ -103,12 +98,10 @@ public:
protected:
virtual int get_prescaler() const override;
-
- // device-level overrides
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+ virtual double adpcm_capture_divisor() const override { return 2.0; }
// 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;
};