Make CIC_UNKOWN behave like CIC_NUS_6102. If debugger is enabled, it will display an error message with the missing CIC CRC.

This commit is contained in:
Emmet Young 2015-02-14 14:10:05 +11:00
parent e2f73e9e3d
commit 3e1498ef8e
4 changed files with 9 additions and 1 deletions

View File

@ -19,6 +19,7 @@ CDMA::CDMA(CFlashram & FlashRam, CSram & Sram) :
void CDMA::OnFirstDMA (void) {
switch (g_Rom->CicChipID()) {
case CIC_NUS_6101: *(DWORD *)&((g_MMU->Rdram())[0x318]) = g_MMU->RdramSize(); break;
case CIC_UNKNOWN:
case CIC_NUS_6102: *(DWORD *)&((g_MMU->Rdram())[0x318]) = g_MMU->RdramSize(); break;
case CIC_NUS_6103: *(DWORD *)&((g_MMU->Rdram())[0x318]) = g_MMU->RdramSize(); break;
case CIC_NUS_6105: *(DWORD *)&((g_MMU->Rdram())[0x3F0]) = g_MMU->RdramSize(); break;

View File

@ -734,6 +734,7 @@ void CN64System::InitRegisters( bool bPostPif, CMipsMemory & MMU )
case Europe: case Spanish: case Australia:
case X_PAL: case Y_PAL:
switch (g_Rom->CicChipID()) {
case CIC_UNKNOWN:
case CIC_NUS_6102:
m_Reg.m_GPR[5].DW=0xFFFFFFFFC0F1D859;
m_Reg.m_GPR[14].DW=0x000000002DE108EA;
@ -764,6 +765,7 @@ void CN64System::InitRegisters( bool bPostPif, CMipsMemory & MMU )
case NTSC_BETA: case X_NTSC: case USA: case Japan:
default:
switch (g_Rom->CicChipID()) {
case CIC_UNKNOWN:
case CIC_NUS_6102:
m_Reg.m_GPR[5].DW=0xFFFFFFFFC95973D5;
m_Reg.m_GPR[14].DW=0x000000002449A366;
@ -791,6 +793,7 @@ void CN64System::InitRegisters( bool bPostPif, CMipsMemory & MMU )
case CIC_NUS_6101:
m_Reg.m_GPR[22].DW=0x000000000000003F;
break;
case CIC_UNKNOWN:
case CIC_NUS_6102:
m_Reg.m_GPR[1].DW=0x0000000000000001;
m_Reg.m_GPR[2].DW=0x000000000EBDA536;
@ -849,6 +852,7 @@ void CN64System::InitRegisters( bool bPostPif, CMipsMemory & MMU )
switch (g_Rom->CicChipID()) {
case CIC_NUS_6101: PIF_Ram[37] = 0x06; PIF_Ram[38] = 0x3F; break;
case CIC_UNKNOWN:
case CIC_NUS_6102: PIF_Ram[37] = 0x02; PIF_Ram[38] = 0x3F; break;
case CIC_NUS_6103: PIF_Ram[37] = 0x02; PIF_Ram[38] = 0x78; break;
case CIC_NUS_6105: PIF_Ram[37] = 0x02; PIF_Ram[38] = 0x91; break;

View File

@ -244,6 +244,8 @@ void CN64Rom::CalculateCicChip ( void )
case 0x0000011A49F60E96: m_CicChip = CIC_NUS_6105; break;
case 0x000000D6D5BE5580: m_CicChip = CIC_NUS_6106; break;
default:
if (bHaveDebugger())
g_Notify->DisplayError("Unknown CIC checksum:\n%I64d.", CRC);
m_CicChip = CIC_UNKNOWN; break;
}

View File

@ -12,7 +12,8 @@
#include "N64 Types.h"
class CN64Rom
class CN64Rom :
protected CDebugSettings
{
//constant values
enum { ReadFromRomSection = 0x400000 };