mirror of
https://github.com/zeldaret/mm.git
synced 2026-05-26 15:44:42 -04:00
General Cleanup (#155)
* minor fixes * Consolidate into globalCtx * fix error * Fix Warnings Co-authored-by: engineer124 <engineer124enginer124@gmail.com>
This commit is contained in:
+14
-14
@@ -3,49 +3,49 @@
|
||||
|
||||
// This file is most likely z_en_a_obj.c
|
||||
|
||||
void EnAObj_Init(ActorEnAObj* this, GlobalContext* ctxt) {
|
||||
void EnAObj_Init(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
ActorEnAObj* s0 = (ActorEnAObj*)this;
|
||||
s0->base.textId = ((s0->base.params >> 8) & 0xFF) | 0x300;
|
||||
s0->base.params = (s0->base.params & 0xFF) - 9;
|
||||
Actor_ProcessInitChain((Actor*)s0, &enAObjInitVar);
|
||||
ActorShape_Init(&s0->base.shape, 0, (ActorShadowFunc)func_800B3FC0, 12);
|
||||
Collider_InitAndSetCylinder(ctxt, &s0->collision, (Actor*)s0, &enAObjCylinderInit);
|
||||
Collider_InitAndSetCylinder(globalCtx, &s0->collision, (Actor*)s0, &enAObjCylinderInit);
|
||||
Collider_UpdateCylinder((Actor*)s0, &s0->collision);
|
||||
s0->base.colChkInfo.mass = 255;
|
||||
s0->update = (ActorFunc)EnAObj_Update1;
|
||||
}
|
||||
|
||||
void EnAObj_Destroy(ActorEnAObj* this, GlobalContext* ctxt) {
|
||||
void EnAObj_Destroy(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
ColliderCylinder* a2 = &this->collision;
|
||||
Collider_DestroyCylinder(ctxt, a2);
|
||||
Collider_DestroyCylinder(globalCtx, a2);
|
||||
}
|
||||
|
||||
void EnAObj_Update1(ActorEnAObj* this, GlobalContext* ctxt) {
|
||||
void EnAObj_Update1(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
s16 v0;
|
||||
s32 v1;
|
||||
if (func_800B84D0((Actor*)this, ctxt) != 0) {
|
||||
if (func_800B84D0((Actor*)this, globalCtx) != 0) {
|
||||
this->update = (ActorFunc)EnAObj_Update2;
|
||||
} else {
|
||||
v0 = this->base.yawTowardsPlayer - this->base.shape.rot.y;
|
||||
v1 = (v0 < 0) ? -v0 : v0;
|
||||
if ((v1 < 10240) || ((this->base.params == 1) && (v1 > 22528))) {
|
||||
func_800B863C((Actor*)this, ctxt);
|
||||
func_800B863C((Actor*)this, globalCtx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EnAObj_Update2(ActorEnAObj* this, GlobalContext* ctxt) {
|
||||
if (func_800B867C((Actor*)this, ctxt) != 0) {
|
||||
void EnAObj_Update2(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
if (func_800B867C((Actor*)this, globalCtx) != 0) {
|
||||
this->update = (ActorFunc)EnAObj_Update1;
|
||||
}
|
||||
}
|
||||
|
||||
void EnAObj_Update(ActorEnAObj* this, GlobalContext* ctxt) {
|
||||
(this->update)((Actor*)this, (GlobalContext*)ctxt);
|
||||
void EnAObj_Update(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
(this->update)((Actor*)this, (GlobalContext*)globalCtx);
|
||||
Actor_SetHeight((Actor*)this, 45.0f);
|
||||
CollisionCheck_SetOC(ctxt, &ctxt->colCheckCtx, (Collider*)&this->collision);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, (Collider*)&this->collision);
|
||||
}
|
||||
|
||||
void EnAObj_Draw(ActorEnAObj* this, GlobalContext* ctxt) {
|
||||
func_800BDFC0(ctxt, enAObjDisplayLists[this->base.params]);
|
||||
void EnAObj_Draw(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
func_800BDFC0(globalCtx, enAObjDisplayLists[this->base.params]);
|
||||
}
|
||||
|
||||
+12
-12
@@ -40,7 +40,7 @@ EffInfo sEffInfoTable[] = {
|
||||
};
|
||||
|
||||
GlobalContext* Effect_GetContext(void) {
|
||||
return sEffTable.ctxt;
|
||||
return sEffTable.globalCtx;
|
||||
}
|
||||
|
||||
void* Effect_GetParams(s32 index) {
|
||||
@@ -92,7 +92,7 @@ void Effect_InitCommon(EffCommon* common) {
|
||||
common->unk2 = 0;
|
||||
}
|
||||
|
||||
void Effect_Init(GlobalContext* ctxt) {
|
||||
void Effect_Init(GlobalContext* globalCtx) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
@@ -112,10 +112,10 @@ void Effect_Init(GlobalContext* ctxt) {
|
||||
Effect_InitCommon(&sEffTable.tireMarks[i].base);
|
||||
}
|
||||
|
||||
sEffTable.ctxt = ctxt;
|
||||
sEffTable.globalCtx = globalCtx;
|
||||
}
|
||||
|
||||
void Effect_Add(GlobalContext* ctxt, s32* index, s32 type, u8 param_4, u8 param_5, void* initParams) {
|
||||
void Effect_Add(GlobalContext* globalCtx, s32* index, s32 type, u8 param_4, u8 param_5, void* initParams) {
|
||||
u32 slotFound;
|
||||
s32 i;
|
||||
void* params;
|
||||
@@ -125,7 +125,7 @@ void Effect_Add(GlobalContext* ctxt, s32* index, s32 type, u8 param_4, u8 param_
|
||||
*index = 46;
|
||||
common = NULL;
|
||||
|
||||
if (func_8016A01C(ctxt) != 1) {
|
||||
if (func_8016A01C(globalCtx) != 1) {
|
||||
slotFound = 0;
|
||||
switch (type) {
|
||||
case 0:
|
||||
@@ -219,13 +219,13 @@ void Effect_DrawAll(GraphicsContext* gCtxt) {
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// 15 is being placed in s5 instead of at
|
||||
void Effect_UpdateAll(GlobalContext* ctxt) {
|
||||
void Effect_UpdateAll(GlobalContext* globalCtx) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
if (sEffTable.sparks[i].base.active) {
|
||||
if (sEffInfoTable[0].update(&sEffTable.sparks[i].params) == 1) {
|
||||
Effect_Destroy(ctxt, i);
|
||||
Effect_Destroy(globalCtx, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -233,7 +233,7 @@ void Effect_UpdateAll(GlobalContext* ctxt) {
|
||||
for (i = 0; i < 25; i++) {
|
||||
if (sEffTable.blures[i].base.active) {
|
||||
if (sEffInfoTable[1].update(&sEffTable.blures[i].params) == 1) {
|
||||
Effect_Destroy(ctxt, i + 3);
|
||||
Effect_Destroy(globalCtx, i + 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -241,7 +241,7 @@ void Effect_UpdateAll(GlobalContext* ctxt) {
|
||||
for (i = 0; i < 3; i++) {
|
||||
if (sEffTable.shieldParticles[i].base.active) {
|
||||
if (sEffInfoTable[3].update(&sEffTable.shieldParticles[i].params) == 1) {
|
||||
Effect_Destroy(ctxt, i + 28);
|
||||
Effect_Destroy(globalCtx, i + 28);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -249,7 +249,7 @@ void Effect_UpdateAll(GlobalContext* ctxt) {
|
||||
for (i = 0; i < 15; i++) {
|
||||
if (sEffTable.tireMarks[i].base.active) {
|
||||
if (sEffInfoTable[4].update(&sEffTable.tireMarks[i].params) == 1) {
|
||||
Effect_Destroy(ctxt, i + 31);
|
||||
Effect_Destroy(globalCtx, i + 31);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -258,7 +258,7 @@ void Effect_UpdateAll(GlobalContext* ctxt) {
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/code_0x800AF710/Effect_UpdateAll.asm")
|
||||
#endif
|
||||
|
||||
void Effect_Destroy(GlobalContext* ctxt, s32 index) {
|
||||
void Effect_Destroy(GlobalContext* globalCtx, s32 index) {
|
||||
if (index == 46) {
|
||||
return;
|
||||
}
|
||||
@@ -291,7 +291,7 @@ void Effect_Destroy(GlobalContext* ctxt, s32 index) {
|
||||
}
|
||||
}
|
||||
|
||||
void Effect_DestroyAll(GlobalContext* ctxt) {
|
||||
void Effect_DestroyAll(GlobalContext* globalCtx) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
|
||||
@@ -9,12 +9,12 @@ void BcCheck3_BgActorInit(DynaPolyActor* actor, UNK_TYPE4 param_2) {
|
||||
actor->unk_158 = 0;
|
||||
}
|
||||
|
||||
void BgCheck3_LoadMesh(GlobalContext* ctxt, DynaPolyActor* actor, CollisionHeader* meshHeader) {
|
||||
void BgCheck3_LoadMesh(GlobalContext* globalCtx, DynaPolyActor* actor, CollisionHeader* meshHeader) {
|
||||
CollisionHeader* header;
|
||||
|
||||
header = NULL;
|
||||
BgCheck_RelocateMeshHeader(meshHeader, &header);
|
||||
actor->bgId = BgCheck_AddActorMesh(ctxt, &ctxt->colCtx.dyna, actor, header);
|
||||
actor->bgId = BgCheck_AddActorMesh(globalCtx, &globalCtx->colCtx.dyna, actor, header);
|
||||
}
|
||||
|
||||
void BgCheck3_ResetFlags(DynaPolyActor* actor) {
|
||||
|
||||
+14
-16
@@ -1,8 +1,8 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void func_800E8EA0(GlobalContext* ctxt, Actor* actor, u16 param_3) {
|
||||
func_80151938(ctxt, param_3);
|
||||
void func_800E8EA0(GlobalContext* globalCtx, Actor* actor, u16 param_3) {
|
||||
func_80151938(globalCtx, param_3);
|
||||
actor->textId = param_3;
|
||||
}
|
||||
|
||||
@@ -54,16 +54,15 @@ s32 func_800E8FA4(Actor* actor, Vec3f* param_2, Vec3s* param_3, Vec3s* param_4)
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_800E9138(GlobalContext* ctxt, Actor* actor, Vec3s* param_3, Vec3s* param_4, f32 param_5) {
|
||||
s32 func_800E9138(GlobalContext* globalCtx, Actor* actor, Vec3s* param_3, Vec3s* param_4, f32 param_5) {
|
||||
ActorPlayer* player = PLAYER;
|
||||
s16 sVar3;
|
||||
Actor* player;
|
||||
Vec3f local_14;
|
||||
|
||||
player = (ctxt->actorCtx).actorList[2].first;
|
||||
actor->focus.pos = actor->world.pos;
|
||||
actor->focus.pos.y += param_5;
|
||||
|
||||
if (((ctxt->csCtx).state == 0) && (D_801D0D50 == 0)) {
|
||||
if (((globalCtx->csCtx).state == 0) && (D_801D0D50 == 0)) {
|
||||
sVar3 = actor->yawTowardsPlayer - actor->shape.rot.y;
|
||||
// TODO is this shifting because of a missing cast?
|
||||
if (0x42ff < (sVar3 < 0 ? ((-sVar3 << 0x10) >> 0x10) : ((sVar3 << 0x10) >> 0x10))) {
|
||||
@@ -72,25 +71,24 @@ s32 func_800E9138(GlobalContext* ctxt, Actor* actor, Vec3s* param_3, Vec3s* para
|
||||
}
|
||||
}
|
||||
|
||||
if (((ctxt->csCtx).state != 0) || (D_801D0D50 != 0)) {
|
||||
local_14 = ctxt->view.eye;
|
||||
if (((globalCtx->csCtx).state != 0) || (D_801D0D50 != 0)) {
|
||||
local_14 = globalCtx->view.eye;
|
||||
} else {
|
||||
local_14 = player->focus.pos;
|
||||
local_14 = player->base.focus.pos;
|
||||
}
|
||||
|
||||
func_800E8FA4(actor, &local_14, param_3, param_4);
|
||||
|
||||
return 1;
|
||||
}
|
||||
s32 func_800E9250(GlobalContext* ctxt, Actor* actor, Vec3s* param_3, Vec3s* param_4, Vec3f param_5) {
|
||||
s32 func_800E9250(GlobalContext* globalCtx, Actor* actor, Vec3s* param_3, Vec3s* param_4, Vec3f param_5) {
|
||||
ActorPlayer* player = PLAYER;
|
||||
s16 sVar3;
|
||||
Actor* player;
|
||||
Vec3f local_14;
|
||||
|
||||
player = (ctxt->actorCtx).actorList[2].first;
|
||||
actor->focus.pos = param_5;
|
||||
|
||||
if (((ctxt->csCtx).state == 0) && (D_801D0D50 == 0)) {
|
||||
if (((globalCtx->csCtx).state == 0) && (D_801D0D50 == 0)) {
|
||||
sVar3 = actor->yawTowardsPlayer - actor->shape.rot.y;
|
||||
// TODO is this shifting because of a missing cast?
|
||||
if (0x42ff < (sVar3 < 0 ? ((-sVar3 << 0x10) >> 0x10) : ((sVar3 << 0x10) >> 0x10))) {
|
||||
@@ -99,10 +97,10 @@ s32 func_800E9250(GlobalContext* ctxt, Actor* actor, Vec3s* param_3, Vec3s* para
|
||||
}
|
||||
}
|
||||
|
||||
if (((ctxt->csCtx).state != 0) || (D_801D0D50 != 0)) {
|
||||
local_14 = ctxt->view.eye;
|
||||
if (((globalCtx->csCtx).state != 0) || (D_801D0D50 != 0)) {
|
||||
local_14 = globalCtx->view.eye;
|
||||
} else {
|
||||
local_14 = player->focus.pos;
|
||||
local_14 = player->base.focus.pos;
|
||||
}
|
||||
|
||||
func_800E8FA4(actor, &local_14, param_3, param_4);
|
||||
|
||||
+48
-48
@@ -147,7 +147,7 @@ void func_800B40E0(GlobalContext* globalCtx, Light* light, MtxF* arg2, s32 arg3,
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_actor//func_800B5040.asm")
|
||||
|
||||
void Actor_TargetContextInit(TargetContext* targetCtxt, Actor* actor, GlobalContext* ctxt) {
|
||||
void Actor_TargetContextInit(TargetContext* targetCtxt, Actor* actor, GlobalContext* globalCtx) {
|
||||
targetCtxt->unk90 = NULL;
|
||||
targetCtxt->unk8C = NULL;
|
||||
targetCtxt->unk3C = NULL;
|
||||
@@ -155,94 +155,94 @@ void Actor_TargetContextInit(TargetContext* targetCtxt, Actor* actor, GlobalCont
|
||||
targetCtxt->unk4B = 0;
|
||||
targetCtxt->unk4C = 0;
|
||||
targetCtxt->unk40 = 0;
|
||||
func_800B5040(targetCtxt, actor, actor->category, ctxt);
|
||||
func_800B4F78(targetCtxt, actor->category, ctxt);
|
||||
func_800B5040(targetCtxt, actor, actor->category, globalCtx);
|
||||
func_800B4F78(targetCtxt, actor->category, globalCtx);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_actor//func_800B5208.asm")
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_actor//func_800B5814.asm")
|
||||
|
||||
u32 Flags_GetSwitch(GlobalContext* ctxt, s32 flag) {
|
||||
u32 Flags_GetSwitch(GlobalContext* globalCtx, s32 flag) {
|
||||
if (flag >= 0 && flag < 0x80) {
|
||||
return ctxt->actorCtx.switchFlags[(flag & -0x20) >> 5] & (1 << (flag & 0x1F));
|
||||
return globalCtx->actorCtx.switchFlags[(flag & -0x20) >> 5] & (1 << (flag & 0x1F));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Actor_SetSwitchFlag(GlobalContext* ctxt, s32 flag) {
|
||||
void Actor_SetSwitchFlag(GlobalContext* globalCtx, s32 flag) {
|
||||
if (flag >= 0 && flag < 0x80) {
|
||||
ctxt->actorCtx.switchFlags[(flag & -0x20) >> 5] |= 1 << (flag & 0x1F);
|
||||
globalCtx->actorCtx.switchFlags[(flag & -0x20) >> 5] |= 1 << (flag & 0x1F);
|
||||
}
|
||||
}
|
||||
|
||||
void Actor_UnsetSwitchFlag(GlobalContext* ctxt, s32 flag) {
|
||||
void Actor_UnsetSwitchFlag(GlobalContext* globalCtx, s32 flag) {
|
||||
if (flag >= 0 && flag < 0x80) {
|
||||
ctxt->actorCtx.switchFlags[(flag & -0x20) >> 5] &= ~(1 << (flag & 0x1F));
|
||||
globalCtx->actorCtx.switchFlags[(flag & -0x20) >> 5] &= ~(1 << (flag & 0x1F));
|
||||
}
|
||||
}
|
||||
|
||||
u32 Actor_GetChestFlag(GlobalContext* ctxt, u32 flag) {
|
||||
return ctxt->actorCtx.chestFlags & (1 << flag);
|
||||
u32 Actor_GetChestFlag(GlobalContext* globalCtx, u32 flag) {
|
||||
return globalCtx->actorCtx.chestFlags & (1 << flag);
|
||||
}
|
||||
|
||||
void Actor_SetChestFlag(GlobalContext* ctxt, u32 flag) {
|
||||
ctxt->actorCtx.chestFlags |= (1 << flag);
|
||||
void Actor_SetChestFlag(GlobalContext* globalCtx, u32 flag) {
|
||||
globalCtx->actorCtx.chestFlags |= (1 << flag);
|
||||
}
|
||||
|
||||
void Actor_SetAllChestFlag(GlobalContext* ctxt, u32 flag) {
|
||||
ctxt->actorCtx.chestFlags = flag;
|
||||
void Actor_SetAllChestFlag(GlobalContext* globalCtx, u32 flag) {
|
||||
globalCtx->actorCtx.chestFlags = flag;
|
||||
}
|
||||
|
||||
u32 Actor_GetAllChestFlag(GlobalContext* ctxt) {
|
||||
return ctxt->actorCtx.chestFlags;
|
||||
u32 Actor_GetAllChestFlag(GlobalContext* globalCtx) {
|
||||
return globalCtx->actorCtx.chestFlags;
|
||||
}
|
||||
|
||||
u32 Actor_GetRoomCleared(GlobalContext* ctxt, u32 roomNumber) {
|
||||
return ctxt->actorCtx.clearedRooms & (1 << roomNumber);
|
||||
u32 Actor_GetRoomCleared(GlobalContext* globalCtx, u32 roomNumber) {
|
||||
return globalCtx->actorCtx.clearedRooms & (1 << roomNumber);
|
||||
}
|
||||
|
||||
void Actor_SetRoomCleared(GlobalContext* ctxt, u32 roomNumber) {
|
||||
ctxt->actorCtx.clearedRooms |= (1 << roomNumber);
|
||||
void Actor_SetRoomCleared(GlobalContext* globalCtx, u32 roomNumber) {
|
||||
globalCtx->actorCtx.clearedRooms |= (1 << roomNumber);
|
||||
}
|
||||
|
||||
void Actor_UnsetRoomCleared(GlobalContext* ctxt, u32 roomNumber) {
|
||||
ctxt->actorCtx.clearedRooms &= ~(1 << roomNumber);
|
||||
void Actor_UnsetRoomCleared(GlobalContext* globalCtx, u32 roomNumber) {
|
||||
globalCtx->actorCtx.clearedRooms &= ~(1 << roomNumber);
|
||||
}
|
||||
|
||||
u32 Actor_GetRoomClearedTemp(GlobalContext* ctxt, u32 roomNumber) {
|
||||
return ctxt->actorCtx.clearedRoomsTemp & (1 << roomNumber);
|
||||
u32 Actor_GetRoomClearedTemp(GlobalContext* globalCtx, u32 roomNumber) {
|
||||
return globalCtx->actorCtx.clearedRoomsTemp & (1 << roomNumber);
|
||||
}
|
||||
|
||||
void Actor_SetRoomClearedTemp(GlobalContext* ctxt, u32 roomNumber) {
|
||||
ctxt->actorCtx.clearedRoomsTemp |= (1 << roomNumber);
|
||||
void Actor_SetRoomClearedTemp(GlobalContext* globalCtx, u32 roomNumber) {
|
||||
globalCtx->actorCtx.clearedRoomsTemp |= (1 << roomNumber);
|
||||
}
|
||||
|
||||
void Actor_UnsetRoomClearedTemp(GlobalContext* ctxt, u32 roomNumber) {
|
||||
ctxt->actorCtx.clearedRoomsTemp &= ~(1 << roomNumber);
|
||||
void Actor_UnsetRoomClearedTemp(GlobalContext* globalCtx, u32 roomNumber) {
|
||||
globalCtx->actorCtx.clearedRoomsTemp &= ~(1 << roomNumber);
|
||||
}
|
||||
|
||||
u32 Actor_GetCollectibleFlag(GlobalContext* ctxt, s32 index) {
|
||||
u32 Actor_GetCollectibleFlag(GlobalContext* globalCtx, s32 index) {
|
||||
if (index > 0 && index < 0x80) {
|
||||
return ctxt->actorCtx.collectibleFlags[(index & -0x20) >> 5] & (1 << (index & 0x1F));
|
||||
return globalCtx->actorCtx.collectibleFlags[(index & -0x20) >> 5] & (1 << (index & 0x1F));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Actor_SetCollectibleFlag(GlobalContext* ctxt, s32 index) {
|
||||
void Actor_SetCollectibleFlag(GlobalContext* globalCtx, s32 index) {
|
||||
if (index > 0 && index < 0x80) {
|
||||
ctxt->actorCtx.collectibleFlags[(index & -0x20) >> 5] |= 1 << (index & 0x1F);
|
||||
globalCtx->actorCtx.collectibleFlags[(index & -0x20) >> 5] |= 1 << (index & 0x1F);
|
||||
}
|
||||
}
|
||||
|
||||
void Actor_TitleCardContextInit(GlobalContext* ctxt, TitleCardContext* titleCtxt) {
|
||||
void Actor_TitleCardContextInit(GlobalContext* globalCtx, TitleCardContext* titleCtxt) {
|
||||
titleCtxt->fadeOutDelay = 0;
|
||||
titleCtxt->fadeInDelay = 0;
|
||||
titleCtxt->color = 0;
|
||||
titleCtxt->alpha = 0;
|
||||
}
|
||||
|
||||
void Actor_TitleCardCreate(GlobalContext* ctxt, TitleCardContext* titleCtxt, u32 texture, s16 param_4, s16 param_5,
|
||||
void Actor_TitleCardCreate(GlobalContext* globalCtx, TitleCardContext* titleCtxt, u32 texture, s16 param_4, s16 param_5,
|
||||
u8 param_6, u8 param_7) {
|
||||
titleCtxt->texture = texture;
|
||||
titleCtxt->unk4 = param_4;
|
||||
@@ -255,7 +255,7 @@ void Actor_TitleCardCreate(GlobalContext* ctxt, TitleCardContext* titleCtxt, u32
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_actor//Actor_Nop800B5E50.asm")
|
||||
|
||||
void Actor_TitleCardUpdate(GlobalContext* ctxt, TitleCardContext* titleCtxt) {
|
||||
void Actor_TitleCardUpdate(GlobalContext* globalCtx, TitleCardContext* titleCtxt) {
|
||||
if (DECR(titleCtxt->fadeInDelay) == 0) {
|
||||
if (DECR(titleCtxt->fadeOutDelay) == 0) {
|
||||
Math_StepToS(&titleCtxt->alpha, 0, 30);
|
||||
@@ -318,13 +318,13 @@ void Actor_SetScale(Actor* actor, f32 scale) {
|
||||
actor->scale.x = scale;
|
||||
}
|
||||
|
||||
void Actor_SetObjectSegment(GlobalContext* ctxt, Actor* actor) {
|
||||
void Actor_SetObjectSegment(GlobalContext* globalCtx, Actor* actor) {
|
||||
// TODO: Segment number enum
|
||||
gSegments[6] = PHYSICAL_TO_VIRTUAL(ctxt->objectCtx.status[actor->objBankIndex].segment);
|
||||
gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[actor->objBankIndex].segment);
|
||||
}
|
||||
|
||||
#if 0
|
||||
void Actor_InitToDefaultValues(Actor* actor, GlobalContext* ctxt) {
|
||||
void Actor_InitToDefaultValues(Actor* actor, GlobalContext* globalCtx) {
|
||||
Actor_InitCurrPosition(actor);
|
||||
Actor_InitDrawRotation(actor);
|
||||
Actor_SetHeight(actor, 0);
|
||||
@@ -344,9 +344,9 @@ void Actor_InitToDefaultValues(Actor* actor, GlobalContext* ctxt) {
|
||||
actor->naviMsgId = 255;
|
||||
|
||||
Actor_Setshape(&actor->shape, 0, 0, 0);
|
||||
if (Object_IsLoaded(&ctxt->objectCtx, actor->objBankIndex) != 0) {
|
||||
Actor_SetObjectSegment(ctxt, actor);
|
||||
actor->init(actor, ctxt);
|
||||
if (Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex) != 0) {
|
||||
Actor_SetObjectSegment(globalCtx, actor);
|
||||
actor->init(actor, globalCtx);
|
||||
actor->init = NULL;
|
||||
}
|
||||
}
|
||||
@@ -354,10 +354,10 @@ void Actor_InitToDefaultValues(Actor* actor, GlobalContext* ctxt) {
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_actor//Actor_InitToDefaultValues.asm")
|
||||
#endif
|
||||
|
||||
void Actor_FiniActor(Actor* actor, GlobalContext* ctxt) {
|
||||
void Actor_FiniActor(Actor* actor, GlobalContext* globalCtx) {
|
||||
if (actor->init == NULL) {
|
||||
if (actor->destroy != NULL) {
|
||||
actor->destroy(actor, ctxt);
|
||||
actor->destroy(actor, globalCtx);
|
||||
actor->destroy = NULL;
|
||||
}
|
||||
}
|
||||
@@ -622,7 +622,7 @@ s32 Actor_IsActorFacingActorAndWithinRange(Actor* actor, Actor* other, f32 range
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_actor//func_800B8934.asm")
|
||||
|
||||
u32 Actor_HasParent(Actor* actor, GlobalContext* ctxt) {
|
||||
u32 Actor_HasParent(Actor* actor, GlobalContext* globalCtx) {
|
||||
if (actor->parent != NULL) {
|
||||
return 1;
|
||||
} else {
|
||||
@@ -698,9 +698,9 @@ u32 Actor_HasParent(Actor* actor, GlobalContext* ctxt) {
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_actor//func_800B9D1C.asm")
|
||||
|
||||
void Actor_DrawAllSetup(GlobalContext* ctxt) {
|
||||
ctxt->actorCtx.undrawnActorCount = 0;
|
||||
ctxt->actorCtx.unkB = 0;
|
||||
void Actor_DrawAllSetup(GlobalContext* globalCtx) {
|
||||
globalCtx->actorCtx.undrawnActorCount = 0;
|
||||
globalCtx->actorCtx.unkB = 0;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_actor//Actor_RecordUndrawnActor.asm")
|
||||
|
||||
@@ -26,13 +26,13 @@ void BgCheck_PolygonLinkedListNodeInsert(DynaSSNodeList* list, u16* head, s16* p
|
||||
*head = index;
|
||||
}
|
||||
|
||||
void BgCheck_PolygonLinkedListInit(GlobalContext* ctxt, DynaSSNodeList* list) {
|
||||
void BgCheck_PolygonLinkedListInit(GlobalContext* globalCtx, DynaSSNodeList* list) {
|
||||
list->tbl = NULL;
|
||||
list->count = 0;
|
||||
}
|
||||
|
||||
void BgCheck_PolygonLinkedListAlloc(GlobalContext* ctxt, DynaSSNodeList* list, u32 numNodes) {
|
||||
list->tbl = (SSNode*)THA_AllocEndAlign(&ctxt->state.heap, numNodes << 2, 0xfffffffe);
|
||||
void BgCheck_PolygonLinkedListAlloc(GlobalContext* globalCtx, DynaSSNodeList* list, u32 numNodes) {
|
||||
list->tbl = (SSNode*)THA_AllocEndAlign(&globalCtx->state.heap, numNodes << 2, 0xfffffffe);
|
||||
list->max = numNodes;
|
||||
list->count = 0;
|
||||
}
|
||||
|
||||
+409
-409
File diff suppressed because it is too large
Load Diff
+11
-11
@@ -1,11 +1,11 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void EffFootmark_Init(GlobalContext* ctxt) {
|
||||
void EffFootmark_Init(GlobalContext* globalCtx) {
|
||||
EffFootmark* footmark;
|
||||
s32 i;
|
||||
|
||||
for (footmark = ctxt->footmarks, i = 0; i < 100; i++, footmark++) {
|
||||
for (footmark = globalCtx->footmarks, i = 0; i < 100; i++, footmark++) {
|
||||
footmark->actor = NULL;
|
||||
footmark->location.x = 0;
|
||||
footmark->location.y = 0;
|
||||
@@ -17,7 +17,7 @@ void EffFootmark_Init(GlobalContext* ctxt) {
|
||||
}
|
||||
}
|
||||
|
||||
void EffFootmark_Add(GlobalContext* ctxt, MtxF* displayMatrix, Actor* actor, u8 id, Vec3f* location, u16 size, u8 red,
|
||||
void EffFootmark_Add(GlobalContext* globalCtx, MtxF* displayMatrix, Actor* actor, u8 id, Vec3f* location, u16 size, u8 red,
|
||||
u8 green, u8 blue, u16 alpha, u16 alphaChange, u16 fadeoutDelay) {
|
||||
s32 i;
|
||||
EffFootmark* footmark;
|
||||
@@ -25,7 +25,7 @@ void EffFootmark_Add(GlobalContext* ctxt, MtxF* displayMatrix, Actor* actor, u8
|
||||
EffFootmark* oldest = NULL;
|
||||
s32 isNew = 1;
|
||||
|
||||
for (footmark = ctxt->footmarks, i = 0; i < 100; i++, footmark++) {
|
||||
for (footmark = globalCtx->footmarks, i = 0; i < 100; i++, footmark++) {
|
||||
if (((actor == footmark->actor) && (footmark->id == id)) && ((footmark->flags & 1) == 0)) {
|
||||
if (fabsf((footmark->location).x - location->x) <= 1) {
|
||||
if (fabsf((footmark->location).z - location->z) <= 1) {
|
||||
@@ -71,11 +71,11 @@ void EffFootmark_Add(GlobalContext* ctxt, MtxF* displayMatrix, Actor* actor, u8
|
||||
}
|
||||
}
|
||||
|
||||
void EffFootmark_Update(GlobalContext* ctxt) {
|
||||
void EffFootmark_Update(GlobalContext* globalCtx) {
|
||||
EffFootmark* footmark;
|
||||
s32 i;
|
||||
|
||||
for (footmark = ctxt->footmarks, i = 0; i < 100; i++, footmark++) {
|
||||
for (footmark = globalCtx->footmarks, i = 0; i < 100; i++, footmark++) {
|
||||
if (footmark->actor != NULL) {
|
||||
if ((footmark->flags & 1) == 1) {
|
||||
if (footmark->age < 0xFFFFu) { // TODO replace with MAX_U16 or something
|
||||
@@ -96,21 +96,21 @@ void EffFootmark_Update(GlobalContext* ctxt) {
|
||||
}
|
||||
}
|
||||
|
||||
void EffFootmark_Draw(GlobalContext* ctxt) {
|
||||
void EffFootmark_Draw(GlobalContext* globalCtx) {
|
||||
EffFootmark* footmark;
|
||||
s32 i;
|
||||
GraphicsContext* gfxCtx = ctxt->state.gfxCtx;
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
|
||||
func_8012C448(ctxt->state.gfxCtx);
|
||||
func_8012C448(globalCtx->state.gfxCtx);
|
||||
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, D_801BC240);
|
||||
|
||||
for (footmark = ctxt->footmarks, i = 0; i < 100; i++, footmark++) {
|
||||
for (footmark = globalCtx->footmarks, i = 0; i < 100; i++, footmark++) {
|
||||
if (footmark->actor != NULL) {
|
||||
Matrix_Put(&footmark->displayMatrix);
|
||||
Matrix_Scale(footmark->size * 0.00390625f * 0.7f, 1, footmark->size * 0.00390625f, 1);
|
||||
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(ctxt->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD);
|
||||
|
||||
gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0, footmark->red, footmark->green, footmark->blue,
|
||||
footmark->alpha >> 8);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void EffectSS_Init(GlobalContext* ctxt, s32 numEntries) {
|
||||
void EffectSS_Init(GlobalContext* globalCtx, s32 numEntries) {
|
||||
u32 i;
|
||||
EffectSs* iter;
|
||||
ParticleOverlay* iter2;
|
||||
|
||||
EffectSS2Info.data_table = (EffectSs*)THA_AllocEndAlign16(&ctxt->state.heap, numEntries * sizeof(EffectSs));
|
||||
EffectSS2Info.data_table = (EffectSs*)THA_AllocEndAlign16(&globalCtx->state.heap, numEntries * sizeof(EffectSs));
|
||||
EffectSS2Info.searchIndex = 0;
|
||||
EffectSS2Info.size = numEntries;
|
||||
|
||||
@@ -19,7 +19,7 @@ void EffectSS_Init(GlobalContext* ctxt, s32 numEntries) {
|
||||
}
|
||||
}
|
||||
|
||||
void EffectSS_Clear(GlobalContext* ctxt) {
|
||||
void EffectSS_Clear(GlobalContext* globalCtx) {
|
||||
u32 i;
|
||||
EffectSs* iter;
|
||||
ParticleOverlay* iter2;
|
||||
@@ -149,9 +149,9 @@ s32 EffectSS_FindFreeSpace(u32 priority, u32* tableEntry) {
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_effect_soft_sprite/EffectSS_FindFreeSpace.asm")
|
||||
#endif
|
||||
|
||||
void EffectSS_Copy(GlobalContext* ctxt, EffectSs* a1) {
|
||||
void EffectSS_Copy(GlobalContext* globalCtx, EffectSs* a1) {
|
||||
u32 index;
|
||||
if (func_8016A01C(ctxt) != 1) {
|
||||
if (func_8016A01C(globalCtx) != 1) {
|
||||
if (EffectSS_FindFreeSpace(a1->priority, &index) == 0) {
|
||||
EffectSS2Info.searchIndex = index + 1;
|
||||
EffectSS2Info.data_table[index] = *a1;
|
||||
@@ -160,7 +160,7 @@ void EffectSS_Copy(GlobalContext* ctxt, EffectSs* a1) {
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
void EffectSs_Spawn(GlobalContext* ctxt, s32 type, s32 priority, void* initData) {
|
||||
void EffectSs_Spawn(GlobalContext* globalCtx, s32 type, s32 priority, void* initData) {
|
||||
u32 index;
|
||||
u32 initRet;
|
||||
u32 overlaySize;
|
||||
@@ -202,7 +202,7 @@ void EffectSs_Spawn(GlobalContext* ctxt, s32 type, s32 priority, void* initData)
|
||||
EffectSS2Info.data_table[index].type = type;
|
||||
EffectSS2Info.data_table[index].priority = priority;
|
||||
|
||||
initRet = (*overlayInfo->init)(ctxt, index, &EffectSS2Info.data_table[index], initData);
|
||||
initRet = (*overlayInfo->init)(globalCtx, index, &EffectSS2Info.data_table[index], initData);
|
||||
|
||||
if (initRet == 0) {
|
||||
EffectSS_ResetEntry(&EffectSS2Info.data_table[index]);
|
||||
@@ -213,7 +213,7 @@ void EffectSs_Spawn(GlobalContext* ctxt, s32 type, s32 priority, void* initData)
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_effect_soft_sprite/EffectSs_Spawn.asm")
|
||||
#endif
|
||||
|
||||
void EffectSS_UpdateParticle(GlobalContext* ctxt, s32 index) {
|
||||
void EffectSS_UpdateParticle(GlobalContext* globalCtx, s32 index) {
|
||||
EffectSs* particle = &EffectSS2Info.data_table[index];
|
||||
|
||||
if (particle->update != NULL) {
|
||||
@@ -225,11 +225,11 @@ void EffectSS_UpdateParticle(GlobalContext* ctxt, s32 index) {
|
||||
particle->pos.y += particle->velocity.y;
|
||||
particle->pos.z += particle->velocity.z;
|
||||
|
||||
particle->update(ctxt, index, particle);
|
||||
particle->update(globalCtx, index, particle);
|
||||
}
|
||||
}
|
||||
|
||||
void EffectSS_UpdateAllParticles(GlobalContext* ctxt) {
|
||||
void EffectSS_UpdateAllParticles(GlobalContext* globalCtx) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < EffectSS2Info.size; i++) {
|
||||
@@ -242,25 +242,25 @@ void EffectSS_UpdateAllParticles(GlobalContext* ctxt) {
|
||||
}
|
||||
|
||||
if (EffectSS2Info.data_table[i].life > -1) {
|
||||
EffectSS_UpdateParticle(ctxt, i);
|
||||
EffectSS_UpdateParticle(globalCtx, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EffectSS_DrawParticle(GlobalContext* ctxt, s32 index) {
|
||||
void EffectSS_DrawParticle(GlobalContext* globalCtx, s32 index) {
|
||||
EffectSs* entry = &EffectSS2Info.data_table[index];
|
||||
if (entry->draw != 0) {
|
||||
entry->draw(ctxt, index, entry);
|
||||
entry->draw(globalCtx, index, entry);
|
||||
}
|
||||
}
|
||||
|
||||
void EffectSS_DrawAllParticles(GlobalContext* ctxt) {
|
||||
void EffectSS_DrawAllParticles(GlobalContext* globalCtx) {
|
||||
Lights* s0;
|
||||
s32 i;
|
||||
|
||||
s0 = LightContext_NewLights(&ctxt->lightCtx, ctxt->state.gfxCtx);
|
||||
Lights_BindAll(s0, ctxt->lightCtx.listHead, 0, ctxt);
|
||||
Lights_Draw(s0, ctxt->state.gfxCtx);
|
||||
s0 = LightContext_NewLights(&globalCtx->lightCtx, globalCtx->state.gfxCtx);
|
||||
Lights_BindAll(s0, globalCtx->lightCtx.listHead, 0, globalCtx);
|
||||
Lights_Draw(s0, globalCtx->state.gfxCtx);
|
||||
|
||||
for (i = 0; i < EffectSS2Info.size; i++) {
|
||||
if (EffectSS2Info.data_table[i].life > -1) {
|
||||
@@ -269,7 +269,7 @@ void EffectSS_DrawAllParticles(GlobalContext* ctxt) {
|
||||
EffectSS2Info.data_table[i].pos.z > 32000 || EffectSS2Info.data_table[i].pos.z < -32000) {
|
||||
EffectSS_Delete(&EffectSS2Info.data_table[i]);
|
||||
} else {
|
||||
EffectSS_DrawParticle(ctxt, i);
|
||||
EffectSS_DrawParticle(globalCtx, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ void func_800A6650(EnItem00* this, GlobalContext* globalCtx);
|
||||
void func_800A6780(EnItem00* this, GlobalContext* globalCtx);
|
||||
void func_800A6A40(EnItem00* this, GlobalContext* globalCtx);
|
||||
|
||||
ActorInit En_Item00_InitVars = {
|
||||
const ActorInit En_Item00_InitVars = {
|
||||
ACTOR_EN_ITEM00,
|
||||
ACTORCAT_MISC,
|
||||
FLAGS,
|
||||
@@ -28,7 +28,7 @@ ActorInit En_Item00_InitVars = {
|
||||
(ActorFunc)EnItem00_Draw,
|
||||
};
|
||||
|
||||
ColliderCylinderInit enItem00CylinderInit = {
|
||||
static ColliderCylinderInit sCylinderInit = {
|
||||
{ COLTYPE_NONE, AT_NONE, AC_ON | AT_TYPE_PLAYER, OC1_NONE, OC2_NONE, COLSHAPE_CYLINDER },
|
||||
{ ELEMTYPE_UNK0,
|
||||
{ 0x00000000, 0x00, 0x00 },
|
||||
@@ -39,7 +39,9 @@ ColliderCylinderInit enItem00CylinderInit = {
|
||||
{ 10, 30, 0, { 0, 0, 0 } },
|
||||
};
|
||||
|
||||
InitChainEntry enItem00InitVars[1] = { ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_STOP) };
|
||||
static InitChainEntry sInitChain[] = {
|
||||
ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_STOP),
|
||||
};
|
||||
|
||||
void EnItem00_SetObject(EnItem00* this, GlobalContext* globalCtx, f32* shadowOffset, f32* shadowScale) {
|
||||
Actor_SetObjectSegment(globalCtx, &this->actor);
|
||||
@@ -76,8 +78,8 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
this->actor.params = ITEM00_HEART;
|
||||
}
|
||||
|
||||
Actor_ProcessInitChain(&this->actor, enItem00InitVars);
|
||||
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &enItem00CylinderInit);
|
||||
Actor_ProcessInitChain(&this->actor, sInitChain);
|
||||
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
|
||||
|
||||
this->unk150 = 1;
|
||||
|
||||
@@ -273,7 +275,7 @@ void EnItem00_WaitForHeartObject(EnItem00* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_800A640C(EnItem00* this, GlobalContext* ctxt) {
|
||||
void func_800A640C(EnItem00* this, GlobalContext* globalCtx) {
|
||||
if ((this->actor.params <= ITEM00_RUPEE_RED) || ((this->actor.params == ITEM00_HEART) && (this->unk152 < 0)) ||
|
||||
(this->actor.params == ITEM00_HEART_PIECE) || (this->actor.params == ITEM00_HEART_CONTAINER)) {
|
||||
this->actor.shape.rot.y = this->actor.shape.rot.y + 960;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void Kanfont_Nop800F4F40(GlobalContext* ctxt, UNK_TYPE param_2, UNK_TYPE param_3) {
|
||||
void Kanfont_Nop800F4F40(GlobalContext* globalCtx, UNK_TYPE param_2, UNK_TYPE param_3) {
|
||||
}
|
||||
|
||||
void Kanfont_LoadAsciiChar(GlobalContext* ctxt, u8 character, s32 iParm3) {
|
||||
void Kanfont_LoadAsciiChar(GlobalContext* globalCtx, u8 character, s32 iParm3) {
|
||||
// UB to convert pointer to u32
|
||||
DmaMgr_SendRequest0((void*)((u32)&ctxt->msgCtx.font.unk0[(ctxt->msgCtx).unk11EF0] + iParm3),
|
||||
DmaMgr_SendRequest0((void*)((u32)&globalCtx->msgCtx.font.unk0[(globalCtx->msgCtx).unk11EF0] + iParm3),
|
||||
(u32)_nes_font_staticSegmentRomStart + character * 0x80 - 0x1000, 0x80);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -897,8 +897,8 @@ void func_8012C240(GraphicsContext* gCtxt) {
|
||||
gSPDisplayList(gCtxt->polyXlu.p++, &sSetupDL[6 * 0x19]);
|
||||
}
|
||||
|
||||
void func_8012C268(GlobalContext* ctxt) {
|
||||
func_8012C28C(ctxt->state.gfxCtx);
|
||||
void func_8012C268(GlobalContext* globalCtx) {
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
void func_8012C28C(GraphicsContext* gCtxt) {
|
||||
|
||||
+33
-33
@@ -1,31 +1,31 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void Room_nop8012D510(GlobalContext* ctxt, Room* room, UNK_PTR param_3, UNK_TYPE1 param_4) {
|
||||
void Room_nop8012D510(GlobalContext* globalCtx, Room* room, UNK_PTR param_3, UNK_TYPE1 param_4) {
|
||||
}
|
||||
|
||||
void Room_DrawType3Mesh(GlobalContext* ctxt, Room* room, u32 flags) {
|
||||
void Room_DrawType3Mesh(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
}
|
||||
|
||||
void Room_DrawType0Mesh(GlobalContext* ctxt, Room* room, u32 flags) {
|
||||
void Room_DrawType0Mesh(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
RoomMeshType0* mesh;
|
||||
s32 i;
|
||||
RoomMeshType0Params* meshParams;
|
||||
GraphicsContext* gfxCtx;
|
||||
UNK_TYPE4 pad;
|
||||
|
||||
gfxCtx = ctxt->state.gfxCtx;
|
||||
gfxCtx = globalCtx->state.gfxCtx;
|
||||
if (flags & 1) {
|
||||
func_800BCBF4(&D_801C1D10, ctxt);
|
||||
func_800BCBF4(&D_801C1D10, globalCtx);
|
||||
gSPSegment(gfxCtx->polyOpa.p++, 0x03, room->segment);
|
||||
func_8012C268(ctxt);
|
||||
func_8012C268(globalCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, &D_801D1DE0, G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
}
|
||||
|
||||
if (flags & 2) {
|
||||
func_800BCC68(&D_801C1D10, ctxt);
|
||||
func_800BCC68(&D_801C1D10, globalCtx);
|
||||
gSPSegment(gfxCtx->polyXlu.p++, 0x03, room->segment);
|
||||
func_8012C2DC(ctxt->state.gfxCtx);
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, &D_801D1DE0, G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
}
|
||||
|
||||
@@ -52,18 +52,18 @@ void Room_DrawType0Mesh(GlobalContext* ctxt, Room* room, u32 flags) {
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_room/func_8012E32C.asm")
|
||||
|
||||
void Room_DrawType1Mesh(GlobalContext* ctxt, Room* room, u32 flags) {
|
||||
void Room_DrawType1Mesh(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
RoomMeshType1* mesh = &room->mesh->type1;
|
||||
if (mesh->format == 1) {
|
||||
func_8012DEE8(ctxt, room, flags);
|
||||
func_8012DEE8(globalCtx, room, flags);
|
||||
} else if (mesh->format == 2) {
|
||||
func_8012E32C(ctxt, room, flags);
|
||||
func_8012E32C(globalCtx, room, flags);
|
||||
} else {
|
||||
assert_fail(D_801DDFAC, 0x3c5);
|
||||
}
|
||||
}
|
||||
|
||||
void Room_Init(GlobalContext* ctxt, RoomContext* roomCtxt) {
|
||||
void Room_Init(GlobalContext* globalCtx, RoomContext* roomCtxt) {
|
||||
s32 i;
|
||||
roomCtxt->currRoom.num = -1;
|
||||
roomCtxt->currRoom.segment = NULL;
|
||||
@@ -77,7 +77,7 @@ void Room_Init(GlobalContext* ctxt, RoomContext* roomCtxt) {
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_room/Room_AllocateAndLoad.asm")
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
s32 Room_StartRoomTransition(GlobalContext* ctxt, RoomContext* roomCtxt, s32 index) {
|
||||
s32 Room_StartRoomTransition(GlobalContext* globalCtx, RoomContext* roomCtxt, s32 index) {
|
||||
u32 size;
|
||||
|
||||
// XXX: this should use a branch-likely
|
||||
@@ -87,13 +87,13 @@ s32 Room_StartRoomTransition(GlobalContext* ctxt, RoomContext* roomCtxt, s32 ind
|
||||
roomCtxt->currRoom.segment = NULL;
|
||||
roomCtxt->unk31 = 1;
|
||||
|
||||
size = ctxt->roomAddrs[index].vromEnd - ctxt->roomAddrs[index].vromStart;
|
||||
size = globalCtx->roomAddrs[index].vromEnd - globalCtx->roomAddrs[index].vromStart;
|
||||
roomCtxt->activeRoomVram =
|
||||
(void*)((s32)roomCtxt->roomMemPages[roomCtxt->activeMemPage] - (size + 8) * roomCtxt->activeMemPage + 8) &
|
||||
0xfffffff0;
|
||||
|
||||
osCreateMesgQueue(&roomCtxt->loadQueue, roomCtxt->loadMsg, 1);
|
||||
DmaMgr_SendRequestImpl(&roomCtxt->dmaRequest, roomCtxt->activeRoomVram, ctxt->roomAddrs[index].vromStart, size,
|
||||
DmaMgr_SendRequestImpl(&roomCtxt->dmaRequest, roomCtxt->activeRoomVram, globalCtx->roomAddrs[index].vromStart, size,
|
||||
0, &roomCtxt->loadQueue, NULL);
|
||||
roomCtxt->activeMemPage ^= 1;
|
||||
|
||||
@@ -106,7 +106,7 @@ s32 Room_StartRoomTransition(GlobalContext* ctxt, RoomContext* roomCtxt, s32 ind
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_room/Room_StartRoomTransition.asm")
|
||||
#endif
|
||||
|
||||
s32 Room_HandleLoadCallbacks(GlobalContext* ctxt, RoomContext* roomCtxt) {
|
||||
s32 Room_HandleLoadCallbacks(GlobalContext* globalCtx, RoomContext* roomCtxt) {
|
||||
if (roomCtxt->unk31 == 1) {
|
||||
if (!osRecvMesg(&roomCtxt->loadQueue, NULL, OS_MESG_NOBLOCK)) {
|
||||
roomCtxt->unk31 = 0;
|
||||
@@ -114,18 +114,18 @@ s32 Room_HandleLoadCallbacks(GlobalContext* ctxt, RoomContext* roomCtxt) {
|
||||
// TODO: Segment number enum
|
||||
gSegments[3] = PHYSICAL_TO_VIRTUAL(roomCtxt->activeRoomVram);
|
||||
|
||||
Scene_ProcessHeader(ctxt, (SceneCmd*)roomCtxt->currRoom.segment);
|
||||
func_80123140(ctxt, (ActorPlayer*)ctxt->actorCtx.actorList[2].first);
|
||||
Actor_SpawnTransitionActors(ctxt, &ctxt->actorCtx);
|
||||
Scene_ProcessHeader(globalCtx, (SceneCmd*)roomCtxt->currRoom.segment);
|
||||
func_80123140(globalCtx, PLAYER);
|
||||
Actor_SpawnTransitionActors(globalCtx, &globalCtx->actorCtx);
|
||||
|
||||
if (((ctxt->sceneNum != SCENE_IKANA) || (roomCtxt->currRoom.num != 1)) &&
|
||||
(ctxt->sceneNum != SCENE_IKNINSIDE)) {
|
||||
ctxt->kankyoContext.unkC3 = 0xff;
|
||||
ctxt->kankyoContext.unkE0 = 0;
|
||||
if (((globalCtx->sceneNum != SCENE_IKANA) || (roomCtxt->currRoom.num != 1)) &&
|
||||
(globalCtx->sceneNum != SCENE_IKNINSIDE)) {
|
||||
globalCtx->kankyoContext.unkC3 = 0xff;
|
||||
globalCtx->kankyoContext.unkE0 = 0;
|
||||
}
|
||||
func_800FEAB0();
|
||||
if (!func_800FE4B8(ctxt)) {
|
||||
func_800FD858(ctxt);
|
||||
if (!func_800FE4B8(globalCtx)) {
|
||||
func_800FD858(globalCtx);
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
@@ -135,23 +135,23 @@ s32 Room_HandleLoadCallbacks(GlobalContext* ctxt, RoomContext* roomCtxt) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
void Room_Draw(GlobalContext* ctxt, Room* room, u32 flags) {
|
||||
void Room_Draw(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
if (room->segment != NULL) {
|
||||
// TODO: Segment number enum
|
||||
gSegments[3] = PHYSICAL_TO_VIRTUAL(room->segment);
|
||||
roomDrawFuncs[room->mesh->type0.type](ctxt, room, flags);
|
||||
roomDrawFuncs[room->mesh->type0.type](globalCtx, room, flags);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void func_8012EBF8(GlobalContext* ctxt, RoomContext* roomCtxt) {
|
||||
void func_8012EBF8(GlobalContext* globalCtx, RoomContext* roomCtxt) {
|
||||
roomCtxt->prevRoom.num = -1;
|
||||
roomCtxt->prevRoom.segment = NULL;
|
||||
func_800BA798(ctxt, &ctxt->actorCtx);
|
||||
Actor_SpawnTransitionActors(ctxt, &ctxt->actorCtx);
|
||||
func_800BA798(globalCtx, &globalCtx->actorCtx);
|
||||
Actor_SpawnTransitionActors(globalCtx, &globalCtx->actorCtx);
|
||||
if (-1 < roomCtxt->currRoom.num) {
|
||||
func_8010A33C(ctxt, roomCtxt->currRoom.num);
|
||||
func_8010A2DC(ctxt);
|
||||
func_8010A33C(globalCtx, roomCtxt->currRoom.num);
|
||||
func_8010A2DC(globalCtx);
|
||||
}
|
||||
func_801A3CD8(ctxt->roomContext.currRoom.echo);
|
||||
func_801A3CD8(globalCtx->roomContext.currRoom.echo);
|
||||
}
|
||||
|
||||
+7
-7
@@ -3,10 +3,10 @@
|
||||
|
||||
typedef struct {
|
||||
Actor actor;
|
||||
s32 (*pictoFunc)(GlobalContext* ctxt, Actor* actor);
|
||||
s32 (*pictoFunc)(GlobalContext* globalCtx, Actor* actor);
|
||||
} PictoActor;
|
||||
|
||||
s32 func_8013A240(GlobalContext* ctxt) {
|
||||
s32 func_8013A240(GlobalContext* globalCtx) {
|
||||
PictoActor* pictoActor;
|
||||
Actor* actor;
|
||||
s32 type = 0;
|
||||
@@ -16,15 +16,15 @@ s32 func_8013A240(GlobalContext* ctxt) {
|
||||
gSaveContext.perm.pictoFlags0 = 0;
|
||||
gSaveContext.perm.pictoFlags1 = 0;
|
||||
|
||||
if (ctxt->sceneNum == SCENE_20SICHITAI) {
|
||||
if (globalCtx->sceneNum == SCENE_20SICHITAI) {
|
||||
func_8013A41C(1);
|
||||
}
|
||||
|
||||
for (; type < 12; type++) {
|
||||
for (actor = ctxt->actorCtx.actorList[type].first; actor != NULL; actor = actor->next) {
|
||||
for (actor = globalCtx->actorCtx.actorList[type].first; actor != NULL; actor = actor->next) {
|
||||
seen = 0;
|
||||
|
||||
switch (ctxt->sceneNum) {
|
||||
switch (globalCtx->sceneNum) {
|
||||
case SCENE_20SICHITAI:
|
||||
if ((actor->id == ACTOR_EN_MNK) || (actor->id == ACTOR_EN_BIGOKUTA)) {
|
||||
seen = 1;
|
||||
@@ -64,7 +64,7 @@ s32 func_8013A240(GlobalContext* ctxt) {
|
||||
if (seen != 0) {
|
||||
pictoActor = (PictoActor*)actor;
|
||||
if (pictoActor->pictoFunc != NULL) {
|
||||
if ((pictoActor->pictoFunc)(ctxt, actor) == 0) {
|
||||
if ((pictoActor->pictoFunc)(globalCtx, actor) == 0) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
@@ -148,7 +148,7 @@ s32 func_8013A530(GlobalContext* globalCtx, Actor* actor, s32 flag, Vec3f* pos,
|
||||
}
|
||||
|
||||
actors[0] = actor;
|
||||
actors[1] = globalCtx->actorCtx.actorList[2].first; // TODO PLAYER macro
|
||||
actors[1] = &PLAYER->base;
|
||||
if (CollisionCheck_LineOCCheck(globalCtx, &globalCtx->colCheckCtx, pos, &camera->eye, actors, 2) != 0) {
|
||||
func_8013A41C(0x3b);
|
||||
ret |= 0x3b;
|
||||
|
||||
Reference in New Issue
Block a user