diff options
Diffstat (limited to 'src/emu/sound/scsp.c')
-rw-r--r-- | src/emu/sound/scsp.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/emu/sound/scsp.c b/src/emu/sound/scsp.c index 3adf4b9fb8c..e221cf8f482 100644 --- a/src/emu/sound/scsp.c +++ b/src/emu/sound/scsp.c @@ -111,11 +111,11 @@ static const double DRTimes[64]={100000/*infinity*/,100000/*infinity*/,118200.0, 28.0,25.0,22.0,18.0,14.0,12.0,11.0,8.5,7.1,6.1,5.4,4.3,3.6,3.1}; static INT32 EG_TABLE[0x400]; -enum _STATE {ATTACK,DECAY1,DECAY2,RELEASE}; -struct _EG +enum STATE {ATTACK,DECAY1,DECAY2,RELEASE}; +struct EG_t { int volume; // - _STATE state; + STATE state; int step; //step vals int AR; //Attack @@ -128,7 +128,7 @@ struct _EG UINT8 LPLINK; }; -struct _SLOT +struct SLOT { union { @@ -141,9 +141,9 @@ struct _SLOT UINT32 cur_addr; //current play address (24.8) UINT32 nxt_addr; //next play address UINT32 step; //pitch step (24.8) - struct _EG EG; //Envelope - struct _LFO PLFO; //Phase LFO - struct _LFO ALFO; //Amplitude LFO + EG_t EG; //Envelope + LFO_t PLFO; //Phase LFO + LFO_t ALFO; //Amplitude LFO int slot; signed short Prev; //Previous sample (for interpolation) }; @@ -182,7 +182,7 @@ struct scsp_state UINT16 data[0x30/2]; UINT8 datab[0x30]; } udata; - struct _SLOT Slots[32]; + SLOT Slots[32]; signed short RINGBUF[128]; unsigned char BUFPTR; #if FM_DELAY @@ -224,7 +224,7 @@ struct scsp_state int ARTABLE[64], DRTABLE[64]; - struct _SCSPDSP DSP; + SCSPDSP DSP; devcb_resolved_write_line main_irq; device_t *device; @@ -389,7 +389,7 @@ static int Get_RR(scsp_state *scsp,int base,int R) return scsp->DRTABLE[Rate]; } -static void Compute_EG(scsp_state *scsp,struct _SLOT *slot) +static void Compute_EG(scsp_state *scsp,SLOT *slot) { int octave=(OCT(slot)^8)-8; int rate; @@ -407,9 +407,9 @@ static void Compute_EG(scsp_state *scsp,struct _SLOT *slot) slot->EG.EGHOLD=EGHOLD(slot); } -static void SCSP_StopSlot(struct _SLOT *slot,int keyoff); +static void SCSP_StopSlot(SLOT *slot,int keyoff); -static int EG_Update(struct _SLOT *slot) +static int EG_Update(SLOT *slot) { switch(slot->EG.state) { @@ -459,7 +459,7 @@ static int EG_Update(struct _SLOT *slot) return (slot->EG.volume>>EG_SHIFT)<<(SHIFT-10); } -static UINT32 SCSP_Step(struct _SLOT *slot) +static UINT32 SCSP_Step(SLOT *slot) { int octave=(OCT(slot)^8)-8+SHIFT-10; UINT32 Fn=FNS(slot)+(1 << 10); @@ -476,7 +476,7 @@ static UINT32 SCSP_Step(struct _SLOT *slot) } -static void Compute_LFO(struct _SLOT *slot) +static void Compute_LFO(SLOT *slot) { if(PLFOS(slot)!=0) LFO_ComputeStep(&(slot->PLFO),LFOF(slot),PLFOWS(slot),PLFOS(slot),0); @@ -484,7 +484,7 @@ static void Compute_LFO(struct _SLOT *slot) LFO_ComputeStep(&(slot->ALFO),LFOF(slot),ALFOWS(slot),ALFOS(slot),1); } -static void SCSP_StartSlot(scsp_state *scsp, struct _SLOT *slot) +static void SCSP_StartSlot(scsp_state *scsp, SLOT *slot) { UINT32 start_offset; @@ -505,7 +505,7 @@ static void SCSP_StartSlot(scsp_state *scsp, struct _SLOT *slot) // printf("StartSlot[%p]: SA %x PCM8B %x LPCTL %x ALFOS %x STWINH %x TL %x EFSDL %x\n", slot, SA(slot), PCM8B(slot), LPCTL(slot), ALFOS(slot), STWINH(slot), TL(slot), EFSDL(slot)); } -static void SCSP_StopSlot(struct _SLOT *slot,int keyoff) +static void SCSP_StopSlot(SLOT *slot,int keyoff) { if(keyoff /*&& slot->EG.state!=RELEASE*/) { @@ -657,7 +657,7 @@ static void SCSP_Init(device_t *device, scsp_state *scsp, const scsp_interface * static void SCSP_UpdateSlotReg(scsp_state *scsp,int s,int r) { - struct _SLOT *slot=scsp->Slots+s; + SLOT *slot=scsp->Slots+s; int sl; switch(r&0x3f) { @@ -667,7 +667,7 @@ static void SCSP_UpdateSlotReg(scsp_state *scsp,int s,int r) { for(sl=0;sl<32;++sl) { - struct _SLOT *s2=scsp->Slots+sl; + SLOT *s2=scsp->Slots+sl; { if(KEYONB(s2) && s2->EG.state==RELEASE/*&& !s2->active*/) { @@ -863,7 +863,7 @@ static void SCSP_UpdateRegR(scsp_state *scsp, int reg) // MSLC | CA |SGC|EG // f e d c b a 9 8 7 6 5 4 3 2 1 0 unsigned char MSLC=(scsp->udata.data[0x8/2]>>11)&0x1f; - struct _SLOT *slot=scsp->Slots + MSLC; + SLOT *slot=scsp->Slots + MSLC; unsigned int SGC = (slot->EG.state) & 3; unsigned int CA = (slot->cur_addr>>(SHIFT+12)) & 0xf; unsigned int EG = (0x1f - (slot->EG.volume>>(EG_SHIFT+5))) & 0x1f; @@ -953,7 +953,7 @@ static unsigned short SCSP_r16(scsp_state *scsp, unsigned int addr) #define REVSIGN(v) ((~v)+1) -INLINE INT32 SCSP_UpdateSlot(scsp_state *scsp, struct _SLOT *slot) +INLINE INT32 SCSP_UpdateSlot(scsp_state *scsp, SLOT *slot) { INT32 sample; int step=slot->step; @@ -1135,7 +1135,7 @@ static void SCSP_DoMasterSamples(scsp_state *scsp, int nsamples) #endif if(scsp->Slots[sl].active) { - struct _SLOT *slot=scsp->Slots+sl; + SLOT *slot=scsp->Slots+sl; unsigned short Enc; signed int sample; @@ -1165,7 +1165,7 @@ static void SCSP_DoMasterSamples(scsp_state *scsp, int nsamples) for(i=0;i<16;++i) { - struct _SLOT *slot=scsp->Slots+i; + SLOT *slot=scsp->Slots+i; if(EFSDL(slot)) { unsigned short Enc=((EFPAN(slot))<<0x8)|((EFSDL(slot))<<0xd); |