mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-26 03:35:26 +00:00
Core/DSP: Fix loop/loopi for Interpreter and JIT.
A repeat count of zero still executed the instruction once. Fixes Zelda Ucode audio crackling. Fixes DSPLLE audio in: Luigi Mansion, Pikmin, Super Mario Galaxy, Zelda CE, Zelda Four Swords, Zelda WW, Zelda TP. (Thanks LM for testing) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7370 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
a2159f38bd
commit
ed6fa744ad
@ -193,6 +193,8 @@ void loop(const UDSPInstruction opc)
|
||||
dsp_reg_store_stack(2, loop_pc);
|
||||
dsp_reg_store_stack(3, cnt);
|
||||
}
|
||||
else
|
||||
dsp_skip_inst();
|
||||
}
|
||||
|
||||
// LOOPI #I
|
||||
@ -214,6 +216,8 @@ void loopi(const UDSPInstruction opc)
|
||||
dsp_reg_store_stack(2, loop_pc);
|
||||
dsp_reg_store_stack(3, cnt);
|
||||
}
|
||||
else
|
||||
dsp_skip_inst();
|
||||
}
|
||||
|
||||
|
||||
|
@ -377,9 +377,15 @@ void DSPEmitter::loop(const UDSPInstruction opc)
|
||||
MOV(16, R(RDX), Imm16(loop_pc));
|
||||
dsp_reg_store_stack(2);
|
||||
gpr.flushRegs(c);
|
||||
MOV(16, M(&(g_dsp.pc)), Imm16(compilePC + 1));
|
||||
FixupBranch exit = J(true);
|
||||
|
||||
SetJumpTarget(cnt);
|
||||
MOV(16, M(&(g_dsp.pc)), Imm16(compilePC + 1));
|
||||
// dsp_skip_inst();
|
||||
MOV(16, M(&g_dsp.pc), Imm16(loop_pc + opTable[loop_pc]->size));
|
||||
WriteBranchExit(*this);
|
||||
gpr.flushRegs(c,false);
|
||||
SetJumpTarget(exit);
|
||||
}
|
||||
|
||||
// LOOPI #I
|
||||
@ -395,7 +401,7 @@ void DSPEmitter::loopi(const UDSPInstruction opc)
|
||||
u16 cnt = opc & 0xff;
|
||||
u16 loop_pc = compilePC + 1;
|
||||
|
||||
if (cnt)
|
||||
if (cnt)
|
||||
{
|
||||
MOV(16, R(RDX), Imm16(compilePC + 1));
|
||||
dsp_reg_store_stack(0);
|
||||
@ -406,6 +412,12 @@ void DSPEmitter::loopi(const UDSPInstruction opc)
|
||||
|
||||
MOV(16, M(&(g_dsp.pc)), Imm16(compilePC + 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
// dsp_skip_inst();
|
||||
MOV(16, M(&g_dsp.pc), Imm16(loop_pc + opTable[loop_pc]->size));
|
||||
WriteBranchExit(*this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user