Implement some previously unknown gekko/flipper cpuid-type regs

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4698 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman 2009-12-16 08:59:18 +00:00
parent 5a417fe76c
commit f2c060d8cb
6 changed files with 44 additions and 11 deletions

View file

@ -221,6 +221,9 @@ typedef unsigned int ppc_word;
case 921: return "WPAR";
case 922: return "DMA_U";
case 923: return "DMA_L";
case 924: return "ECID_U";
case 925: return "ECID_M";
case 926: return "ECID_L";
case 936: return "UMMCR0";
case 937: return "UPMC1";
case 938: return "UPMC2";

View file

@ -38,7 +38,7 @@ enum
PI_FIFO_WPTR = 0x14,
PI_FIFO_RESET = 0x18, // ??? - GXAbortFrame writes to it
PI_RESET_CODE = 0x24,
PI_MB_REV = 0x2C,
PI_FLIPPER_REV = 0x2C,
PI_UNKNOWN = 0x30 // ??? - BS1 writes to it
};
@ -53,7 +53,7 @@ u32 Fifo_CPUWritePointer;
u32 m_Fifo_Reset;
u32 m_ResetCode;
u32 m_MBRev;
u32 m_FlipperRev;
u32 m_Unknown;
@ -74,7 +74,7 @@ void DoState(PointerWrap &p)
p.Do(Fifo_CPUWritePointer);
p.Do(m_Fifo_Reset);
p.Do(m_ResetCode);
p.Do(m_MBRev);
p.Do(m_FlipperRev);
p.Do(m_Unknown);
}
@ -86,13 +86,17 @@ void Init()
Fifo_CPUBase = 0;
Fifo_CPUEnd = 0;
Fifo_CPUWritePointer = 0;
m_MBRev = 2 << 28; // HW2 production board
/*
Previous Flipper IDs:
0x046500B0 = A
0x146500B1 = B
*/
m_FlipperRev = 0x246500B1; // revision C
m_Unknown = 0;
// Bleh, why?
//m_ResetCode |= 0x80000000;
//m_InterruptCause |= INT_CAUSE_RST_BUTTON;
m_InterruptCause = INT_CAUSE_RST_BUTTON | INT_CAUSE_VI;
toggleResetButton = CoreTiming::RegisterEvent("ToggleResetButton", &ToggleResetButtonCallback);
}
@ -132,9 +136,9 @@ void Read32(u32& _uReturnValue, const u32 _iAddress)
_uReturnValue = m_ResetCode;
return;
case PI_MB_REV:
INFO_LOG(PROCESSORINTERFACE, "read board rev, 0x%08x", m_MBRev);
_uReturnValue = m_MBRev;
case PI_FLIPPER_REV:
INFO_LOG(PROCESSORINTERFACE, "read flipper rev, 0x%08x", m_FlipperRev);
_uReturnValue = m_FlipperRev;
return;
default:

View file

@ -252,7 +252,7 @@ void Init()
g_ComCSR.Hex = 0;
g_StatusReg.Hex = 0;
g_EXIClockCount.Hex = 0;
memset(g_SIBuffer, 0xce, 128); // This could be the cause of "WII something" in GCController
memset(g_SIBuffer, 0, 128);
changeDevice = CoreTiming::RegisterEvent("ChangeSIDevice", ChangeDeviceCallback);
}

View file

@ -611,6 +611,7 @@ enum
SPR_TU = 269,
SPR_TL_W = 284,
SPR_TU_W = 285,
SPR_PVR = 287,
SPR_SPRG0 = 272,
SPR_SPRG1 = 273,
SPR_SPRG2 = 274,
@ -637,7 +638,11 @@ enum
SPR_HID2 = 920,
SPR_WPAR = 921,
SPR_DMAU = 922,
SPR_DMAL = 923
SPR_DMAL = 923,
SPR_ECID_U = 924,
SPR_ECID_M = 925,
SPR_ECID_L = 926,
SPR_L2CR = 1017
};
// Exceptions

View file

@ -370,6 +370,7 @@ void mtspr(UGeckoInstruction _inst)
GPFifo::ResetGatherPipe();
break;
// Graphics Quantization Registers
case SPR_GQR0:
case SPR_GQR0 + 1:
case SPR_GQR0 + 2:
@ -399,6 +400,10 @@ void mtspr(UGeckoInstruction _inst)
DMAL.DMA_T = 0;
break;
case SPR_L2CR:
//PanicAlert("mtspr( L2CR )!");
break;
case SPR_DEC:
if (!(oldValue >> 31) && (m_GPR[_inst.RD]>>31)) //top bit from 0 to 1
{

View file

@ -79,6 +79,21 @@ void ResetRegisters()
}
memset(ppcState.spr, 0, sizeof(ppcState.spr));
/*
0x00080200 = lonestar 2.0
0x00088202 = lonestar 2.2
0x70000100 = gekko 1.0
0x00080100 = gekko 2.0
0x00083203 = gekko 2.3a
0x00083213 = gekko 2.3b
0x00083204 = gekko 2.4
0x00083214 = gekko 2.4e (8SE) - retail HW2
*/
ppcState.spr[SPR_PVR] = 0x00083214;
ppcState.spr[SPR_HID1] = 0x80000000; // We're running at 3x the bus clock
ppcState.spr[SPR_ECID_U] = 0x0d96e200;
ppcState.spr[SPR_ECID_M] = 0x1840c00d;
ppcState.spr[SPR_ECID_L] = 0x82bb08e8;
ppcState.cr = 0;
ppcState.fpscr = 0;
@ -89,6 +104,7 @@ void ResetRegisters()
TL = 0;
TU = 0;
// MSR should be 0x40, but we don't emulate BS1, so it would never be turned off :}
ppcState.msr = 0;
rDEC = 0xFFFFFFFF;
}