From 86254071be586c2b7ce935408dec00d29b6d1e34 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 16 Aug 2012 23:55:47 +0200 Subject: [PATCH] (Xbox 1) Fixed Xbox 1 crash - the problem was that there are (non-static) inline functions being declared in two source files - ym2413.c and ym2612.c. A call to set_sl_rr in ym2612.c would jump to the inline function declared in ym2413.c and completely crashihng the app. Both functions in the input files have now been uniquely named to avoid conflicts. There might be more conflicts up ahead (sound is still not correct), but at least games run now --- .../msvc-2003-xbox1/msvc-2003-xbox1.vcproj | 93 +++++++++++++++++++ source/sound/ym2413.c | 12 +-- source/sound/ym2612.c | 4 +- 3 files changed, 100 insertions(+), 9 deletions(-) diff --git a/libretro/msvc/msvc-2003-xbox1/msvc-2003-xbox1.vcproj b/libretro/msvc/msvc-2003-xbox1/msvc-2003-xbox1.vcproj index 5a3a36c..67f6705 100644 --- a/libretro/msvc/msvc-2003-xbox1/msvc-2003-xbox1.vcproj +++ b/libretro/msvc/msvc-2003-xbox1/msvc-2003-xbox1.vcproj @@ -200,6 +200,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SLOT[slot&1]; - SLOT->sl = sl_tab[ v>>4 ]; - SLOT->rr = (v&0x0f)? 16 + ((v&0x0f)<<2) : 0; SLOT->eg_sh_rr = eg_rate_shift [SLOT->rr + SLOT->ksr ]; SLOT->eg_sel_rr = eg_rate_select[SLOT->rr + SLOT->ksr ]; @@ -1265,8 +1263,8 @@ static void load_instrument(UINT32 chan, UINT32 slot, UINT8* inst ) set_ksl_wave_fb(chan, inst[3]); set_ar_dr(slot, inst[4]); set_ar_dr(slot+1, inst[5]); - set_sl_rr(slot, inst[6]); - set_sl_rr(slot+1, inst[7]); + set_sl_rr_ym2413(slot, inst[6]); + set_sl_rr_ym2413(slot+1, inst[7]); } static void update_instrument_zero(UINT8 r) @@ -1345,7 +1343,7 @@ static void update_instrument_zero(UINT8 r) { if ((ym2413.instvol_r[chan]&0xf0)==0) { - set_sl_rr(chan*2, inst[6]); + set_sl_rr_ym2413(chan*2, inst[6]); } } break; @@ -1355,7 +1353,7 @@ static void update_instrument_zero(UINT8 r) { if ((ym2413.instvol_r[chan]&0xf0)==0) { - set_sl_rr(chan*2+1, inst[7]); + set_sl_rr_ym2413(chan*2+1, inst[7]); } } break; diff --git a/source/sound/ym2612.c b/source/sound/ym2612.c index 663f066..70479da 100644 --- a/source/sound/ym2612.c +++ b/source/sound/ym2612.c @@ -1011,7 +1011,7 @@ INLINE void set_sr(FM_SLOT *SLOT,int v) } /* set release rate */ -INLINE void set_sl_rr(FM_SLOT *SLOT,int v) +INLINE void set_sl_rr_ym2612(FM_SLOT *SLOT,int v) { SLOT->sl = sl_table[ v>>4 ]; @@ -1586,7 +1586,7 @@ INLINE void OPNWriteReg(int r, int v) break; case 0x80: /* SL, RR */ - set_sl_rr(SLOT,v); + set_sl_rr_ym2612(SLOT,v); break; case 0x90: /* SSG-EG */