Re-implement BIOS SoundBias function more correctly. Get rid of SPU_ReadLong.

(is the bias feature really used by many games anyway? I don't think so)
This commit is contained in:
luigi__ 2009-10-08 19:58:15 +00:00
parent 1fcd48722a
commit d8578f1f58
3 changed files with 6 additions and 16 deletions

View File

@ -515,15 +515,6 @@ void SPU_struct::KeyOn(int channel)
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
u32 SPU_ReadLong(u32 addr)
{
addr &= 0xFFF;
return T1ReadLong(MMU.ARM7_REG, addr);
}
//////////////////////////////////////////////////////////////////////////////
void SPU_struct::WriteByte(u32 addr, u8 val) void SPU_struct::WriteByte(u32 addr, u8 val)
{ {
channel_struct &thischan=channels[(addr >> 4) & 0xF]; channel_struct &thischan=channels[(addr >> 4) & 0xF];

View File

@ -139,7 +139,6 @@ void SPU_KeyOn(int channel);
void SPU_WriteByte(u32 addr, u8 val); void SPU_WriteByte(u32 addr, u8 val);
void SPU_WriteWord(u32 addr, u16 val); void SPU_WriteWord(u32 addr, u16 val);
void SPU_WriteLong(u32 addr, u32 val); void SPU_WriteLong(u32 addr, u32 val);
u32 SPU_ReadLong(u32 addr);
void SPU_Emulate_core(void); void SPU_Emulate_core(void);
void SPU_Emulate_user(void); void SPU_Emulate_user(void);

View File

@ -1049,12 +1049,12 @@ TEMPLATE static u32 isDebugger()
TEMPLATE static u32 SoundBias() TEMPLATE static u32 SoundBias()
{ {
u32 current = SPU_ReadLong(0x4000504); u32 curBias = _MMU_read32<ARMCPU_ARM7>(0x04000504);
if (cpu->R[0] > current) u32 newBias = (curBias == 0) ? 0x000:0x200;
SPU_WriteLong(0x4000504, current + 0x1); u32 delay = (newBias > curBias) ? (newBias-curBias) : (curBias-newBias);
else
SPU_WriteLong(0x4000504, current - 0x1); _MMU_write32<ARMCPU_ARM7>(0x04000504, newBias);
return cpu->R[1]; return cpu->R[1] * delay;
} }
TEMPLATE static u32 getBootProcs() TEMPLATE static u32 getBootProcs()