revert this for now, i need to read more
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2739 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
32b983ef83
commit
fc582ea560
|
@ -213,12 +213,62 @@ void CheckExceptions()
|
|||
// gcemu uses the mask 0x87C0FFFF instead of 0x0780FF77
|
||||
// Investigate!
|
||||
|
||||
// EXTERNAL INTTERUPT
|
||||
if (MSR & 0x0008000)
|
||||
if (ppcState.Exceptions & EXCEPTION_FPU_UNAVAILABLE)
|
||||
{
|
||||
//This happens a lot - Gamecube OS uses deferred FPU context switching
|
||||
SRR0 = PC; // re-execute the instruction
|
||||
SRR1 = MSR & 0x0780FF77;
|
||||
NPC = 0x80000800;
|
||||
|
||||
INFO_LOG(GEKKO, "EXCEPTION_FPU_UNAVAILABLE");
|
||||
ppcState.Exceptions &= ~EXCEPTION_FPU_UNAVAILABLE;
|
||||
SRR1 |= 0x02; //recoverable
|
||||
}
|
||||
else if (ppcState.Exceptions & EXCEPTION_SYSCALL)
|
||||
{
|
||||
SRR0 = NPC; // execute next instruction when we come back from handler
|
||||
SRR1 = MSR & 0x0780FF77;
|
||||
NPC = 0x80000C00;
|
||||
|
||||
INFO_LOG(GEKKO, "EXCEPTION_SYSCALL (PC=%08x)", PC);
|
||||
ppcState.Exceptions &= ~EXCEPTION_SYSCALL;
|
||||
SRR1 |= 0x02; //recoverable
|
||||
}
|
||||
else if (ppcState.Exceptions & EXCEPTION_DSI)
|
||||
{
|
||||
SRR0 = PC; // re-execute the instruction
|
||||
SRR1 = MSR & 0x0780FF77;
|
||||
NPC = 0x80000300;
|
||||
|
||||
INFO_LOG(GEKKO, "EXCEPTION_DSI");
|
||||
ppcState.Exceptions &= ~EXCEPTION_DSI;
|
||||
//SRR1 |= 0x02; //make recoverable ?
|
||||
}
|
||||
else if (ppcState.Exceptions & EXCEPTION_ISI)
|
||||
{
|
||||
SRR0 = PC;
|
||||
SRR1 = (MSR & 0x0780FF77) | 0x40000000;
|
||||
NPC = 0x80000400;
|
||||
|
||||
INFO_LOG(GEKKO, "EXCEPTION_ISI");
|
||||
ppcState.Exceptions &= ~EXCEPTION_ISI;
|
||||
//SRR1 |= 0x02; //make recoverable ?
|
||||
}
|
||||
else if (ppcState.Exceptions & EXCEPTION_ALIGNMENT)
|
||||
{
|
||||
//This never happens ATM
|
||||
SRR0 = NPC;
|
||||
SRR1 = MSR & 0x0780FF77;
|
||||
NPC = 0x80000600;
|
||||
|
||||
INFO_LOG(GEKKO, "EXCEPTION_ALIGNMENT");
|
||||
ppcState.Exceptions &= ~EXCEPTION_ALIGNMENT;
|
||||
//SRR1 |= 0x02; //make recoverable ?
|
||||
}
|
||||
|
||||
// EXTERNAL INTTERUPT
|
||||
else if (MSR & 0x0008000)
|
||||
{
|
||||
// EXCEPTION_SYSRESET (hard)
|
||||
// EXCEPTION_MACHINE_CHECK
|
||||
// EXCEPTION_SYSRESET (soft)
|
||||
if (ppcState.Exceptions & EXCEPTION_EXTERNAL_INT)
|
||||
{
|
||||
// Pokemon gets this "too early", it hasn't a handler yet
|
||||
|
@ -233,7 +283,6 @@ void CheckExceptions()
|
|||
SRR1 |= 0x02; //set it to recoverable
|
||||
_dbg_assert_msg_(GEKKO, (SRR1 & 0x02) != 0, "GEKKO", "EXTERNAL_INT unrecoverable???"); // unrecoverable exception !?!
|
||||
}
|
||||
// EXCEPTION_PERF_MONITOR
|
||||
else if (ppcState.Exceptions & EXCEPTION_DECREMENTER)
|
||||
{
|
||||
SRR0 = NPC;
|
||||
|
@ -251,73 +300,6 @@ void CheckExceptions()
|
|||
ERROR_LOG(GEKKO, "Unknown EXTERNAL INTERRUPT exception: Exceptions == %08x", ppcState.Exceptions);
|
||||
}
|
||||
}
|
||||
else if (ppcState.Exceptions & EXCEPTION_ISI)
|
||||
{
|
||||
SRR0 = PC;
|
||||
SRR1 = (MSR & 0x0780FF77) | 0x40000000;
|
||||
NPC = 0x80000400;
|
||||
|
||||
INFO_LOG(GEKKO, "EXCEPTION_ISI");
|
||||
ppcState.Exceptions &= ~EXCEPTION_ISI;
|
||||
//SRR1 |= 0x02; //make recoverable ?
|
||||
}
|
||||
// EXCEPTION_ADDR_BREAKPOINT
|
||||
else if (ppcState.Exceptions & EXCEPTION_PROGRAM)
|
||||
{
|
||||
SRR0 = NPC; // execute next instruction when we come back from handler
|
||||
SRR1 = MSR & 0x0780FF77;
|
||||
NPC = 0x80000700;
|
||||
|
||||
INFO_LOG(GEKKO, "EXCEPTION_PROGRAM (PC=%08x)", PC);
|
||||
ppcState.Exceptions &= ~EXCEPTION_PROGRAM;
|
||||
SRR1 |= 0x02; //recoverable
|
||||
}
|
||||
else if (ppcState.Exceptions & EXCEPTION_SYSCALL)
|
||||
{
|
||||
SRR0 = NPC; // execute next instruction when we come back from handler
|
||||
SRR1 = MSR & 0x0780FF77;
|
||||
NPC = 0x80000C00;
|
||||
|
||||
INFO_LOG(GEKKO, "EXCEPTION_SYSCALL (PC=%08x)", PC);
|
||||
ppcState.Exceptions &= ~EXCEPTION_SYSCALL;
|
||||
SRR1 |= 0x02; //recoverable
|
||||
}
|
||||
else if (ppcState.Exceptions & EXCEPTION_FPU_UNAVAILABLE)
|
||||
{
|
||||
//This happens a lot - Gamecube OS uses deferred FPU context switching
|
||||
SRR0 = PC; // re-execute the instruction
|
||||
SRR1 = MSR & 0x0780FF77;
|
||||
NPC = 0x80000800;
|
||||
|
||||
INFO_LOG(GEKKO, "EXCEPTION_FPU_UNAVAILABLE");
|
||||
ppcState.Exceptions &= ~EXCEPTION_FPU_UNAVAILABLE;
|
||||
SRR1 |= 0x02; //recoverable
|
||||
}
|
||||
// EXCEPTION_PROGRAM (floating point)
|
||||
else if (ppcState.Exceptions & EXCEPTION_DSI)
|
||||
{
|
||||
SRR0 = PC; // re-execute the instruction
|
||||
SRR1 = MSR & 0x0780FF77;
|
||||
NPC = 0x80000300;
|
||||
|
||||
INFO_LOG(GEKKO, "EXCEPTION_DSI");
|
||||
ppcState.Exceptions &= ~EXCEPTION_DSI;
|
||||
//SRR1 |= 0x02; //make recoverable ?
|
||||
}
|
||||
else if (ppcState.Exceptions & EXCEPTION_ALIGNMENT)
|
||||
{
|
||||
// Alignment exceptions have priorities
|
||||
//This never happens ATM
|
||||
SRR0 = NPC;
|
||||
SRR1 = MSR & 0x0780FF77;
|
||||
NPC = 0x80000600;
|
||||
|
||||
INFO_LOG(GEKKO, "EXCEPTION_ALIGNMENT");
|
||||
ppcState.Exceptions &= ~EXCEPTION_ALIGNMENT;
|
||||
//SRR1 |= 0x02; //make recoverable ?
|
||||
}
|
||||
// Other DSI exceptions
|
||||
// EXCEPTION_TRACE
|
||||
MSR &= ~0x0008000; // clear EE-bit so interrupts aren't possible anymore
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue