(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
This commit is contained in:
twinaphex 2012-08-16 23:55:47 +02:00
parent f861ab1361
commit 86254071be
3 changed files with 100 additions and 9 deletions

View File

@ -200,6 +200,39 @@
<File
RelativePath="..\..\libretro.c">
</File>
<File
RelativePath="..\..\scrc32.c">
<FileConfiguration
Name="Debug|Xbox">
<Tool
Name="VCCLCompilerTool"
CompileAs="1"/>
</FileConfiguration>
<FileConfiguration
Name="Profile|Xbox">
<Tool
Name="VCCLCompilerTool"
CompileAs="1"/>
</FileConfiguration>
<FileConfiguration
Name="Profile_FastCap|Xbox">
<Tool
Name="VCCLCompilerTool"
CompileAs="1"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Xbox">
<Tool
Name="VCCLCompilerTool"
CompileAs="1"/>
</FileConfiguration>
<FileConfiguration
Name="Release_LTCG|Xbox">
<Tool
Name="VCCLCompilerTool"
CompileAs="1"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="source"
@ -311,9 +344,69 @@
</File>
<File
RelativePath="..\..\..\source\sound\ym2413.c">
<FileConfiguration
Name="Debug|Xbox">
<Tool
Name="VCCLCompilerTool"
Optimization="0"/>
</FileConfiguration>
<FileConfiguration
Name="Profile|Xbox">
<Tool
Name="VCCLCompilerTool"
Optimization="0"/>
</FileConfiguration>
<FileConfiguration
Name="Profile_FastCap|Xbox">
<Tool
Name="VCCLCompilerTool"
Optimization="0"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Xbox">
<Tool
Name="VCCLCompilerTool"
Optimization="0"/>
</FileConfiguration>
<FileConfiguration
Name="Release_LTCG|Xbox">
<Tool
Name="VCCLCompilerTool"
Optimization="0"/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\..\source\sound\ym2612.c">
<FileConfiguration
Name="Debug|Xbox">
<Tool
Name="VCCLCompilerTool"
Optimization="0"/>
</FileConfiguration>
<FileConfiguration
Name="Profile|Xbox">
<Tool
Name="VCCLCompilerTool"
Optimization="0"/>
</FileConfiguration>
<FileConfiguration
Name="Profile_FastCap|Xbox">
<Tool
Name="VCCLCompilerTool"
Optimization="0"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Xbox">
<Tool
Name="VCCLCompilerTool"
Optimization="0"/>
</FileConfiguration>
<FileConfiguration
Name="Release_LTCG|Xbox">
<Tool
Name="VCCLCompilerTool"
Optimization="0"/>
</FileConfiguration>
</File>
</Filter>
<Filter

View File

@ -1245,13 +1245,11 @@ INLINE void set_ar_dr(int slot,int v)
}
/* set sustain level & release rate */
INLINE void set_sl_rr(int slot,int v)
INLINE void set_sl_rr_ym2413(int slot,int v)
{
YM2413_OPLL_CH *CH = &ym2413.P_CH[slot/2];
YM2413_OPLL_SLOT *SLOT = &CH->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;

View File

@ -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 */