mirror of https://github.com/zeldaret/mm.git
Cleanup pass for CIC6105.c (#1371)
* IO_READ * CIC6105.h * CIC defines * sRomInfoFaultClient * CIC6105_Init * CIC6105_Destroy * hopefully final cleanup * review * bss * bss
This commit is contained in:
parent
2e87212038
commit
a017b8f228
|
@ -0,0 +1,21 @@
|
||||||
|
#ifndef CIC6105_H
|
||||||
|
#define CIC6105_H
|
||||||
|
|
||||||
|
#include "ultra64.h"
|
||||||
|
|
||||||
|
// IPL3 puts values in those addresses as part of the anti-piracy checks
|
||||||
|
#define CIC_ADDRESS_1 0x002FB1F4
|
||||||
|
#define CIC_ADDRESS_2 0x002FE1C0
|
||||||
|
|
||||||
|
|
||||||
|
void CIC6105_Noop1(void);
|
||||||
|
void CIC6105_Noop2(void);
|
||||||
|
void CIC6105_PrintRomInfo(void);
|
||||||
|
void CIC6105_AddRomInfoFaultPage(void);
|
||||||
|
void CIC6105_Destroy(void);
|
||||||
|
void CIC6105_Init(void);
|
||||||
|
|
||||||
|
extern s32 gCICAddr1Val;
|
||||||
|
extern s32 gCICAddr2Val;
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,8 @@
|
||||||
|
#ifndef BUILD_H
|
||||||
|
#define BUILD_H
|
||||||
|
|
||||||
|
extern char gBuildTeam[];
|
||||||
|
extern char gBuildDate[];
|
||||||
|
extern char gBuildMakeOption[];
|
||||||
|
|
||||||
|
#endif
|
|
@ -34,13 +34,9 @@ void IrqMgr_HandlePRENMI500(IrqMgr* irqmgr);
|
||||||
void IrqMgr_HandleRetrace(IrqMgr* irqmgr);
|
void IrqMgr_HandleRetrace(IrqMgr* irqmgr);
|
||||||
void IrqMgr_ThreadEntry(IrqMgr* irqmgr);
|
void IrqMgr_ThreadEntry(IrqMgr* irqmgr);
|
||||||
void IrqMgr_Init(IrqMgr* irqmgr, void* stack, OSPri pri, u8 retraceCount);
|
void IrqMgr_Init(IrqMgr* irqmgr, void* stack, OSPri pri, u8 retraceCount);
|
||||||
void CIC6105_Nop80081820(void);
|
|
||||||
void CIC6105_Nop80081828(void);
|
|
||||||
void CIC6105_PrintRomInfo(void);
|
|
||||||
void CIC6105_AddRomInfoFaultPage(void);
|
|
||||||
void CIC6105_RemoveRomInfoFaultPage(void);
|
|
||||||
void func_800818F4(void);
|
|
||||||
void osSyncPrintfUnused(const char* fmt, ...);
|
void osSyncPrintfUnused(const char* fmt, ...);
|
||||||
|
|
||||||
void rmonPrintf(const char* fmt, ...);
|
void rmonPrintf(const char* fmt, ...);
|
||||||
|
|
||||||
void RcpUtils_PrintRegisterStatus(void);
|
void RcpUtils_PrintRegisterStatus(void);
|
||||||
|
|
|
@ -24,19 +24,12 @@ extern s32 sIrqMgrRetraceCount;
|
||||||
// extern UNK_TYPE4 D_80097524;
|
// extern UNK_TYPE4 D_80097524;
|
||||||
// extern u32 sRandInt;
|
// extern u32 sRandInt;
|
||||||
|
|
||||||
extern char gBuildTeam[];
|
|
||||||
extern char gBuildDate[];
|
|
||||||
extern char gBuildMakeOption[];
|
|
||||||
|
|
||||||
extern u8 sYaz0DataBuffer[0x400];
|
extern u8 sYaz0DataBuffer[0x400];
|
||||||
extern u8* sYaz0CurDataEnd;
|
extern u8* sYaz0CurDataEnd;
|
||||||
extern u32 sYaz0CurRomStart;
|
extern u32 sYaz0CurRomStart;
|
||||||
extern u32 sYaz0CurSize;
|
extern u32 sYaz0CurSize;
|
||||||
extern u8* sYaz0MaxPtr;
|
extern u8* sYaz0MaxPtr;
|
||||||
extern void* gYaz0DecompressDstEnd;
|
extern void* gYaz0DecompressDstEnd;
|
||||||
// extern UNK_TYPE4 D_8009BE30;
|
|
||||||
// extern UNK_TYPE4 D_8009BE34;
|
|
||||||
// extern FaultClient romInfoFaultClient;
|
|
||||||
|
|
||||||
// extern UNK_TYPE4 D_8009CD10;
|
// extern UNK_TYPE4 D_8009CD10;
|
||||||
extern u32 sRandFloat;
|
extern u32 sRandFloat;
|
||||||
|
|
|
@ -1,32 +1,33 @@
|
||||||
#include "prevent_bss_reordering.h"
|
#include "prevent_bss_reordering.h"
|
||||||
#include "global.h"
|
#include "CIC6105.h"
|
||||||
|
#include "build.h"
|
||||||
#include "fault.h"
|
#include "fault.h"
|
||||||
|
|
||||||
UNK_TYPE4 D_8009BE30;
|
s32 gCICAddr1Val;
|
||||||
UNK_TYPE4 D_8009BE34;
|
s32 gCICAddr2Val;
|
||||||
FaultClient romInfoFaultClient;
|
FaultClient sRomInfoFaultClient;
|
||||||
|
|
||||||
void CIC6105_Nop80081820(void) {
|
void CIC6105_Noop1(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CIC6105_Nop80081828(void) {
|
void CIC6105_Noop2(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CIC6105_PrintRomInfo(void) {
|
void CIC6105_PrintRomInfo(void) {
|
||||||
FaultDrawer_DrawText(80, 200, "SP_STATUS %08x", HW_REG(SP_STATUS_REG, u32));
|
FaultDrawer_DrawText(80, 200, "SP_STATUS %08x", IO_READ(SP_STATUS_REG));
|
||||||
FaultDrawer_DrawText(40, 184, "ROM_F [Creator:%s]", gBuildTeam);
|
FaultDrawer_DrawText(40, 184, "ROM_F [Creator:%s]", gBuildTeam);
|
||||||
FaultDrawer_DrawText(56, 192, "[Date:%s]", gBuildDate);
|
FaultDrawer_DrawText(56, 192, "[Date:%s]", gBuildDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CIC6105_AddRomInfoFaultPage(void) {
|
void CIC6105_AddRomInfoFaultPage(void) {
|
||||||
Fault_AddClient(&romInfoFaultClient, (void*)CIC6105_PrintRomInfo, NULL, NULL);
|
Fault_AddClient(&sRomInfoFaultClient, (void*)CIC6105_PrintRomInfo, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CIC6105_RemoveRomInfoFaultPage(void) {
|
void CIC6105_Destroy(void) {
|
||||||
Fault_RemoveClient(&romInfoFaultClient);
|
Fault_RemoveClient(&sRomInfoFaultClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_800818F4(void) {
|
void CIC6105_Init(void) {
|
||||||
D_8009BE30 = *(u32*)0xA02FB1F4;
|
gCICAddr1Val = IO_READ(CIC_ADDRESS_1);
|
||||||
D_8009BE34 = *(u32*)0xA02FE1C0;
|
gCICAddr2Val = IO_READ(CIC_ADDRESS_2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "idle.h"
|
#include "idle.h"
|
||||||
#include "stack.h"
|
#include "stack.h"
|
||||||
#include "stackcheck.h"
|
#include "stackcheck.h"
|
||||||
|
#include "CIC6105.h"
|
||||||
#include "z64thread.h"
|
#include "z64thread.h"
|
||||||
|
|
||||||
StackEntry sBootStackInfo;
|
StackEntry sBootStackInfo;
|
||||||
|
@ -14,7 +15,7 @@ STACK(sBootStack, 0x400);
|
||||||
void bootproc(void) {
|
void bootproc(void) {
|
||||||
StackCheck_Init(&sBootStackInfo, sBootStack, STACK_TOP(sBootStack), 0, -1, "boot");
|
StackCheck_Init(&sBootStackInfo, sBootStack, STACK_TOP(sBootStack), 0, -1, "boot");
|
||||||
osMemSize = osGetMemSize();
|
osMemSize = osGetMemSize();
|
||||||
func_800818F4();
|
CIC6105_Init();
|
||||||
osInitialize();
|
osInitialize();
|
||||||
osUnmapTLBAll();
|
osUnmapTLBAll();
|
||||||
gCartHandle = osCartRomInit();
|
gCartHandle = osCartRomInit();
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include "irqmgr.h"
|
#include "irqmgr.h"
|
||||||
#include "padmgr.h"
|
#include "padmgr.h"
|
||||||
#include "scheduler.h"
|
#include "scheduler.h"
|
||||||
|
#include "CIC6105.h"
|
||||||
#include "stack.h"
|
#include "stack.h"
|
||||||
#include "stackcheck.h"
|
#include "stackcheck.h"
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
* Description: Seahorse
|
* Description: Seahorse
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "prevent_bss_reordering.h"
|
||||||
#include "z_en_ot.h"
|
#include "z_en_ot.h"
|
||||||
#include "objects/object_ot/object_ot.h"
|
#include "objects/object_ot/object_ot.h"
|
||||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include "z_title.h"
|
#include "z_title.h"
|
||||||
#include "z64shrink_window.h"
|
#include "z64shrink_window.h"
|
||||||
#include "z64view.h"
|
#include "z64view.h"
|
||||||
|
#include "CIC6105.h"
|
||||||
#include "overlays/gamestates/ovl_opening/z_opening.h"
|
#include "overlays/gamestates/ovl_opening/z_opening.h"
|
||||||
#include "misc/nintendo_rogo_static/nintendo_rogo_static.h"
|
#include "misc/nintendo_rogo_static/nintendo_rogo_static.h"
|
||||||
|
|
||||||
|
@ -146,7 +147,7 @@ void ConsoleLogo_Destroy(GameState* thisx) {
|
||||||
|
|
||||||
Sram_InitSram(&this->state, &this->sramCtx);
|
Sram_InitSram(&this->state, &this->sramCtx);
|
||||||
ShrinkWindow_Destroy();
|
ShrinkWindow_Destroy();
|
||||||
CIC6105_Nop80081828();
|
CIC6105_Noop2();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConsoleLogo_Init(GameState* thisx) {
|
void ConsoleLogo_Init(GameState* thisx) {
|
||||||
|
|
|
@ -40,12 +40,12 @@
|
||||||
0x800815CC:("IrqMgr_HandleRetrace",),
|
0x800815CC:("IrqMgr_HandleRetrace",),
|
||||||
0x80081684:("IrqMgr_ThreadEntry",),
|
0x80081684:("IrqMgr_ThreadEntry",),
|
||||||
0x80081754:("IrqMgr_Init",),
|
0x80081754:("IrqMgr_Init",),
|
||||||
0x80081820:("CIC6105_Nop80081820",),
|
0x80081820:("CIC6105_Noop1",),
|
||||||
0x80081828:("CIC6105_Nop80081828",),
|
0x80081828:("CIC6105_Noop2",),
|
||||||
0x80081830:("CIC6105_PrintRomInfo",),
|
0x80081830:("CIC6105_PrintRomInfo",),
|
||||||
0x8008189C:("CIC6105_AddRomInfoFaultPage",),
|
0x8008189C:("CIC6105_AddRomInfoFaultPage",),
|
||||||
0x800818D0:("CIC6105_RemoveRomInfoFaultPage",),
|
0x800818D0:("CIC6105_Destroy",),
|
||||||
0x800818F4:("func_800818F4",),
|
0x800818F4:("CIC6105_Init",),
|
||||||
0x80081920:("osSyncPrintfUnused",),
|
0x80081920:("osSyncPrintfUnused",),
|
||||||
0x8008193C:("osSyncPrintf",),
|
0x8008193C:("osSyncPrintf",),
|
||||||
0x80081958:("rmonPrintf",),
|
0x80081958:("rmonPrintf",),
|
||||||
|
|
|
@ -310,9 +310,9 @@
|
||||||
0x8009BE18:("sYaz0CurSize","u32","",0x4),
|
0x8009BE18:("sYaz0CurSize","u32","",0x4),
|
||||||
0x8009BE1C:("sYaz0MaxPtr","u8*","",0x4),
|
0x8009BE1C:("sYaz0MaxPtr","u8*","",0x4),
|
||||||
0x8009BE20:("gYaz0DecompressDstEnd","void*","",0x4),
|
0x8009BE20:("gYaz0DecompressDstEnd","void*","",0x4),
|
||||||
0x8009BE30:("D_8009BE30","UNK_TYPE4","",0x4),
|
0x8009BE30:("gCICAddr1Val","UNK_TYPE4","",0x4),
|
||||||
0x8009BE34:("D_8009BE34","UNK_TYPE4","",0x4),
|
0x8009BE34:("gCICAddr2Val","UNK_TYPE4","",0x4),
|
||||||
0x8009BE38:("romInfoFaultClient","FaultClient","",0x10),
|
0x8009BE38:("sRomInfoFaultClient","FaultClient","",0x10),
|
||||||
0x8009BE50:("sFaultInstance","FaultMgr*","",0x4),
|
0x8009BE50:("sFaultInstance","FaultMgr*","",0x4),
|
||||||
0x8009BE54:("sFaultTimeTotal","f32","",0x4),
|
0x8009BE54:("sFaultTimeTotal","f32","",0x4),
|
||||||
0x8009BE58:("faultCustomOptions","u32","",0x4),
|
0x8009BE58:("faultCustomOptions","u32","",0x4),
|
||||||
|
|
|
@ -37,12 +37,12 @@ asm/non_matchings/boot/irqmgr/IrqMgr_HandlePRENMI500.s,IrqMgr_HandlePRENMI500,0x
|
||||||
asm/non_matchings/boot/irqmgr/IrqMgr_HandleRetrace.s,IrqMgr_HandleRetrace,0x800815CC,0x2E
|
asm/non_matchings/boot/irqmgr/IrqMgr_HandleRetrace.s,IrqMgr_HandleRetrace,0x800815CC,0x2E
|
||||||
asm/non_matchings/boot/irqmgr/IrqMgr_ThreadEntry.s,IrqMgr_ThreadEntry,0x80081684,0x34
|
asm/non_matchings/boot/irqmgr/IrqMgr_ThreadEntry.s,IrqMgr_ThreadEntry,0x80081684,0x34
|
||||||
asm/non_matchings/boot/irqmgr/IrqMgr_Init.s,IrqMgr_Init,0x80081754,0x33
|
asm/non_matchings/boot/irqmgr/IrqMgr_Init.s,IrqMgr_Init,0x80081754,0x33
|
||||||
asm/non_matchings/boot/CIC6105/CIC6105_Nop80081820.s,CIC6105_Nop80081820,0x80081820,0x2
|
asm/non_matchings/boot/CIC6105/CIC6105_Noop1.s,CIC6105_Noop1,0x80081820,0x2
|
||||||
asm/non_matchings/boot/CIC6105/CIC6105_Nop80081828.s,CIC6105_Nop80081828,0x80081828,0x2
|
asm/non_matchings/boot/CIC6105/CIC6105_Noop2.s,CIC6105_Noop2,0x80081828,0x2
|
||||||
asm/non_matchings/boot/CIC6105/CIC6105_PrintRomInfo.s,CIC6105_PrintRomInfo,0x80081830,0x1B
|
asm/non_matchings/boot/CIC6105/CIC6105_PrintRomInfo.s,CIC6105_PrintRomInfo,0x80081830,0x1B
|
||||||
asm/non_matchings/boot/CIC6105/CIC6105_AddRomInfoFaultPage.s,CIC6105_AddRomInfoFaultPage,0x8008189C,0xD
|
asm/non_matchings/boot/CIC6105/CIC6105_AddRomInfoFaultPage.s,CIC6105_AddRomInfoFaultPage,0x8008189C,0xD
|
||||||
asm/non_matchings/boot/CIC6105/CIC6105_RemoveRomInfoFaultPage.s,CIC6105_RemoveRomInfoFaultPage,0x800818D0,0x9
|
asm/non_matchings/boot/CIC6105/CIC6105_Destroy.s,CIC6105_Destroy,0x800818D0,0x9
|
||||||
asm/non_matchings/boot/CIC6105/func_800818F4.s,func_800818F4,0x800818F4,0xB
|
asm/non_matchings/boot/CIC6105/CIC6105_Init.s,CIC6105_Init,0x800818F4,0xB
|
||||||
asm/non_matchings/boot/syncprintf/osSyncPrintfUnused.s,osSyncPrintfUnused,0x80081920,0x7
|
asm/non_matchings/boot/syncprintf/osSyncPrintfUnused.s,osSyncPrintfUnused,0x80081920,0x7
|
||||||
asm/non_matchings/boot/syncprintf/osSyncPrintf.s,osSyncPrintf,0x8008193C,0x7
|
asm/non_matchings/boot/syncprintf/osSyncPrintf.s,osSyncPrintf,0x8008193C,0x7
|
||||||
asm/non_matchings/boot/syncprintf/rmonPrintf.s,rmonPrintf,0x80081958,0xA
|
asm/non_matchings/boot/syncprintf/rmonPrintf.s,rmonPrintf,0x80081958,0xA
|
||||||
|
|
|
Loading…
Reference in New Issue