DSPLLE: Commented out the else in bloop, it doesn't make sense, and I didn't get any
regression, but please check and tell me if it broke something. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3695 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
ce6e8ed798
commit
d8d2b8030e
|
@ -142,20 +142,20 @@ void halt(const UDSPInstruction& opc)
|
||||||
// LOOP handling: Loop stack is used to control execution of repeated blocks of
|
// LOOP handling: Loop stack is used to control execution of repeated blocks of
|
||||||
// instructions. Whenever there is value on stack $st2 and current PC is equal
|
// instructions. Whenever there is value on stack $st2 and current PC is equal
|
||||||
// value at $st2, then value at stack $st3 is decremented. If value is not zero
|
// value at $st2, then value at stack $st3 is decremented. If value is not zero
|
||||||
// then PC is modified with calue from call stack $st0. Otherwise values from
|
// then PC is modified with value from call stack $st0. Otherwise values from
|
||||||
// callstack $st0 and both loop stacks $st2 and $st3 are poped and execution
|
// call stack $st0 and both loop stacks $st2 and $st3 are poped and execution
|
||||||
// continues at next opcode.
|
// continues at next opcode.
|
||||||
void HandleLoop()
|
void HandleLoop()
|
||||||
{
|
{
|
||||||
// Handle looping hardware.
|
// Handle looping hardware.
|
||||||
|
const u16 rCallAddress = g_dsp.r[DSP_REG_ST0];
|
||||||
|
const u16 rLoopAddress = g_dsp.r[DSP_REG_ST2];
|
||||||
u16& rLoopCounter = g_dsp.r[DSP_REG_ST3];
|
u16& rLoopCounter = g_dsp.r[DSP_REG_ST3];
|
||||||
if (rLoopCounter > 0)
|
|
||||||
|
if (rLoopAddress > 0 && rLoopCounter > 0)
|
||||||
{
|
{
|
||||||
const u16 rCallAddress = g_dsp.r[DSP_REG_ST0];
|
// FIXME: why -1?
|
||||||
const u16 rLoopAddress = g_dsp.r[DSP_REG_ST2];
|
if (g_dsp.pc - 1 == rLoopAddress)
|
||||||
|
|
||||||
|
|
||||||
if (g_dsp.pc == (rLoopAddress + 1)) //opSize[rLoopAddress]))
|
|
||||||
{
|
{
|
||||||
rLoopCounter--;
|
rLoopCounter--;
|
||||||
if (rLoopCounter > 0)
|
if (rLoopCounter > 0)
|
||||||
|
@ -239,11 +239,11 @@ void bloop(const UDSPInstruction& opc)
|
||||||
dsp_reg_store_stack(2, loop_pc);
|
dsp_reg_store_stack(2, loop_pc);
|
||||||
dsp_reg_store_stack(3, cnt);
|
dsp_reg_store_stack(3, cnt);
|
||||||
}
|
}
|
||||||
else
|
/* else
|
||||||
{
|
{
|
||||||
g_dsp.pc = loop_pc;
|
g_dsp.pc = loop_pc;
|
||||||
g_dsp.pc += opSize[dsp_peek_code()];
|
g_dsp.pc += opSize[dsp_peek_code()];
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
// BLOOPI #I, addrA
|
// BLOOPI #I, addrA
|
||||||
|
@ -260,17 +260,17 @@ void bloopi(const UDSPInstruction& opc)
|
||||||
u16 cnt = opc.hex & 0xff;
|
u16 cnt = opc.hex & 0xff;
|
||||||
u16 loop_pc = dsp_fetch_code();
|
u16 loop_pc = dsp_fetch_code();
|
||||||
|
|
||||||
if (cnt)
|
if (cnt)
|
||||||
{
|
{
|
||||||
dsp_reg_store_stack(0, g_dsp.pc);
|
dsp_reg_store_stack(0, g_dsp.pc);
|
||||||
dsp_reg_store_stack(2, loop_pc);
|
dsp_reg_store_stack(2, loop_pc);
|
||||||
dsp_reg_store_stack(3, cnt);
|
dsp_reg_store_stack(3, cnt);
|
||||||
}
|
}
|
||||||
else
|
/* else
|
||||||
{
|
{
|
||||||
g_dsp.pc = loop_pc;
|
g_dsp.pc = loop_pc;
|
||||||
g_dsp.pc += opSize[dsp_peek_code()];
|
g_dsp.pc += opSize[dsp_peek_code()];
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
Loading…
Reference in New Issue