summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/scsp.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/sound/scsp.h')
-rw-r--r--src/devices/sound/scsp.h101
1 files changed, 50 insertions, 51 deletions
diff --git a/src/devices/sound/scsp.h b/src/devices/sound/scsp.h
index 50e42bc03c8..725dff85914 100644
--- a/src/devices/sound/scsp.h
+++ b/src/devices/sound/scsp.h
@@ -20,20 +20,20 @@ class scsp_device : public device_t,
public device_rom_interface
{
public:
- static constexpr feature_type imperfect_features() { return feature::SOUND; } // DSP incorrections, etc
+ static constexpr feature_type imperfect_features() { return feature::SOUND; } // DSP / EG incorrections, etc
- scsp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 22'579'200);
+ scsp_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 22'579'200);
auto irq_cb() { return m_irq_cb.bind(); }
auto main_irq_cb() { return m_main_irq_cb.bind(); }
// SCSP register access
- DECLARE_READ16_MEMBER( read );
- DECLARE_WRITE16_MEMBER( write );
+ DECLARE_READ16_MEMBER(read);
+ DECLARE_WRITE16_MEMBER(write);
// MIDI I/O access (used for comms on Model 2/3)
void midi_in(u8 data);
- DECLARE_READ16_MEMBER( midi_out_r );
+ DECLARE_READ16_MEMBER(midi_out_r);
protected:
// device-level overrides
@@ -61,14 +61,14 @@ private:
int RR; //Release
int DL; //Decay level
- uint8_t EGHOLD;
- uint8_t LPLINK;
+ u8 EGHOLD;
+ u8 LPLINK;
};
struct SCSP_LFO_t
{
- uint16_t phase;
- uint32_t phase_step;
+ u16 phase;
+ u32 phase_step;
int *table;
int *scale;
};
@@ -77,20 +77,20 @@ private:
{
union
{
- uint16_t data[0x10]; //only 0x1a bytes used
- uint8_t datab[0x20];
+ u16 data[0x10]; //only 0x1a bytes used
+ u8 datab[0x20];
} udata;
- uint8_t Backwards; //the wave is playing backwards
- uint8_t active; //this slot is currently playing
- uint32_t cur_addr; //current play address (24.8)
- uint32_t nxt_addr; //next play address
- uint32_t step; //pitch step (24.8)
+ u8 Backwards; //the wave is playing backwards
+ u8 active; //this slot is currently playing
+ u32 cur_addr; //current play address (24.8)
+ u32 nxt_addr; //next play address
+ u32 step; //pitch step (24.8)
SCSP_EG_t EG; //Envelope
SCSP_LFO_t PLFO; //Phase LFO
SCSP_LFO_t ALFO; //Amplitude LFO
int slot;
- int16_t Prev; //Previous sample (for interpolation)
+ s16 Prev; //Previous sample (for interpolation)
};
devcb_write8 m_irq_cb; /* irq callback */
@@ -98,29 +98,28 @@ private:
union
{
- uint16_t data[0x30/2];
- uint8_t datab[0x30];
+ u16 data[0x30/2];
+ u8 datab[0x30];
} m_udata;
SCSP_SLOT m_Slots[32];
- int16_t m_RINGBUF[128];
- uint8_t m_BUFPTR;
+ s16 m_RINGBUF[128];
+ u8 m_BUFPTR;
#if SCSP_FM_DELAY
- int16_t m_DELAYBUF[SCSP_FM_DELAY];
- uint8_t m_DELAYPTR;
+ s16 m_DELAYBUF[SCSP_FM_DELAY];
+ u8 m_DELAYPTR;
#endif
- char m_Master;
sound_stream * m_stream;
- uint32_t m_IrqTimA;
- uint32_t m_IrqTimBC;
- uint32_t m_IrqMidi;
+ u32 m_IrqTimA;
+ u32 m_IrqTimBC;
+ u32 m_IrqMidi;
- uint8_t m_MidiOutW, m_MidiOutR;
- uint8_t m_MidiStack[32];
- uint8_t m_MidiW, m_MidiR;
+ u8 m_MidiOutW, m_MidiOutR;
+ u8 m_MidiStack[32];
+ u8 m_MidiW, m_MidiR;
- int32_t m_EG_TABLE[0x400];
+ s32 m_EG_TABLE[0x400];
int m_LPANTABLE[0x10000];
int m_RPANTABLE[0x10000];
@@ -134,15 +133,15 @@ private:
// DMA stuff
struct
{
- uint32_t dmea;
- uint16_t drga;
- uint16_t dtlg;
- uint8_t dgate;
- uint8_t ddir;
+ u32 dmea;
+ u16 drga;
+ u16 dtlg;
+ u8 dgate;
+ u8 ddir;
} m_dma;
- uint16_t m_mcieb;
- uint16_t m_mcipd;
+ u16 m_mcieb;
+ u16 m_mcipd;
int m_ARTABLE[64], m_DRTABLE[64];
@@ -155,7 +154,7 @@ private:
int m_length;
- int16_t *m_RBUFDST; //this points to where the sample will be stored in the RingBuf
+ s16 *m_RBUFDST; //this points to where the sample will be stored in the RingBuf
//LFO
int m_PLFO_TRI[256], m_PLFO_SQR[256], m_PLFO_SAW[256], m_PLFO_NOI[256];
@@ -164,18 +163,18 @@ private:
int m_ASCALES[8][256];
void exec_dma(); /*state DMA transfer function*/
- uint8_t DecodeSCI(uint8_t irq);
+ u8 DecodeSCI(u8 irq);
void CheckPendingIRQ();
- void MainCheckPendingIRQ(uint16_t irq_type);
+ void MainCheckPendingIRQ(u16 irq_type);
void ResetInterrupts();
- TIMER_CALLBACK_MEMBER( timerA_cb );
- TIMER_CALLBACK_MEMBER( timerB_cb );
- TIMER_CALLBACK_MEMBER( timerC_cb );
+ TIMER_CALLBACK_MEMBER(timerA_cb);
+ TIMER_CALLBACK_MEMBER(timerB_cb);
+ TIMER_CALLBACK_MEMBER(timerC_cb);
int Get_AR(int base, int R);
int Get_DR(int base, int R);
void Compute_EG(SCSP_SLOT *slot);
int EG_Update(SCSP_SLOT *slot);
- uint32_t Step(SCSP_SLOT *slot);
+ u32 Step(SCSP_SLOT *slot);
void Compute_LFO(SCSP_SLOT *slot);
void StartSlot(SCSP_SLOT *slot);
void StopSlot(SCSP_SLOT *slot, int keyoff);
@@ -184,16 +183,16 @@ private:
void UpdateReg(int reg);
void UpdateSlotRegR(int slot, int reg);
void UpdateRegR(int reg);
- void w16(uint32_t addr, uint16_t val);
- uint16_t r16(uint32_t addr);
- inline int32_t UpdateSlot(SCSP_SLOT *slot);
+ void w16(u32 addr, u16 val);
+ u16 r16(u32 addr);
+ inline s32 UpdateSlot(SCSP_SLOT *slot);
void DoMasterSamples(int nsamples);
//LFO
void LFO_Init();
- int32_t PLFO_Step(SCSP_LFO_t *LFO);
- int32_t ALFO_Step(SCSP_LFO_t *LFO);
- void LFO_ComputeStep(SCSP_LFO_t *LFO, uint32_t LFOF, uint32_t LFOWS, uint32_t LFOS, int ALFO);
+ s32 PLFO_Step(SCSP_LFO_t *LFO);
+ s32 ALFO_Step(SCSP_LFO_t *LFO);
+ void LFO_ComputeStep(SCSP_LFO_t *LFO, u32 LFOF, u32 LFOWS, u32 LFOS, int ALFO);
};
DECLARE_DEVICE_TYPE(SCSP, scsp_device)