diff options
| author | nakeee <nakeee@gmail.com> | 2009-07-05 13:07:38 +0000 |
|---|---|---|
| committer | nakeee <nakeee@gmail.com> | 2009-07-05 13:07:38 +0000 |
| commit | 96429cf75245f87295ecb1454ad6214775aca718 (patch) | |
| tree | f51009f1bf731f5c811bf7d448320dc2f2f1bdb1 /Source/Core/DSPCore/Src/DSPCore.cpp | |
| parent | df3abc6a2a7bb30015b9c21d276b0c8320efae00 (diff) | |
DSPLLE Take 2 in getting rid of exception hack.
This time zelda seems to work and mails seems to pass between CPU and SPU
Very similar to the ones from HLE
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3680 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DSPCore/Src/DSPCore.cpp')
| -rw-r--r-- | Source/Core/DSPCore/Src/DSPCore.cpp | 50 |
1 files changed, 31 insertions, 19 deletions
diff --git a/Source/Core/DSPCore/Src/DSPCore.cpp b/Source/Core/DSPCore/Src/DSPCore.cpp index d7eebd5e4f..6a70432552 100644 --- a/Source/Core/DSPCore/Src/DSPCore.cpp +++ b/Source/Core/DSPCore/Src/DSPCore.cpp @@ -145,6 +145,7 @@ void DSPCore_Reset() g_dsp.r[DSP_REG_WR1] = 0xffff;
g_dsp.r[DSP_REG_WR2] = 0xffff;
g_dsp.r[DSP_REG_WR3] = 0xffff;
+
}
void DSPCore_SetException(u8 level)
@@ -157,8 +158,14 @@ void DSPCore_CheckExternalInterrupt() // check if there is an external interrupt
if (g_dsp.cr & CR_EXTERNAL_INT)
{
- if (dsp_SR_is_flag_set(SR_EXT_INT_ENABLE) && (g_dsp.exception_in_progress_hack == false))
+#ifdef DEBUG_EXP
+ NOTICE_LOG(DSPLLE, "trying External interupt fired");
+#endif
+ if (dsp_SR_is_flag_set(SR_EXT_INT_ENABLE))
{
+#ifdef DEBUG_EXP
+ NOTICE_LOG(DSPLLE, "External interupt fired");
+#endif
// level 7 is the interrupt exception
DSPCore_SetException(EXP_INT);
@@ -167,25 +174,30 @@ void DSPCore_CheckExternalInterrupt() }
}
-void DSPCore_CheckExceptions()
+void DSPCore_CheckExceptions()
{
- // check exceptions
- if ((g_dsp.exceptions != 0) && (!g_dsp.exception_in_progress_hack))
- {
- for (int i = 0; i < 8; i++)
- {
- 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.pc = i * 2;
- g_dsp.exceptions &= ~(1 << i);
-
- g_dsp.exception_in_progress_hack = true;
- break;
+ if (g_dsp.exceptions != 0) {
+#ifdef DEBUG_EXP
+ NOTICE_LOG(DSPLLE, "trying exception %d fired", g_dsp.exceptions);
+#endif
+ // check exceptions
+ for (int i = 0; i < 8; i++) {
+ // Seems 7 must pass or zelda dies
+ if (dsp_SR_is_flag_set(SR_INT_ENABLE) || i == EXP_INT) {
+ 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.pc = i * 2;
+ g_dsp.exceptions &= ~(1 << i);
+#ifdef DEBUG_EXP
+ NOTICE_LOG(DSPLLE, "exception %d fired");
+#endif
+ g_dsp.exception_in_progress_hack = true;
+ break;
+ }
}
}
}
|
