mirror of
https://github.com/zeldaret/mm.git
synced 2026-05-30 08:56:25 -04:00
Port OoT's docs for fault.c and fault_drawer.c (#1199)
* fault.h * some docs stealing * fix building * fault_internal.h * pass * finish stealing docs * finish cleanup * format * warning * Update src/boot_O2_g3/fault.c Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * Update src/boot_O2_g3/fault.c Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * Update src/boot_O2_g3/fault.c Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * review Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * arggggg * arggggg part 2 * STACK * PHYS_TO_K0(0x400000) * format * fix * Instance * format * Neutral reset * variables.h cleanup * bss * frameBuffer * format * Update src/boot_O2_g3/fault.c Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * review Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * Update src/boot_O2_g3/fault.c Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * bss * bss * bss * callback cleanup * fix function declarations * fix again * bss * bss * Update src/overlays/actors/ovl_En_Fishing/z_en_fishing.c Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Update src/boot_O2_g3/fault.c Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * bss * bss * Update src/boot_O2_g3/fault.c Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * review * import bss * format * minor cleanup * bss * review * fix * bss * bss * bss * bss * bss * format * a * Z_PRIORITY_FAULT * bss * fix * idle.c bss doesn't want to get fixed :c * review * bss --------- Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
This commit is contained in:
+18
-12
@@ -1,5 +1,17 @@
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
#include "z64.h"
|
||||
#include "regs.h"
|
||||
#include "functions.h"
|
||||
#include "fault.h"
|
||||
|
||||
// Variables are put before most headers as a hacky way to bypass bss reordering
|
||||
FaultAddrConvClient sGraphFaultAddrConvClient;
|
||||
FaultClient sGraphFaultClient;
|
||||
GfxMasterList* gGfxMasterDL;
|
||||
CfbInfo sGraphCfbInfos[3];
|
||||
OSTime sGraphTaskStartTime;
|
||||
|
||||
#include "variables.h"
|
||||
#include "macros.h"
|
||||
#include "buffers.h"
|
||||
#include "idle.h"
|
||||
#include "system_malloc.h"
|
||||
@@ -10,12 +22,6 @@
|
||||
#include "overlays/gamestates/ovl_title/z_title.h"
|
||||
#include "z_title_setup.h"
|
||||
|
||||
FaultAddrConvClient sGraphFaultAddrConvClient;
|
||||
FaultClient sGraphFaultClient;
|
||||
GfxMasterList* gGfxMasterDL;
|
||||
CfbInfo sGraphCfbInfos[3];
|
||||
OSTime sGraphTaskStartTime;
|
||||
|
||||
void Graph_FaultClient(void) {
|
||||
FaultDrawer_DrawText(30, 100, "ShowFrameBuffer PAGE 0/1");
|
||||
osViSwapBuffer(SysCfb_GetFramebuffer(0));
|
||||
@@ -93,7 +99,7 @@ GameStateOverlay* Graph_GetNextGameState(GameState* gameState) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void* Graph_FaultAddrConv(void* address, void* param) {
|
||||
uintptr_t Graph_FaultAddrConv(uintptr_t address, void* param) {
|
||||
uintptr_t addr = address;
|
||||
GameStateOverlay* gameStateOvl = &gGameStateOverlayTable[0];
|
||||
size_t ramConv;
|
||||
@@ -112,7 +118,7 @@ void* Graph_FaultAddrConv(void* address, void* param) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Graph_Init(GraphicsContext* gfxCtx) {
|
||||
@@ -124,7 +130,7 @@ void Graph_Init(GraphicsContext* gfxCtx) {
|
||||
gfxCtx->xScale = gViConfigXScale;
|
||||
gfxCtx->yScale = gViConfigYScale;
|
||||
osCreateMesgQueue(&gfxCtx->queue, gfxCtx->msgBuff, ARRAY_COUNT(gfxCtx->msgBuff));
|
||||
Fault_AddClient(&sGraphFaultClient, Graph_FaultClient, NULL, NULL);
|
||||
Fault_AddClient(&sGraphFaultClient, (void*)Graph_FaultClient, NULL, NULL);
|
||||
Fault_AddAddrConvClient(&sGraphFaultAddrConvClient, Graph_FaultAddrConv, NULL);
|
||||
}
|
||||
|
||||
@@ -354,7 +360,7 @@ void Graph_ThreadEntry(void* arg) {
|
||||
gGfxSPTaskOutputBufferEndHiRes = (u8*)gGfxSPTaskOutputBufferHiRes + sizeof(*gGfxSPTaskOutputBufferHiRes);
|
||||
|
||||
SysCfb_Init();
|
||||
Fault_SetFB(gWorkBuffer, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
Fault_SetFrameBuffer(gWorkBuffer, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
Graph_Init(&gfxCtx);
|
||||
|
||||
while (nextOvl) {
|
||||
|
||||
Reference in New Issue
Block a user