Fixed the DSPLLE on thread option. Works with DSP JIT, DSP Interpreter, AX and Zelda ucodes.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6859 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
skidau 2011-01-16 10:47:29 +00:00
parent 7e9f02869a
commit f9f7629268
3 changed files with 32 additions and 4 deletions

View File

@ -191,7 +191,13 @@ void DSPCore_SetException(u8 level)
g_dsp.exceptions |= 1 << level; g_dsp.exceptions |= 1 << level;
} }
// Comming from the CPU // Notify that an external interrupt is pending (used by thread mode)
void DSPCore_SetExternalInterrupt()
{
g_dsp.external_interrupt_waiting = true;
}
// Coming from the CPU
void DSPCore_CheckExternalInterrupt() void DSPCore_CheckExternalInterrupt()
{ {
if (! dsp_SR_is_flag_set(SR_EXT_INT_ENABLE)) if (! dsp_SR_is_flag_set(SR_EXT_INT_ENABLE))
@ -244,6 +250,14 @@ int DSPCore_RunCycles(int cycles)
cyclesLeft = cycles; cyclesLeft = cycles;
CompiledCode pExecAddr = (CompiledCode)jit->enterDispatcher; CompiledCode pExecAddr = (CompiledCode)jit->enterDispatcher;
pExecAddr(); pExecAddr();
if (g_dsp.external_interrupt_waiting)
{
DSPCore_CheckExternalInterrupt();
DSPCore_CheckExceptions();
g_dsp.external_interrupt_waiting = false;
}
return cyclesLeft; return cyclesLeft;
} }

View File

@ -231,6 +231,7 @@ struct SDSP
u8 reg_stack_ptr[4]; u8 reg_stack_ptr[4];
u8 exceptions; // pending exceptions u8 exceptions; // pending exceptions
bool external_interrupt_waiting;
// DSP hardware stacks. They're mapped to a bunch of registers, such that writes // DSP hardware stacks. They're mapped to a bunch of registers, such that writes
// to them push and reads pop. // to them push and reads pop.
@ -277,6 +278,7 @@ void DSPCore_Shutdown(); // Frees all allocated memory.
void DSPCore_CheckExternalInterrupt(); void DSPCore_CheckExternalInterrupt();
void DSPCore_CheckExceptions(); void DSPCore_CheckExceptions();
void DSPCore_SetExternalInterrupt();
// sets a flag in the pending exception register. // sets a flag in the pending exception register.
void DSPCore_SetException(u8 level); void DSPCore_SetException(u8 level);

View File

@ -150,8 +150,14 @@ int RunCyclesDebug(int cycles)
if (cycles < 0) if (cycles < 0)
return 0; return 0;
} }
//DSPCore_CheckExternalInterrupt(); // In thread mode, process external interrupts
if (g_dsp.external_interrupt_waiting)
{
DSPCore_CheckExternalInterrupt();
DSPCore_CheckExceptions();
g_dsp.external_interrupt_waiting = false;
}
while (true) while (true)
{ {
@ -209,7 +215,13 @@ int RunCycles(int cycles)
return 0; return 0;
} }
//DSPCore_CheckExternalInterrupt(); // In thread mode, process external interrupts
if (g_dsp.external_interrupt_waiting)
{
DSPCore_CheckExternalInterrupt();
DSPCore_CheckExceptions();
g_dsp.external_interrupt_waiting = false;
}
while (true) while (true)
{ {