X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fsound%2Fym2612.c;h=692f34eed773459c8569bd8ab5950b114500daff;hb=14f9ad30a65f9c5f1e40ff49442c1958c441437e;hp=efe5054e9e8d3acc46c33485097838cb9092f5ab;hpb=4f3ad415128d7d33bf340059aa4f173ec7b620fe;p=picodrive.git diff --git a/pico/sound/ym2612.c b/pico/sound/ym2612.c index efe5054..692f34e 100644 --- a/pico/sound/ym2612.c +++ b/pico/sound/ym2612.c @@ -139,6 +139,10 @@ void memset32(int *dest, int c, int count); #define INLINE static __inline #endif +#ifndef STRICTINLINE +#define STRICTINLINE static inline +#endif + #ifndef M_PI #define M_PI 3.14159265358979323846 #endif @@ -531,7 +535,7 @@ static int g_lfo_ampm = 0; /* OPN Mode Register Write */ -INLINE void set_timers( int v ) +static INLINE void set_timers( int v ) { /* b7 = CSM MODE */ /* b6 = 3 slot mode */ @@ -553,7 +557,7 @@ INLINE void set_timers( int v ) } -INLINE void FM_KEYON(int c , int s ) +static INLINE void FM_KEYON(int c , int s ) { FM_SLOT *SLOT = &ym2612.CH[c].SLOT[s]; if( !SLOT->key ) @@ -565,7 +569,7 @@ INLINE void FM_KEYON(int c , int s ) } } -INLINE void FM_KEYOFF(int c , int s ) +static INLINE void FM_KEYOFF(int c , int s ) { FM_SLOT *SLOT = &ym2612.CH[c].SLOT[s]; if( SLOT->key ) @@ -578,7 +582,7 @@ INLINE void FM_KEYOFF(int c , int s ) /* set detune & multiple */ -INLINE void set_det_mul(FM_CH *CH, FM_SLOT *SLOT, int v) +static INLINE void set_det_mul(FM_CH *CH, FM_SLOT *SLOT, int v) { SLOT->mul = (v&0x0f)? (v&0x0f)*2 : 1; SLOT->DT = ym2612.OPN.ST.dt_tab[(v>>4)&7]; @@ -586,13 +590,13 @@ INLINE void set_det_mul(FM_CH *CH, FM_SLOT *SLOT, int v) } /* set total level */ -INLINE void set_tl(FM_SLOT *SLOT, int v) +static INLINE void set_tl(FM_SLOT *SLOT, int v) { SLOT->tl = (v&0x7f)<<(ENV_BITS-7); /* 7bit TL */ } /* set attack rate & key scale */ -INLINE void set_ar_ksr(FM_CH *CH, FM_SLOT *SLOT, int v) +static INLINE void set_ar_ksr(FM_CH *CH, FM_SLOT *SLOT, int v) { UINT8 old_KSR = SLOT->KSR; @@ -624,7 +628,7 @@ INLINE void set_ar_ksr(FM_CH *CH, FM_SLOT *SLOT, int v) } /* set decay rate */ -INLINE void set_dr(FM_SLOT *SLOT, int v) +static INLINE void set_dr(FM_SLOT *SLOT, int v) { int eg_sh_d1r, eg_sel_d1r; @@ -637,7 +641,7 @@ INLINE void set_dr(FM_SLOT *SLOT, int v) } /* set sustain rate */ -INLINE void set_sr(FM_SLOT *SLOT, int v) +static INLINE void set_sr(FM_SLOT *SLOT, int v) { int eg_sh_d2r, eg_sel_d2r; @@ -650,7 +654,7 @@ INLINE void set_sr(FM_SLOT *SLOT, int v) } /* set release rate */ -INLINE void set_sl_rr(FM_SLOT *SLOT, int v) +static INLINE void set_sl_rr(FM_SLOT *SLOT, int v) { int eg_sh_rr, eg_sel_rr; @@ -664,9 +668,7 @@ INLINE void set_sl_rr(FM_SLOT *SLOT, int v) SLOT->eg_pack_rr = eg_inc_pack[eg_sel_rr] | (eg_sh_rr<<24); } - - -INLINE signed int op_calc(UINT32 phase, unsigned int env, signed int pm) +static INLINE signed int op_calc(UINT32 phase, unsigned int env, signed int pm) { int ret, sin = (phase>>16) + (pm>>1); int neg = sin & 0x200; @@ -683,7 +685,7 @@ INLINE signed int op_calc(UINT32 phase, unsigned int env, signed int pm) return neg ? -ret : ret; } -INLINE signed int op_calc1(UINT32 phase, unsigned int env, signed int pm) +static INLINE signed int op_calc1(UINT32 phase, unsigned int env, signed int pm) { int ret, sin = (phase+pm)>>16; int neg = sin & 0x200; @@ -701,7 +703,7 @@ INLINE signed int op_calc1(UINT32 phase, unsigned int env, signed int pm) #if !defined(_ASM_YM2612_C) || defined(EXTERNAL_YM2612) /* advance LFO to next sample */ -INLINE int advance_lfo(int lfo_ampm, UINT32 lfo_cnt_old, UINT32 lfo_cnt) +static INLINE int advance_lfo(int lfo_ampm, UINT32 lfo_cnt_old, UINT32 lfo_cnt) { UINT8 pos; UINT8 prev_pos; @@ -742,7 +744,7 @@ INLINE int advance_lfo(int lfo_ampm, UINT32 lfo_cnt_old, UINT32 lfo_cnt) #define EG_INC_VAL() \ ((1 << ((pack >> ((eg_cnt>>shift)&7)*3)&7)) >> 1) -INLINE UINT32 update_eg_phase(FM_SLOT *SLOT, UINT32 eg_cnt) +STRICTINLINE UINT32 update_eg_phase(FM_SLOT *SLOT, UINT32 eg_cnt) { INT32 volume = SLOT->volume; @@ -1201,7 +1203,7 @@ static int chan_render(int *buffer, int length, int c, UINT32 flags) // flags: s } /* update phase increment and envelope generator */ -INLINE void refresh_fc_eg_slot(FM_SLOT *SLOT, int fc, int kc) +STRICTINLINE void refresh_fc_eg_slot(FM_SLOT *SLOT, int fc, int kc) { int ksr, fdt; @@ -1250,7 +1252,7 @@ INLINE void refresh_fc_eg_slot(FM_SLOT *SLOT, int fc, int kc) } /* update phase increment counters */ -INLINE void refresh_fc_eg_chan(FM_CH *CH) +void refresh_fc_eg_chan(FM_CH *CH) { if( CH->SLOT[SLOT1].Incr==-1){ int fc = CH->fc; @@ -1262,7 +1264,7 @@ INLINE void refresh_fc_eg_chan(FM_CH *CH) } } -INLINE void refresh_fc_eg_chan_sl3(void) +void refresh_fc_eg_chan_sl3(void) { if( ym2612.CH[2].SLOT[SLOT1].Incr==-1) {