mirror of
https://github.com/zeldaret/mm.git
synced 2026-07-25 22:18:29 -04:00
Use structs.h generated from Ghidra project
This commit is contained in:
@@ -20,17 +20,17 @@ UNK_RET func_80ACB50C(z_ActorBgFuKaiten* this);
|
||||
void z_bg_fu_kaiten_main(z_ActorBgFuKaiten* this, z_GlobalContext* ctxt);
|
||||
void func_80ACB5A0(z_ActorBgFuKaiten* this, z_GlobalContext* ctxt);
|
||||
|
||||
z_ActorInit bgBgFuKaitenInitVar = {
|
||||
z_ActorInitData bgBgFuKaitenInitVar = {
|
||||
0x01AE,
|
||||
1,
|
||||
0,
|
||||
0x30,
|
||||
0x01A0,
|
||||
sizeof(z_ActorBgFuKaiten),
|
||||
(z_ActorFunc)z_bg_fu_kaiten_init,
|
||||
(z_ActorFunc)z_bg_fu_kaiten_fini,
|
||||
(z_ActorFunc)z_bg_fu_kaiten_main,
|
||||
(z_ActorFunc)func_80ACB5A0
|
||||
(actor_func)z_bg_fu_kaiten_init,
|
||||
(actor_func)z_bg_fu_kaiten_fini,
|
||||
(actor_func)z_bg_fu_kaiten_main,
|
||||
(actor_func)func_80ACB5A0
|
||||
};
|
||||
|
||||
f32 D_80ACB650 = 0.002;
|
||||
|
||||
@@ -18,17 +18,17 @@ void func_80BD54BC(z_ActorBgIkanaRay* this, z_GlobalContext* ctxt);
|
||||
void func_80BD5500(z_ActorBgIkanaRay* this);
|
||||
void func_80BD5530(z_ActorBgIkanaRay* this, z_GlobalContext* ctxt);
|
||||
|
||||
z_ActorInit bgIkanaRayInitVar = {
|
||||
z_ActorInitData bgIkanaRayInitVar = {
|
||||
0x0256,
|
||||
6,
|
||||
0,
|
||||
0,
|
||||
0x0203,
|
||||
sizeof(z_ActorBgIkanaRay),
|
||||
(z_ActorFunc)z_bg_ikana_ray_init,
|
||||
(z_ActorFunc)z_bg_ikana_ray_fini,
|
||||
(z_ActorFunc)z_bg_ikana_ray_main,
|
||||
(z_ActorFunc)z_bg_ikana_ray_draw
|
||||
(actor_func)z_bg_ikana_ray_init,
|
||||
(actor_func)z_bg_ikana_ray_fini,
|
||||
(actor_func)z_bg_ikana_ray_main,
|
||||
(actor_func)z_bg_ikana_ray_draw
|
||||
};
|
||||
|
||||
GLOBAL_ASM(
|
||||
@@ -119,7 +119,7 @@ void func_80BD54BC(z_ActorBgIkanaRay* this, z_GlobalContext* ctxt) {
|
||||
}
|
||||
|
||||
void func_80BD5500(z_ActorBgIkanaRay* this) {
|
||||
this->baseActor.drawFunc = (z_ActorFunc)z_bg_ikana_ray_draw;
|
||||
this->baseActor.drawFunc = (actor_func)z_bg_ikana_ray_draw;
|
||||
this->baseActor.unk4 &= 0xFFFFFFEF;
|
||||
this->unk404 = func_80BD5530;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ UNK_RET func_80080250(void) {
|
||||
sp28 = *v0;
|
||||
*v0 = 0;
|
||||
|
||||
func_80080C04((s80080A08*)&sp48, (UNK_FUN_ARG)func_800A5AC0, v1, (u32)t7 - (u32)v1, 0, &sp30, 0);
|
||||
func_80080C04((z_DmaRequest*)&sp48, (UNK_FUN_ARG)func_800A5AC0, v1, (u32)t7 - (u32)v1, 0, &sp30, 0);
|
||||
func_8008019C();
|
||||
func_800801EC();
|
||||
osRecvMesg(&sp30, 0, 1);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void func_80085320(s80085320* a0, UNK_PTR a1, UNK_PTR a2, UNK_TYPE a3, UNK_TYPE sp10, UNK_PTR sp14) {
|
||||
void func_80085320(z_ThreadInfo* a0, UNK_PTR a1, UNK_PTR a2, UNK_TYPE a3, UNK_TYPE sp10, UNK_PTR sp14) {
|
||||
UNK_TYPE* i;
|
||||
s80085320* v0;
|
||||
z_ThreadInfo* v0;
|
||||
|
||||
if (a0 == NULL) {
|
||||
g_s80085320_ListHead = NULL;
|
||||
@@ -42,7 +42,7 @@ void func_80085320(s80085320* a0, UNK_PTR a1, UNK_PTR a2, UNK_TYPE a3, UNK_TYPE
|
||||
}
|
||||
}
|
||||
|
||||
UNK_RET func_800853F8(s80085320* a0) {
|
||||
UNK_RET func_800853F8(z_ThreadInfo* a0) {
|
||||
if (a0->prev == NULL) {
|
||||
if (g_s80085320_ListHead == a0) {
|
||||
g_s80085320_ListHead = a0->next;
|
||||
@@ -58,7 +58,7 @@ UNK_RET func_800853F8(s80085320* a0) {
|
||||
}
|
||||
}
|
||||
|
||||
UNK_TYPE func_80085468(s80085320* a0) {
|
||||
UNK_TYPE func_80085468(z_ThreadInfo* a0) {
|
||||
UNK_TYPE* v1 = a0->unk8;
|
||||
UNK_TYPE* a1 = a0->unkC;
|
||||
UNK_TYPE* v0 = v1;
|
||||
@@ -83,7 +83,7 @@ UNK_TYPE func_80085468(s80085320* a0) {
|
||||
}
|
||||
|
||||
UNK_TYPE func_800854E0(UNK_ARGS) {
|
||||
s80085320* s0 = g_s80085320_ListHead;
|
||||
z_ThreadInfo* s0 = g_s80085320_ListHead;
|
||||
UNK_TYPE ret = 0;
|
||||
while (s0 != NULL) {
|
||||
if (func_80085468(s0) != 0) {
|
||||
@@ -95,7 +95,7 @@ UNK_TYPE func_800854E0(UNK_ARGS) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
UNK_RET func_80085538(s80085320* a0) {
|
||||
UNK_RET func_80085538(z_ThreadInfo* a0) {
|
||||
if (a0 == NULL) {
|
||||
func_800854E0();
|
||||
} else {
|
||||
|
||||
+10
-10
@@ -48,8 +48,8 @@ void Dmamgr_osEPiStartDmaWrapper(OSPiHandle* pihandle, OSIoMesg* mb, s32 directi
|
||||
osEPiStartDma(pihandle, mb, direction);
|
||||
}
|
||||
|
||||
DmadataEntry* Dmamgr_FindDmaEntry(u32 a0) {
|
||||
DmadataEntry* curr;
|
||||
z_DmadataEntry* Dmamgr_FindDmaEntry(u32 a0) {
|
||||
z_DmadataEntry* curr;
|
||||
|
||||
for (curr = dmadata; curr->vromEnd != 0; curr++) {
|
||||
if (a0 < curr->vromStart) continue;
|
||||
@@ -62,7 +62,7 @@ DmadataEntry* Dmamgr_FindDmaEntry(u32 a0) {
|
||||
}
|
||||
|
||||
s32 Dmamgr_TranslateVromToRom(u32 a0) {
|
||||
DmadataEntry* v0 = Dmamgr_FindDmaEntry(a0);
|
||||
z_DmadataEntry* v0 = Dmamgr_FindDmaEntry(a0);
|
||||
|
||||
if (v0 != NULL) {
|
||||
if (v0->romEnd == 0) {
|
||||
@@ -80,7 +80,7 @@ s32 Dmamgr_TranslateVromToRom(u32 a0) {
|
||||
}
|
||||
|
||||
s32 Dmamgr_FindDmaIndex(u32 a0) {
|
||||
DmadataEntry* v0 = Dmamgr_FindDmaEntry(a0);
|
||||
z_DmadataEntry* v0 = Dmamgr_FindDmaEntry(a0);
|
||||
|
||||
if (v0 != NULL) {
|
||||
return v0 - dmadata;
|
||||
@@ -95,7 +95,7 @@ UNK_TYPE* func_800809F4(u32 a0) {
|
||||
|
||||
#ifdef NONMATCHING
|
||||
|
||||
void Dmamgr_HandleRequest(s80080A08* a0) {
|
||||
void Dmamgr_HandleRequest(z_DmaRequest* a0) {
|
||||
UNK_TYPE sp34;
|
||||
UNK_TYPE sp30;
|
||||
UNK_TYPE sp2C;
|
||||
@@ -149,9 +149,9 @@ GLOBAL_ASM("./asm/nonmatching/z_std_dma/Dmamgr_HandleRequest.asm")
|
||||
#ifdef NONMATCHING
|
||||
|
||||
void Dmamgr_ThreadEntry(void* a0) {
|
||||
s80080A08* sp34;
|
||||
z_DmaRequest* sp34;
|
||||
UNK_TYPE pad;
|
||||
s80080A08* s0;
|
||||
z_DmaRequest* s0;
|
||||
|
||||
for (;;) {
|
||||
osRecvMesg(&D_8009B2C0, (OSMesg)&sp34, 1);
|
||||
@@ -172,7 +172,7 @@ GLOBAL_ASM("./asm/nonmatching/z_std_dma/Dmamgr_ThreadEntry.asm")
|
||||
|
||||
#ifdef NONMATCHING
|
||||
|
||||
s32 Dmamgr_SendRequest(s80080A08* a0, UNK_FUN_PTR(a1), UNK_PTR a2, UNK_TYPE a3, UNK_TYPE sp30, OSMesgQueue* sp34, UNK_TYPE sp38) {
|
||||
s32 Dmamgr_SendRequest(z_DmaRequest* a0, UNK_FUN_PTR(a1), UNK_PTR a2, UNK_TYPE a3, UNK_TYPE sp30, OSMesgQueue* sp34, UNK_TYPE sp38) {
|
||||
// TODO this isn't correct, it uses a lui, addiu to get the address of D_80096B60, then loads it,
|
||||
// meaning that this is likely just "if (*D_80096B60 >= 2)". However, I can not get it to not
|
||||
// produce the usual lui, lw combo to load from an address :/
|
||||
@@ -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) {
|
||||
s80080A08 sp48;
|
||||
z_DmaRequest sp48;
|
||||
OSMesgQueue sp30;
|
||||
OSMesg sp2C;
|
||||
s32 ret;
|
||||
@@ -220,7 +220,7 @@ s32 Dmamgr_SendRequestAndWait(UNK_TYPE a0, UNK_PTR a1, UNK_TYPE a2) {
|
||||
#ifdef NONMATCHING
|
||||
|
||||
void Dmamgr_Start() {
|
||||
DmadataEntry* v0;
|
||||
z_DmadataEntry* v0;
|
||||
u32 v1;
|
||||
// TODO register load ordering is wrong
|
||||
Dmamgr_DoDmaTransfer(&dmadataRomStart, dmadata, (u8*)&dmadataRomEnd - (u8*)&dmadataRomStart);
|
||||
|
||||
+21
-21
@@ -6,48 +6,48 @@
|
||||
// This file is most likely En_A_Obj
|
||||
|
||||
UNK_RET EnAObj_Init(void* a0, UNK_TYPE a1) {
|
||||
s800A5AC0* s0 = (s800A5AC0*)a0;
|
||||
s0->unk116 = ((s0->unk1C >> 8) & 0xFF) | 0x300;
|
||||
s0->unk1C = (s0->unk1C & 0xFF) - 9;
|
||||
z_ActorEnAObj* s0 = (z_ActorEnAObj*)a0;
|
||||
s0->base.textId = ((s0->base.variable >> 8) & 0xFF) | 0x300;
|
||||
s0->base.variable = (s0->base.variable & 0xFF) - 9;
|
||||
Lib_ApplyActorInitVars((z_Actor*)s0, (z_ActorCompInitEntry*)&D_801ADEAC);
|
||||
func_800B3BA4(&s0->unkBC, 0, (UNK_PTR)&func_800B3FC0, 12);
|
||||
Collision_InitCylinder(a1, &s0->unk148, (z_Actor*)s0, &D_801ADE80);
|
||||
Collision_CylinderMoveToActor((z_Actor*)s0, &s0->unk148);
|
||||
s0->unkB6 = 255;
|
||||
s0->unk144 = EnAObj_Update1;
|
||||
func_800B3BA4(&s0->base.unkBC, 0, (UNK_PTR)&func_800B3FC0, 12);
|
||||
Collision_InitCylinder(a1, &s0->collision, (z_Actor*)s0, &D_801ADE80);
|
||||
Collision_CylinderMoveToActor((z_Actor*)s0, &s0->collision);
|
||||
s0->base.unkA0.unk16 = 255;
|
||||
s0->update = (actor_func)EnAObj_Update1;
|
||||
}
|
||||
|
||||
UNK_RET EnAObj_Fini(s800A5AC0* a0, z_GlobalContext* a1) {
|
||||
UNK_TYPE* a2 = &a0->unk148;
|
||||
UNK_RET EnAObj_Fini(z_ActorEnAObj* a0, z_GlobalContext* a1) {
|
||||
z_ColCylinder* a2 = &a0->collision;
|
||||
Collision_FiniCylinder(a1, a2);
|
||||
}
|
||||
|
||||
UNK_RET EnAObj_Update1(s800A5AC0* a0, UNK_TYPE a1) {
|
||||
UNK_RET EnAObj_Update1(z_ActorEnAObj* a0, UNK_TYPE a1) {
|
||||
s16 v0;
|
||||
s32 v1;
|
||||
if (func_800B84D0(a0, a1) != 0) {
|
||||
a0->unk144 = (void(*)(s800A5AC0*, UNK_TYPE))EnAObj_Update2; //! Is this cast correct?
|
||||
a0->update = (actor_func)EnAObj_Update2;
|
||||
} else {
|
||||
v0 = a0->unk92 - a0->unkBE;
|
||||
v0 = a0->base.unk92 - a0->base.unkBC.rotation.y;
|
||||
v1 = (v0 < 0)? -v0 : v0;
|
||||
if ((v1 < 10240) || ((a0->unk1C == 1) && (v1 > 22528))) {
|
||||
if ((v1 < 10240) || ((a0->base.variable == 1) && (v1 > 22528))) {
|
||||
func_800B863C(a0, a1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UNK_RET EnAObj_Update2(s800A5AC0* a0) {
|
||||
UNK_RET EnAObj_Update2(z_ActorEnAObj* a0) {
|
||||
if (func_800B867C(a0) != 0) {
|
||||
a0->unk144 = EnAObj_Update1;
|
||||
a0->update = (actor_func)EnAObj_Update1;
|
||||
}
|
||||
}
|
||||
|
||||
UNK_RET EnAObj_Main(s800A5AC0* a0, UNK_TYPE a1) {
|
||||
(a0->unk144)(a0, a1);
|
||||
UNK_RET EnAObj_Main(z_ActorEnAObj* a0, UNK_TYPE a1) {
|
||||
(a0->update)((z_Actor*)a0, (z_GlobalContext*)a1);
|
||||
func_800B675C(a0, 0x42340000);
|
||||
Collision_AddOT(a1, a1 + 0x18884, &a0->unk148);
|
||||
Collision_AddOT(a1, a1 + 0x18884, &a0->collision);
|
||||
}
|
||||
|
||||
UNK_RET EnAObj_Draw(s800A5AC0* a0, UNK_TYPE a1) {
|
||||
func_800BDFC0(a1, D_801ADEB0[a0->unk1C], a1, a0);
|
||||
UNK_RET EnAObj_Draw(z_ActorEnAObj* a0, UNK_TYPE a1) {
|
||||
func_800BDFC0(a1, D_801ADEB0[a0->base.variable], a1, a0);
|
||||
}
|
||||
|
||||
+10
-10
@@ -3,7 +3,7 @@
|
||||
|
||||
UNK_RET func_800BF9A0(UNK_TYPE a0, UNK_TYPE a1) {
|
||||
s32 i;
|
||||
s800BF9A0* s0;
|
||||
z_ActorOverlayTableEntry* s0;
|
||||
UNK_TYPE v1;
|
||||
|
||||
func_8008439C(-2, 0);
|
||||
@@ -11,27 +11,27 @@ UNK_RET func_800BF9A0(UNK_TYPE a0, UNK_TYPE a1) {
|
||||
func_800847CC(&D_801DCBC4);
|
||||
|
||||
for (i = 0, s0 = &D_801AEFD0; i < D_801B4610; i++, s0++) {
|
||||
v1 = s0->unkC - s0->unk8;
|
||||
if (s0->unk10 == 0) continue;
|
||||
func_800847CC(&D_801DCBE4, i, s0->unk10, s0->unk10 + v1, s0->unk1E, &D_801DCBFC);
|
||||
v1 = s0->vramEnd - s0->vramStart;
|
||||
if (s0->ramAddr == 0) continue;
|
||||
func_800847CC(&D_801DCBE4, i, s0->ramAddr, s0->ramAddr + v1, s0->clients, &D_801DCBFC);
|
||||
}
|
||||
}
|
||||
|
||||
UNK_TYPE func_800BFA78(UNK_TYPE a0, UNK_TYPE a1) {
|
||||
s32 i;
|
||||
s800BF9A0* v0 = &D_801AEFD0;
|
||||
z_ActorOverlayTableEntry* v0 = &D_801AEFD0;
|
||||
UNK_TYPE t1;
|
||||
UNK_TYPE a2;
|
||||
UNK_TYPE a0_2 = a0;
|
||||
|
||||
for (i = 0; i < D_801B4610; i++, v0++) {
|
||||
t1 = v0->unk8 - v0->unk10;
|
||||
a2 = v0->unkC - v0->unk8;
|
||||
t1 = v0->vramStart - v0->ramAddr;
|
||||
a2 = v0->vramEnd - v0->vramStart;
|
||||
|
||||
if (v0->unk10 == 0) continue;
|
||||
if (a0_2 < v0->unk10) continue;
|
||||
if (v0->ramAddr == 0) continue;
|
||||
if (a0_2 < v0->ramAddr) continue;
|
||||
|
||||
if (a0_2 < (v0->unk10 + a2)) {
|
||||
if (a0_2 < (v0->ramAddr + a2)) {
|
||||
return a0_2 + t1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,8 @@ UNK_RET func_800CAAD0(UNK_TYPE a0, UNK_TYPE a1, UNK_TYPE a2) {
|
||||
|
||||
v1 = (s800CAAD0*)(a0 + a1 * 100);
|
||||
|
||||
func_80139894(&spD0, v1->unk68, v1->unk6C, v1->unk70, v1->unk72, v1->unk74,
|
||||
v1->unk76, v1->unk7C, v1->unk80, v1->unk84);
|
||||
func_80139894(&spD0, v1->unk68, v1->unk6C, v1->unk70, v1->unk74, v1->unk76,
|
||||
v1->unk78, v1->unk7C, v1->unk80, v1->unk84);
|
||||
|
||||
if (func_80139188(&spD0, &sp90) == 2) return;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ void EffectSS_Init(z_GlobalContext* ctxt, s32 numEntries) {
|
||||
z_LoadedParticleEntry* iter;
|
||||
z_ParticleOverlayTableEntry* iter2;
|
||||
|
||||
EffectSS2Info.data_table = (z_LoadedParticleEntry*)GameStateHeap_AllocFromEnd(&ctxt->unk74, numEntries * sizeof(z_LoadedParticleEntry));
|
||||
EffectSS2Info.data_table = (z_LoadedParticleEntry*)GameStateHeap_AllocFromEnd(&ctxt->commonVars.heap, numEntries * sizeof(z_LoadedParticleEntry));
|
||||
EffectSS2Info.searchIndex = 0;
|
||||
EffectSS2Info.size = numEntries;
|
||||
|
||||
@@ -81,11 +81,11 @@ void EffectSS_ResetLoadedParticleEntry(z_LoadedParticleEntry* particle) {
|
||||
particle->priority = 128;
|
||||
particle->draw = NULL;
|
||||
particle->update = NULL;
|
||||
particle->unk38 = 0;
|
||||
particle->displayList = 0;
|
||||
particle->unk3C = 0;
|
||||
|
||||
for (i = 0; i != 13; i++) {
|
||||
particle->unk40[i] = 0;
|
||||
particle->regs[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,9 +282,9 @@ void EffectSS_DrawAllParticles(z_GlobalContext* ctxt) {
|
||||
UNK_TYPE s0;
|
||||
s32 i;
|
||||
|
||||
s0 = Lights_CreateMapper(&ctxt->unk818, ctxt->unk0);
|
||||
Lights_MapLights(s0, ctxt->unk818, 0, ctxt);
|
||||
Lights_UploadLights(s0, ctxt->unk0);
|
||||
s0 = Lights_CreateMapper(&ctxt->lightsContext, ctxt->commonVars.graphicsContext);
|
||||
Lights_MapLights(s0, ctxt->lightsContext.lightsHead, 0, ctxt);
|
||||
Lights_UploadLights(s0, ctxt->commonVars.graphicsContext);
|
||||
|
||||
for (i = 0; i < EffectSS2Info.size; i++) {
|
||||
if (EffectSS2Info.data_table[i].life > -1) {
|
||||
|
||||
+28
-28
@@ -255,7 +255,7 @@ s16 Lib_randStride_s(s16 a0, s16 a1, s16 a2) {
|
||||
return (s16)(randZeroOne() * a2) * a1 + a0;
|
||||
}
|
||||
|
||||
UNK_RET Lib_CopyVec3f(z_Vector3D* dst, z_Vector3D* src) {
|
||||
UNK_RET Lib_CopyVec3f(z_Vector3f* dst, z_Vector3f* src) {
|
||||
f32 x = src->x;
|
||||
f32 y = src->y;
|
||||
f32 z = src->z;
|
||||
@@ -265,7 +265,7 @@ UNK_RET Lib_CopyVec3f(z_Vector3D* dst, z_Vector3D* src) {
|
||||
dst->z = z;
|
||||
}
|
||||
|
||||
UNK_RET Lib_CopyVec3s(z_Vector3Ds16* dst, z_Vector3Ds16* src) {
|
||||
UNK_RET Lib_CopyVec3s(z_Vector3s* dst, z_Vector3s* src) {
|
||||
s16 x = src->x;
|
||||
s16 y = src->y;
|
||||
s16 z = src->z;
|
||||
@@ -275,7 +275,7 @@ UNK_RET Lib_CopyVec3s(z_Vector3Ds16* dst, z_Vector3Ds16* src) {
|
||||
dst->z = z;
|
||||
}
|
||||
|
||||
UNK_RET Lib_ToVec3f(z_Vector3D* dst, z_Vector3Ds16* src) {
|
||||
UNK_RET Lib_ToVec3f(z_Vector3f* dst, z_Vector3s* src) {
|
||||
f32 x = src->x;
|
||||
f32 y = src->y;
|
||||
f32 z = src->z;
|
||||
@@ -285,7 +285,7 @@ UNK_RET Lib_ToVec3f(z_Vector3D* dst, z_Vector3Ds16* src) {
|
||||
dst->z = z;
|
||||
}
|
||||
|
||||
UNK_RET Lib_ToVec3s(z_Vector3Ds16* dst, z_Vector3D* src) {
|
||||
UNK_RET Lib_ToVec3s(z_Vector3s* dst, z_Vector3f* src) {
|
||||
f32 x = src->x;
|
||||
f32 y = src->y;
|
||||
f32 z = src->z;
|
||||
@@ -295,55 +295,55 @@ UNK_RET Lib_ToVec3s(z_Vector3Ds16* dst, z_Vector3D* src) {
|
||||
dst->z = z;
|
||||
}
|
||||
|
||||
UNK_RET Lib_AddVec3f(z_Vector3D* a0, z_Vector3D* a1, z_Vector3D* a2) {
|
||||
UNK_RET Lib_AddVec3f(z_Vector3f* a0, z_Vector3f* a1, z_Vector3f* a2) {
|
||||
a2->x = a0->x + a1->x;
|
||||
a2->y = a0->y + a1->y;
|
||||
a2->z = a0->z + a1->z;
|
||||
}
|
||||
|
||||
UNK_RET Lib_SubVec3f(z_Vector3D* a0, z_Vector3D* a1, z_Vector3D* a2) {
|
||||
UNK_RET Lib_SubVec3f(z_Vector3f* a0, z_Vector3f* a1, z_Vector3f* a2) {
|
||||
a2->x = a0->x - a1->x;
|
||||
a2->y = a0->y - a1->y;
|
||||
a2->z = a0->z - a1->z;
|
||||
}
|
||||
|
||||
UNK_RET Lib_SubVec3sToVec3f(z_Vector3D* a0, z_Vector3Ds16* a1, z_Vector3Ds16* a2) {
|
||||
UNK_RET Lib_SubVec3sToVec3f(z_Vector3f* a0, z_Vector3s* a1, z_Vector3s* a2) {
|
||||
a0->x = a1->x - a2->x;
|
||||
a0->y = a1->y - a2->y;
|
||||
a0->z = a1->z - a2->z;
|
||||
}
|
||||
|
||||
UNK_RET Lib_ScaleInPlaceVec3f(z_Vector3D* a0, f32 a1) {
|
||||
UNK_RET Lib_ScaleInPlaceVec3f(z_Vector3f* a0, f32 a1) {
|
||||
a0->x *= a1;
|
||||
a0->y *= a1;
|
||||
a0->z *= a1;
|
||||
}
|
||||
|
||||
UNK_RET Lib_ScaleVec3f(z_Vector3D* a0, f32 a1, z_Vector3D* a2) {
|
||||
UNK_RET Lib_ScaleVec3f(z_Vector3f* a0, f32 a1, z_Vector3f* a2) {
|
||||
a2->x = a0->x * a1;
|
||||
a2->y = a0->y * a1;
|
||||
a2->z = a0->z * a1;
|
||||
}
|
||||
|
||||
UNK_RET Lib_LerpVec3f(z_Vector3D* a0, z_Vector3D* a1, f32 a2, z_Vector3D* a3) {
|
||||
UNK_RET Lib_LerpVec3f(z_Vector3f* a0, z_Vector3f* a1, f32 a2, z_Vector3f* a3) {
|
||||
a3->x = (a1->x - a0->x) * a2 + a0->x;
|
||||
a3->y = (a1->y - a0->y) * a2 + a0->y;
|
||||
a3->z = (a1->z - a0->z) * a2 + a0->z;
|
||||
}
|
||||
|
||||
UNK_RET Lib_AddScaledVec3f(z_Vector3D* a0, z_Vector3D* a1, f32 a2, z_Vector3D* a3) {
|
||||
UNK_RET Lib_AddScaledVec3f(z_Vector3f* a0, z_Vector3f* a1, f32 a2, z_Vector3f* a3) {
|
||||
a3->x = a1->x * a2 + a0->x;
|
||||
a3->y = a1->y * a2 + a0->y;
|
||||
a3->z = a1->z * a2 + a0->z;
|
||||
}
|
||||
|
||||
UNK_RET Lib_ModifyRandScaled(z_Vector3D* a0, f32 a1, z_Vector3D* a2) {
|
||||
UNK_RET Lib_ModifyRandScaled(z_Vector3f* a0, f32 a1, z_Vector3f* a2) {
|
||||
a2->x = randPlusMinusPoint5Scaled(a1) + a0->x;
|
||||
a2->y = randPlusMinusPoint5Scaled(a1) + a0->y;
|
||||
a2->z = randPlusMinusPoint5Scaled(a1) + a0->z;
|
||||
}
|
||||
|
||||
void Lib_ScaledNormalizedDifferenceVec3f(z_Vector3D* a0, z_Vector3D* a1, f32 a2, z_Vector3D* a3) {
|
||||
void Lib_ScaledNormalizedDifferenceVec3f(z_Vector3f* a0, z_Vector3f* a1, f32 a2, z_Vector3f* a3) {
|
||||
f32 f0 = Lib_DistanceAndDifferenceVec3f(a0, a1, a3);
|
||||
f32 f2;
|
||||
|
||||
@@ -358,24 +358,24 @@ void Lib_ScaledNormalizedDifferenceVec3f(z_Vector3D* a0, z_Vector3D* a1, f32 a2,
|
||||
a3->z *= f2;
|
||||
}
|
||||
|
||||
f32 Lib_DistanceVec3f(z_Vector3D* a0, z_Vector3D* a1) {
|
||||
z_Vector3D sp1C;
|
||||
f32 Lib_DistanceVec3f(z_Vector3f* a0, z_Vector3f* a1) {
|
||||
z_Vector3f sp1C;
|
||||
Lib_SubVec3f(a1, a0, &sp1C);
|
||||
return sqrtf((sp1C.x * sp1C.x) + (sp1C.y * sp1C.y) + (sp1C.z * sp1C.z));
|
||||
}
|
||||
|
||||
f32 Lib_DistanceAndDifferenceVec3f(z_Vector3D* a0, z_Vector3D* a1, z_Vector3D* a2) {
|
||||
f32 Lib_DistanceAndDifferenceVec3f(z_Vector3f* a0, z_Vector3f* a1, z_Vector3f* a2) {
|
||||
Lib_SubVec3f(a1, a0, a2);
|
||||
return sqrtf((a2->x * a2->x) + (a2->y * a2->y) + (a2->z * a2->z));
|
||||
}
|
||||
|
||||
f32 Lib_DistanceXZVec3f(z_Vector3D* a0, z_Vector3D* a1) {
|
||||
f32 Lib_DistanceXZVec3f(z_Vector3f* a0, z_Vector3f* a1) {
|
||||
f32 dx = a1->x - a0->x;
|
||||
f32 dz = a1->z - a0->z;
|
||||
return sqrtf((dx * dx) + (dz * dz));
|
||||
}
|
||||
|
||||
f32 Lib_DistanceAndDifferenceXZVec3f(z_Vector3D* a0, z_Vector3D* a1, f32* a2, f32* a3) {
|
||||
f32 Lib_DistanceAndDifferenceXZVec3f(z_Vector3f* a0, z_Vector3f* a1, f32* a2, f32* a3) {
|
||||
*a2 = a1->x - a0->x;
|
||||
*a3 = a1->z - a0->z;
|
||||
return sqrtf((*a2 * *a2) + (*a3 * *a3));
|
||||
@@ -383,7 +383,7 @@ f32 Lib_DistanceAndDifferenceXZVec3f(z_Vector3D* a0, z_Vector3D* a1, f32* a2, f3
|
||||
|
||||
#ifdef NONMATCHING
|
||||
|
||||
UNK_RET Lib_PushAwayXZVec3f(z_Vector3D* a0, z_Vector3D* a1, f32 a2) {
|
||||
UNK_RET Lib_PushAwayXZVec3f(z_Vector3f* a0, z_Vector3f* a1, f32 a2) {
|
||||
f32 sp24;
|
||||
f32 sp20;
|
||||
f32 f0 = Lib_DistanceAndDifferenceXZVec3f(a1, a0, &sp24, &sp20);
|
||||
@@ -405,17 +405,17 @@ GLOBAL_ASM("./asm/nonmatching/z_lib/Lib_PushAwayXZVec3f.asm")
|
||||
|
||||
#endif
|
||||
|
||||
f32 Lib_DistanceYVec3f(z_Vector3D* a0, z_Vector3D* a1) {
|
||||
f32 Lib_DistanceYVec3f(z_Vector3f* a0, z_Vector3f* a1) {
|
||||
return a1->y - a0->y;
|
||||
}
|
||||
|
||||
UNK_TYPE Lib_YawVec3f(z_Vector3D* a0, z_Vector3D* a1) {
|
||||
UNK_TYPE Lib_YawVec3f(z_Vector3f* a0, z_Vector3f* a1) {
|
||||
f32 f14 = a1->x - a0->x;
|
||||
f32 f12 = a1->z - a0->z;
|
||||
return atans_flip(f12, f14);
|
||||
}
|
||||
|
||||
UNK_TYPE Lib_PitchVec3f(z_Vector3D* a0, z_Vector3D* a1) {
|
||||
UNK_TYPE Lib_PitchVec3f(z_Vector3f* a0, z_Vector3f* a1) {
|
||||
return atans_flip(Lib_DistanceXZVec3f(a0, a1), a0->y - a1->y);
|
||||
}
|
||||
|
||||
@@ -458,7 +458,7 @@ UNK_RET Lib_ApplyActorInitVarFloat1000th(u8* a0, z_ActorCompInitEntry* a1) {
|
||||
}
|
||||
|
||||
UNK_RET Lib_ApplyActorInitVarVector3f(u8* a0, z_ActorCompInitEntry* a1) {
|
||||
z_Vector3D* v0 = (z_Vector3D*)(a0 + a1->offset);
|
||||
z_Vector3f* v0 = (z_Vector3f*)(a0 + a1->offset);
|
||||
f32 f0 = (f32)(a1->value);
|
||||
|
||||
v0->z = f0;
|
||||
@@ -467,7 +467,7 @@ UNK_RET Lib_ApplyActorInitVarVector3f(u8* a0, z_ActorCompInitEntry* a1) {
|
||||
}
|
||||
|
||||
UNK_RET Lib_ApplyActorInitVarVector3f1000th(u8* a0, z_ActorCompInitEntry* a1) {
|
||||
z_Vector3D* v0 = (z_Vector3D*)(a0 + a1->offset);
|
||||
z_Vector3f* v0 = (z_Vector3f*)(a0 + a1->offset);
|
||||
f32 f0 = (f32)(a1->value) / 1000;
|
||||
|
||||
v0->z = f0;
|
||||
@@ -476,7 +476,7 @@ UNK_RET Lib_ApplyActorInitVarVector3f1000th(u8* a0, z_ActorCompInitEntry* a1) {
|
||||
}
|
||||
|
||||
UNK_RET Lib_ApplyActorInitVarVector3s(u8* a0, z_ActorCompInitEntry* a1) {
|
||||
z_Vector3Ds16* v0 = (z_Vector3Ds16*)(a0 + a1->offset);
|
||||
z_Vector3s* v0 = (z_Vector3s*)(a0 + a1->offset);
|
||||
s16 v1 = (s16)(a1->value);
|
||||
|
||||
v0->z = v1;
|
||||
@@ -600,7 +600,7 @@ UNK_RET func_801000F4(UNK_TYPE a0, u16 a1) {
|
||||
func_8019F1C0(a0, a1);
|
||||
}
|
||||
|
||||
void Lib_TranslateAndRotateYVec3f(z_Vector3D* a0, s16 a1, z_Vector3D* a2, z_Vector3D* a3) {
|
||||
void Lib_TranslateAndRotateYVec3f(z_Vector3f* a0, s16 a1, z_Vector3f* a2, z_Vector3f* a3) {
|
||||
f32 sp1C;
|
||||
f32 f0;
|
||||
|
||||
@@ -626,8 +626,8 @@ GLOBAL_ASM("./asm/nonmatching/z_lib/Lib_LerpRGB.asm")
|
||||
|
||||
#endif
|
||||
|
||||
f32 Lib_PushAwayVec3f(z_Vector3D* a0, z_Vector3D* a1, f32 a2) {
|
||||
z_Vector3D sp24;
|
||||
f32 Lib_PushAwayVec3f(z_Vector3f* a0, z_Vector3f* a1, f32 a2) {
|
||||
z_Vector3f sp24;
|
||||
f32 f2;
|
||||
f32 f0;
|
||||
|
||||
|
||||
@@ -30,10 +30,10 @@ void osInitialize(void) {
|
||||
while (__osSiRawReadIo(0x1FC007FC, &pifdata) != 0);
|
||||
while (__osSiRawWriteIo(0x1FC007FC, pifdata | 8) != 0);
|
||||
|
||||
*(s8008A6FC*)0x80000000 = *((s8008A6FC*)__osExceptionPreamble);
|
||||
*(s8008A6FC*)0x80000080 = *((s8008A6FC*)__osExceptionPreamble);
|
||||
*(s8008A6FC*)0x80000100 = *((s8008A6FC*)__osExceptionPreamble);
|
||||
*(s8008A6FC*)0x80000180 = *((s8008A6FC*)__osExceptionPreamble);
|
||||
*(__osExceptionVector*)0x80000000 = *((__osExceptionVector*)__osExceptionPreamble);
|
||||
*(__osExceptionVector*)0x80000080 = *((__osExceptionVector*)__osExceptionPreamble);
|
||||
*(__osExceptionVector*)0x80000100 = *((__osExceptionVector*)__osExceptionPreamble);
|
||||
*(__osExceptionVector*)0x80000180 = *((__osExceptionVector*)__osExceptionPreamble);
|
||||
|
||||
osWritebackDCache((void*)0x80000000, 400);
|
||||
osInvalICache((void*)0x80000000, 400);
|
||||
|
||||
Reference in New Issue
Block a user