(Xbox 1) Fixed sound - never, ever name non-static inline functions

the same in disparate source files - they must all be named uniquely
This commit is contained in:
twinaphex 2012-08-17 00:20:22 +02:00
parent 86254071be
commit 00d98cee9c
2 changed files with 42 additions and 42 deletions

View File

@ -505,7 +505,7 @@ static INT32 LFO_PM;
static YM2413 ym2413;
/* advance LFO to next sample */
INLINE void advance_lfo(void)
INLINE void advance_lfo_ym2413(void)
{
/* LFO */
ym2413.lfo_am_cnt += ym2413.lfo_am_inc;
@ -748,7 +748,7 @@ INLINE void advance(void)
}
INLINE signed int op_calc(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab)
INLINE signed int op_calc_ym2413(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab)
{
UINT32 p = (env<<5) + sin_tab[wave_tab + ((((signed int)((phase & ~FREQ_MASK) + (pm<<17))) >> FREQ_SH ) & SIN_MASK) ];
@ -757,7 +757,7 @@ INLINE signed int op_calc(UINT32 phase, unsigned int env, signed int pm, unsigne
return tl_tab[p];
}
INLINE signed int op_calc1(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab)
INLINE signed int op_calc1_ym2413(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab)
{
UINT32 p = (env<<5) + sin_tab[wave_tab + ((((signed int)((phase & ~FREQ_MASK) + pm)) >> FREQ_SH ) & SIN_MASK) ];
@ -769,7 +769,7 @@ INLINE signed int op_calc1(UINT32 phase, unsigned int env, signed int pm, unsign
#define volume_calc(OP) ((OP)->TLL + ((UINT32)(OP)->volume) + (LFO_AM & (OP)->AMmask))
/* calculate output */
INLINE void chan_calc( YM2413_OPLL_CH *CH )
INLINE void chan_calc_ym2413( YM2413_OPLL_CH *CH )
{
YM2413_OPLL_SLOT *SLOT;
unsigned int env;
@ -790,7 +790,7 @@ INLINE void chan_calc( YM2413_OPLL_CH *CH )
{
if (!SLOT->fb_shift)
out = 0;
SLOT->op1_out[1] = op_calc1(SLOT->phase, env, (out<<SLOT->fb_shift), SLOT->wavetable );
SLOT->op1_out[1] = op_calc1_ym2413(SLOT->phase, env, (out<<SLOT->fb_shift), SLOT->wavetable );
}
/* SLOT 2 */
@ -799,7 +799,7 @@ INLINE void chan_calc( YM2413_OPLL_CH *CH )
env = volume_calc(SLOT);
if( env < ENV_QUIET )
{
output[0] += op_calc(SLOT->phase, env, phase_modulation, SLOT->wavetable);
output[0] += op_calc_ym2413(SLOT->phase, env, phase_modulation, SLOT->wavetable);
}
}
@ -870,14 +870,14 @@ INLINE void rhythm_calc( YM2413_OPLL_CH *CH, unsigned int noise )
{
if (!SLOT->fb_shift)
out = 0;
SLOT->op1_out[1] = op_calc1(SLOT->phase, env, (out<<SLOT->fb_shift), SLOT->wavetable );
SLOT->op1_out[1] = op_calc1_ym2413(SLOT->phase, env, (out<<SLOT->fb_shift), SLOT->wavetable );
}
/* SLOT 2 */
SLOT++;
env = volume_calc(SLOT);
if( env < ENV_QUIET )
output[1] += op_calc(SLOT->phase, env, phase_modulation, SLOT->wavetable);
output[1] += op_calc_ym2413(SLOT->phase, env, phase_modulation, SLOT->wavetable);
/* Phase generation is based on: */
@ -945,7 +945,7 @@ INLINE void rhythm_calc( YM2413_OPLL_CH *CH, unsigned int noise )
phase = 0xd0>>2;
}
output[1] += op_calc(phase<<FREQ_SH, env, 0, CH[7].SLOT[SLOT1].wavetable);
output[1] += op_calc_ym2413(phase<<FREQ_SH, env, 0, CH[7].SLOT[SLOT1].wavetable);
}
/* Snare Drum (verified on real YM3812) */
@ -966,13 +966,13 @@ INLINE void rhythm_calc( YM2413_OPLL_CH *CH, unsigned int noise )
if (noise)
phase ^= 0x100;
output[1] += op_calc(phase<<FREQ_SH, env, 0, CH[7].SLOT[SLOT2].wavetable);
output[1] += op_calc_ym2413(phase<<FREQ_SH, env, 0, CH[7].SLOT[SLOT2].wavetable);
}
/* Tom Tom (verified on real YM3812) */
env = volume_calc(&CH[8].SLOT[SLOT1]);
if( env < ENV_QUIET )
output[1] += op_calc(CH[8].SLOT[SLOT1].phase, env, 0, CH[8].SLOT[SLOT1].wavetable);
output[1] += op_calc_ym2413(CH[8].SLOT[SLOT1].phase, env, 0, CH[8].SLOT[SLOT1].wavetable);
/* Top Cymbal (verified on real YM2413) */
env = volume_calc(&CH[8].SLOT[SLOT2]);
@ -999,13 +999,13 @@ INLINE void rhythm_calc( YM2413_OPLL_CH *CH, unsigned int noise )
if (res2)
phase = 0x300;
output[1] += op_calc(phase<<FREQ_SH, env, 0, CH[8].SLOT[SLOT2].wavetable);
output[1] += op_calc_ym2413(phase<<FREQ_SH, env, 0, CH[8].SLOT[SLOT2].wavetable);
}
}
/* generic table initialize */
static int init_tables(void)
static int init_tables_ym2413(void)
{
signed int i,x;
signed int n;
@ -1592,7 +1592,7 @@ static void OPLLWriteReg(int r, int v)
void YM2413Init(double clock, int rate)
{
init_tables();
init_tables_ym2413();
/* clear */
memset(&ym2413,0,sizeof(YM2413));
@ -1682,21 +1682,21 @@ void YM2413Update(int *buffer, int length)
output[0] = 0;
output[1] = 0;
advance_lfo();
advance_lfo_ym2413();
/* FM part */
chan_calc(&ym2413.P_CH[0]);
chan_calc(&ym2413.P_CH[1]);
chan_calc(&ym2413.P_CH[2]);
chan_calc(&ym2413.P_CH[3]);
chan_calc(&ym2413.P_CH[4]);
chan_calc(&ym2413.P_CH[5]);
chan_calc_ym2413(&ym2413.P_CH[0]);
chan_calc_ym2413(&ym2413.P_CH[1]);
chan_calc_ym2413(&ym2413.P_CH[2]);
chan_calc_ym2413(&ym2413.P_CH[3]);
chan_calc_ym2413(&ym2413.P_CH[4]);
chan_calc_ym2413(&ym2413.P_CH[5]);
if(!(ym2413.rhythm&0x20))
{
chan_calc(&ym2413.P_CH[6]);
chan_calc(&ym2413.P_CH[7]);
chan_calc(&ym2413.P_CH[8]);
chan_calc_ym2413(&ym2413.P_CH[6]);
chan_calc_ym2413(&ym2413.P_CH[7]);
chan_calc_ym2413(&ym2413.P_CH[8]);
}
else /* Rhythm part */
{

View File

@ -1026,7 +1026,7 @@ INLINE void set_sl_rr_ym2612(FM_SLOT *SLOT,int v)
}
/* advance LFO to next sample */
INLINE void advance_lfo()
INLINE void advance_lfo_ym2612()
{
if (ym2612.OPN.lfo_timer_overflow) /* LFO enabled ? */
{
@ -1407,7 +1407,7 @@ INLINE void refresh_fc_eg_chan(FM_CH *CH )
#define volume_calc(OP) ((OP)->vol_out + (AM & (OP)->AMmask))
INLINE signed int op_calc(UINT32 phase, unsigned int env, signed int pm)
INLINE signed int op_calc_ym2612(UINT32 phase, unsigned int env, signed int pm)
{
UINT32 p = (env<<3) + sin_tab[ ( ((signed int)((phase & ~FREQ_MASK) + (pm<<15))) >> FREQ_SH ) & SIN_MASK ];
@ -1416,7 +1416,7 @@ INLINE signed int op_calc(UINT32 phase, unsigned int env, signed int pm)
return tl_tab[p];
}
INLINE signed int op_calc1(UINT32 phase, unsigned int env, signed int pm)
INLINE signed int op_calc1_ym2612(UINT32 phase, unsigned int env, signed int pm)
{
UINT32 p = (env<<3) + sin_tab[ ( ((signed int)((phase & ~FREQ_MASK) + pm )) >> FREQ_SH ) & SIN_MASK ];
@ -1425,7 +1425,7 @@ INLINE signed int op_calc1(UINT32 phase, unsigned int env, signed int pm)
return tl_tab[p];
}
INLINE void chan_calc(FM_CH *CH)
INLINE void chan_calc_ym2612(FM_CH *CH)
{
UINT32 AM = ym2612.OPN.LFO_AM >> CH->ams;
unsigned int eg_out = volume_calc(&CH->SLOT[SLOT1]);
@ -1451,21 +1451,21 @@ INLINE void chan_calc(FM_CH *CH)
if (!CH->FB)
out=0;
CH->op1_out[1] = op_calc1(CH->SLOT[SLOT1].phase, eg_out, (out<<CH->FB) );
CH->op1_out[1] = op_calc1_ym2612(CH->SLOT[SLOT1].phase, eg_out, (out<<CH->FB) );
}
}
eg_out = volume_calc(&CH->SLOT[SLOT3]);
if( eg_out < ENV_QUIET ) /* SLOT 3 */
*CH->connect3 += op_calc(CH->SLOT[SLOT3].phase, eg_out, m2);
*CH->connect3 += op_calc_ym2612(CH->SLOT[SLOT3].phase, eg_out, m2);
eg_out = volume_calc(&CH->SLOT[SLOT2]);
if( eg_out < ENV_QUIET ) /* SLOT 2 */
*CH->connect2 += op_calc(CH->SLOT[SLOT2].phase, eg_out, c1);
*CH->connect2 += op_calc_ym2612(CH->SLOT[SLOT2].phase, eg_out, c1);
eg_out = volume_calc(&CH->SLOT[SLOT4]);
if( eg_out < ENV_QUIET ) /* SLOT 4 */
*CH->connect4 += op_calc(CH->SLOT[SLOT4].phase, eg_out, c2);
*CH->connect4 += op_calc_ym2612(CH->SLOT[SLOT4].phase, eg_out, c2);
/* store current MEM */
@ -1826,7 +1826,7 @@ static void reset_channels(FM_CH *CH , int num )
}
/* initialize generic tables */
static void init_tables(void)
static void init_tables_ym2612(void)
{
signed int i,x;
signed int n;
@ -1932,7 +1932,7 @@ static void init_tables(void)
void YM2612Init(double clock, int rate)
{
memset(&ym2612,0,sizeof(YM2612));
init_tables();
init_tables_ym2612();
ym2612.OPN.ST.clock = clock;
ym2612.OPN.ST.rate = rate;
OPNSetPres(6*24); /* YM2612 prescaler is fixed to 1/6, one sample (6 mixed channels) is output for each 24 FM clocks */
@ -2082,14 +2082,14 @@ void YM2612Update(int *buffer, int length)
update_ssg_eg_channel(&ym2612.CH[5].SLOT[SLOT1]);
/* calculate FM */
chan_calc(&ym2612.CH[0]);
chan_calc(&ym2612.CH[1]);
chan_calc(&ym2612.CH[2]);
chan_calc(&ym2612.CH[3]);
chan_calc(&ym2612.CH[4]);
chan_calc_ym2612(&ym2612.CH[0]);
chan_calc_ym2612(&ym2612.CH[1]);
chan_calc_ym2612(&ym2612.CH[2]);
chan_calc_ym2612(&ym2612.CH[3]);
chan_calc_ym2612(&ym2612.CH[4]);
if (!ym2612.dacen)
{
chan_calc(&ym2612.CH[5]);
chan_calc_ym2612(&ym2612.CH[5]);
}
else
{
@ -2098,7 +2098,7 @@ void YM2612Update(int *buffer, int length)
}
/* advance LFO */
advance_lfo();
advance_lfo_ym2612();
/* advance envelope generator */
ym2612.OPN.eg_timer += ym2612.OPN.eg_timer_add;
@ -2197,7 +2197,7 @@ void YM2612Restore(unsigned char *buffer)
setup_connection(&ym2612.CH[5],5);
/* restore TL table (DAC resolution might have been modified) */
init_tables();
init_tables_ym2612();
}
int YM2612LoadContext(unsigned char *state)