diff options
author | 2012-09-16 05:24:30 +0000 | |
---|---|---|
committer | 2012-09-16 05:24:30 +0000 | |
commit | 1a301849034da9956b893453acce8e0f9168e150 (patch) | |
tree | a39f7a6c6b4c54b7993e58cd22ea6b6bd25f37cf /src/emu/sound/multipcm.c | |
parent | 91f928d6cd774c9526c7fde7e0860aded24d08a5 (diff) |
Final round of struct/union/enum normalization.
Diffstat (limited to 'src/emu/sound/multipcm.c')
-rw-r--r-- | src/emu/sound/multipcm.c | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/src/emu/sound/multipcm.c b/src/emu/sound/multipcm.c index 1f86058e85b..5a2f036229e 100644 --- a/src/emu/sound/multipcm.c +++ b/src/emu/sound/multipcm.c @@ -37,7 +37,7 @@ //???? #define MULTIPCM_CLOCKDIV (180.0) -struct _Sample +struct Sample_t { unsigned int Start; unsigned int Loop; @@ -48,12 +48,12 @@ struct _Sample unsigned char AM; }; -enum _STATE {ATTACK,DECAY1,DECAY2,RELEASE}; -ALLOW_SAVE_TYPE(_STATE); // allow save_item on a non-fundamental type -struct _EG +enum STATE {ATTACK,DECAY1,DECAY2,RELEASE}; +ALLOW_SAVE_TYPE(STATE); // allow save_item on a non-fundamental type +struct EG_t { int volume; // - _STATE state; + STATE state; int step; //step vals int AR; //Attack @@ -63,7 +63,7 @@ struct _EG int DL; //Decay level }; -struct _LFO +struct LFO_t { unsigned short phase; UINT32 phase_step; @@ -72,12 +72,12 @@ struct _LFO }; -struct _SLOT +struct SLOT { unsigned char Num; unsigned char Regs[8]; int Playing; - struct _Sample *Sample; + Sample_t *Sample; unsigned int Base; unsigned int offset; unsigned int step; @@ -85,17 +85,16 @@ struct _SLOT unsigned int DstTL; int TLStep; signed int Prev; - struct _EG EG; - struct _LFO PLFO; //Phase lfo - struct _LFO ALFO; //AM lfo + EG_t EG; + LFO_t PLFO; //Phase lfo + LFO_t ALFO; //AM lfo }; -typedef struct _MultiPCM MultiPCM; -struct _MultiPCM +struct MultiPCM { sound_stream * stream; - struct _Sample Samples[0x200]; //Max 512 samples - struct _SLOT Slots[28]; + Sample_t Samples[0x200]; //Max 512 samples + SLOT Slots[28]; unsigned int CurSlot; unsigned int Address; unsigned int BankR,BankL; @@ -150,7 +149,7 @@ static int TLSteps[2]; #define EG_SHIFT 16 -static int EG_Update(struct _SLOT *slot) +static int EG_Update(SLOT *slot) { switch(slot->EG.state) { @@ -202,7 +201,7 @@ static unsigned int Get_RATE(unsigned int *Steps,unsigned int rate,unsigned int return Steps[r]; } -static void EG_Calc(MultiPCM *ptChip,struct _SLOT *slot) +static void EG_Calc(MultiPCM *ptChip,SLOT *slot) { int octave=((slot->Regs[3]>>4)-1)&0xf; int rate; @@ -284,7 +283,7 @@ static void LFO_Init(void) } } -INLINE signed int PLFO_Step(struct _LFO *LFO) +INLINE signed int PLFO_Step(LFO_t *LFO) { int p; LFO->phase+=LFO->phase_step; @@ -293,7 +292,7 @@ INLINE signed int PLFO_Step(struct _LFO *LFO) return p<<(SHIFT-LFO_SHIFT); } -INLINE signed int ALFO_Step(struct _LFO *LFO) +INLINE signed int ALFO_Step(LFO_t *LFO) { int p; LFO->phase+=LFO->phase_step; @@ -302,7 +301,7 @@ INLINE signed int ALFO_Step(struct _LFO *LFO) return p<<(SHIFT-LFO_SHIFT); } -static void LFO_ComputeStep(MultiPCM *ptChip,struct _LFO *LFO,UINT32 LFOF,UINT32 LFOS,int ALFO) +static void LFO_ComputeStep(MultiPCM *ptChip,LFO_t *LFO,UINT32 LFOF,UINT32 LFOS,int ALFO) { float step=(float) LFOFreq[LFOF]*256.0/(float) ptChip->Rate; LFO->phase_step=(unsigned int) ((float) (1<<LFO_SHIFT)*step); @@ -320,7 +319,7 @@ static void LFO_ComputeStep(MultiPCM *ptChip,struct _LFO *LFO,UINT32 LFOF,UINT32 -static void WriteSlot(MultiPCM *ptChip,struct _SLOT *slot,int reg,unsigned char data) +static void WriteSlot(MultiPCM *ptChip,SLOT *slot,int reg,unsigned char data) { slot->Regs[reg]=data; @@ -333,7 +332,7 @@ static void WriteSlot(MultiPCM *ptChip,struct _SLOT *slot,int reg,unsigned char //according to YMF278 sample write causes some base params written to the regs (envelope+lfos) //the game should never change the sample while playing. { - struct _Sample *Sample=ptChip->Samples+slot->Regs[1]; + Sample_t *Sample=ptChip->Samples+slot->Regs[1]; WriteSlot(ptChip,slot,6,Sample->LFOVIB); WriteSlot(ptChip,slot,7,Sample->AM); } @@ -441,7 +440,7 @@ static STREAM_UPDATE( MultiPCM_update ) signed int smpr=0; for(sl=0;sl<28;++sl) { - struct _SLOT *slot=ptChip->Slots+sl; + SLOT *slot=ptChip->Slots+sl; if(slot->Playing) { unsigned int vol=(slot->TL>>SHIFT)|(slot->Pan<<7); |