Skip to content

Commit 1606029

Browse files
committed
Fix missing notes in musics with DSPHLE.
Tales of Symphonia and Skies of Arcadia Legends now have working musics with DSPHLE. Some other games with the same symptoms (missing instruments) should probably be fixed by that change too.
1 parent 8eb6f90 commit 1606029

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX.cpp

+18-2
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,6 @@ void CUCode_AX::MixAdd(short* _pBuffer, int _iSize)
172172
if (!ReadPB(blockAddr, PB))
173173
break;
174174

175-
ProcessUpdates(PB);
176-
177175
if (m_CRC != 0x3389a79e)
178176
VoiceHacks(PB);
179177

@@ -335,6 +333,24 @@ bool CUCode_AX::AXTask(u32& _uMail)
335333
PBaddr[numPBaddr] = HLEMemory_Read_U32(uAddress);
336334
numPBaddr++;
337335

336+
// HACK: process updates right now instead of waiting until
337+
// Premix is called. Some games using sequenced music (Tales of
338+
// Symphonia for example) thought PBs were unused because we
339+
// were too slow to update them and set them as running. This
340+
// happens because Premix is basically completely desync-ed
341+
// from the emulation core (it's running in the audio thread).
342+
// Fixing this would require rewriting most of the AX HLE.
343+
u32 block_addr = uAddress;
344+
AXPB pb;
345+
while (block_addr)
346+
{
347+
if (!ReadPB(block_addr, pb))
348+
break;
349+
ProcessUpdates(pb);
350+
WritePB(block_addr, pb);
351+
block_addr = (pb.next_pb_hi << 16) | pb.next_pb_lo;
352+
}
353+
338354
m_addressPBs = HLEMemory_Read_U32(uAddress); // left in for now
339355
uAddress += 4;
340356
soundStream->GetMixer()->SetHLEReady(true);

0 commit comments

Comments
 (0)