mirror of
https://github.com/HarbourMasters/2ship2harkinian.git
synced 2024-11-23 22:19:53 +00: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:
parent
a506e8620a
commit
b3eae0e5b7
109
include/fault.h
Normal file
109
include/fault.h
Normal file
@ -0,0 +1,109 @@
|
||||
#ifndef FAULT_H
|
||||
#define FAULT_H
|
||||
|
||||
#include "ultra64.h"
|
||||
#include "unk.h"
|
||||
#include "libc/stdarg.h"
|
||||
#include "libc/stdint.h"
|
||||
#include "io/controller.h"
|
||||
#include "padmgr.h"
|
||||
#include "stack.h"
|
||||
|
||||
// These are the same as the 3-bit ansi color codes
|
||||
#define FAULT_COLOR_BLACK 0
|
||||
#define FAULT_COLOR_RED 1
|
||||
#define FAULT_COLOR_GREEN 2
|
||||
#define FAULT_COLOR_YELLOW 3
|
||||
#define FAULT_COLOR_BLUE 4
|
||||
#define FAULT_COLOR_MAGENTA 5
|
||||
#define FAULT_COLOR_CYAN 6
|
||||
#define FAULT_COLOR_WHITE 7
|
||||
// Additional color codes
|
||||
#define FAULT_COLOR_DARK_GRAY 8
|
||||
#define FAULT_COLOR_LIGHT_GRAY 9
|
||||
|
||||
#define FAULT_COLOR_STRINGIFY(s) #s
|
||||
#define FAULT_COLOR_EXPAND_AND_STRINGIFY(s) FAULT_COLOR_STRINGIFY(s)
|
||||
|
||||
#define FAULT_ESC '\x1A'
|
||||
#define FAULT_COLOR(n) "\x1A" FAULT_COLOR_EXPAND_AND_STRINGIFY(FAULT_COLOR_ ## n)
|
||||
|
||||
|
||||
// Address at the end of "non-expansion" memory space
|
||||
#define FAULT_FB_ADDRESS (void*)((PHYS_TO_K0(0x400000) - SCREEN_HEIGHT * SCREEN_WIDTH * sizeof(u16)))
|
||||
|
||||
typedef void (*FaultClientCallback)(void*, void*);
|
||||
|
||||
typedef struct FaultClient {
|
||||
/* 0x0 */ struct FaultClient* next;
|
||||
/* 0x4 */ FaultClientCallback callback;
|
||||
/* 0x8 */ void* arg0;
|
||||
/* 0xC */ void* arg1;
|
||||
} FaultClient; // size = 0x10
|
||||
|
||||
|
||||
typedef uintptr_t (*FaultAddrConvClientCallback)(uintptr_t, void*);
|
||||
|
||||
typedef struct FaultAddrConvClient {
|
||||
/* 0x0 */ struct FaultAddrConvClient* next;
|
||||
/* 0x4 */ FaultAddrConvClientCallback callback;
|
||||
/* 0x8 */ void* arg;
|
||||
} FaultAddrConvClient; // size = 0xC
|
||||
|
||||
typedef void(*FaultPadCallback)(Input* input);
|
||||
|
||||
|
||||
// Initialization
|
||||
|
||||
void Fault_Init(void);
|
||||
|
||||
// Fatal Errors
|
||||
|
||||
void Fault_AddHungupAndCrashImpl(const char* exp1, const char* exp2);
|
||||
void Fault_AddHungupAndCrash(const char* file, s32 line);
|
||||
|
||||
// Client Registration
|
||||
|
||||
void Fault_AddClient(FaultClient* client, FaultClientCallback callback, void* arg0, void* arg1);
|
||||
void Fault_RemoveClient(FaultClient* client);
|
||||
void Fault_AddAddrConvClient(FaultAddrConvClient* client, FaultAddrConvClientCallback callback, void* arg);
|
||||
void Fault_RemoveAddrConvClient(FaultAddrConvClient* client);
|
||||
|
||||
// For use in Fault Client callbacks
|
||||
|
||||
void Fault_WaitForInput(void);
|
||||
void Fault_FillScreenBlack(void);
|
||||
void Fault_SetFrameBuffer(void* fb, u16 w, u16 h);
|
||||
|
||||
void FaultDrawer_SetForeColor(u16 color);
|
||||
void FaultDrawer_SetBackColor(u16 color);
|
||||
void FaultDrawer_SetFontColor(u16 color);
|
||||
void FaultDrawer_SetCharPad(s8 padW, s8 padH);
|
||||
void FaultDrawer_SetCursor(s32 x, s32 y);
|
||||
s32 FaultDrawer_VPrintf(const char* fmt, va_list ap);
|
||||
s32 FaultDrawer_Printf(const char* fmt, ...);
|
||||
void FaultDrawer_DrawText(s32 x, s32 y, const char* fmt, ...);
|
||||
|
||||
|
||||
typedef struct FaultMgr {
|
||||
/* 0x000 */ OSThread thread;
|
||||
/* 0x1B0 */ STACK(stack, 0x600); // Seems leftover from an earlier version. The thread actually uses a stack of this size at 0x8009BE60
|
||||
/* 0x7B0 */ OSMesgQueue queue;
|
||||
/* 0x7C8 */ OSMesg msg[1];
|
||||
/* 0x7CC */ u8 exit;
|
||||
/* 0x7CD */ u8 msgId; // 1 - CPU Break; 2 - Fault; 3 - Unknown
|
||||
/* 0x7CE */ u8 faultHandlerEnabled;
|
||||
/* 0x7CF */ u8 autoScroll;
|
||||
/* 0x7D0 */ OSThread* faultedThread;
|
||||
/* 0x7D4 */ FaultPadCallback padCallback;
|
||||
/* 0x7D8 */ FaultClient* clients;
|
||||
/* 0x7DC */ FaultAddrConvClient* addrConvClients;
|
||||
/* 0x7E0 */ UNK_TYPE1 unk_7E0[0x4];
|
||||
/* 0x7E4 */ Input inputs[MAXCONTROLLERS];
|
||||
/* 0x844 */ void* fb;
|
||||
} FaultMgr; // size = 0x848
|
||||
|
||||
extern FaultMgr gFaultMgr;
|
||||
|
||||
|
||||
#endif
|
18
include/fault_internal.h
Normal file
18
include/fault_internal.h
Normal file
@ -0,0 +1,18 @@
|
||||
#ifndef FAULT_INTERNAL_H
|
||||
#define FAULT_INTERNAL_H
|
||||
|
||||
#include "ultra64.h"
|
||||
|
||||
|
||||
typedef void (*FaultDrawerCallback)(void);
|
||||
|
||||
void FaultDrawer_SetOsSyncPrintfEnabled(u32 enabled);
|
||||
void FaultDrawer_DrawRecImpl(s32 xStart, s32 yStart, s32 xEnd, s32 yEnd, u16 color);
|
||||
void FaultDrawer_FillScreen(void);
|
||||
void* FaultDrawer_FormatStringFunc(void* arg, const char* str, size_t count);
|
||||
void FaultDrawer_SetDrawerFrameBuffer(void* frameBuffer, u16 w, u16 h);
|
||||
void FaultDrawer_SetInputCallback(FaultDrawerCallback callback);
|
||||
void FaultDrawer_Init(void);
|
||||
|
||||
|
||||
#endif
|
@ -43,64 +43,7 @@ void func_800818F4(void);
|
||||
void __osSyncVPrintf(const char* fmt, ...);
|
||||
void osSyncPrintf(const char* fmt, ...);
|
||||
void rmonPrintf(const char* fmt, ...);
|
||||
void Fault_SleepImpl(u32 duration);
|
||||
void Fault_AddClient(FaultClient* client, void* callback, void* param0, void* param1);
|
||||
void Fault_RemoveClient(FaultClient* client);
|
||||
void Fault_AddAddrConvClient(FaultAddrConvClient* client, void* callback, void* param);
|
||||
void Fault_RemoveAddrConvClient(FaultAddrConvClient* client);
|
||||
void* Fault_ConvertAddress(void* addr);
|
||||
void Fault_Sleep(u32 duration);
|
||||
void Fault_PadCallback(Input* input);
|
||||
void Fault_UpdatePadImpl(void);
|
||||
u32 Fault_WaitForInputImpl(void);
|
||||
void Fault_WaitForInput(void);
|
||||
void Fault_DrawRec(s32 x, s32 y, s32 w, s32 h, u16 color);
|
||||
void Fault_FillScreenBlack(void);
|
||||
void Fault_FillScreenRed(void);
|
||||
void Fault_DrawCornerRec(u16 color);
|
||||
void Fault_PrintFReg(s32 idx, f32* value);
|
||||
void osSyncPrintfFReg(s32 idx, f32* value);
|
||||
void Fault_PrintFPCR(u32 value);
|
||||
void osSyncPrintfFPCR(u32 value);
|
||||
void Fault_PrintThreadContext(OSThread* t);
|
||||
void osSyncPrintfThreadContext(OSThread* t);
|
||||
OSThread* Fault_FindFaultedThread(void);
|
||||
void Fault_Wait5Seconds(void);
|
||||
void Fault_WaitForButtonCombo(void);
|
||||
void Fault_DrawMemDumpPage(const char* title, u32* addr, u32 param_3);
|
||||
void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1);
|
||||
void Fault_FindNextStackCall(uintptr_t* spPtr, uintptr_t* pcPtr, uintptr_t* raPtr);
|
||||
void Fault_DrawStackTrace(OSThread* t, u32 flags);
|
||||
void osSyncPrintfStackTrace(OSThread* t, u32 flags);
|
||||
void Fault_ResumeThread(OSThread* t);
|
||||
void Fault_CommitFB(void);
|
||||
void Fault_ProcessClients(void);
|
||||
void Fault_SetOptionsFromController3(void);
|
||||
void Fault_SetOptions(void);
|
||||
void Fault_ThreadEntry(void* arg);
|
||||
void Fault_SetFB(void* fb, u16 w, u16 h);
|
||||
void Fault_Start(void);
|
||||
void Fault_HangupFaultClient(const char* arg0, char* arg1);
|
||||
void Fault_AddHungupAndCrashImpl(const char* arg0, char* arg1);
|
||||
void Fault_AddHungupAndCrash(const char* filename, u32 line);
|
||||
void FaultDrawer_SetOsSyncPrintfEnabled(u32 enabled);
|
||||
void FaultDrawer_DrawRecImpl(s32 xStart, s32 yStart, s32 xEnd, s32 yEnd, u16 color);
|
||||
void FaultDrawer_DrawChar(char c);
|
||||
s32 FaultDrawer_ColorToPrintColor(u16 color);
|
||||
void FaultDrawer_UpdatePrintColor(void);
|
||||
void FaultDrawer_SetForeColor(u16 color);
|
||||
void FaultDrawer_SetBackColor(u16 color);
|
||||
void FaultDrawer_SetFontColor(u16 color);
|
||||
void FaultDrawer_SetCharPad(s8 padW, s8 padH);
|
||||
void FaultDrawer_SetCursor(s32 x, s32 y);
|
||||
void FaultDrawer_FillScreen(void);
|
||||
void* FaultDrawer_FormatStringFunc(void* arg, const char* str, size_t count);
|
||||
void FaultDrawer_VPrintf(const char* fmt, va_list ap);
|
||||
void FaultDrawer_Printf(const char* fmt, ...);
|
||||
void FaultDrawer_DrawText(s32 x, s32 y, const char* fmt, ...);
|
||||
void FaultDrawer_SetDrawerFB(void* fb, u16 w, u16 h);
|
||||
void FaultDrawer_SetInputCallback(FaultDrawerCallback callback);
|
||||
void FaultDrawer_Init(void);
|
||||
|
||||
void func_80084940(void);
|
||||
void func_80084968(void);
|
||||
|
||||
@ -192,7 +135,7 @@ void __osSiRelAccess(void);
|
||||
s32 osContInit(OSMesgQueue* mq, u8* bitpattern, OSContStatus* data);
|
||||
void __osContGetInitData(u8* pattern, OSContStatus* data);
|
||||
void __osPackRequestData(u8 poll);
|
||||
void osCreateThread(OSThread* t, OSId id, void* entry, void* arg, void* sp, OSPri p);
|
||||
void osCreateThread(OSThread* thread, OSId id, void* entry, void* arg, void* sp, OSPri p);
|
||||
s32 osContStartReadData(OSMesgQueue* mq);
|
||||
void osContGetReadData(OSContPad* data);
|
||||
void __osPackReadData(void);
|
||||
@ -270,7 +213,7 @@ s32 __osSpDeviceBusy(void);
|
||||
s32 __osSiDeviceBusy(void);
|
||||
void guMtxIdent(Mtx* mtx);
|
||||
s32 osJamMesg(OSMesgQueue* mq, OSMesg msg, s32 flag);
|
||||
void osSetThreadPri(OSThread* t, OSPri p);
|
||||
void osSetThreadPri(OSThread* thread, OSPri p);
|
||||
OSPri osGetThreadPri(OSThread* t);
|
||||
s32 __osEPiRawReadIo(OSPiHandle* handle, uintptr_t devAddr, u32* data);
|
||||
void osViSwapBuffer(void* frameBufPtr);
|
||||
@ -718,7 +661,7 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s16
|
||||
void Actor_SpawnIceEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s32 limbPosCount, s32 effectsPerLimb, f32 scale, f32 scaleRange);
|
||||
|
||||
void ActorOverlayTable_FaultClient(void* arg0, void* arg1);
|
||||
void* ActorOverlayTable_FaultAddrConv(void* address, void* param);
|
||||
uintptr_t ActorOverlayTable_FaultAddrConv(uintptr_t address, void* param);
|
||||
void ActorOverlayTable_Init(void);
|
||||
void ActorOverlayTable_Cleanup(void);
|
||||
|
||||
@ -1365,7 +1308,7 @@ void Message_FindCreditsMessage(PlayState* play, u16 textId);
|
||||
void func_8015E7EC(PlayState* play, UNK_PTR puParm2);
|
||||
// void func_8015F8A8(UNK_TYPE4 ctxt);
|
||||
|
||||
void* KaleidoManager_FaultAddrConv(void* address, void* param);
|
||||
uintptr_t KaleidoManager_FaultAddrConv(uintptr_t address, void* param);
|
||||
void KaleidoManager_LoadOvl(KaleidoMgrOverlay* ovl);
|
||||
void KaleidoManager_ClearOvl(KaleidoMgrOverlay* ovl);
|
||||
void KaleidoManager_Init(PlayState* play);
|
||||
@ -1498,7 +1441,7 @@ void Graph_FaultClient(void);
|
||||
void Graph_InitTHGA(TwoHeadGfxArena* arena, Gfx* buffer, s32 size);
|
||||
void Graph_SetNextGfxPool(GraphicsContext* gfxCtx);
|
||||
GameStateOverlay* Graph_GetNextGameState(GameState* gameState);
|
||||
void* Graph_FaultAddrConv(void* address, void* param);
|
||||
uintptr_t Graph_FaultAddrConv(uintptr_t address, void* param);
|
||||
void Graph_Init(GraphicsContext* gfxCtx);
|
||||
void Graph_Destroy(GraphicsContext* gfxCtx);
|
||||
void Graph_TaskSet00(GraphicsContext* gfxCtx, GameState* gameState);
|
||||
|
@ -18,6 +18,9 @@
|
||||
#define OS_PHYSICAL_TO_K0(x) (void*)(((u32)(x)+0x80000000))
|
||||
#define OS_PHYSICAL_TO_K1(x) (void*)(((u32)(x)+0xA0000000))
|
||||
|
||||
#define OS_MSEC_TO_CYCLES(n) OS_USEC_TO_CYCLES((n) * 1000)
|
||||
#define OS_SEC_TO_CYCLES(n) OS_MSEC_TO_CYCLES((n) * 1000)
|
||||
|
||||
/* Functions */
|
||||
|
||||
extern uintptr_t osVirtualToPhysical(void*);
|
||||
|
@ -20,11 +20,16 @@
|
||||
#define OS_PRIORITY_VIMGR 254
|
||||
#define OS_PRIORITY_MAX 255
|
||||
|
||||
#define OS_PRIORITY_THREADTAIL -1
|
||||
|
||||
#define OS_STATE_STOPPED (1 << 0)
|
||||
#define OS_STATE_RUNNABLE (1 << 1)
|
||||
#define OS_STATE_RUNNING (1 << 2)
|
||||
#define OS_STATE_WAITING (1 << 3)
|
||||
|
||||
#define OS_FLAG_CPU_BREAK 1
|
||||
#define OS_FLAG_FAULT 2
|
||||
|
||||
typedef s32 OSPri;
|
||||
typedef s32 OSId;
|
||||
|
||||
|
@ -24,10 +24,7 @@ extern vs32 gIrqMgrResetStatus;
|
||||
extern volatile OSTime sIrqMgrResetTime;
|
||||
extern volatile OSTime sIrqMgrRetraceTime;
|
||||
extern s32 sIrqMgrRetraceCount;
|
||||
extern const char* sCpuExceptions[18];
|
||||
extern const char* sFpuExceptions[6];
|
||||
extern FaultDrawer* sFaultDrawContext;
|
||||
extern FaultDrawer sFaultDrawerDefault;
|
||||
|
||||
// extern UNK_TYPE1 sGfxPrintFontTLUT;
|
||||
// extern UNK_TYPE1 sGfxPrintRainbowTLUT;
|
||||
// extern UNK_TYPE1 sGfxPrintRainbowData;
|
||||
@ -92,136 +89,7 @@ extern char yaz0String8009823C[];
|
||||
extern char D_80098280[];
|
||||
extern char D_80098290[];
|
||||
extern char D_800982A4[];
|
||||
extern char D_800982B0[];
|
||||
extern char D_800982BC[];
|
||||
extern char D_800982D0[];
|
||||
extern char D_800982E8[];
|
||||
extern char D_80098300[];
|
||||
extern char D_80098318[];
|
||||
extern char D_80098330[];
|
||||
extern char D_80098344[];
|
||||
extern char D_80098358[];
|
||||
extern char D_80098370[];
|
||||
extern char D_80098388[];
|
||||
extern char D_800983A0[];
|
||||
extern char D_800983B8[];
|
||||
extern char D_800983CC[];
|
||||
extern char D_800983DC[];
|
||||
extern char D_800983F8[];
|
||||
extern char D_80098414[];
|
||||
extern char D_8009842C[];
|
||||
extern char D_80098448[];
|
||||
extern char D_80098460[];
|
||||
extern char D_80098474[];
|
||||
extern char D_80098488[];
|
||||
extern char D_80098494[];
|
||||
extern char D_800984A0[];
|
||||
extern char D_800984B4[55];
|
||||
extern char D_800984EC[54];
|
||||
extern char D_80098524[71];
|
||||
extern char D_8009856C[74];
|
||||
extern char D_800985B8[];
|
||||
extern char D_800985C8[];
|
||||
extern char D_800985DC[];
|
||||
extern char D_800985EC[];
|
||||
extern char D_80098600[];
|
||||
extern char D_80098610[];
|
||||
extern char D_80098618[];
|
||||
extern char D_8009861C[];
|
||||
extern char D_8009862C[];
|
||||
extern char D_80098634[];
|
||||
extern char D_80098648[];
|
||||
extern char D_80098664[];
|
||||
extern char D_80098680[];
|
||||
extern char D_8009869C[];
|
||||
extern char D_800986B8[];
|
||||
extern char D_800986D4[];
|
||||
extern char D_800986F0[];
|
||||
extern char D_8009870C[];
|
||||
extern char D_80098728[];
|
||||
extern char D_80098744[];
|
||||
extern char D_80098760[];
|
||||
extern char D_80098780[];
|
||||
extern char D_80098784[];
|
||||
extern char D_80098788[];
|
||||
extern char D_8009878C[];
|
||||
extern char D_80098790[];
|
||||
extern char D_80098794[];
|
||||
extern char D_80098798[];
|
||||
extern char D_8009879C[];
|
||||
extern char D_800987A0[];
|
||||
extern char D_800987A4[];
|
||||
extern char D_800987B0[];
|
||||
extern char D_800987B4[];
|
||||
extern char D_800987CC[];
|
||||
extern char D_800987EC[];
|
||||
extern char D_8009880C[];
|
||||
extern char D_8009882C[];
|
||||
extern char D_8009884C[];
|
||||
extern char D_8009886C[];
|
||||
extern char D_8009888C[];
|
||||
extern char D_800988AC[];
|
||||
extern char D_800988CC[];
|
||||
extern char D_800988EC[];
|
||||
extern char D_8009890C[];
|
||||
extern char D_8009892C[];
|
||||
extern char D_80098930[];
|
||||
extern char D_80098934[];
|
||||
extern char D_80098938[];
|
||||
extern char D_8009893C[];
|
||||
extern char D_80098940[];
|
||||
extern char D_80098944[];
|
||||
extern char D_80098948[];
|
||||
extern char D_8009894C[];
|
||||
extern char D_80098950[];
|
||||
extern char D_80098954[];
|
||||
extern char D_8009895C[];
|
||||
extern char D_80098968[];
|
||||
extern char D_80098970[];
|
||||
extern char D_80098978[];
|
||||
extern char D_80098980[];
|
||||
extern char D_8009898C[];
|
||||
extern char D_800989A4[];
|
||||
extern char D_800989B0[];
|
||||
extern char D_800989BC[];
|
||||
extern char D_800989CC[];
|
||||
extern char D_800989D8[];
|
||||
extern char D_800989F4[];
|
||||
extern char D_80098A00[];
|
||||
extern char D_80098A0C[];
|
||||
extern char D_80098A1C[];
|
||||
extern char D_80098A20[34];
|
||||
extern const char D_80098A44[];
|
||||
extern const char D_80098A68[];
|
||||
extern char D_80098A88[53];
|
||||
extern char D_80098AC0[49];
|
||||
extern char D_80098AF4[51];
|
||||
extern char D_80098B28[];
|
||||
extern char D_80098B4C[];
|
||||
extern char D_80098B68[];
|
||||
extern char D_80098B84[];
|
||||
extern char D_80098BA0[];
|
||||
extern char D_80098BBC[];
|
||||
extern const char faultThreadName[];
|
||||
extern char D_80098BE0[];
|
||||
extern char D_80098BF8[];
|
||||
extern char D_80098BFC[];
|
||||
extern char D_80098C04[];
|
||||
extern char D_80098C08[];
|
||||
extern char D_80098C10[];
|
||||
extern char D_80098C28[];
|
||||
extern char D_80098C2C[];
|
||||
extern char D_80098C34[];
|
||||
extern char D_80098C38[];
|
||||
extern char D_80098C40[];
|
||||
extern char D_80099050[];
|
||||
extern char D_80099054[];
|
||||
extern char D_8009905C[];
|
||||
extern char D_80099064[];
|
||||
extern char D_80099070[];
|
||||
extern const char D_80099078[];
|
||||
extern const char D_8009907C[];
|
||||
extern const char D_80099080[];
|
||||
|
||||
extern char D_800990B0[];
|
||||
extern f32 D_800990C0[9];
|
||||
extern f32 D_800990E4;
|
||||
@ -277,9 +145,6 @@ extern void* gYaz0DecompressDstEnd;
|
||||
// extern UNK_TYPE4 D_8009BE34;
|
||||
// extern FaultClient romInfoFaultClient;
|
||||
|
||||
extern FaultThreadStruct gFaultStruct;
|
||||
|
||||
extern FaultDrawer sFaultDrawerStruct;
|
||||
// extern UNK_TYPE4 D_8009CD10;
|
||||
extern u32 sRandFloat;
|
||||
// extern UNK_TYPE4 sArenaLockMsg;
|
||||
@ -2067,21 +1932,6 @@ extern f32 D_801ED8D0;
|
||||
// extern UNK_TYPE1 D_801ED8DC;
|
||||
extern Mtx D_801ED8E0;
|
||||
extern Actor* D_801ED920;
|
||||
extern FaultClient sActorOverlayTableFaultClient;
|
||||
extern FaultAddrConvClient sActorOverlayTableFaultAddrConvClient;
|
||||
extern char D_801ED950[80];
|
||||
extern char D_801ED9A0[80];
|
||||
extern Vec3f D_801ED9F0[3];
|
||||
extern Vec3f D_801EDA18[3];
|
||||
extern MtxF sModelToWorldMtxF;
|
||||
extern Vec3f D_801EDA80[3];
|
||||
extern char D_801EDAA8[80];
|
||||
extern char D_801EDAF8[80];
|
||||
extern Vec3f D_801EDB48[3];
|
||||
extern Vec3f D_801EDB70[3];
|
||||
extern Plane D_801EDB98;
|
||||
extern Sphere16 D_801EDBA8;
|
||||
extern TriNorm D_801EDBB0;
|
||||
|
||||
extern Vec3f D_801EDE00;
|
||||
extern Vec3f D_801EDE10;
|
||||
@ -2219,7 +2069,7 @@ extern s16 D_801F4E7A;
|
||||
// extern UNK_TYPE1 D_801F6B58;
|
||||
extern void (*sKaleidoScopeUpdateFunc)(PlayState* play);
|
||||
extern void (*sKaleidoScopeDrawFunc)(PlayState* play);
|
||||
extern FaultAddrConvClient sKaleidoMgrFaultAddrConvClient;
|
||||
|
||||
extern s16 sTransitionFillTimer;
|
||||
extern Input D_801F6C18;
|
||||
extern TransitionTile sTransitionTile;
|
||||
@ -2237,19 +2087,12 @@ extern struct_801F8010 D_801F8010;
|
||||
extern VisZbuf sVisZbuf;
|
||||
extern VisMono sMonoColors;
|
||||
extern ViMode D_801F8048;
|
||||
extern FaultAddrConvClient sGraphFaultAddrConvClient;
|
||||
extern FaultClient sGraphFaultClient;
|
||||
extern GfxMasterList* gGfxMasterDL;
|
||||
extern CfbInfo sGraphCfbInfos[3];
|
||||
extern OSTime sGraphTaskStartTime;
|
||||
|
||||
extern FaultClient sSchedFaultClient;
|
||||
extern OSTime sRSPGFXStartTime;
|
||||
extern OSTime sRSPAudioStartTime;
|
||||
extern OSTime sRSPOtherStartTime;
|
||||
extern OSTime sRDPStartTime;
|
||||
extern GfxMasterList* gGfxMasterDL;
|
||||
|
||||
extern u64* gAudioSPDataPtr;
|
||||
extern u32 gAudioSPDataSize;
|
||||
|
||||
extern volatile OSTime D_801FBAE0;
|
||||
extern volatile OSTime D_801FBAE8;
|
||||
extern volatile OSTime D_801FBAF0;
|
||||
|
@ -75,40 +75,6 @@ typedef struct {
|
||||
/* 0x14 */ OSMesgQueue messageQueue;
|
||||
} FlashromRequest; // size = 0x2C
|
||||
|
||||
// End of RDRAM without the Expansion Pak installed
|
||||
#define NORMAL_RDRAM_END 0x80400000
|
||||
// End of RDRAM with the Expansion Pak installed
|
||||
#define EXPANDED_RDRAM_END 0x80800000
|
||||
// Address at the end of normal RDRAM after which is room for a screen buffer
|
||||
#define FAULT_FB_ADDRESS (NORMAL_RDRAM_END - sizeof(u16[SCREEN_HEIGHT][SCREEN_WIDTH]))
|
||||
|
||||
typedef void (*FaultDrawerCallback)(void);
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u16* fb;
|
||||
/* 0x04 */ u16 w;
|
||||
/* 0x06 */ u16 h;
|
||||
/* 0x08 */ u16 yStart;
|
||||
/* 0x0A */ u16 yEnd;
|
||||
/* 0x0C */ u16 xStart;
|
||||
/* 0x0E */ u16 xEnd;
|
||||
/* 0x10 */ u16 foreColor;
|
||||
/* 0x12 */ u16 backColor;
|
||||
/* 0x14 */ u16 cursorX;
|
||||
/* 0x16 */ u16 cursorY;
|
||||
/* 0x18 */ const u32* font;
|
||||
/* 0x1C */ u8 charW;
|
||||
/* 0x1D */ u8 charH;
|
||||
/* 0x1E */ s8 charWPad;
|
||||
/* 0x1F */ s8 charHPad;
|
||||
/* 0x20 */ u16 printColors[10];
|
||||
/* 0x34 */ u8 escCode;
|
||||
/* 0x35 */ u8 osSyncPrintfEnabled;
|
||||
/* 0x38 */ FaultDrawerCallback inputCallback;
|
||||
} FaultDrawer; // size = 0x3C
|
||||
|
||||
typedef void(*fault_update_input_func)(Input* input);
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ View view;
|
||||
/* 0x168 */ u8* iconItemSegment;
|
||||
@ -315,37 +281,6 @@ typedef struct {
|
||||
/* 0x24 */ u32 flags;
|
||||
} PreRenderParams; // size = 0x28
|
||||
|
||||
typedef struct FaultAddrConvClient {
|
||||
/* 0x0 */ struct FaultAddrConvClient* next;
|
||||
/* 0x4 */ void* (*callback)(void*, void*);
|
||||
/* 0x8 */ void* param;
|
||||
} FaultAddrConvClient; // size = 0xC
|
||||
|
||||
typedef struct FaultClient {
|
||||
/* 0x0 */ struct FaultClient* next;
|
||||
/* 0x4 */ void (*callback)(void*, void*);
|
||||
/* 0x8 */ void* param0;
|
||||
/* 0xC */ void* param1;
|
||||
} FaultClient; // size = 0x10
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ OSThread thread;
|
||||
/* 0x1B0 */ u8 stack[1536]; // Seems leftover from an earlier version. The thread actually uses a stack of this size at 0x8009BE60
|
||||
/* 0x7B0 */ OSMesgQueue queue;
|
||||
/* 0x7C8 */ OSMesg msg[1];
|
||||
/* 0x7CC */ u8 exitDebugger;
|
||||
/* 0x7CD */ u8 msgId; // 1 - CPU Break; 2 - Fault; 3 - Unknown
|
||||
/* 0x7CE */ u8 faultHandlerEnabled;
|
||||
/* 0x7CF */ u8 faultActive;
|
||||
/* 0x7D0 */ OSThread* faultedThread;
|
||||
/* 0x7D4 */ fault_update_input_func padCallback;
|
||||
/* 0x7D8 */ FaultClient* clients;
|
||||
/* 0x7DC */ FaultAddrConvClient* addrConvClients;
|
||||
/* 0x7E0 */ UNK_TYPE1 pad7E0[0x4];
|
||||
/* 0x7E4 */ Input padInput[MAXCONTROLLERS];
|
||||
/* 0x844 */ void* fb;
|
||||
} FaultThreadStruct; // size = 0x848
|
||||
|
||||
struct PlayState;
|
||||
|
||||
typedef struct {
|
||||
|
@ -1,16 +1,17 @@
|
||||
#ifndef Z64THREAD_H
|
||||
#define Z64THREAD_H
|
||||
|
||||
#define Z_THREAD_ID_IDLE 1
|
||||
#define Z_THREAD_ID_SLOWLY 2
|
||||
#define Z_THREAD_ID_MAIN 3
|
||||
#define Z_THREAD_ID_GRAPH 4
|
||||
#define Z_THREAD_ID_SCHED 5
|
||||
#define Z_THREAD_ID_PADMGR 7
|
||||
#define Z_THREAD_ID_IDLE 1
|
||||
#define Z_THREAD_ID_SLOWLY 2
|
||||
#define Z_THREAD_ID_FAULT 2
|
||||
#define Z_THREAD_ID_MAIN 3
|
||||
#define Z_THREAD_ID_GRAPH 4
|
||||
#define Z_THREAD_ID_SCHED 5
|
||||
#define Z_THREAD_ID_PADMGR 7
|
||||
#define Z_THREAD_ID_AUDIOMGR 10
|
||||
#define Z_THREAD_ID_FLASHROM 13
|
||||
#define Z_THREAD_ID_DMAMGR 18
|
||||
#define Z_THREAD_ID_IRQMGR 19
|
||||
#define Z_THREAD_ID_DMAMGR 18
|
||||
#define Z_THREAD_ID_IRQMGR 19
|
||||
|
||||
#define Z_PRIORITY_SLOWLY 5
|
||||
#define Z_PRIORITY_GRAPH 9
|
||||
@ -22,5 +23,6 @@
|
||||
#define Z_PRIORITY_SCHED 16
|
||||
#define Z_PRIORITY_DMAMGR 17
|
||||
#define Z_PRIORITY_IRQMGR 18
|
||||
#define Z_PRIORITY_FAULT OS_PRIORITY_APPMAX
|
||||
|
||||
#endif
|
||||
|
1
spec
1
spec
@ -24,7 +24,6 @@ beginseg
|
||||
include "build/src/boot_O2_g3/CIC6105.o"
|
||||
include "build/src/boot_O2_g3/syncprintf.o"
|
||||
include "build/src/boot_O2_g3/fault.o"
|
||||
include "build/data/boot/fault.bss.o"
|
||||
include "build/src/boot_O2_g3/fault_drawer.o"
|
||||
include "build/src/boot_O2/boot_80084940.o"
|
||||
include "build/src/boot_O2/loadfragment.o"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "fault.h"
|
||||
|
||||
void __assert(const char* file, u32 lineNum) {
|
||||
osGetThreadId(NULL);
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "fault.h"
|
||||
|
||||
UNK_TYPE4 D_8009BE30;
|
||||
UNK_TYPE4 D_8009BE34;
|
||||
@ -17,7 +18,7 @@ void CIC6105_PrintRomInfo(void) {
|
||||
}
|
||||
|
||||
void CIC6105_AddRomInfoFaultPage(void) {
|
||||
Fault_AddClient(&romInfoFaultClient, CIC6105_PrintRomInfo, 0, 0);
|
||||
Fault_AddClient(&romInfoFaultClient, (void*)CIC6105_PrintRomInfo, NULL, NULL);
|
||||
}
|
||||
|
||||
void CIC6105_RemoveRomInfoFaultPage(void) {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,28 +1,64 @@
|
||||
/**
|
||||
* @file fault_drawer.c
|
||||
*
|
||||
* Implements routines for drawing text with a fixed font directly to a framebuffer, used in displaying
|
||||
* the crash screen implemented by fault.c
|
||||
*/
|
||||
|
||||
#include "fault.h"
|
||||
#include "fault_internal.h"
|
||||
#include "global.h"
|
||||
#include "vt.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u16* frameBuffer;
|
||||
/* 0x04 */ u16 w;
|
||||
/* 0x06 */ u16 h;
|
||||
/* 0x08 */ u16 yStart;
|
||||
/* 0x0A */ u16 yEnd;
|
||||
/* 0x0C */ u16 xStart;
|
||||
/* 0x0E */ u16 xEnd;
|
||||
/* 0x10 */ u16 foreColor;
|
||||
/* 0x12 */ u16 backColor;
|
||||
/* 0x14 */ u16 cursorX;
|
||||
/* 0x16 */ u16 cursorY;
|
||||
/* 0x18 */ const u32* fontData;
|
||||
/* 0x1C */ u8 charW;
|
||||
/* 0x1D */ u8 charH;
|
||||
/* 0x1E */ s8 charWPad;
|
||||
/* 0x1F */ s8 charHPad;
|
||||
/* 0x20 */ u16 printColors[10];
|
||||
/* 0x34 */ u8 escCode; // bool
|
||||
/* 0x35 */ u8 osSyncPrintfEnabled;
|
||||
/* 0x38 */ FaultDrawerCallback inputCallback;
|
||||
} FaultDrawer; // size = 0x3C
|
||||
|
||||
extern const u32 sFaultDrawerFont[];
|
||||
|
||||
FaultDrawer sFaultDrawerStruct;
|
||||
FaultDrawer sFaultDrawer;
|
||||
|
||||
FaultDrawer* sFaultDrawerInstance = &sFaultDrawer;
|
||||
|
||||
#define FAULT_DRAWER_CURSOR_X 22
|
||||
#define FAULT_DRAWER_CURSOR_Y 16
|
||||
|
||||
FaultDrawer* sFaultDrawContext = &sFaultDrawerStruct;
|
||||
FaultDrawer sFaultDrawerDefault = {
|
||||
FAULT_FB_ADDRESS, // fb
|
||||
SCREEN_WIDTH, // w
|
||||
SCREEN_HEIGHT, // h
|
||||
16, // yStart
|
||||
223, // yEnd
|
||||
22, // xStart
|
||||
297, // xEnd
|
||||
GPACK_RGBA5551(255, 255, 255, 255), // foreColor
|
||||
GPACK_RGBA5551(0, 0, 0, 0), // backColor
|
||||
22, // cursorX
|
||||
16, // cursorY
|
||||
sFaultDrawerFont, // font
|
||||
8, // charW
|
||||
8, // charH
|
||||
0, // charWPad
|
||||
0, // charHPad
|
||||
FAULT_FB_ADDRESS, // frameBuffer
|
||||
SCREEN_WIDTH, // w
|
||||
SCREEN_HEIGHT, // h
|
||||
FAULT_DRAWER_CURSOR_Y, // yStart
|
||||
SCREEN_HEIGHT - FAULT_DRAWER_CURSOR_Y - 1, // yEnd
|
||||
FAULT_DRAWER_CURSOR_X, // xStart
|
||||
SCREEN_WIDTH - FAULT_DRAWER_CURSOR_X - 1, // xEnd
|
||||
GPACK_RGBA5551(255, 255, 255, 255), // foreColor
|
||||
GPACK_RGBA5551(0, 0, 0, 0), // backColor
|
||||
FAULT_DRAWER_CURSOR_X, // cursorX
|
||||
FAULT_DRAWER_CURSOR_Y, // cursorY
|
||||
sFaultDrawerFont, // fontData
|
||||
8, // charW
|
||||
8, // charH
|
||||
0, // charWPad
|
||||
0, // charHPad
|
||||
{
|
||||
// printColors
|
||||
GPACK_RGBA5551(0, 0, 0, 1), // BLACK
|
||||
@ -36,24 +72,24 @@ FaultDrawer sFaultDrawerDefault = {
|
||||
GPACK_RGBA5551(120, 120, 120, 1), // DARK GRAY
|
||||
GPACK_RGBA5551(176, 176, 176, 1), // LIGHT GRAY
|
||||
},
|
||||
0, // escCode
|
||||
0, // osSyncPrintfEnabled
|
||||
NULL, // inputCallback
|
||||
false, // escCode
|
||||
false, // osSyncPrintfEnabled
|
||||
NULL, // inputCallback
|
||||
};
|
||||
|
||||
//! TODO: Needs to be extracted
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/boot/fault_drawer/sFaultDrawerFont.s")
|
||||
|
||||
void FaultDrawer_SetOsSyncPrintfEnabled(u32 enabled) {
|
||||
sFaultDrawContext->osSyncPrintfEnabled = enabled;
|
||||
sFaultDrawerInstance->osSyncPrintfEnabled = enabled;
|
||||
}
|
||||
|
||||
void FaultDrawer_DrawRecImpl(s32 xStart, s32 yStart, s32 xEnd, s32 yEnd, u16 color) {
|
||||
u16* fb;
|
||||
u16* frameBuffer;
|
||||
s32 x;
|
||||
s32 y;
|
||||
s32 xDiff = sFaultDrawContext->w - xStart;
|
||||
s32 yDiff = sFaultDrawContext->h - yStart;
|
||||
s32 xDiff = sFaultDrawerInstance->w - xStart;
|
||||
s32 yDiff = sFaultDrawerInstance->h - yStart;
|
||||
s32 xSize = xEnd - xStart + 1;
|
||||
s32 ySize = yEnd - yStart + 1;
|
||||
|
||||
@ -66,12 +102,12 @@ void FaultDrawer_DrawRecImpl(s32 xStart, s32 yStart, s32 xEnd, s32 yEnd, u16 col
|
||||
ySize = yDiff;
|
||||
}
|
||||
|
||||
fb = sFaultDrawContext->fb + sFaultDrawContext->w * yStart + xStart;
|
||||
frameBuffer = sFaultDrawerInstance->frameBuffer + sFaultDrawerInstance->w * yStart + xStart;
|
||||
for (y = 0; y < ySize; y++) {
|
||||
for (x = 0; x < xSize; x++) {
|
||||
*fb++ = color;
|
||||
*frameBuffer++ = color;
|
||||
}
|
||||
fb += sFaultDrawContext->w - xSize;
|
||||
frameBuffer += sFaultDrawerInstance->w - xSize;
|
||||
}
|
||||
|
||||
osWritebackDCacheAll();
|
||||
@ -82,29 +118,29 @@ void FaultDrawer_DrawChar(char c) {
|
||||
s32 x;
|
||||
s32 y;
|
||||
u32 data;
|
||||
s32 cursorX = sFaultDrawContext->cursorX;
|
||||
s32 cursorY = sFaultDrawContext->cursorY;
|
||||
s32 cursorX = sFaultDrawerInstance->cursorX;
|
||||
s32 cursorY = sFaultDrawerInstance->cursorY;
|
||||
s32 shift = c % 4;
|
||||
const u32* dataPtr = &sFaultDrawContext->font[(((c / 8) * 16) + ((c & 4) >> 2))];
|
||||
u16* fb = sFaultDrawContext->fb + (sFaultDrawContext->w * cursorY) + cursorX;
|
||||
const u32* dataPtr = &sFaultDrawerInstance->fontData[(((c / 8) * 16) + ((c & 4) >> 2))];
|
||||
u16* frameBuffer = sFaultDrawerInstance->frameBuffer + (sFaultDrawerInstance->w * cursorY) + cursorX;
|
||||
|
||||
if ((sFaultDrawContext->xStart <= cursorX) &&
|
||||
((sFaultDrawContext->charW + cursorX - 1) <= sFaultDrawContext->xEnd) &&
|
||||
(sFaultDrawContext->yStart <= cursorY) &&
|
||||
((sFaultDrawContext->charH + cursorY - 1) <= sFaultDrawContext->yEnd)) {
|
||||
for (y = 0; y < sFaultDrawContext->charH; y++) {
|
||||
if ((sFaultDrawerInstance->xStart <= cursorX) &&
|
||||
((sFaultDrawerInstance->charW + cursorX - 1) <= sFaultDrawerInstance->xEnd) &&
|
||||
(sFaultDrawerInstance->yStart <= cursorY) &&
|
||||
((sFaultDrawerInstance->charH + cursorY - 1) <= sFaultDrawerInstance->yEnd)) {
|
||||
for (y = 0; y < sFaultDrawerInstance->charH; y++) {
|
||||
u32 mask = 0x10000000 << shift;
|
||||
|
||||
data = *dataPtr;
|
||||
for (x = 0; x < sFaultDrawContext->charW; x++) {
|
||||
for (x = 0; x < sFaultDrawerInstance->charW; x++) {
|
||||
if (mask & data) {
|
||||
fb[x] = sFaultDrawContext->foreColor;
|
||||
} else if (sFaultDrawContext->backColor & 1) {
|
||||
fb[x] = sFaultDrawContext->backColor;
|
||||
frameBuffer[x] = sFaultDrawerInstance->foreColor;
|
||||
} else if (sFaultDrawerInstance->backColor & 1) {
|
||||
frameBuffer[x] = sFaultDrawerInstance->backColor;
|
||||
}
|
||||
mask >>= 4;
|
||||
}
|
||||
fb += sFaultDrawContext->w;
|
||||
frameBuffer += sFaultDrawerInstance->w;
|
||||
dataPtr += 2;
|
||||
}
|
||||
}
|
||||
@ -113,37 +149,39 @@ void FaultDrawer_DrawChar(char c) {
|
||||
s32 FaultDrawer_ColorToPrintColor(u16 color) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
if (color == sFaultDrawContext->printColors[i]) {
|
||||
for (i = 0; i < ARRAY_COUNT(sFaultDrawerInstance->printColors); i++) {
|
||||
if (color == sFaultDrawerInstance->printColors[i]) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void FaultDrawer_UpdatePrintColor() {
|
||||
s32 idx;
|
||||
void FaultDrawer_UpdatePrintColor(void) {
|
||||
s32 index;
|
||||
|
||||
if (sFaultDrawContext->osSyncPrintfEnabled) {
|
||||
if (sFaultDrawerInstance->osSyncPrintfEnabled) {
|
||||
osSyncPrintf(VT_RST);
|
||||
idx = FaultDrawer_ColorToPrintColor(sFaultDrawContext->foreColor);
|
||||
if ((idx >= 0) && (idx < 8)) {
|
||||
osSyncPrintf(VT_SGR("3%d"), idx);
|
||||
|
||||
index = FaultDrawer_ColorToPrintColor(sFaultDrawerInstance->foreColor);
|
||||
if ((index >= 0) && (index < 8)) {
|
||||
osSyncPrintf(VT_SGR("3%d"), index);
|
||||
}
|
||||
idx = FaultDrawer_ColorToPrintColor(sFaultDrawContext->backColor);
|
||||
if ((idx >= 0) && (idx < 8)) {
|
||||
osSyncPrintf(VT_SGR("4%d"), idx);
|
||||
|
||||
index = FaultDrawer_ColorToPrintColor(sFaultDrawerInstance->backColor);
|
||||
if ((index >= 0) && (index < 8)) {
|
||||
osSyncPrintf(VT_SGR("4%d"), index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FaultDrawer_SetForeColor(u16 color) {
|
||||
sFaultDrawContext->foreColor = color;
|
||||
sFaultDrawerInstance->foreColor = color;
|
||||
FaultDrawer_UpdatePrintColor();
|
||||
}
|
||||
|
||||
void FaultDrawer_SetBackColor(u16 color) {
|
||||
sFaultDrawContext->backColor = color;
|
||||
sFaultDrawerInstance->backColor = color;
|
||||
FaultDrawer_UpdatePrintColor();
|
||||
}
|
||||
|
||||
@ -152,70 +190,71 @@ void FaultDrawer_SetFontColor(u16 color) {
|
||||
}
|
||||
|
||||
void FaultDrawer_SetCharPad(s8 padW, s8 padH) {
|
||||
sFaultDrawContext->charWPad = padW;
|
||||
sFaultDrawContext->charHPad = padH;
|
||||
sFaultDrawerInstance->charWPad = padW;
|
||||
sFaultDrawerInstance->charHPad = padH;
|
||||
}
|
||||
|
||||
void FaultDrawer_SetCursor(s32 x, s32 y) {
|
||||
if (sFaultDrawContext->osSyncPrintfEnabled) {
|
||||
osSyncPrintf(VT_CUP("%d", "%d"),
|
||||
(y - sFaultDrawContext->yStart) / (sFaultDrawContext->charH + sFaultDrawContext->charHPad),
|
||||
(x - sFaultDrawContext->xStart) / (sFaultDrawContext->charW + sFaultDrawContext->charWPad));
|
||||
if (sFaultDrawerInstance->osSyncPrintfEnabled) {
|
||||
osSyncPrintf(
|
||||
VT_CUP("%d", "%d"),
|
||||
(y - sFaultDrawerInstance->yStart) / (sFaultDrawerInstance->charH + sFaultDrawerInstance->charHPad),
|
||||
(x - sFaultDrawerInstance->xStart) / (sFaultDrawerInstance->charW + sFaultDrawerInstance->charWPad));
|
||||
}
|
||||
sFaultDrawContext->cursorX = x;
|
||||
sFaultDrawContext->cursorY = y;
|
||||
sFaultDrawerInstance->cursorX = x;
|
||||
sFaultDrawerInstance->cursorY = y;
|
||||
}
|
||||
|
||||
void FaultDrawer_FillScreen() {
|
||||
if (sFaultDrawContext->osSyncPrintfEnabled) {
|
||||
if (sFaultDrawerInstance->osSyncPrintfEnabled) {
|
||||
osSyncPrintf(VT_CLS);
|
||||
}
|
||||
|
||||
FaultDrawer_DrawRecImpl(sFaultDrawContext->xStart, sFaultDrawContext->yStart, sFaultDrawContext->xEnd,
|
||||
sFaultDrawContext->yEnd, sFaultDrawContext->backColor | 1);
|
||||
FaultDrawer_SetCursor(sFaultDrawContext->xStart, sFaultDrawContext->yStart);
|
||||
FaultDrawer_DrawRecImpl(sFaultDrawerInstance->xStart, sFaultDrawerInstance->yStart, sFaultDrawerInstance->xEnd,
|
||||
sFaultDrawerInstance->yEnd, sFaultDrawerInstance->backColor | 1);
|
||||
FaultDrawer_SetCursor(sFaultDrawerInstance->xStart, sFaultDrawerInstance->yStart);
|
||||
}
|
||||
|
||||
void* FaultDrawer_FormatStringFunc(void* arg, const char* str, size_t count) {
|
||||
for (; count != 0; count--, str++) {
|
||||
if (sFaultDrawContext->escCode) {
|
||||
sFaultDrawContext->escCode = false;
|
||||
if ((*str >= '1') && (*str <= '9')) {
|
||||
FaultDrawer_SetForeColor(sFaultDrawContext->printColors[*str - '0']);
|
||||
if (sFaultDrawerInstance->escCode) {
|
||||
sFaultDrawerInstance->escCode = false;
|
||||
if (*str >= '1' && *str <= '9') {
|
||||
FaultDrawer_SetForeColor(sFaultDrawerInstance->printColors[*str - '0']);
|
||||
}
|
||||
} else {
|
||||
switch (*str) {
|
||||
case '\n':
|
||||
if (sFaultDrawContext->osSyncPrintfEnabled) {
|
||||
if (sFaultDrawerInstance->osSyncPrintfEnabled) {
|
||||
osSyncPrintf("\n");
|
||||
}
|
||||
|
||||
sFaultDrawContext->cursorX = sFaultDrawContext->w;
|
||||
sFaultDrawerInstance->cursorX = sFaultDrawerInstance->w;
|
||||
break;
|
||||
|
||||
case '\x1A':
|
||||
sFaultDrawContext->escCode = true;
|
||||
case FAULT_ESC:
|
||||
sFaultDrawerInstance->escCode = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (sFaultDrawContext->osSyncPrintfEnabled) {
|
||||
if (sFaultDrawerInstance->osSyncPrintfEnabled) {
|
||||
osSyncPrintf("%c", *str);
|
||||
}
|
||||
|
||||
FaultDrawer_DrawChar(*str);
|
||||
sFaultDrawContext->cursorX += sFaultDrawContext->charW + sFaultDrawContext->charWPad;
|
||||
sFaultDrawerInstance->cursorX += sFaultDrawerInstance->charW + sFaultDrawerInstance->charWPad;
|
||||
}
|
||||
}
|
||||
|
||||
if (sFaultDrawContext->cursorX >= (sFaultDrawContext->xEnd - sFaultDrawContext->charW)) {
|
||||
sFaultDrawContext->cursorX = sFaultDrawContext->xStart;
|
||||
sFaultDrawContext->cursorY += sFaultDrawContext->charH + sFaultDrawContext->charHPad;
|
||||
if (sFaultDrawContext->yEnd - sFaultDrawContext->charH <= sFaultDrawContext->cursorY) {
|
||||
if (sFaultDrawContext->inputCallback != NULL) {
|
||||
sFaultDrawContext->inputCallback();
|
||||
if (sFaultDrawerInstance->cursorX >= (sFaultDrawerInstance->xEnd - sFaultDrawerInstance->charW)) {
|
||||
sFaultDrawerInstance->cursorX = sFaultDrawerInstance->xStart;
|
||||
sFaultDrawerInstance->cursorY += sFaultDrawerInstance->charH + sFaultDrawerInstance->charHPad;
|
||||
if (sFaultDrawerInstance->yEnd - sFaultDrawerInstance->charH <= sFaultDrawerInstance->cursorY) {
|
||||
if (sFaultDrawerInstance->inputCallback != NULL) {
|
||||
sFaultDrawerInstance->inputCallback();
|
||||
FaultDrawer_FillScreen();
|
||||
}
|
||||
sFaultDrawContext->cursorY = sFaultDrawContext->yStart;
|
||||
sFaultDrawerInstance->cursorY = sFaultDrawerInstance->yStart;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -227,17 +266,21 @@ void* FaultDrawer_FormatStringFunc(void* arg, const char* str, size_t count) {
|
||||
|
||||
const char D_80099080[] = "(null)";
|
||||
|
||||
void FaultDrawer_VPrintf(const char* fmt, va_list ap) {
|
||||
_Printf(FaultDrawer_FormatStringFunc, sFaultDrawContext, fmt, ap);
|
||||
s32 FaultDrawer_VPrintf(const char* fmt, va_list ap) {
|
||||
return _Printf(FaultDrawer_FormatStringFunc, sFaultDrawerInstance, fmt, ap);
|
||||
}
|
||||
|
||||
void FaultDrawer_Printf(const char* fmt, ...) {
|
||||
s32 FaultDrawer_Printf(const char* fmt, ...) {
|
||||
s32 ret;
|
||||
va_list args;
|
||||
|
||||
va_start(args, fmt);
|
||||
|
||||
FaultDrawer_VPrintf(fmt, args);
|
||||
ret = FaultDrawer_VPrintf(fmt, args);
|
||||
|
||||
va_end(args);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void FaultDrawer_DrawText(s32 x, s32 y, const char* fmt, ...) {
|
||||
@ -250,18 +293,18 @@ void FaultDrawer_DrawText(s32 x, s32 y, const char* fmt, ...) {
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
void FaultDrawer_SetDrawerFB(void* fb, u16 w, u16 h) {
|
||||
sFaultDrawContext->fb = (u16*)fb;
|
||||
sFaultDrawContext->w = w;
|
||||
sFaultDrawContext->h = h;
|
||||
void FaultDrawer_SetDrawerFrameBuffer(void* frameBuffer, u16 w, u16 h) {
|
||||
sFaultDrawerInstance->frameBuffer = frameBuffer;
|
||||
sFaultDrawerInstance->w = w;
|
||||
sFaultDrawerInstance->h = h;
|
||||
}
|
||||
|
||||
void FaultDrawer_SetInputCallback(FaultDrawerCallback callback) {
|
||||
sFaultDrawContext->inputCallback = callback;
|
||||
sFaultDrawerInstance->inputCallback = callback;
|
||||
}
|
||||
|
||||
void FaultDrawer_Init() {
|
||||
sFaultDrawContext = &sFaultDrawerStruct;
|
||||
bcopy(&sFaultDrawerDefault, sFaultDrawContext, sizeof(FaultDrawer));
|
||||
sFaultDrawContext->fb = (u16*)((osMemSize | 0x80000000) - 0x25800);
|
||||
sFaultDrawerInstance = &sFaultDrawer;
|
||||
bcopy(&sFaultDrawerDefault, sFaultDrawerInstance, sizeof(FaultDrawer));
|
||||
sFaultDrawerInstance->frameBuffer = (u16*)(PHYS_TO_K0(osMemSize) - SCREEN_HEIGHT * SCREEN_WIDTH * sizeof(u16));
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
#include "fault.h"
|
||||
|
||||
u8 sYaz0DataBuffer[0x400];
|
||||
u8* sYaz0CurDataEnd;
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
#include "fault.h"
|
||||
#include "stack.h"
|
||||
#include "stackcheck.h"
|
||||
#include "z64thread.h"
|
||||
|
@ -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) {
|
||||
|
@ -1,12 +1,11 @@
|
||||
#include "audiomgr.h"
|
||||
#include "fault.h"
|
||||
#include "idle.h"
|
||||
#include "irqmgr.h"
|
||||
#include "padmgr.h"
|
||||
#include "scheduler.h"
|
||||
#include "stack.h"
|
||||
#include "stackcheck.h"
|
||||
#include "system_heap.h"
|
||||
#include "z64thread.h"
|
||||
|
||||
// Variables are put before most headers as a hacky way to bypass bss reordering
|
||||
OSMesgQueue sSerialEventQueue;
|
||||
@ -32,6 +31,8 @@ PadMgr gPadMgr;
|
||||
#include "main.h"
|
||||
#include "buffers.h"
|
||||
#include "global.h"
|
||||
#include "system_heap.h"
|
||||
#include "z64thread.h"
|
||||
|
||||
s32 gScreenWidth = SCREEN_WIDTH;
|
||||
s32 gScreenHeight = SCREEN_HEIGHT;
|
||||
@ -47,7 +48,7 @@ void Main(void* arg) {
|
||||
gScreenHeight = SCREEN_HEIGHT;
|
||||
|
||||
Nmi_Init();
|
||||
Fault_Start();
|
||||
Fault_Init();
|
||||
Check_RegionIsSupported();
|
||||
Check_ExpansionPak();
|
||||
|
||||
|
@ -30,9 +30,11 @@
|
||||
* `osContStartReadData` to receiving the data. By running this on a separate thread to the game state, work can be
|
||||
* done while waiting for this operation to complete.
|
||||
*/
|
||||
|
||||
#include "global.h"
|
||||
#include "io/controller.h"
|
||||
#include "ultra64/motor.h"
|
||||
#include "fault.h"
|
||||
|
||||
#define PADMGR_RETRACE_MSG (1 << 0)
|
||||
#define PADMGR_PRE_NMI_MSG (1 << 1)
|
||||
@ -641,7 +643,7 @@ void PadMgr_HandleRetrace(void) {
|
||||
}
|
||||
|
||||
// Rumble Pak
|
||||
if (gFaultStruct.msgId != 0) {
|
||||
if (gFaultMgr.msgId != 0) {
|
||||
// If fault is active, no rumble
|
||||
PadMgr_RumbleStop();
|
||||
} else if (sPadMgrInstance->rumbleOffTimer > 0) {
|
||||
|
@ -1,15 +1,8 @@
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
#include "fault.h"
|
||||
#include "idle.h"
|
||||
#include "stackcheck.h"
|
||||
#include "z64thread.h"
|
||||
|
||||
#define RSP_DONE_MSG 667
|
||||
#define RDP_DONE_MSG 668
|
||||
#define ENTRY_MSG 670
|
||||
#define RDP_AUDIO_CANCEL_MSG 671
|
||||
#define RSP_GFX_CANCEL_MSG 672
|
||||
#include "z64.h"
|
||||
|
||||
// Variables are put before most headers as a hacky way to bypass bss reordering
|
||||
FaultClient sSchedFaultClient;
|
||||
|
||||
OSTime sRSPGFXStartTime;
|
||||
@ -20,6 +13,17 @@ OSTime sRDPStartTime;
|
||||
u64* gAudioSPDataPtr;
|
||||
u32 gAudioSPDataSize;
|
||||
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
#include "stackcheck.h"
|
||||
#include "z64thread.h"
|
||||
|
||||
#define RSP_DONE_MSG 667
|
||||
#define RDP_DONE_MSG 668
|
||||
#define ENTRY_MSG 670
|
||||
#define RDP_AUDIO_CANCEL_MSG 671
|
||||
#define RSP_GFX_CANCEL_MSG 672
|
||||
|
||||
void Sched_SwapFramebuffer(CfbInfo* cfbInfo) {
|
||||
if (cfbInfo->swapBuffer != NULL) {
|
||||
osViSwapBuffer(cfbInfo->swapBuffer);
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
#include "fault.h"
|
||||
#include "stack.h"
|
||||
#include "stackcheck.h"
|
||||
#include "system_malloc.h"
|
||||
|
@ -7,6 +7,7 @@
|
||||
* are DMA'd directly to fixed RAM addresses.
|
||||
*/
|
||||
#include "global.h"
|
||||
#include "fault.h"
|
||||
#include "misc/locerrmsg/locerrmsg.h"
|
||||
#include "misc/memerrmsg/memerrmsg.h"
|
||||
|
||||
@ -23,7 +24,7 @@
|
||||
|
||||
// Address with enough room after to load either of the error message image files before the fault screen buffer at the
|
||||
// end of RDRAM
|
||||
#define CHECK_ERRMSG_STATIC_SEGMENT (u8*)(FAULT_FB_ADDRESS - MAX(SIZEOF_LOCERRMSG, SIZEOF_MEMERRMSG))
|
||||
#define CHECK_ERRMSG_STATIC_SEGMENT (u8*)((uintptr_t)FAULT_FB_ADDRESS - MAX(SIZEOF_LOCERRMSG, SIZEOF_MEMERRMSG))
|
||||
|
||||
void Check_WriteRGBA16Pixel(u16* buffer, u32 x, u32 y, u32 value) {
|
||||
if (value & RGBA16_PIXEL_OPAQUE) {
|
||||
|
@ -39,6 +39,7 @@
|
||||
* (APPLY), or to just overwrite it (NEW).
|
||||
*/
|
||||
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
|
||||
/* data */
|
||||
|
@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
#include "global.h"
|
||||
#include "fault.h"
|
||||
#include "loadfragment.h"
|
||||
#include "z64horse.h"
|
||||
#include "z64quake.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "fault.h"
|
||||
|
||||
// Init Vars declarations (also used in the table below)
|
||||
#define DEFINE_ACTOR(name, _enumValue, _allocType, _debugName) extern ActorInit name##_InitVars;
|
||||
@ -60,7 +61,7 @@ void ActorOverlayTable_FaultClient(void* arg0, void* arg1) {
|
||||
}
|
||||
}
|
||||
|
||||
void* ActorOverlayTable_FaultAddrConv(void* address, void* param) {
|
||||
uintptr_t ActorOverlayTable_FaultAddrConv(uintptr_t address, void* param) {
|
||||
uintptr_t addr = address;
|
||||
ActorOverlay* actorOvl = &gActorOverlayTable[0];
|
||||
size_t ramConv;
|
||||
@ -79,7 +80,8 @@ void* ActorOverlayTable_FaultAddrConv(void* address, void* param) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ActorOverlayTable_Init(void) {
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "fault.h"
|
||||
#include "fixed_point.h"
|
||||
#include "vt.h"
|
||||
#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h"
|
||||
@ -80,9 +81,15 @@ BgSpecialSceneMaxObjects sCustomDynapolyMem[] = {
|
||||
// TODO: All these bss variables are localized to one function and can
|
||||
// likely be made into in-function static bss variables in the future
|
||||
|
||||
char D_801ED950[80];
|
||||
char D_801ED9A0[80];
|
||||
|
||||
Vec3f D_801ED9F0[3]; // polyVerts
|
||||
Vec3f D_801EDA18[3]; // polyVerts
|
||||
MtxF sModelToWorldMtxF;
|
||||
Vec3f D_801EDA80[3]; // polyVerts
|
||||
char D_801EDAA8[80];
|
||||
char D_801EDAF8[80];
|
||||
Vec3f D_801EDB48[3]; // polyVerts
|
||||
|
||||
#ifndef NON_MATCHING
|
||||
@ -92,13 +99,6 @@ Sphere16 D_801EDBA8; // sphere;
|
||||
TriNorm D_801EDBB0; // tri;
|
||||
#endif
|
||||
|
||||
char D_801ED950[80];
|
||||
char D_801ED9A0[80];
|
||||
|
||||
char D_801EDAA8[80];
|
||||
char D_801EDAF8[80];
|
||||
MtxF sModelToWorldMtxF;
|
||||
|
||||
void BgCheck_GetStaticLookupIndicesFromPos(CollisionContext* colCtx, Vec3f* pos, Vec3i* sector);
|
||||
f32 BgCheck_RaycastFloorDyna(DynaRaycast* dynaRaycast);
|
||||
s32 BgCheck_SphVsDynaWall(CollisionContext* colCtx, u16 xpFlags, f32* outX, f32* outZ, Vec3f* pos, f32 radius,
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
#include "z64collision_check.h"
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
#include "z64quake.h"
|
||||
#include "z64rumble.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "fault.h"
|
||||
#include "loadfragment.h"
|
||||
|
||||
#define KALEIDO_OVERLAY(name) \
|
||||
@ -16,7 +17,7 @@ void* sKaleidoAreaPtr = NULL;
|
||||
KaleidoMgrOverlay* gKaleidoMgrCurOvl = NULL;
|
||||
FaultAddrConvClient sKaleidoMgrFaultAddrConvClient;
|
||||
|
||||
void* KaleidoManager_FaultAddrConv(void* address, void* param) {
|
||||
uintptr_t KaleidoManager_FaultAddrConv(uintptr_t address, void* param) {
|
||||
uintptr_t addr = address;
|
||||
KaleidoMgrOverlay* kaleidoMgrOvl = gKaleidoMgrCurOvl;
|
||||
size_t ramConv;
|
||||
@ -34,7 +35,7 @@ void* KaleidoManager_FaultAddrConv(void* address, void* param) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void KaleidoManager_LoadOvl(KaleidoMgrOverlay* ovl) {
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
#include "buffers.h"
|
||||
#include "idle.h"
|
||||
|
@ -3,7 +3,6 @@
|
||||
* Description: Set of library functions to interact with the Player system
|
||||
*/
|
||||
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
|
||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||
|
@ -1,28 +1,28 @@
|
||||
#include "global.h"
|
||||
|
||||
void osCreateThread(OSThread* t, OSId id, void* entry, void* arg, void* sp, OSPri p) {
|
||||
void osCreateThread(OSThread* thread, OSId id, void* entry, void* arg, void* sp, OSPri p) {
|
||||
register u32 saveMask;
|
||||
OSIntMask mask;
|
||||
|
||||
t->id = id;
|
||||
t->priority = p;
|
||||
t->next = NULL;
|
||||
t->queue = NULL;
|
||||
t->context.pc = (u32)entry;
|
||||
t->context.a0 = arg;
|
||||
t->context.sp = (u64)(s32)sp - 16;
|
||||
t->context.ra = __osCleanupThread;
|
||||
thread->id = id;
|
||||
thread->priority = p;
|
||||
thread->next = NULL;
|
||||
thread->queue = NULL;
|
||||
thread->context.pc = (u32)entry;
|
||||
thread->context.a0 = arg;
|
||||
thread->context.sp = (u64)(s32)sp - 16;
|
||||
thread->context.ra = __osCleanupThread;
|
||||
|
||||
mask = 0x3FFF01;
|
||||
t->context.sr = 0xFF03;
|
||||
t->context.rcp = (mask & 0x3F0000) >> 16;
|
||||
t->context.fpcsr = 0x01000800;
|
||||
t->fp = 0;
|
||||
t->state = 1;
|
||||
t->flags = 0;
|
||||
thread->context.sr = 0xFF03;
|
||||
thread->context.rcp = (mask & 0x3F0000) >> 16;
|
||||
thread->context.fpcsr = 0x01000800;
|
||||
thread->fp = 0;
|
||||
thread->state = 1;
|
||||
thread->flags = 0;
|
||||
|
||||
saveMask = __osDisableInt();
|
||||
t->tlnext = __osActiveQueue;
|
||||
__osActiveQueue = t;
|
||||
thread->tlnext = __osActiveQueue;
|
||||
__osActiveQueue = thread;
|
||||
__osRestoreInt(saveMask);
|
||||
}
|
||||
|
@ -1,20 +1,20 @@
|
||||
#include "global.h"
|
||||
|
||||
void osSetThreadPri(OSThread* t, OSPri p) {
|
||||
void osSetThreadPri(OSThread* thread, OSPri p) {
|
||||
register u32 saveMask;
|
||||
|
||||
saveMask = __osDisableInt();
|
||||
|
||||
if (t == NULL) {
|
||||
t = __osRunningThread;
|
||||
if (thread == NULL) {
|
||||
thread = __osRunningThread;
|
||||
}
|
||||
|
||||
if (t->priority != p) {
|
||||
t->priority = p;
|
||||
if (thread->priority != p) {
|
||||
thread->priority = p;
|
||||
|
||||
if (t != __osRunningThread && t->state != 1) {
|
||||
__osDequeueThread(t->queue, t);
|
||||
__osEnqueueThread(t->queue, t);
|
||||
if (thread != __osRunningThread && thread->state != 1) {
|
||||
__osDequeueThread(thread->queue, thread);
|
||||
__osEnqueueThread(thread->queue, thread);
|
||||
}
|
||||
|
||||
if (__osRunningThread->priority < __osRunQueue->priority) {
|
||||
|
@ -4,6 +4,7 @@
|
||||
* Description: Twinmold
|
||||
*/
|
||||
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "z_boss_02.h"
|
||||
#include "z64rumble.h"
|
||||
#include "z64shrink_window.h"
|
||||
|
@ -4,7 +4,6 @@
|
||||
* Description: Seahorse
|
||||
*/
|
||||
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "z_en_ot.h"
|
||||
#include "objects/object_ot/object_ot.h"
|
||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||
|
@ -3,6 +3,7 @@
|
||||
* Overlay: ovl_Obj_Hunsui
|
||||
* Description: Switch-Activated Geyser
|
||||
*/
|
||||
|
||||
#include "z_obj_hunsui.h"
|
||||
#include "objects/object_hunsui/object_hunsui.h"
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Overlay: ovl_player_actor
|
||||
* Description: Player
|
||||
*/
|
||||
#include "prevent_bss_reordering.h"
|
||||
|
||||
#include "global.h"
|
||||
#include "z64horse.h"
|
||||
#include "z64quake.h"
|
||||
|
@ -3,6 +3,8 @@
|
||||
* Overlay: ovl_kaleido_scope
|
||||
* Description: Pause Menu
|
||||
*/
|
||||
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "z_kaleido_scope.h"
|
||||
#include "z64view.h"
|
||||
#include "overlays/gamestates/ovl_opening/z_opening.h"
|
||||
|
@ -65,27 +65,27 @@
|
||||
0x8008212C:("Fault_FillScreenRed",),
|
||||
0x80082180:("Fault_DrawCornerRec",),
|
||||
0x800821D4:("Fault_PrintFReg",),
|
||||
0x80082280:("osSyncPrintfFReg",),
|
||||
0x80082280:("Fault_LogFReg",),
|
||||
0x80082330:("Fault_PrintFPCR",),
|
||||
0x800823D4:("osSyncPrintfFPCR",),
|
||||
0x800823D4:("Fault_LogFPCSR",),
|
||||
0x8008246C:("Fault_PrintThreadContext",),
|
||||
0x800827BC:("osSyncPrintfThreadContext",),
|
||||
0x80082AB8:("Fault_FindFaultedThread",),
|
||||
0x80082B40:("Fault_Wait5Seconds",),
|
||||
0x80082BD0:("Fault_WaitForButtonCombo",),
|
||||
0x80082C6C:("Fault_DrawMemDumpPage",),
|
||||
0x80082C6C:("Fault_DrawMemDumpContents",),
|
||||
0x80082DD8:("Fault_DrawMemDump",),
|
||||
0x80082FD0:("Fault_FindNextStackCall",),
|
||||
0x80082FD0:("Fault_WalkStack",),
|
||||
0x80083144:("Fault_DrawStackTrace",),
|
||||
0x800832D4:("osSyncPrintfStackTrace",),
|
||||
0x800832D4:("Fault_LogStackTrace",),
|
||||
0x80083450:("Fault_ResumeThread",),
|
||||
0x800834CC:("Fault_CommitFB",),
|
||||
0x800834CC:("Fault_DisplayFrameBuffer",),
|
||||
0x8008358C:("Fault_ProcessClients",),
|
||||
0x80083670:("Fault_SetOptionsFromController3",),
|
||||
0x800837E4:("Fault_SetOptions",),
|
||||
0x800837E4:("Fault_UpdatePad",),
|
||||
0x80083828:("Fault_ThreadEntry",),
|
||||
0x80083B70:("Fault_SetFB",),
|
||||
0x80083BC4:("Fault_Start",),
|
||||
0x80083B70:("Fault_SetFrameBuffer",),
|
||||
0x80083BC4:("Fault_Init",),
|
||||
0x80083CF8:("Fault_HangupFaultClient",),
|
||||
0x80083DF4:("Fault_AddHungupAndCrashImpl",),
|
||||
0x80083E4C:("Fault_AddHungupAndCrash",),
|
||||
@ -104,7 +104,7 @@
|
||||
0x8008477C:("FaultDrawer_VPrintf",),
|
||||
0x800847CC:("FaultDrawer_Printf",),
|
||||
0x8008481C:("FaultDrawer_DrawText",),
|
||||
0x8008486C:("FaultDrawer_SetDrawerFB",),
|
||||
0x8008486C:("FaultDrawer_SetDrawerFrameBuffer",),
|
||||
0x800848A4:("FaultDrawer_SetInputCallback",),
|
||||
0x800848B8:("FaultDrawer_Init",),
|
||||
0x80084940:("func_80084940",),
|
||||
|
@ -25,7 +25,7 @@
|
||||
0x80096B78:("sIrqMgrRetraceCount","s32","",0x4),
|
||||
0x80096B80:("sCpuExceptions","char*","[18]",0x48),
|
||||
0x80096BC8:("sFpuExceptions","char*","[6]",0x18),
|
||||
0x80096BE0:("sFaultDrawContext","FaultDrawer*","",0x4),
|
||||
0x80096BE0:("sFaultDrawerInstance","FaultDrawer*","",0x4),
|
||||
0x80096BE4:("sFaultDrawerDefault","FaultDrawer","",0x3c),
|
||||
0x80096C20:("gLoadLogSeverity","UNK_TYPE4","",0x4),
|
||||
0x80096C30:("gOverlayLogSeverity","UNK_TYPE4","",0x4),
|
||||
@ -313,14 +313,14 @@
|
||||
0x8009BE30:("D_8009BE30","UNK_TYPE4","",0x4),
|
||||
0x8009BE34:("D_8009BE34","UNK_TYPE4","",0x4),
|
||||
0x8009BE38:("romInfoFaultClient","FaultClient","",0x10),
|
||||
0x8009BE50:("sFaultContext","FaultThreadStruct*","",0x4),
|
||||
0x8009BE54:("D_8009BE54","f32","",0x4),
|
||||
0x8009BE50:("sFaultInstance","FaultMgr*","",0x4),
|
||||
0x8009BE54:("sFaultTimeTotal","f32","",0x4),
|
||||
0x8009BE58:("faultCustomOptions","u32","",0x4),
|
||||
0x8009BE5C:("faultCopyToLog","u32","",0x4),
|
||||
0x8009BE60:("sFaultStack","u8","[1536]",0x600),
|
||||
0x8009C460:("sFaultStackInfo","StackEntry","",0x1c),
|
||||
0x8009C480:("gFaultStruct","FaultThreadStruct","",0x848),
|
||||
0x8009CCD0:("sFaultDrawerStruct","FaultDrawer","",0x3c),
|
||||
0x8009C460:("sFaultStackInfo","StackEntry","",0x1C),
|
||||
0x8009C480:("gFaultMgr","FaultMgr","",0x848),
|
||||
0x8009CCD0:("sFaultDrawer","FaultDrawer","",0x3c),
|
||||
0x8009CD10:("D_8009CD10","UNK_TYPE4","",0x4),
|
||||
0x8009CD20:("gSystemArena","Arena","",0x24),
|
||||
0x8009CD50:("sRandFloat","f32","",0x4),
|
||||
|
@ -1128,6 +1128,8 @@ wordReplace = {
|
||||
"D_801D1E20": "gIdentityMtxF",
|
||||
"sSetupDL": "gSetupDLs",
|
||||
|
||||
"gFaultStruct": "gFaultMgr",
|
||||
|
||||
"D_801BDA9C": "gHorseIsMounted",
|
||||
"D_801BDAA4": "gHorsePlayedEponasSong",
|
||||
|
||||
|
@ -62,27 +62,27 @@ asm/non_matchings/boot/fault/Fault_FillScreenBlack.s,Fault_FillScreenBlack,0x800
|
||||
asm/non_matchings/boot/fault/Fault_FillScreenRed.s,Fault_FillScreenRed,0x8008212C,0x15
|
||||
asm/non_matchings/boot/fault/Fault_DrawCornerRec.s,Fault_DrawCornerRec,0x80082180,0x15
|
||||
asm/non_matchings/boot/fault/Fault_PrintFReg.s,Fault_PrintFReg,0x800821D4,0x2B
|
||||
asm/non_matchings/boot/fault/osSyncPrintfFReg.s,osSyncPrintfFReg,0x80082280,0x2C
|
||||
asm/non_matchings/boot/fault/Fault_LogFReg.s,Fault_LogFReg,0x80082280,0x2C
|
||||
asm/non_matchings/boot/fault/Fault_PrintFPCR.s,Fault_PrintFPCR,0x80082330,0x29
|
||||
asm/non_matchings/boot/fault/osSyncPrintfFPCR.s,osSyncPrintfFPCR,0x800823D4,0x26
|
||||
asm/non_matchings/boot/fault/Fault_LogFPCSR.s,Fault_LogFPCSR,0x800823D4,0x26
|
||||
asm/non_matchings/boot/fault/Fault_PrintThreadContext.s,Fault_PrintThreadContext,0x8008246C,0xD4
|
||||
asm/non_matchings/boot/fault/osSyncPrintfThreadContext.s,osSyncPrintfThreadContext,0x800827BC,0xBF
|
||||
asm/non_matchings/boot/fault/Fault_FindFaultedThread.s,Fault_FindFaultedThread,0x80082AB8,0x22
|
||||
asm/non_matchings/boot/fault/Fault_Wait5Seconds.s,Fault_Wait5Seconds,0x80082B40,0x24
|
||||
asm/non_matchings/boot/fault/Fault_WaitForButtonCombo.s,Fault_WaitForButtonCombo,0x80082BD0,0x27
|
||||
asm/non_matchings/boot/fault/Fault_DrawMemDumpPage.s,Fault_DrawMemDumpPage,0x80082C6C,0x5B
|
||||
asm/non_matchings/boot/fault/Fault_DrawMemDumpContents.s,Fault_DrawMemDumpContents,0x80082C6C,0x5B
|
||||
asm/non_matchings/boot/fault/Fault_DrawMemDump.s,Fault_DrawMemDump,0x80082DD8,0x7E
|
||||
asm/non_matchings/boot/fault/Fault_FindNextStackCall.s,Fault_FindNextStackCall,0x80082FD0,0x5D
|
||||
asm/non_matchings/boot/fault/Fault_WalkStack.s,Fault_WalkStack,0x80082FD0,0x5D
|
||||
asm/non_matchings/boot/fault/Fault_DrawStackTrace.s,Fault_DrawStackTrace,0x80083144,0x64
|
||||
asm/non_matchings/boot/fault/osSyncPrintfStackTrace.s,osSyncPrintfStackTrace,0x800832D4,0x5F
|
||||
asm/non_matchings/boot/fault/Fault_LogStackTrace.s,Fault_LogStackTrace,0x800832D4,0x5F
|
||||
asm/non_matchings/boot/fault/Fault_ResumeThread.s,Fault_ResumeThread,0x80083450,0x1F
|
||||
asm/non_matchings/boot/fault/Fault_CommitFB.s,Fault_CommitFB,0x800834CC,0x30
|
||||
asm/non_matchings/boot/fault/Fault_DisplayFrameBuffer.s,Fault_DisplayFrameBuffer,0x800834CC,0x30
|
||||
asm/non_matchings/boot/fault/Fault_ProcessClients.s,Fault_ProcessClients,0x8008358C,0x39
|
||||
asm/non_matchings/boot/fault/Fault_SetOptionsFromController3.s,Fault_SetOptionsFromController3,0x80083670,0x5D
|
||||
asm/non_matchings/boot/fault/Fault_SetOptions.s,Fault_SetOptions,0x800837E4,0x11
|
||||
asm/non_matchings/boot/fault/Fault_UpdatePad.s,Fault_UpdatePad,0x800837E4,0x11
|
||||
asm/non_matchings/boot/fault/Fault_ThreadEntry.s,Fault_ThreadEntry,0x80083828,0xD2
|
||||
asm/non_matchings/boot/fault/Fault_SetFB.s,Fault_SetFB,0x80083B70,0x15
|
||||
asm/non_matchings/boot/fault/Fault_Start.s,Fault_Start,0x80083BC4,0x4D
|
||||
asm/non_matchings/boot/fault/Fault_SetFrameBuffer.s,Fault_SetFrameBuffer,0x80083B70,0x15
|
||||
asm/non_matchings/boot/fault/Fault_Init.s,Fault_Init,0x80083BC4,0x4D
|
||||
asm/non_matchings/boot/fault/Fault_HangupFaultClient.s,Fault_HangupFaultClient,0x80083CF8,0x3F
|
||||
asm/non_matchings/boot/fault/Fault_AddHungupAndCrashImpl.s,Fault_AddHungupAndCrashImpl,0x80083DF4,0x16
|
||||
asm/non_matchings/boot/fault/Fault_AddHungupAndCrash.s,Fault_AddHungupAndCrash,0x80083E4C,0x19
|
||||
@ -101,7 +101,7 @@ asm/non_matchings/boot/fault_drawer/FaultDrawer_FormatStringFunc.s,FaultDrawer_F
|
||||
asm/non_matchings/boot/fault_drawer/FaultDrawer_VPrintf.s,FaultDrawer_VPrintf,0x8008477C,0x14
|
||||
asm/non_matchings/boot/fault_drawer/FaultDrawer_Printf.s,FaultDrawer_Printf,0x800847CC,0x14
|
||||
asm/non_matchings/boot/fault_drawer/FaultDrawer_DrawText.s,FaultDrawer_DrawText,0x8008481C,0x14
|
||||
asm/non_matchings/boot/fault_drawer/FaultDrawer_SetDrawerFB.s,FaultDrawer_SetDrawerFB,0x8008486C,0xE
|
||||
asm/non_matchings/boot/fault_drawer/FaultDrawer_SetDrawerFrameBuffer.s,FaultDrawer_SetDrawerFrameBuffer,0x8008486C,0xE
|
||||
asm/non_matchings/boot/fault_drawer/FaultDrawer_SetInputCallback.s,FaultDrawer_SetInputCallback,0x800848A4,0x5
|
||||
asm/non_matchings/boot/fault_drawer/FaultDrawer_Init.s,FaultDrawer_Init,0x800848B8,0x22
|
||||
asm/non_matchings/boot/boot_80084940/func_80084940.s,func_80084940,0x80084940,0xA
|
||||
|
|
Loading…
Reference in New Issue
Block a user