Generate all major headers from ghidra project

This commit is contained in:
rozlette
2019-12-07 18:21:34 -06:00
parent 86ab9c2067
commit 60eaf159b4
19 changed files with 17066 additions and 19482 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
#include <ultra64.h>
#include <global.h>
UNK_TYPE func_8008D350(void) {
u32 func_8008D350(void) {
u32* spC;
u32 sp8;
u32 sp4;
+1 -1
View File
@@ -12,7 +12,7 @@ void func_80081830(void) {
}
void func_8008189C(void) {
func_800819F0(&D_8009BE38, (void(*)(UNK_TYPE, UNK_TYPE))func_80081830, 0, 0);
func_800819F0(&D_8009BE38, (u32)(void(*)(UNK_TYPE, UNK_TYPE))func_80081830, 0, 0);
}
void func_800818D0(void) {
+3 -3
View File
@@ -2,13 +2,13 @@
#include <global.h>
UNK_RET start(void) {
thread_info_init(&bootThreadInfo, &bootStack, &irqmgrContext, 0, -1, &bootThreadName);
thread_info_init(&bootThreadInfo, bootStack, &bootStack[1024], 0, -1, bootThreadName);
osMemSize = func_8008D350();
func_800818F4();
osInitialize();
osUnmapTLBAll();
D_80096B40 = func_80092920();
thread_info_init(&idleTreadInfo, &idleStack, &idleStack[1024], 0, 256, &idleThreadName);
osCreateThread(&idleOSThread, 1, (void(*)(void*))Idle_ThreadEntry, 0, &idleTreadInfo, 12);
thread_info_init(&idleTreadInfo, idleStack, &idleStack[1024], 0, 256, idleThreadName);
osCreateThread(&idleOSThread, 1, (osCreateThread_func*)Idle_ThreadEntry, 0, &idleTreadInfo, 12);
osStartThread(&idleOSThread);
}
+5 -5
View File
@@ -1,7 +1,7 @@
#include <ultra64.h>
#include <global.h>
s32 Dmamgr_DoDmaTransfer(void* a0, void* a1, s32 a2) {
s32 Dmamgr_DoDmaTransfer(u32 a0, void* a1, u32 a2) {
u32 spPad;
OSIoMesg sp60;
OSMesgQueue sp48;
@@ -24,7 +24,7 @@ s32 Dmamgr_DoDmaTransfer(void* a0, void* a1, s32 a2) {
osRecvMesg(&sp48, NULL, 1);
a2 -= s0;
a0 = (u8*)a0 + s0;
a0 = a0 + s0;
a1 = (u8*)a1 + s0;
}
}
@@ -61,7 +61,7 @@ DmadataEntry* Dmamgr_FindDmaEntry(u32 a0) {
return NULL;
}
s32 Dmamgr_TranslateVromToRom(u32 a0) {
u32 Dmamgr_TranslateVromToRom(u32 a0) {
DmadataEntry* v0 = Dmamgr_FindDmaEntry(a0);
if (v0 != NULL) {
@@ -199,7 +199,7 @@ GLOBAL_ASM("./asm/nonmatching/z_std_dma/Dmamgr_SendRequest.asm")
#endif
s32 Dmamgr_SendRequestAndWait(UNK_TYPE a0, UNK_PTR a1, UNK_TYPE a2) {
s32 Dmamgr_SendRequestAndWait(u32 a0, u32 a1, u32 a2) {
DmaRequest sp48;
OSMesgQueue sp30;
OSMesg sp2C;
@@ -207,7 +207,7 @@ s32 Dmamgr_SendRequestAndWait(UNK_TYPE a0, UNK_PTR a1, UNK_TYPE a2) {
osCreateMesgQueue(&sp30, &sp2C, 1);
ret = Dmamgr_SendRequest(&sp48, (UNK_FUN_ARG)a0, a1, a2, 0, &sp30, 0);
ret = Dmamgr_SendRequest(&sp48, a0, a1, a2, 0, &sp30, 0);
if (ret == -1) {
return ret;
+11 -11
View File
@@ -5,7 +5,7 @@
// This file is most likely En_A_Obj
UNK_RET EnAObj_Init(void* a0, UNK_TYPE a1) {
UNK_RET EnAObj_Init(ActorEnAObj* a0, GlobalContext* a1) {
ActorEnAObj* s0 = (ActorEnAObj*)a0;
s0->base.textId = ((s0->base.variable >> 8) & 0xFF) | 0x300;
s0->base.variable = (s0->base.variable & 0xFF) - 9;
@@ -22,32 +22,32 @@ UNK_RET EnAObj_Fini(ActorEnAObj* a0, GlobalContext* a1) {
Collision_FiniCylinder(a1, a2);
}
UNK_RET EnAObj_Update1(ActorEnAObj* a0, UNK_TYPE a1) {
UNK_RET EnAObj_Update1(ActorEnAObj* a0, GlobalContext* a1) {
s16 v0;
s32 v1;
if (func_800B84D0(a0, a1) != 0) {
if (func_800B84D0((Actor*)a0, a1) != 0) {
a0->update = (actor_func)EnAObj_Update2;
} else {
v0 = a0->base.unk92 - a0->base.unkBC.rotation.y;
v1 = (v0 < 0)? -v0 : v0;
if ((v1 < 10240) || ((a0->base.variable == 1) && (v1 > 22528))) {
func_800B863C(a0, a1);
func_800B863C((Actor*)a0, a1);
}
}
}
UNK_RET EnAObj_Update2(ActorEnAObj* a0) {
if (func_800B867C(a0) != 0) {
UNK_RET EnAObj_Update2(ActorEnAObj* a0, GlobalContext* a1) {
if (func_800B867C((Actor*)a0, a1) != 0) {
a0->update = (actor_func)EnAObj_Update1;
}
}
UNK_RET EnAObj_Main(ActorEnAObj* a0, UNK_TYPE a1) {
UNK_RET EnAObj_Main(ActorEnAObj* a0, GlobalContext* a1) {
(a0->update)((Actor*)a0, (GlobalContext*)a1);
func_800B675C(a0, 0x42340000);
Collision_AddOT(a1, a1 + 0x18884, &a0->collision);
func_800B675C((Actor*)a0, 45.0f);
Collision_AddOT(a1, &a1->collisionContext, (ColCommon*)&a0->collision);
}
UNK_RET EnAObj_Draw(ActorEnAObj* a0, UNK_TYPE a1) {
func_800BDFC0(a1, D_801ADEB0[a0->base.variable], a1, a0);
UNK_RET EnAObj_Draw(ActorEnAObj* a0, GlobalContext* a1) {
func_800BDFC0(a1, D_801ADEB0[a0->base.variable]);
}
+5 -5
View File
@@ -7,13 +7,13 @@ UNK_RET func_800BF9A0(UNK_TYPE a0, UNK_TYPE a1) {
UNK_TYPE v1;
func_8008439C(-2, 0);
func_800847CC(&D_801DCBB0, D_801B4610);
func_800847CC(&D_801DCBC4);
func_800847CC(D_801DCBB0, D_801B4610);
func_800847CC(D_801DCBC4);
for (i = 0, s0 = &actorOverlayTable[0]; i < D_801B4610; i++, s0++) {
v1 = s0->vramEnd - s0->vramStart;
if (s0->ramAddr == 0) continue;
func_800847CC(&D_801DCBE4, i, s0->ramAddr, s0->ramAddr + v1, s0->clients, &D_801DCBFC);
func_800847CC(D_801DCBE4, i, s0->ramAddr, s0->ramAddr + v1, s0->clients, &D_801DCBFC);
}
}
@@ -41,8 +41,8 @@ UNK_TYPE func_800BFA78(UNK_TYPE a0, UNK_TYPE a1) {
UNK_RET func_800BFAE8(UNK_ARGS) {
D_801B4610 = 690;
func_800819F0(&D_801ED930, func_800BF9A0, 0, 0);
func_80081BCC(&D_801ED940, func_800BFA78, 0);
func_800819F0(&D_801ED930, (u32)func_800BF9A0, 0, 0);
func_80081BCC(&D_801ED940, (u32)func_800BFA78, 0);
}
UNK_RET func_800BFB40(UNK_ARGS) {
+1 -1
View File
@@ -259,7 +259,7 @@ GLOBAL_ASM("./asm/nonmatching/z_actor/func_800B8898.asm")
GLOBAL_ASM("./asm/nonmatching/z_actor/func_800B8934.asm")
UNK_TYPE Actor_HasParent(Actor* actor, GlobalContext* ctxt) {
u32 Actor_HasParent(Actor* actor, GlobalContext* ctxt) {
if (actor->parent != NULL) {
return 1;
} else {
+1 -1
View File
@@ -279,7 +279,7 @@ GLOBAL_ASM("./asm/nonmatching/z_effect_soft_sprite/EffectSS_DrawParticle.asm")
#endif
void EffectSS_DrawAllParticles(GlobalContext* ctxt) {
UNK_TYPE s0;
LightMapper* s0;
s32 i;
s0 = Lights_CreateMapper(&ctxt->lightsContext, ctxt->commonVars.graphicsContext);
+16 -16
View File
@@ -61,11 +61,11 @@ s32 Lib_StepTowardsGet_i(s32 a0, s32 a1, s32 a2) {
return a1;
}
UNK_RET Lib_StepTowards_i(u32* a0, u32 a1, u32 a2) {
void Lib_StepTowards_i(s32* a0, s32 a1, s32 a2) {
*a0 = Lib_StepTowardsGet_i(*a0, a1, a2);
}
UNK_TYPE Lib_StepTowardsCheck_i(u32* a0, u32 a1, u32 a2) {
UNK_TYPE Lib_StepTowardsCheck_i(s32* a0, s32 a1, s32 a2) {
Lib_StepTowards_i(a0, a1, a2);
return a1 == *a0;
@@ -524,7 +524,7 @@ f32 func_800FFCD8(f32* a0, f32 a1, f32 a2, f32 a3, f32 a4) {
return fabsf(a1 - *a0);
}
UNK_RET Lib_ScaleMax_f(f32* a0, f32 a1, f32 a2, f32 a3) {
void Lib_ScaleMax_f(f32* a0, f32 a1, f32 a2, f32 a3) {
f32 f2;
if (*a0 != a1) {
@@ -581,11 +581,11 @@ void Lib_ScaleMax_s(s16* a0, s16 a1, s16 a2, s16 a3) {
*a0 += v0;
}
UNK_RET Lib_CopyColor(u8* a0, u8* a1) {
a0[0] = a1[0];
a0[1] = a1[1];
a0[2] = a1[2];
a0[3] = a1[3];
UNK_RET Lib_CopyColor(Color* a0, Color* a1) {
a0->red = a1->red;
a0->green = a1->green;
a0->blue = a1->blue;
a0->alpha = a1->alpha;
}
UNK_RET func_801000A4(u16 a0) {
@@ -613,11 +613,11 @@ void Lib_TranslateAndRotateYVec3f(Vector3f* a0, s16 a1, Vector3f* a2, Vector3f*
#ifdef NONMATCHING
void Lib_LerpRGB(u8* a0, u8* a1, f32 a2, u8* a3) {
void Lib_LerpRGB(RGB* a0, RGB* a1, f32 a2, RGB* a3) {
// XXX regalloc is slightly off
a3[0] = (f32)a0[0] + ((f32)a1[0] - (f32)a0[0]) * a2;
a3[1] = (f32)a0[1] + ((f32)a1[1] - (f32)a0[1]) * a2;
a3[2] = (f32)a0[2] + ((f32)a1[2] - (f32)a0[2]) * a2;
a3->red = (f32)a0->red + ((f32)a1->red - (f32)a0->red) * a2;
a3->green = (f32)a0->green + ((f32)a1->green - (f32)a0->green) * a2;
a3->blue = (f32)a0->blue + ((f32)a1->blue - (f32)a0->blue) * a2;
}
#else
@@ -649,11 +649,11 @@ f32 Lib_PushAwayVec3f(Vector3f* a0, Vector3f* a1, f32 a2) {
void Lib_Nop801004FC(void) {}
UNK_TYPE Lib_PtrSegToPhys(u32 a0) {
u32 Lib_PtrSegToPhys(u32 a0) {
return(rspSegmentPhysAddrs[(a0 << 4) >> 28] + (a0 & 0xFFFFFF)) + 0x80000000;
}
UNK_TYPE Lib_PtrSegToPhysNull(u32 a0) {
u32 Lib_PtrSegToPhysNull(u32 a0) {
if ((a0 >> 28) == 0) {
return a0;
}
@@ -661,7 +661,7 @@ UNK_TYPE Lib_PtrSegToPhysNull(u32 a0) {
return(rspSegmentPhysAddrs[(a0 << 4) >> 28] + (a0 & 0xFFFFFF)) + 0x80000000;
}
UNK_TYPE Lib_PtrSegToK0(UNK_TYPE a0) {
u32 Lib_PtrSegToK0(u32 a0) {
if (a0 == 0) {
return 0;
} else {
@@ -669,7 +669,7 @@ UNK_TYPE Lib_PtrSegToK0(UNK_TYPE a0) {
}
}
UNK_TYPE Lib_PtrSegToK0Null(UNK_TYPE a0) {
u32 Lib_PtrSegToK0Null(u32 a0) {
if (a0 == 0) {
return 0;
} else {
+4 -4
View File
@@ -1,10 +1,10 @@
#include <PR/ultratypes.h>
#include <osint.h>
void osCreateThread(OSThread* t, OSId id, void(*entry)(void*), void* arg, void* sp, OSPri p) {
void osCreateThread(OSThread* t, OSId id, osCreateThread_func* entry, void* arg, void* sp, OSPri p) {
register u32 saveMask;
OSIntMask mask;
t->id = id;
t->priority = p;
t->next = NULL;
@@ -13,7 +13,7 @@ void osCreateThread(OSThread* t, OSId id, void(*entry)(void*), void* arg, void*
t->context.a0 = (u64)arg;
t->context.sp = (u64)sp - 16;
t->context.ra = (u64)__osCleanupThread;
mask = 0x3FFF01;
t->context.sr = 0xFF03;
t->context.rcp = (mask & 0x3F0000) >> 16;
@@ -21,7 +21,7 @@ void osCreateThread(OSThread* t, OSId id, void(*entry)(void*), void* arg, void*
t->fp = 0;
t->state = 1;
t->flags = 0;
saveMask = __osDisableInt();
t->tlnext = __osActiveQueue;
__osActiveQueue = t;
+1 -1
View File
@@ -25,7 +25,7 @@ void osInitialize(void) {
__osSetSR(__osGetSR() | 0x20000000);
__osSetFpcCsr(0x01000800);
func_80096820(0x04900000);
__osSetWatchLo(0x04900000);
while (__osSiRawReadIo(0x1FC007FC, &pifdata) != 0);
while (__osSiRawWriteIo(0x1FC007FC, pifdata | 8) != 0);
+9 -9
View File
@@ -3,33 +3,33 @@
#include <osint.h>
#include <viint.h>
int osStopTimer(OSTimer* t)
s32 osStopTimer(OSTimer* t)
{
register u32 savedMask;
OSTimer* timep;
if (t->next == NULL) {
return -1;
}
savedMask = __osDisableInt();
timep = t->next;
if (timep != __osTimerList) {
timep->value += t->value;
}
t->prev->next = t->next;
t->next->prev = t->prev;
t->next = NULL;
t->prev = NULL;
if (__osTimerList->next == __osTimerList) {
__osSetCompare(0);
}
__osRestoreInt(savedMask);
return 0;
}