SPU2ghz: Reverted an experimental ASDR slider that broke way more than expected.. >_<

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@471 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2009-02-11 08:07:37 +00:00
parent d5bc5099d1
commit 343afaffdf
2 changed files with 21 additions and 25 deletions

View File

@ -344,8 +344,8 @@ static int GetLinearSrAr( uint SrAr )
// the bottom 2 bits go on the left side of the shift, and // the bottom 2 bits go on the left side of the shift, and
// the right side of the shift gets divided by 4: // the right side of the shift gets divided by 4:
const uint newSr = 0x127 - SrAr; const uint newSr = 0x7f - SrAr;
return (1+(newSr&3)) << (30UL-(newSr>>2)); return ((1|(newSr&3)) << (newSr>>2));
} }
static void __forceinline CalculateADSR( V_Voice& vc ) static void __forceinline CalculateADSR( V_Voice& vc )
@ -372,9 +372,9 @@ static void __forceinline CalculateADSR( V_Voice& vc )
if (env.Am && (env.Value>=0x60000000)) if (env.Am && (env.Value>=0x60000000))
env.Value += PsxRates[(env.Ar^0x7f)-0x18+32]; env.Value += PsxRates[(env.Ar^0x7f)-0x18+32];
else if( env.Ar < 0x7f ) else //if( env.Ar < 0x7f )
//env.Value+=PsxRates[(env.Ar^0x7f)-0x10+32]; env.Value+=PsxRates[(env.Ar^0x7f)-0x10+32];
env.Value += GetLinearSrAr( env.Ar ); //env.Value += GetLinearSrAr( env.Ar );
if( env.Value < 0 ) if( env.Value < 0 )
{ {
@ -422,8 +422,8 @@ static void __forceinline CalculateADSR( V_Voice& vc )
} }
else // linear else // linear
{ {
//env.Value-=PsxRates[(env.Sr^0x7f)-0xf+32]; env.Value-=PsxRates[(env.Sr^0x7f)-0xf+32];
env.Value -= GetLinearSrAr( env.Sr ); //env.Value -= GetLinearSrAr( env.Sr );
} }
if( env.Value <= 0 ) if( env.Value <= 0 )
@ -439,10 +439,8 @@ static void __forceinline CalculateADSR( V_Voice& vc )
else else
{ {
// linear / Pseudo below 75% (they're the same) // linear / Pseudo below 75% (they're the same)
//env.Value+=PsxRates[(env.Sr^0x7f)-0x10+32]; env.Value+=PsxRates[(env.Sr^0x7f)-0x10+32];
//env.Value += GetLinearSrAr( env.Sr );
int newSr = 0x7f-env.Sr;
env.Value += GetLinearSrAr( env.Sr );
} }
if( env.Value < 0 ) if( env.Value < 0 )
@ -471,7 +469,7 @@ static void __forceinline CalculateADSR( V_Voice& vc )
{ {
//env.Value-=PsxRates[((env.Rr^0x1f)*4)-0xc+32]; //env.Value-=PsxRates[((env.Rr^0x1f)*4)-0xc+32];
if( env.Rr != 0x1f ) if( env.Rr != 0x1f )
env.Value -= 1 << (30UL-env.Rr); env.Value -= (1 << (0x1f-env.Rr));
} }
if( env.Value <= 0 ) if( env.Value <= 0 )
@ -1068,8 +1066,8 @@ static __forceinline void MixVoice( V_Core& thiscore, V_Voice& vc, s32& VValL, s
// Write-back of raw voice data (post ADSR applied) // Write-back of raw voice data (post ADSR applied)
if (voice==1) spu2M_WriteFast( 0x400 + (core<<12) + OutPos, (s16)Value>>3 ); if (voice==1) spu2M_WriteFast( 0x400 + (core<<12) + OutPos, (s16)Value );
else if (voice==3) spu2M_WriteFast( 0x600 + (core<<12) + OutPos, (s16)Value>>3 ); else if (voice==3) spu2M_WriteFast( 0x600 + (core<<12) + OutPos, (s16)Value );
} }

View File

@ -1317,17 +1317,15 @@ void VoiceStart(int core,int vc)
#ifndef PUBLIC #ifndef PUBLIC
DebugCores[core].Voices[vc].FirstBlock=1; DebugCores[core].Voices[vc].FirstBlock=1;
if(core==1)
{ if(MsgKeyOnOff()) ConLog(" * SPU2: KeyOn: C%dV%02d: SSA: %8x; M: %s%s%s%s; H: %02x%02x; P: %04x V: %04x/%04x; ADSR: %04x%04x\n",
if(MsgKeyOnOff()) ConLog(" * SPU2: KeyOn: C%dV%02d: SSA: %8x; M: %s%s%s%s; H: %02x%02x; P: %04x V: %04x/%04x; ADSR: %04x%04x\n", core,vc,Cores[core].Voices[vc].StartA,
core,vc,Cores[core].Voices[vc].StartA, (Cores[core].Voices[vc].DryL)?"+":"-",(Cores[core].Voices[vc].DryR)?"+":"-",
(Cores[core].Voices[vc].DryL)?"+":"-",(Cores[core].Voices[vc].DryR)?"+":"-", (Cores[core].Voices[vc].WetL)?"+":"-",(Cores[core].Voices[vc].WetR)?"+":"-",
(Cores[core].Voices[vc].WetL)?"+":"-",(Cores[core].Voices[vc].WetR)?"+":"-", *(u8*)GetMemPtr(Cores[core].Voices[vc].StartA),*(u8 *)GetMemPtr((Cores[core].Voices[vc].StartA)+1),
*(u8*)GetMemPtr(Cores[core].Voices[vc].StartA),*(u8 *)GetMemPtr((Cores[core].Voices[vc].StartA)+1), Cores[core].Voices[vc].Pitch,
Cores[core].Voices[vc].Pitch, Cores[core].Voices[vc].VolumeL.Value,Cores[core].Voices[vc].VolumeR.Value,
Cores[core].Voices[vc].VolumeL.Value,Cores[core].Voices[vc].VolumeR.Value, Cores[core].Voices[vc].ADSR.Reg_ADSR1,Cores[core].Voices[vc].ADSR.Reg_ADSR2);
Cores[core].Voices[vc].ADSR.Reg_ADSR1,Cores[core].Voices[vc].ADSR.Reg_ADSR2);
}
#endif #endif
} }
else else