diff options
Diffstat (limited to 'Source/Core/DSPCore/Src/DSPCore.cpp')
| -rw-r--r-- | Source/Core/DSPCore/Src/DSPCore.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/Source/Core/DSPCore/Src/DSPCore.cpp b/Source/Core/DSPCore/Src/DSPCore.cpp index 437f24fac9..565e2e6b1a 100644 --- a/Source/Core/DSPCore/Src/DSPCore.cpp +++ b/Source/Core/DSPCore/Src/DSPCore.cpp @@ -137,8 +137,10 @@ void DSPCore_Shutdown() void DSPCore_Reset()
{
+ _assert_msg_(MASTER_LOG, !g_dsp.exception_in_progress_hack, "reset while exception");
g_dsp.pc = DSP_RESET_VECTOR;
- g_dsp.r[DSP_REG_SR] |= SR_INT_ENABLE;
+ g_dsp.exception_in_progress_hack = false;
+
g_dsp.r[DSP_REG_WR0] = 0xffff;
g_dsp.r[DSP_REG_WR1] = 0xffff;
g_dsp.r[DSP_REG_WR2] = 0xffff;
@@ -155,10 +157,11 @@ void DSPCore_CheckExternalInterrupt() // check if there is an external interrupt
if (g_dsp.cr & CR_EXTERNAL_INT)
{
- if (dsp_SR_is_flag_set(SR_800) && dsp_SR_is_flag_set(SR_INT_ENABLE))
+ if (dsp_SR_is_flag_set(FLAG_ENABLE_INTERUPT) && (g_dsp.exception_in_progress_hack == false))
{
- // level 7 is the interrupt exception. is it?
- DSPCore_SetException(EXP_INT);
+ // level 7 is the interrupt exception
+ DSPCore_SetException(7);
+
g_dsp.cr &= ~CR_EXTERNAL_INT;
}
}
@@ -167,20 +170,21 @@ void DSPCore_CheckExternalInterrupt() void DSPCore_CheckExceptions()
{
// check exceptions
- if (g_dsp.exceptions != 0)
+ if ((g_dsp.exceptions != 0) && (!g_dsp.exception_in_progress_hack))
{
for (int i = 0; i < 8; i++)
{
- if (g_dsp.exceptions & (1 << i) && dsp_SR_is_flag_set(SR_INT_ENABLE))
+ if (g_dsp.exceptions & (1 << i))
{
-
+ _assert_msg_(MASTER_LOG, !g_dsp.exception_in_progress_hack, "assert while exception");
+
dsp_reg_store_stack(DSP_STACK_C, g_dsp.pc);
dsp_reg_store_stack(DSP_STACK_D, g_dsp.r[DSP_REG_SR]);
- g_dsp.r[DSP_REG_SR] &= ~ SR_INT_ENABLE;
g_dsp.pc = i * 2;
g_dsp.exceptions &= ~(1 << i);
+ g_dsp.exception_in_progress_hack = true;
break;
}
}
|
