mirror of
https://github.com/zeldaret/oot.git
synced 2025-05-10 02:54:24 +00:00
[ntsc-1.2] Match z_actor_dlftbls.c (#2144)
* Match z_actor_dlftbls.c * Update src/code/z_actor_dlftbls.c Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> --------- Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
This commit is contained in:
parent
d374e71cb8
commit
a8151899cf
3 changed files with 36 additions and 5 deletions
|
@ -72,6 +72,8 @@ void Fault_DrawText(s32 x, s32 y, const char* fmt, ...);
|
||||||
|
|
||||||
#if PLATFORM_N64
|
#if PLATFORM_N64
|
||||||
|
|
||||||
|
void func_800AE1F8(void);
|
||||||
|
|
||||||
// Not implemented. Silently noop-ing is fine, these are not essential for functionality.
|
// Not implemented. Silently noop-ing is fine, these are not essential for functionality.
|
||||||
#define Fault_SetFontColor(color) (void)0
|
#define Fault_SetFontColor(color) (void)0
|
||||||
#define Fault_SetCharPad(padW, padH) (void)0
|
#define Fault_SetCharPad(padW, padH) (void)0
|
||||||
|
@ -90,6 +92,7 @@ s32 Fault_VPrintf(const char* fmt, va_list args);
|
||||||
#if PLATFORM_N64
|
#if PLATFORM_N64
|
||||||
|
|
||||||
extern vs32 gFaultMsgId;
|
extern vs32 gFaultMsgId;
|
||||||
|
extern volatile OSThread* gFaultFaultedThread;
|
||||||
|
|
||||||
#define FAULT_MSG_ID gFaultMsgId
|
#define FAULT_MSG_ID gFaultMsgId
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ FaultCursorCoords sFaultCursorPos;
|
||||||
vs32 sFaultExit;
|
vs32 sFaultExit;
|
||||||
vs32 gFaultMsgId;
|
vs32 gFaultMsgId;
|
||||||
vs32 sFaultDisplayEnable;
|
vs32 sFaultDisplayEnable;
|
||||||
OSThread* sFaultFaultedThread;
|
volatile OSThread* gFaultFaultedThread;
|
||||||
s32 B_80122570[16];
|
s32 B_80122570[16];
|
||||||
s32 B_801225B0[8]; // Unused (file padding?)
|
s32 B_801225B0[8]; // Unused (file padding?)
|
||||||
|
|
||||||
|
@ -768,7 +768,7 @@ void Fault_ThreadEntry(void* arg0) {
|
||||||
osSyncPrintf("FindFaultedThread()=%08x\n", faultedThread);
|
osSyncPrintf("FindFaultedThread()=%08x\n", faultedThread);
|
||||||
}
|
}
|
||||||
} while (faultedThread == NULL);
|
} while (faultedThread == NULL);
|
||||||
sFaultFaultedThread = faultedThread;
|
gFaultFaultedThread = faultedThread;
|
||||||
Fault_LogThreadContext(faultedThread);
|
Fault_LogThreadContext(faultedThread);
|
||||||
osSyncPrintf("%d %s %d:%s = %d\n", osGetThreadId(NULL), "fault.c", 1454, "fault_display_enable",
|
osSyncPrintf("%d %s %d:%s = %d\n", osGetThreadId(NULL), "fault.c", 1454, "fault_display_enable",
|
||||||
sFaultDisplayEnable);
|
sFaultDisplayEnable);
|
||||||
|
|
|
@ -98,19 +98,47 @@ void ActorOverlayTable_LogPrint(void) {
|
||||||
void ActorOverlayTable_FaultPrint(void* arg0, void* arg1) {
|
void ActorOverlayTable_FaultPrint(void* arg0, void* arg1) {
|
||||||
ActorOverlay* overlayEntry;
|
ActorOverlay* overlayEntry;
|
||||||
u32 overlaySize;
|
u32 overlaySize;
|
||||||
|
uintptr_t ramStart;
|
||||||
|
uintptr_t ramEnd;
|
||||||
|
u32 offset;
|
||||||
|
#if PLATFORM_N64
|
||||||
|
uintptr_t pc = gFaultFaultedThread != NULL ? gFaultFaultedThread->context.pc : 0;
|
||||||
|
uintptr_t ra = gFaultFaultedThread != NULL ? gFaultFaultedThread->context.ra : 0;
|
||||||
|
u32 i;
|
||||||
|
#else
|
||||||
s32 i;
|
s32 i;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if PLATFORM_N64
|
||||||
|
func_800AE1F8();
|
||||||
|
|
||||||
|
Fault_Printf("actor_dlftbls %u\n", gMaxActorId);
|
||||||
|
Fault_Printf("No. RamStart-RamEnd Offset\n");
|
||||||
|
#else
|
||||||
Fault_SetCharPad(-2, 0);
|
Fault_SetCharPad(-2, 0);
|
||||||
|
|
||||||
Fault_Printf("actor_dlftbls %u\n", gMaxActorId);
|
Fault_Printf("actor_dlftbls %u\n", gMaxActorId);
|
||||||
Fault_Printf("No. RamStart- RamEnd cn Name\n");
|
Fault_Printf("No. RamStart- RamEnd cn Name\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
for (i = 0, overlayEntry = &gActorOverlayTable[0]; i < gMaxActorId; i++, overlayEntry++) {
|
for (i = 0, overlayEntry = &gActorOverlayTable[0]; i < gMaxActorId; i++, overlayEntry++) {
|
||||||
overlaySize = (uintptr_t)overlayEntry->vramEnd - (uintptr_t)overlayEntry->vramStart;
|
overlaySize = (uintptr_t)overlayEntry->vramEnd - (uintptr_t)overlayEntry->vramStart;
|
||||||
if (overlayEntry->loadedRamAddr != NULL) {
|
ramStart = (uintptr_t)overlayEntry->loadedRamAddr;
|
||||||
Fault_Printf("%3d %08x-%08x %3d %s\n", i, overlayEntry->loadedRamAddr,
|
ramEnd = ramStart + overlaySize;
|
||||||
(uintptr_t)overlayEntry->loadedRamAddr + overlaySize, overlayEntry->numLoaded,
|
offset = (uintptr_t)overlayEntry->vramStart - ramStart;
|
||||||
|
if (ramStart != 0) {
|
||||||
|
#if PLATFORM_N64
|
||||||
|
Fault_Printf("%3d %08x-%08x %08x", i, ramStart, ramEnd, offset);
|
||||||
|
if (ramStart <= pc && pc < ramEnd) {
|
||||||
|
Fault_Printf(" PC:%08x", pc + offset);
|
||||||
|
} else if (ramStart <= ra && ra < ramEnd) {
|
||||||
|
Fault_Printf(" RA:%08x", ra + offset);
|
||||||
|
}
|
||||||
|
Fault_Printf("\n");
|
||||||
|
#else
|
||||||
|
Fault_Printf("%3d %08x-%08x %3d %s\n", i, ramStart, ramEnd, overlayEntry->numLoaded,
|
||||||
(OOT_DEBUG && overlayEntry->name != NULL) ? overlayEntry->name : "");
|
(OOT_DEBUG && overlayEntry->name != NULL) ? overlayEntry->name : "");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue