Rename many functions, structs, and variables to match the oot decomp. Some things have not been renamed as their respective files have not been decompiled yet.

This commit is contained in:
rozlette
2020-03-15 01:13:53 -05:00
parent 0c35be2381
commit ff958ad932
42 changed files with 7946 additions and 7911 deletions
+1 -1
View File
@@ -884,7 +884,7 @@ void Fault_SetFB(void* fb, u16 w, u16 h) {
void Fault_Start(void){
faultCtxt = &faultContextStruct;
bzero(faultCtxt, sizeof(FaultContext));
bzero(faultCtxt, sizeof(FaultThreadStruct));
FaultDrawer_Init();
FaultDrawer_SetInputCallback(Fault_WaitForInput);
faultCtxt->exitDebugger = 0;
+28 -28
View File
@@ -1,8 +1,8 @@
#include <ultra64.h>
#include <global.h>
FaultDrawer* faultDrawContext = &faultDrawContextStruct;
FaultDrawer faultDrawContextInit = {
FaultDrawer* sFaultDrawContext = &sFaultDrawerStruct;
FaultDrawer sFaultDrawerDefault = {
(u16*)0x803DA800, // fb - TODO map out buffers in this region and avoid hard-coded pointer
320, 240, // w, h
16, 223, // yStart, yEnd
@@ -22,7 +22,7 @@ FaultDrawer faultDrawContextInit = {
};
void FaultDrawer_SetOsSyncPrintfEnabled(u32 enabled) {
faultDrawContext->osSyncPrintfEnabled = enabled;
sFaultDrawContext->osSyncPrintfEnabled = enabled;
}
@@ -32,9 +32,9 @@ void FaultDrawer_DrawRecImpl(s32 xstart, s32 ystart, s32 xend, s32 yend, u16 col
s32 x;
s32 y;
u16* fb;
if (faultDrawContext->w - xstart > 0 && faultDrawContext->h - ystart > 0) {
if (sFaultDrawContext->w - xstart > 0 && sFaultDrawContext->h - ystart > 0) {
for (y = 0; y < yend - ystart + 1; y++) {
fb = &faultDrawContext->fb[faultDrawContext->w * y];
fb = &sFaultDrawContext->fb[sFaultDrawContext->w * y];
for (x = 0; x < xend - xstart + 1; x++) {
*fb++ = color;
}
@@ -52,7 +52,7 @@ GLOBAL_ASM("./asm/non_matchings/fault_drawer/FaultDrawer_DrawChar.asm")
s32 FaultDrawer_ColorToPrintColor(u16 color) {
s32 i;
for (i = 0; i < 10; i++) {
if (color == faultDrawContext->printColors[i]) {
if (color == sFaultDrawContext->printColors[i]) {
return i;
}
}
@@ -61,13 +61,13 @@ s32 FaultDrawer_ColorToPrintColor(u16 color) {
void FaultDrawer_UpdatePrintColor() {
s32 idx;
if (faultDrawContext->osSyncPrintfEnabled) {
if (sFaultDrawContext->osSyncPrintfEnabled) {
Fault_Log(D_80099050);
idx = FaultDrawer_ColorToPrintColor(faultDrawContext->foreColor);
idx = FaultDrawer_ColorToPrintColor(sFaultDrawContext->foreColor);
if (idx >= 0 && idx < 8) {
Fault_Log(D_80099054, idx);
}
idx = FaultDrawer_ColorToPrintColor(faultDrawContext->backColor);
idx = FaultDrawer_ColorToPrintColor(sFaultDrawContext->backColor);
if (idx >= 0 && idx < 8) {
Fault_Log(D_8009905C, idx);
}
@@ -75,12 +75,12 @@ void FaultDrawer_UpdatePrintColor() {
}
void FaultDrawer_SetForeColor(u16 color) {
faultDrawContext->foreColor = color;
sFaultDrawContext->foreColor = color;
FaultDrawer_UpdatePrintColor();
}
void FaultDrawer_SetBackColor(u16 color) {
faultDrawContext->backColor = color;
sFaultDrawContext->backColor = color;
FaultDrawer_UpdatePrintColor();
}
@@ -89,31 +89,31 @@ void FaultDrawer_SetFontColor(u16 color) {
}
void FaultDrawer_SetCharPad(s8 padW, s8 padH) {
faultDrawContext->charWPad = padW;
faultDrawContext->charHPad = padH;
sFaultDrawContext->charWPad = padW;
sFaultDrawContext->charHPad = padH;
}
void FaultDrawer_SetCursor(s32 x, s32 y) {
if (faultDrawContext->osSyncPrintfEnabled) {
Fault_Log(D_80099064, (y - faultDrawContext->yStart) / (faultDrawContext->charH + faultDrawContext->charHPad), (x - faultDrawContext->xStart) / (faultDrawContext->charW + faultDrawContext->charWPad));
if (sFaultDrawContext->osSyncPrintfEnabled) {
Fault_Log(D_80099064, (y - sFaultDrawContext->yStart) / (sFaultDrawContext->charH + sFaultDrawContext->charHPad), (x - sFaultDrawContext->xStart) / (sFaultDrawContext->charW + sFaultDrawContext->charWPad));
}
faultDrawContext->cursorX = x;
faultDrawContext->cursorY = y;
sFaultDrawContext->cursorX = x;
sFaultDrawContext->cursorY = y;
}
void FaultDrawer_FillScreen() {
if (faultDrawContext->osSyncPrintfEnabled) {
if (sFaultDrawContext->osSyncPrintfEnabled) {
Fault_Log(D_80099070);
}
FaultDrawer_DrawRecImpl(faultDrawContext->xStart, faultDrawContext->yStart, faultDrawContext->xEnd, faultDrawContext->yEnd, faultDrawContext->backColor | 1);
FaultDrawer_SetCursor(faultDrawContext->xStart, faultDrawContext->yStart);
FaultDrawer_DrawRecImpl(sFaultDrawContext->xStart, sFaultDrawContext->yStart, sFaultDrawContext->xEnd, sFaultDrawContext->yEnd, sFaultDrawContext->backColor | 1);
FaultDrawer_SetCursor(sFaultDrawContext->xStart, sFaultDrawContext->yStart);
}
GLOBAL_ASM("./asm/non_matchings/fault_drawer/FaultDrawer_FormatStringFunc.asm")
void FaultDrawer_VPrintf(char* str, char* args) { //va_list
_Printf((printf_func)FaultDrawer_FormatStringFunc, faultDrawContext, str, args);
_Printf((printf_func)FaultDrawer_FormatStringFunc, sFaultDrawContext, str, args);
}
GLOBAL_ASM("./asm/non_matchings/fault_drawer/FaultDrawer_Printf.asm")
@@ -121,18 +121,18 @@ GLOBAL_ASM("./asm/non_matchings/fault_drawer/FaultDrawer_Printf.asm")
GLOBAL_ASM("./asm/non_matchings/fault_drawer/FaultDrawer_DrawText.asm")
void FaultDrawer_SetDrawerFB(void* fb, u16 w, u16 h) {
faultDrawContext->fb = (u16*)fb;
faultDrawContext->w = w;
faultDrawContext->h = h;
sFaultDrawContext->fb = (u16*)fb;
sFaultDrawContext->w = w;
sFaultDrawContext->h = h;
}
void FaultDrawer_SetInputCallback(void(*callback)()) {
faultDrawContext->inputCallback = callback;
sFaultDrawContext->inputCallback = callback;
}
void FaultDrawer_Init() {
faultDrawContext = &faultDrawContextStruct;
_bcopy(&faultDrawContextInit, faultDrawContext, sizeof(FaultDrawer));
faultDrawContext->fb = (u16*)((osMemSize | 0x80000000) - 0x25800);
sFaultDrawContext = &sFaultDrawerStruct;
_bcopy(&sFaultDrawerDefault, sFaultDrawContext, sizeof(FaultDrawer));
sFaultDrawContext->fb = (u16*)((osMemSize | 0x80000000) - 0x25800);
}