diff options
Diffstat (limited to 'src/devices/sound/scsp.h')
-rw-r--r-- | src/devices/sound/scsp.h | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/devices/sound/scsp.h b/src/devices/sound/scsp.h index 725dff85914..4ec5d60f44b 100644 --- a/src/devices/sound/scsp.h +++ b/src/devices/sound/scsp.h @@ -11,13 +11,16 @@ #include "scspdsp.h" +#include "dirom.h" + + #define SCSP_FM_DELAY 0 // delay in number of slots processed before samples are written to the FM ring buffer // driver code indicates should be 4, but sounds distorted then class scsp_device : public device_t, public device_sound_interface, - public device_rom_interface + public device_rom_interface<20, 1, 0, ENDIANNESS_BIG> { public: static constexpr feature_type imperfect_features() { return feature::SOUND; } // DSP / EG incorrections, etc @@ -28,23 +31,24 @@ public: auto main_irq_cb() { return m_main_irq_cb.bind(); } // SCSP register access - DECLARE_READ16_MEMBER(read); - DECLARE_WRITE16_MEMBER(write); + u16 read(offs_t offset); + void write(offs_t offset, u16 data, u16 mem_mask = ~0); // MIDI I/O access (used for comms on Model 2/3) void midi_in(u8 data); - DECLARE_READ16_MEMBER(midi_out_r); + u16 midi_out_r(); + void midi_out_w(u8 data); protected: // device-level overrides - virtual void device_start() override; + virtual void device_start() override ATTR_COLD; virtual void device_post_load() override; virtual void device_clock_changed() override; - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() 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: enum SCSP_STATE { SCSP_ATTACK, SCSP_DECAY1, SCSP_DECAY2, SCSP_RELEASE }; @@ -115,6 +119,7 @@ private: u32 m_IrqTimBC; u32 m_IrqMidi; + u8 m_MidiOutStack[32]; u8 m_MidiOutW, m_MidiOutR; u8 m_MidiStack[32]; u8 m_MidiW, m_MidiR; @@ -147,13 +152,6 @@ private: SCSPDSP m_DSP; - stream_sample_t *m_bufferl; - stream_sample_t *m_bufferr; - stream_sample_t *m_exts0; - stream_sample_t *m_exts1; - - int m_length; - s16 *m_RBUFDST; //this points to where the sample will be stored in the RingBuf //LFO @@ -186,7 +184,7 @@ private: void w16(u32 addr, u16 val); u16 r16(u32 addr); inline s32 UpdateSlot(SCSP_SLOT *slot); - void DoMasterSamples(int nsamples); + void DoMasterSamples(sound_stream &stream); //LFO void LFO_Init(); |