mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
Add current missing functions prototypes (#181)
* First bash * Another batch * Another bunch * Update actorfixer * run format * Apply suggestions from code review Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Suggestion * context renaming * Update include/functions.h Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Fix renamings * fix Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
This commit is contained in:
co-authored by
engineer124
parent
52d36d7373
commit
3098abd4f6
+144
-137
File diff suppressed because it is too large
Load Diff
+20
-20
@@ -5,7 +5,7 @@
|
||||
// Perhaps it is called something like z_bgcheck_attach.c
|
||||
// The functions will use the BgCheck2 prefix for now.
|
||||
|
||||
void BgCheck2_UpdateActorPosition(CollisionContext* bgCtxt, s32 index, Actor* actor) {
|
||||
void BgCheck2_UpdateActorPosition(CollisionContext* colCtx, s32 index, Actor* actor) {
|
||||
MtxF prevMatrix;
|
||||
MtxF prevMatrixInv;
|
||||
MtxF currMatrix;
|
||||
@@ -17,22 +17,22 @@ void BgCheck2_UpdateActorPosition(CollisionContext* bgCtxt, s32 index, Actor* ac
|
||||
}
|
||||
|
||||
SkinMatrix_SetScaleRotateYRPTranslate(
|
||||
&prevMatrix, bgCtxt->dyna.bgActors[index].prevTransform.scale.x,
|
||||
bgCtxt->dyna.bgActors[index].prevTransform.scale.y, bgCtxt->dyna.bgActors[index].prevTransform.scale.z,
|
||||
bgCtxt->dyna.bgActors[index].prevTransform.rot.x, bgCtxt->dyna.bgActors[index].prevTransform.rot.y,
|
||||
bgCtxt->dyna.bgActors[index].prevTransform.rot.z, bgCtxt->dyna.bgActors[index].prevTransform.pos.x,
|
||||
bgCtxt->dyna.bgActors[index].prevTransform.pos.y, bgCtxt->dyna.bgActors[index].prevTransform.pos.z);
|
||||
&prevMatrix, colCtx->dyna.bgActors[index].prevTransform.scale.x,
|
||||
colCtx->dyna.bgActors[index].prevTransform.scale.y, colCtx->dyna.bgActors[index].prevTransform.scale.z,
|
||||
colCtx->dyna.bgActors[index].prevTransform.rot.x, colCtx->dyna.bgActors[index].prevTransform.rot.y,
|
||||
colCtx->dyna.bgActors[index].prevTransform.rot.z, colCtx->dyna.bgActors[index].prevTransform.pos.x,
|
||||
colCtx->dyna.bgActors[index].prevTransform.pos.y, colCtx->dyna.bgActors[index].prevTransform.pos.z);
|
||||
|
||||
if (SkinMatrix_Invert(&prevMatrix, &prevMatrixInv) == 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
SkinMatrix_SetScaleRotateYRPTranslate(
|
||||
&currMatrix, bgCtxt->dyna.bgActors[index].curTransform.scale.x,
|
||||
bgCtxt->dyna.bgActors[index].curTransform.scale.y, bgCtxt->dyna.bgActors[index].curTransform.scale.z,
|
||||
bgCtxt->dyna.bgActors[index].curTransform.rot.x, bgCtxt->dyna.bgActors[index].curTransform.rot.y,
|
||||
bgCtxt->dyna.bgActors[index].curTransform.rot.z, bgCtxt->dyna.bgActors[index].curTransform.pos.x,
|
||||
bgCtxt->dyna.bgActors[index].curTransform.pos.y, bgCtxt->dyna.bgActors[index].curTransform.pos.z);
|
||||
&currMatrix, colCtx->dyna.bgActors[index].curTransform.scale.x,
|
||||
colCtx->dyna.bgActors[index].curTransform.scale.y, colCtx->dyna.bgActors[index].curTransform.scale.z,
|
||||
colCtx->dyna.bgActors[index].curTransform.rot.x, colCtx->dyna.bgActors[index].curTransform.rot.y,
|
||||
colCtx->dyna.bgActors[index].curTransform.rot.z, colCtx->dyna.bgActors[index].curTransform.pos.x,
|
||||
colCtx->dyna.bgActors[index].curTransform.pos.y, colCtx->dyna.bgActors[index].curTransform.pos.z);
|
||||
|
||||
SkinMatrix_Vec3fMtxFMultXYZ(&prevMatrixInv, &actor->world.pos, &posWithInv);
|
||||
SkinMatrix_Vec3fMtxFMultXYZ(&currMatrix, &posWithInv, &newPos);
|
||||
@@ -40,14 +40,14 @@ void BgCheck2_UpdateActorPosition(CollisionContext* bgCtxt, s32 index, Actor* ac
|
||||
actor->world.pos = newPos;
|
||||
}
|
||||
|
||||
void BgCheck2_UpdateActorYRotation(CollisionContext* bgCtxt, s32 index, Actor* actor) {
|
||||
void BgCheck2_UpdateActorYRotation(CollisionContext* colCtx, s32 index, Actor* actor) {
|
||||
s16 angleChange;
|
||||
|
||||
if (BgCheck_IsActorMeshIndexValid(index) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
angleChange = bgCtxt->dyna.bgActors[index].curTransform.rot.y - bgCtxt->dyna.bgActors[index].prevTransform.rot.y;
|
||||
angleChange = colCtx->dyna.bgActors[index].curTransform.rot.y - colCtx->dyna.bgActors[index].prevTransform.rot.y;
|
||||
|
||||
if (actor->id == 0) {
|
||||
((ActorPlayer*)actor)->unkAD4 += angleChange;
|
||||
@@ -57,14 +57,14 @@ void BgCheck2_UpdateActorYRotation(CollisionContext* bgCtxt, s32 index, Actor* a
|
||||
actor->world.rot.y += angleChange;
|
||||
}
|
||||
|
||||
void BgCheck2_AttachToMesh(CollisionContext* bgCtxt, Actor* actor, s32 index) {
|
||||
void BgCheck2_AttachToMesh(CollisionContext* colCtx, Actor* actor, s32 index) {
|
||||
DynaPolyActor* meshActor;
|
||||
|
||||
if (BgCheck_IsActorMeshIndexValid(index) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
meshActor = BgCheck_GetActorOfMesh(bgCtxt, index);
|
||||
meshActor = BgCheck_GetActorOfMesh(colCtx, index);
|
||||
if (meshActor != NULL) {
|
||||
func_800CAE88(meshActor);
|
||||
|
||||
@@ -77,7 +77,7 @@ void BgCheck2_AttachToMesh(CollisionContext* bgCtxt, Actor* actor, s32 index) {
|
||||
}
|
||||
}
|
||||
|
||||
u32 BgCheck2_UpdateActorAttachedToMesh(CollisionContext* bgCtxt, s32 index, Actor* actor) {
|
||||
u32 BgCheck2_UpdateActorAttachedToMesh(CollisionContext* colCtx, s32 index, Actor* actor) {
|
||||
u32 wasUpdated = 0;
|
||||
DynaPolyActor* meshActor;
|
||||
|
||||
@@ -85,23 +85,23 @@ u32 BgCheck2_UpdateActorAttachedToMesh(CollisionContext* bgCtxt, s32 index, Acto
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (((bgCtxt->dyna.bgActorFlags[index] & 2) != 0) || ((bgCtxt->dyna.bgActorFlags[index] & 1) == 0)) {
|
||||
if (((colCtx->dyna.bgActorFlags[index] & 2) != 0) || ((colCtx->dyna.bgActorFlags[index] & 1) == 0)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
meshActor = BgCheck_GetActorOfMesh(bgCtxt, index);
|
||||
meshActor = BgCheck_GetActorOfMesh(colCtx, index);
|
||||
|
||||
if (meshActor == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((meshActor->unk154 & 1) != 0) {
|
||||
BgCheck2_UpdateActorPosition(bgCtxt, index, actor);
|
||||
BgCheck2_UpdateActorPosition(colCtx, index, actor);
|
||||
wasUpdated = 1;
|
||||
}
|
||||
|
||||
if ((meshActor->unk154 & 2) != 0) {
|
||||
BgCheck2_UpdateActorYRotation(bgCtxt, index, actor);
|
||||
BgCheck2_UpdateActorYRotation(colCtx, index, actor);
|
||||
wasUpdated = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,10 +29,10 @@ void func_800CAE9C(DynaPolyActor* actor) {
|
||||
actor->unk_158 |= 2;
|
||||
}
|
||||
|
||||
void func_800CAEB0(CollisionContext* bgCtxt, s32 index) {
|
||||
void func_800CAEB0(CollisionContext* colCtx, s32 index) {
|
||||
DynaPolyActor* actor;
|
||||
|
||||
actor = BgCheck_GetActorOfMesh(bgCtxt, index);
|
||||
actor = BgCheck_GetActorOfMesh(colCtx, index);
|
||||
if (actor != (DynaPolyActor*)0x0) {
|
||||
func_800CAE9C(actor);
|
||||
}
|
||||
@@ -42,10 +42,10 @@ void func_800CAEE0(DynaPolyActor* actor) {
|
||||
actor->unk_158 |= 4;
|
||||
}
|
||||
|
||||
void func_800CAEF4(CollisionContext* bgCtxt, s32 index) {
|
||||
void func_800CAEF4(CollisionContext* colCtx, s32 index) {
|
||||
DynaPolyActor* actor;
|
||||
|
||||
actor = BgCheck_GetActorOfMesh(bgCtxt, index);
|
||||
actor = BgCheck_GetActorOfMesh(colCtx, index);
|
||||
if (actor != (DynaPolyActor*)0x0) {
|
||||
func_800CAEE0(actor);
|
||||
}
|
||||
|
||||
+52
-52
@@ -63,11 +63,11 @@ void GameState_SetFBFilter(Gfx** gfx, u32 arg1) {
|
||||
*gfx = _gfx;
|
||||
}
|
||||
|
||||
void Game_Nop80173534(GameState* ctxt) {
|
||||
void Game_Nop80173534(GameState* gamestate) {
|
||||
;
|
||||
}
|
||||
|
||||
void GameState_Draw(GameState* ctxt, GraphicsContext* gfxCtx) {
|
||||
void GameState_Draw(GameState* gamestate, GraphicsContext* gfxCtx) {
|
||||
Gfx* nextDisplayList;
|
||||
Gfx* _polyOpa;
|
||||
// Unused vars impact regalloc
|
||||
@@ -95,7 +95,7 @@ lblUnk:; // Label prevents reordering, if(1) around the above block don't seem t
|
||||
|
||||
if (R_ENABLE_ARENA_DBG != 0) {
|
||||
SpeedMeter_DrawTimeEntries(&D_801F7FF0, gfxCtx);
|
||||
SpeedMeter_DrawAllocEntries(&D_801F7FF0, gfxCtx, ctxt);
|
||||
SpeedMeter_DrawAllocEntries(&D_801F7FF0, gfxCtx, gamestate);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,46 +120,46 @@ void func_801736DC(GraphicsContext* gfxCtx) {
|
||||
gfxCtx->polyOpa.p = nextDisplayList;
|
||||
}
|
||||
|
||||
void Game_UpdateInput(GameState* ctxt) {
|
||||
Padmgr_GetInput(ctxt->input, 1);
|
||||
void Game_UpdateInput(GameState* gamestate) {
|
||||
Padmgr_GetInput(gamestate->input, 1);
|
||||
}
|
||||
|
||||
void Game_Update(GameState* ctxt) {
|
||||
void Game_Update(GameState* gamestate) {
|
||||
GraphicsContext* _gCtx;
|
||||
_gCtx = ctxt->gfxCtx;
|
||||
_gCtx = gamestate->gfxCtx;
|
||||
|
||||
Game_ResetSegments(ctxt->gfxCtx);
|
||||
Game_ResetSegments(gamestate->gfxCtx);
|
||||
|
||||
ctxt->main(ctxt);
|
||||
gamestate->main(gamestate);
|
||||
|
||||
if (R_PAUSE_MENU_MODE != 2) {
|
||||
GameState_Draw(ctxt, _gCtx);
|
||||
GameState_Draw(gamestate, _gCtx);
|
||||
func_801736DC(_gCtx);
|
||||
}
|
||||
}
|
||||
|
||||
void Game_IncrementFrameCount(GameState* ctxt) {
|
||||
Game_Nop80173534(ctxt);
|
||||
ctxt->frames++;
|
||||
void Game_IncrementFrameCount(GameState* gamestate) {
|
||||
Game_Nop80173534(gamestate);
|
||||
gamestate->frames++;
|
||||
}
|
||||
|
||||
void Game_InitHeap(GameState* ctxt, u32 size) {
|
||||
void Game_InitHeap(GameState* gamestate, u32 size) {
|
||||
GameState* _ctx;
|
||||
void* buf;
|
||||
|
||||
_ctx = ctxt;
|
||||
_ctx = gamestate;
|
||||
buf = Gamealloc_Alloc(&_ctx->alloc, size);
|
||||
|
||||
if (buf) {
|
||||
THA_Ct(&ctxt->heap, buf, size);
|
||||
THA_Ct(&gamestate->heap, buf, size);
|
||||
return;
|
||||
}
|
||||
|
||||
THA_Ct(&ctxt->heap, NULL, 0);
|
||||
THA_Ct(&gamestate->heap, NULL, 0);
|
||||
assert_fail("../game.c", 0x40B);
|
||||
}
|
||||
|
||||
void Game_ResizeHeap(GameState* ctxt, u32 size) {
|
||||
void Game_ResizeHeap(GameState* gamestate, u32 size) {
|
||||
GameAlloc* alloc;
|
||||
void* buf;
|
||||
u32 systemMaxFree;
|
||||
@@ -167,9 +167,9 @@ void Game_ResizeHeap(GameState* ctxt, u32 size) {
|
||||
u32 bytesAllocated;
|
||||
void* heapStart;
|
||||
|
||||
heapStart = ctxt->heap.bufp;
|
||||
alloc = &ctxt->alloc;
|
||||
THA_Dt(&ctxt->heap);
|
||||
heapStart = gamestate->heap.bufp;
|
||||
alloc = &gamestate->alloc;
|
||||
THA_Dt(&gamestate->heap);
|
||||
Gamealloc_Free(alloc, heapStart);
|
||||
StartHeap_AnalyzeArena(&systemMaxFree, &bytesFree, &bytesAllocated);
|
||||
size = ((systemMaxFree - (sizeof(ArenaNode))) < size) ? (0) : (size);
|
||||
@@ -178,32 +178,32 @@ void Game_ResizeHeap(GameState* ctxt, u32 size) {
|
||||
}
|
||||
|
||||
if (buf = Gamealloc_Alloc(alloc, size)) {
|
||||
THA_Ct(&ctxt->heap, buf, size);
|
||||
THA_Ct(&gamestate->heap, buf, size);
|
||||
} else {
|
||||
THA_Ct(&ctxt->heap, 0, 0);
|
||||
THA_Ct(&gamestate->heap, 0, 0);
|
||||
assert_fail("../game.c", 0x432);
|
||||
}
|
||||
}
|
||||
|
||||
void Game_StateInit(GameState* ctxt, GameStateFunc gameStateInit, GraphicsContext* gfxCtx) {
|
||||
ctxt->gfxCtx = gfxCtx;
|
||||
ctxt->frames = 0U;
|
||||
ctxt->main = NULL;
|
||||
ctxt->destroy = NULL;
|
||||
ctxt->running = 1;
|
||||
void Game_StateInit(GameState* gamestate, GameStateFunc gameStateInit, GraphicsContext* gfxCtx) {
|
||||
gamestate->gfxCtx = gfxCtx;
|
||||
gamestate->frames = 0U;
|
||||
gamestate->main = NULL;
|
||||
gamestate->destroy = NULL;
|
||||
gamestate->running = 1;
|
||||
gfxCtx->unk274 = D_801FBB88;
|
||||
gfxCtx->viConfigFeatures = gViConfigFeatures;
|
||||
gfxCtx->viConfigXScale = gViConfigXScale;
|
||||
gfxCtx->viConfigYScale = gViConfigYScale;
|
||||
ctxt->nextGameStateInit = NULL;
|
||||
ctxt->nextGameStateSize = 0U;
|
||||
gamestate->nextGameStateInit = NULL;
|
||||
gamestate->nextGameStateSize = 0U;
|
||||
|
||||
lblUnk:;
|
||||
Gamealloc_Init(&ctxt->alloc);
|
||||
Game_InitHeap(ctxt, 0x100000);
|
||||
Game_SetFramerateDivisor(ctxt, 3);
|
||||
Gamealloc_Init(&gamestate->alloc);
|
||||
Game_InitHeap(gamestate, 0x100000);
|
||||
Game_SetFramerateDivisor(gamestate, 3);
|
||||
|
||||
gameStateInit(ctxt);
|
||||
gameStateInit(gamestate);
|
||||
|
||||
func_80140CE0(&D_801F8010);
|
||||
func_801420C0(&D_801F8020);
|
||||
@@ -212,16 +212,16 @@ lblUnk:;
|
||||
func_801773A0(&D_801F7FF0);
|
||||
func_8013ED9C();
|
||||
|
||||
osSendMesg(&ctxt->gfxCtx->unk5C, NULL, 1);
|
||||
osSendMesg(&gamestate->gfxCtx->unk5C, NULL, 1);
|
||||
}
|
||||
|
||||
void Game_StateFini(GameState* ctxt) {
|
||||
void Game_StateFini(GameState* gamestate) {
|
||||
func_80172BC0();
|
||||
func_8019E014();
|
||||
osRecvMesg(&ctxt->gfxCtx->unk5C, 0, 1);
|
||||
osRecvMesg(&gamestate->gfxCtx->unk5C, 0, 1);
|
||||
|
||||
if (ctxt->destroy != 0) {
|
||||
ctxt->destroy(ctxt);
|
||||
if (gamestate->destroy != 0) {
|
||||
gamestate->destroy(gamestate);
|
||||
}
|
||||
|
||||
func_8013EDD0();
|
||||
@@ -230,28 +230,28 @@ void Game_StateFini(GameState* ctxt) {
|
||||
func_801420F4(&D_801F8020);
|
||||
func_80141900(&sMonoColors);
|
||||
func_80140900(&D_801F8048);
|
||||
THA_Dt(&ctxt->heap);
|
||||
Gamealloc_FreeAll(&ctxt->alloc);
|
||||
THA_Dt(&gamestate->heap);
|
||||
Gamealloc_FreeAll(&gamestate->alloc);
|
||||
}
|
||||
|
||||
GameStateFunc Game_GetNextStateInit(GameState* ctxt) {
|
||||
return ctxt->nextGameStateInit;
|
||||
GameStateFunc Game_GetNextStateInit(GameState* gamestate) {
|
||||
return gamestate->nextGameStateInit;
|
||||
}
|
||||
|
||||
u32 Game_GetNextStateSize(GameState* ctxt) {
|
||||
return ctxt->nextGameStateSize;
|
||||
u32 Game_GetNextStateSize(GameState* gamestate) {
|
||||
return gamestate->nextGameStateSize;
|
||||
}
|
||||
|
||||
u32 Game_GetShouldContinue(GameState* ctxt) {
|
||||
return ctxt->running;
|
||||
u32 Game_GetShouldContinue(GameState* gamestate) {
|
||||
return gamestate->running;
|
||||
}
|
||||
|
||||
s32 Game_GetHeapFreeSize(GameState* ctxt) {
|
||||
return THA_GetSize(&ctxt->heap);
|
||||
s32 Game_GetHeapFreeSize(GameState* gamestate) {
|
||||
return THA_GetSize(&gamestate->heap);
|
||||
}
|
||||
|
||||
s32 func_80173B48(GameState* ctxt) {
|
||||
s32 func_80173B48(GameState* gamestate) {
|
||||
s32 result;
|
||||
result = OS_CYCLES_TO_NSEC(ctxt->framerateDivisor * sIrqMgrRetraceTime) - OS_CYCLES_TO_NSEC(D_801FBAF0);
|
||||
result = OS_CYCLES_TO_NSEC(gamestate->framerateDivisor * sIrqMgrRetraceTime) - OS_CYCLES_TO_NSEC(D_801FBAF0);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void Matrix_Init(GameState* state) {
|
||||
sMatrixStack = (MtxF*)THA_AllocEndAlign16(&state->heap, 0x500);
|
||||
void SysMatrix_StateAlloc(GameState* gamestate) {
|
||||
sMatrixStack = (MtxF*)THA_AllocEndAlign16(&gamestate->heap, 0x500);
|
||||
sCurrentMatrix = sMatrixStack;
|
||||
}
|
||||
|
||||
void Matrix_Push(void) {
|
||||
void SysMatrix_StatePush(void) {
|
||||
MtxF* prev = sCurrentMatrix;
|
||||
|
||||
sCurrentMatrix++;
|
||||
Matrix_MtxFCopy(sCurrentMatrix, prev);
|
||||
}
|
||||
|
||||
void Matrix_Pop(void) {
|
||||
void SysMatrix_StatePop(void) {
|
||||
sCurrentMatrix--;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/sys_matrix/SysMatrix_CopyCurrentState.asm")
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/sys_matrix/Matrix_Put.asm")
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/sys_matrix/SysMatrix_SetCurrentState.asm")
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/sys_matrix/SysMatrix_GetCurrentState.asm")
|
||||
|
||||
|
||||
+32
-32
@@ -54,7 +54,7 @@ void ActorShadow_Draw(Actor* actor, Lights* lights, GlobalContext* globalCtx, Gf
|
||||
}
|
||||
|
||||
func_800C0094(actor->floorPoly, actor->world.pos.x, actor->floorHeight, actor->world.pos.z, &mtx);
|
||||
Matrix_Put(&mtx);
|
||||
SysMatrix_SetCurrentState(&mtx);
|
||||
|
||||
if (dlist != D_04076BC0) {
|
||||
Matrix_RotateY((f32)actor->shape.rot.y * (M_PI / 32768), MTXMODE_APPLY);
|
||||
@@ -118,7 +118,7 @@ void func_800B40E0(GlobalContext* globalCtx, Light* light, MtxF* arg2, s32 arg3,
|
||||
sp58 = Math_FAtan2F(light->l.dir[0], light->l.dir[2]);
|
||||
arg6 *= (4.5f - (light->l.dir[1] * D_801DCA1C));
|
||||
arg6 = (arg6 < 1.0f) ? 1.0f : arg6;
|
||||
Matrix_Put(arg2);
|
||||
SysMatrix_SetCurrentState(arg2);
|
||||
Matrix_RotateY(sp58, MTXMODE_APPLY);
|
||||
Matrix_Scale(arg5, 1.0f, arg5 * arg6, MTXMODE_APPLY);
|
||||
|
||||
@@ -147,16 +147,16 @@ 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* globalCtx) {
|
||||
targetCtxt->unk90 = NULL;
|
||||
targetCtxt->unk8C = NULL;
|
||||
targetCtxt->unk3C = NULL;
|
||||
targetCtxt->unk38 = NULL;
|
||||
targetCtxt->unk4B = 0;
|
||||
targetCtxt->unk4C = 0;
|
||||
targetCtxt->unk40 = 0;
|
||||
func_800B5040(targetCtxt, actor, actor->category, globalCtx);
|
||||
func_800B4F78(targetCtxt, actor->category, globalCtx);
|
||||
void Actor_TargetContextInit(TargetContext* targetCtx, Actor* actor, GlobalContext* globalCtx) {
|
||||
targetCtx->unk90 = NULL;
|
||||
targetCtx->unk8C = NULL;
|
||||
targetCtx->unk3C = NULL;
|
||||
targetCtx->unk38 = NULL;
|
||||
targetCtx->unk4B = 0;
|
||||
targetCtx->unk4C = 0;
|
||||
targetCtx->unk40 = 0;
|
||||
func_800B5040(targetCtx, actor, actor->category, globalCtx);
|
||||
func_800B4F78(targetCtx, actor->category, globalCtx);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_actor//func_800B5208.asm")
|
||||
@@ -235,34 +235,34 @@ void Actor_SetCollectibleFlag(GlobalContext* globalCtx, s32 index) {
|
||||
}
|
||||
}
|
||||
|
||||
void Actor_TitleCardContextInit(GlobalContext* globalCtx, TitleCardContext* titleCtxt) {
|
||||
titleCtxt->fadeOutDelay = 0;
|
||||
titleCtxt->fadeInDelay = 0;
|
||||
titleCtxt->color = 0;
|
||||
titleCtxt->alpha = 0;
|
||||
void Actor_TitleCardContextInit(GlobalContext* globalCtx, TitleCardContext* titleCardCtx) {
|
||||
titleCardCtx->fadeOutDelay = 0;
|
||||
titleCardCtx->fadeInDelay = 0;
|
||||
titleCardCtx->color = 0;
|
||||
titleCardCtx->alpha = 0;
|
||||
}
|
||||
|
||||
void Actor_TitleCardCreate(GlobalContext* globalCtx, TitleCardContext* titleCtxt, u32 texture, s16 param_4, s16 param_5,
|
||||
void Actor_TitleCardCreate(GlobalContext* globalCtx, TitleCardContext* titleCardCtx, u32 texture, s16 param_4, s16 param_5,
|
||||
u8 param_6, u8 param_7) {
|
||||
titleCtxt->texture = texture;
|
||||
titleCtxt->unk4 = param_4;
|
||||
titleCtxt->unk6 = param_5;
|
||||
titleCtxt->unk8 = param_6;
|
||||
titleCtxt->unk9 = param_7;
|
||||
titleCtxt->fadeOutDelay = 80;
|
||||
titleCtxt->fadeInDelay = 0;
|
||||
titleCardCtx->texture = texture;
|
||||
titleCardCtx->unk4 = param_4;
|
||||
titleCardCtx->unk6 = param_5;
|
||||
titleCardCtx->unk8 = param_6;
|
||||
titleCardCtx->unk9 = param_7;
|
||||
titleCardCtx->fadeOutDelay = 80;
|
||||
titleCardCtx->fadeInDelay = 0;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_actor//Actor_Nop800B5E50.asm")
|
||||
|
||||
void Actor_TitleCardUpdate(GlobalContext* globalCtx, TitleCardContext* titleCtxt) {
|
||||
if (DECR(titleCtxt->fadeInDelay) == 0) {
|
||||
if (DECR(titleCtxt->fadeOutDelay) == 0) {
|
||||
Math_StepToS(&titleCtxt->alpha, 0, 30);
|
||||
Math_StepToS(&titleCtxt->color, 0, 70);
|
||||
void Actor_TitleCardUpdate(GlobalContext* globalCtx, TitleCardContext* titleCardCtx) {
|
||||
if (DECR(titleCardCtx->fadeInDelay) == 0) {
|
||||
if (DECR(titleCardCtx->fadeOutDelay) == 0) {
|
||||
Math_StepToS(&titleCardCtx->alpha, 0, 30);
|
||||
Math_StepToS(&titleCardCtx->color, 0, 70);
|
||||
} else {
|
||||
Math_StepToS(&titleCtxt->alpha, 255, 10);
|
||||
Math_StepToS(&titleCtxt->color, 255, 20);
|
||||
Math_StepToS(&titleCardCtx->alpha, 255, 10);
|
||||
Math_StepToS(&titleCardCtx->color, 255, 20);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,8 +162,8 @@ void BgCheck_CreateVertexFromVec3f(Vec3s* vertex, Vec3f* vector) {
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_bgcheck/func_800C40B4.asm")
|
||||
|
||||
f32 func_800C411C(CollisionContext* bgCtxt, CollisionPoly** arg1, s32* arg2, Actor* actor, Vec3f* pos) {
|
||||
return func_800C3D50(0, bgCtxt, 2, arg1, arg2, pos, actor, 28, 1.0f, 0);
|
||||
f32 func_800C411C(CollisionContext* colCtx, CollisionPoly** arg1, s32* arg2, Actor* actor, Vec3f* pos) {
|
||||
return func_800C3D50(0, colCtx, 2, arg1, arg2, pos, actor, 28, 1.0f, 0);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_bgcheck/func_800C4188.asm")
|
||||
|
||||
@@ -107,7 +107,7 @@ void EffFootmark_Draw(GlobalContext* globalCtx) {
|
||||
|
||||
for (footmark = globalCtx->footmarks, i = 0; i < 100; i++, footmark++) {
|
||||
if (footmark->actor != NULL) {
|
||||
Matrix_Put(&footmark->displayMatrix);
|
||||
SysMatrix_SetCurrentState(&footmark->displayMatrix);
|
||||
Matrix_Scale(footmark->size * 0.00390625f * 0.7f, 1, footmark->size * 0.00390625f, 1);
|
||||
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD);
|
||||
|
||||
+5
-3
@@ -187,7 +187,7 @@ void Effect_Add(GlobalContext* globalCtx, s32* index, s32 type, u8 param_4, u8 p
|
||||
void Effect_DrawAll(GraphicsContext* gfxCtx) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < SPARK_COUNT; i++) {
|
||||
for (i = 0; i < SPARK_COUNT; i++) {
|
||||
if (1) {} // necessary to match
|
||||
if (sEffTable.sparks[i].base.active) {
|
||||
sEffInfoTable[0].draw(&sEffTable.sparks[i].params, gfxCtx);
|
||||
@@ -195,8 +195,10 @@ void Effect_DrawAll(GraphicsContext* gfxCtx) {
|
||||
}
|
||||
|
||||
for (i = 0; i < BLURE_COUNT; i++) {
|
||||
if (1) { if (gfxCtx) {} } // necessary to match
|
||||
if (sEffTable.blures[i].base.active) {
|
||||
if (1) {
|
||||
if (gfxCtx) {}
|
||||
} // necessary to match
|
||||
if (sEffTable.blures[i].base.active) {
|
||||
sEffInfoTable[1].draw(&sEffTable.blures[i].params, gfxCtx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,8 @@ void EffectSS_Init(GlobalContext* globalCtx, s32 numEntries) {
|
||||
EffectSS2Info.searchIndex = 0;
|
||||
EffectSS2Info.size = numEntries;
|
||||
|
||||
for (effectsSs = &EffectSS2Info.data_table[0]; effectsSs < &EffectSS2Info.data_table[EffectSS2Info.size]; effectsSs++) {
|
||||
for (effectsSs = &EffectSS2Info.data_table[0]; effectsSs < &EffectSS2Info.data_table[EffectSS2Info.size];
|
||||
effectsSs++) {
|
||||
EffectSS_ResetEntry(effectsSs);
|
||||
}
|
||||
|
||||
@@ -97,7 +98,7 @@ s32 EffectSS_FindFreeSpace(s32 priority, s32* tableEntry) {
|
||||
// Search for a unused entry
|
||||
i = EffectSS2Info.searchIndex;
|
||||
foundFree = false;
|
||||
while(true) {
|
||||
while (true) {
|
||||
if (EffectSS2Info.data_table[i].life == -1) {
|
||||
foundFree = true;
|
||||
break;
|
||||
@@ -118,12 +119,12 @@ s32 EffectSS_FindFreeSpace(s32 priority, s32* tableEntry) {
|
||||
if (foundFree == true) {
|
||||
*tableEntry = i;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// If all slots are in use, search for a slot with a lower priority
|
||||
// Note that a lower priority is representend by a higher value
|
||||
i = EffectSS2Info.searchIndex;
|
||||
while(true) {
|
||||
while (true) {
|
||||
// Equal priority should only be considered "lower" if flag 0 is set
|
||||
if ((priority <= EffectSS2Info.data_table[i].priority) &&
|
||||
!((priority == EffectSS2Info.data_table[i].priority) && (EffectSS2Info.data_table[i].flags & 1))) {
|
||||
@@ -181,14 +182,13 @@ void EffectSs_Spawn(GlobalContext* globalCtx, s32 type, s32 priority, void* init
|
||||
return;
|
||||
}
|
||||
|
||||
Load2_LoadOverlay(entry->vromStart, entry->vromEnd, entry->vramStart, entry->vramEnd,
|
||||
entry->loadedRamAddr);
|
||||
Load2_LoadOverlay(entry->vromStart, entry->vromEnd, entry->vramStart, entry->vramEnd, entry->loadedRamAddr);
|
||||
}
|
||||
|
||||
overlayInfo = (void*)(u32)(entry->overlayInfo != NULL
|
||||
? (ParticleOverlayInfo*)(-((u32)entry->vramStart - (u32)entry->loadedRamAddr) +
|
||||
(u32)entry->overlayInfo)
|
||||
: NULL);
|
||||
overlayInfo = (void*)(u32)(
|
||||
entry->overlayInfo != NULL
|
||||
? (ParticleOverlayInfo*)(-((u32)entry->vramStart - (u32)entry->loadedRamAddr) + (u32)entry->overlayInfo)
|
||||
: NULL);
|
||||
}
|
||||
|
||||
if (overlayInfo->init != NULL) {
|
||||
|
||||
+31
-31
@@ -63,39 +63,39 @@ void Room_DrawType1Mesh(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
}
|
||||
}
|
||||
|
||||
void Room_Init(GlobalContext* globalCtx, RoomContext* roomCtxt) {
|
||||
void Room_Init(GlobalContext* globalCtx, RoomContext* roomCtx) {
|
||||
s32 i;
|
||||
roomCtxt->currRoom.num = -1;
|
||||
roomCtxt->currRoom.segment = NULL;
|
||||
roomCtxt->unk78 = 1;
|
||||
roomCtxt->unk79 = 0;
|
||||
roomCtx->currRoom.num = -1;
|
||||
roomCtx->currRoom.segment = NULL;
|
||||
roomCtx->unk78 = 1;
|
||||
roomCtx->unk79 = 0;
|
||||
for (i = 0; i < 3; i++) {
|
||||
roomCtxt->unk7A[i] = 0;
|
||||
roomCtx->unk7A[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_room/Room_AllocateAndLoad.asm")
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
s32 Room_StartRoomTransition(GlobalContext* globalCtx, RoomContext* roomCtxt, s32 index) {
|
||||
s32 Room_StartRoomTransition(GlobalContext* globalCtx, RoomContext* roomCtx, s32 index) {
|
||||
u32 size;
|
||||
|
||||
// XXX: this should use a branch-likely
|
||||
if (roomCtxt->unk31 == 0) {
|
||||
roomCtxt->prevRoom = roomCtxt->currRoom;
|
||||
roomCtxt->currRoom.num = index;
|
||||
roomCtxt->currRoom.segment = NULL;
|
||||
roomCtxt->unk31 = 1;
|
||||
if (roomCtx->unk31 == 0) {
|
||||
roomCtx->prevRoom = roomCtx->currRoom;
|
||||
roomCtx->currRoom.num = index;
|
||||
roomCtx->currRoom.segment = NULL;
|
||||
roomCtx->unk31 = 1;
|
||||
|
||||
size = globalCtx->roomAddrs[index].vromEnd - globalCtx->roomAddrs[index].vromStart;
|
||||
roomCtxt->activeRoomVram =
|
||||
(void*)((s32)roomCtxt->roomMemPages[roomCtxt->activeMemPage] - (size + 8) * roomCtxt->activeMemPage + 8) &
|
||||
roomCtx->activeRoomVram =
|
||||
(void*)((s32)roomCtx->roomMemPages[roomCtx->activeMemPage] - (size + 8) * roomCtx->activeMemPage + 8) &
|
||||
0xfffffff0;
|
||||
|
||||
osCreateMesgQueue(&roomCtxt->loadQueue, roomCtxt->loadMsg, 1);
|
||||
DmaMgr_SendRequestImpl(&roomCtxt->dmaRequest, roomCtxt->activeRoomVram, globalCtx->roomAddrs[index].vromStart,
|
||||
size, 0, &roomCtxt->loadQueue, NULL);
|
||||
roomCtxt->activeMemPage ^= 1;
|
||||
osCreateMesgQueue(&roomCtx->loadQueue, roomCtx->loadMsg, 1);
|
||||
DmaMgr_SendRequestImpl(&roomCtx->dmaRequest, roomCtx->activeRoomVram, globalCtx->roomAddrs[index].vromStart,
|
||||
size, 0, &roomCtx->loadQueue, NULL);
|
||||
roomCtx->activeMemPage ^= 1;
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -106,19 +106,19 @@ s32 Room_StartRoomTransition(GlobalContext* globalCtx, RoomContext* roomCtxt, s3
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_room/Room_StartRoomTransition.asm")
|
||||
#endif
|
||||
|
||||
s32 Room_HandleLoadCallbacks(GlobalContext* globalCtx, RoomContext* roomCtxt) {
|
||||
if (roomCtxt->unk31 == 1) {
|
||||
if (!osRecvMesg(&roomCtxt->loadQueue, NULL, OS_MESG_NOBLOCK)) {
|
||||
roomCtxt->unk31 = 0;
|
||||
roomCtxt->currRoom.segment = roomCtxt->activeRoomVram;
|
||||
s32 Room_HandleLoadCallbacks(GlobalContext* globalCtx, RoomContext* roomCtx) {
|
||||
if (roomCtx->unk31 == 1) {
|
||||
if (!osRecvMesg(&roomCtx->loadQueue, NULL, OS_MESG_NOBLOCK)) {
|
||||
roomCtx->unk31 = 0;
|
||||
roomCtx->currRoom.segment = roomCtx->activeRoomVram;
|
||||
// TODO: Segment number enum
|
||||
gSegments[3] = PHYSICAL_TO_VIRTUAL(roomCtxt->activeRoomVram);
|
||||
gSegments[3] = PHYSICAL_TO_VIRTUAL(roomCtx->activeRoomVram);
|
||||
|
||||
Scene_ProcessHeader(globalCtx, (SceneCmd*)roomCtxt->currRoom.segment);
|
||||
Scene_ProcessHeader(globalCtx, (SceneCmd*)roomCtx->currRoom.segment);
|
||||
func_80123140(globalCtx, PLAYER);
|
||||
Actor_SpawnTransitionActors(globalCtx, &globalCtx->actorCtx);
|
||||
|
||||
if (((globalCtx->sceneNum != SCENE_IKANA) || (roomCtxt->currRoom.num != 1)) &&
|
||||
if (((globalCtx->sceneNum != SCENE_IKANA) || (roomCtx->currRoom.num != 1)) &&
|
||||
(globalCtx->sceneNum != SCENE_IKNINSIDE)) {
|
||||
globalCtx->kankyoContext.unkC3 = 0xff;
|
||||
globalCtx->kankyoContext.unkE0 = 0;
|
||||
@@ -144,13 +144,13 @@ void Room_Draw(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
return;
|
||||
}
|
||||
|
||||
void func_8012EBF8(GlobalContext* globalCtx, RoomContext* roomCtxt) {
|
||||
roomCtxt->prevRoom.num = -1;
|
||||
roomCtxt->prevRoom.segment = NULL;
|
||||
void func_8012EBF8(GlobalContext* globalCtx, RoomContext* roomCtx) {
|
||||
roomCtx->prevRoom.num = -1;
|
||||
roomCtx->prevRoom.segment = NULL;
|
||||
func_800BA798(globalCtx, &globalCtx->actorCtx);
|
||||
Actor_SpawnTransitionActors(globalCtx, &globalCtx->actorCtx);
|
||||
if (-1 < roomCtxt->currRoom.num) {
|
||||
func_8010A33C(globalCtx, roomCtxt->currRoom.num);
|
||||
if (-1 < roomCtx->currRoom.num) {
|
||||
func_8010A33C(globalCtx, roomCtx->currRoom.num);
|
||||
func_8010A2DC(globalCtx);
|
||||
}
|
||||
func_801A3CD8(globalCtx->roomContext.currRoom.echo);
|
||||
|
||||
+4
-4
@@ -24,8 +24,8 @@ s32 Object_Spawn(ObjectContext* objectCtx, s16 id) {
|
||||
return objectCtx->num - 1;
|
||||
}
|
||||
|
||||
void Object_InitBank(GameState* state, ObjectContext* objectCtx) {
|
||||
GlobalContext* globalCtx = (GlobalContext*)state;
|
||||
void Object_InitBank(GameState* gamestate, ObjectContext* objectCtx) {
|
||||
GlobalContext* globalCtx = (GlobalContext*)gamestate;
|
||||
s32 pad;
|
||||
u32 spaceSize;
|
||||
s32 i;
|
||||
@@ -50,7 +50,7 @@ void Object_InitBank(GameState* state, ObjectContext* objectCtx) {
|
||||
for (i = 0; i < OBJECT_EXCHANGE_BANK_MAX; i++) { objectCtx->status[i].id = 0; }
|
||||
// clang-format on
|
||||
|
||||
objectCtx->spaceStart = objectCtx->status[0].segment = THA_AllocEndAlign16(&state->heap, spaceSize);
|
||||
objectCtx->spaceStart = objectCtx->status[0].segment = THA_AllocEndAlign16(&gamestate->heap, spaceSize);
|
||||
objectCtx->spaceEnd = (void*)((u32)objectCtx->spaceStart + spaceSize);
|
||||
objectCtx->mainKeepIndex = Object_Spawn(objectCtx, GAMEPLAY_KEEP);
|
||||
|
||||
@@ -328,7 +328,7 @@ void Scene_HeaderCmdTransiActorList(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
}
|
||||
|
||||
// Init function for the transition system.
|
||||
void Transition_Init(GameState* state, TransitionContext* transitionCtx) {
|
||||
void Transition_Init(GameState* gamestate, TransitionContext* transitionCtx) {
|
||||
transitionCtx->nbTransitionActors = 0;
|
||||
}
|
||||
|
||||
|
||||
+32
-32
@@ -40,7 +40,7 @@ void SkelAnime_LodDrawLimb(GlobalContext* globalCtx, s32 limbIndex, void** skele
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
s32 pad;
|
||||
|
||||
Matrix_Push();
|
||||
SysMatrix_StatePush();
|
||||
limbEntry = (StandardLimb*)Lib_SegmentedToVirtual(skeleton[limbIndex]);
|
||||
limbIndex++;
|
||||
rot = limbDrawTable[limbIndex];
|
||||
@@ -71,7 +71,7 @@ void SkelAnime_LodDrawLimb(GlobalContext* globalCtx, s32 limbIndex, void** skele
|
||||
postLimbDraw, actor, dListIndex);
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
SysMatrix_StatePop();
|
||||
|
||||
if (limbEntry->nextLimbIndex != LIMB_DONE) {
|
||||
SkelAnime_LodDrawLimb(globalCtx, limbEntry->nextLimbIndex, skeleton, limbDrawTable, overrideLimbDraw,
|
||||
@@ -98,7 +98,7 @@ void SkelAnime_LodDraw(GlobalContext* globalCtx, void** skeleton, Vec3s* limbDra
|
||||
|
||||
gfxCtx = globalCtx->state.gfxCtx;
|
||||
|
||||
Matrix_Push();
|
||||
SysMatrix_StatePush();
|
||||
|
||||
limbEntry = (StandardLimb*)Lib_SegmentedToVirtual(skeleton[0]);
|
||||
pos.x = limbDrawTable[0].x;
|
||||
@@ -130,7 +130,7 @@ void SkelAnime_LodDraw(GlobalContext* globalCtx, void** skeleton, Vec3s* limbDra
|
||||
postLimbDraw, actor, dListIndex);
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
SysMatrix_StatePop();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -147,7 +147,7 @@ void SkelAnime_LodDrawLimbSV(GlobalContext* globalCtx, s32 limbIndex, void** ske
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
s32 pad;
|
||||
|
||||
Matrix_Push();
|
||||
SysMatrix_StatePush();
|
||||
|
||||
limbEntry = (StandardLimb*)Lib_SegmentedToVirtual(skeleton[limbIndex]);
|
||||
limbIndex++;
|
||||
@@ -183,7 +183,7 @@ void SkelAnime_LodDrawLimbSV(GlobalContext* globalCtx, s32 limbIndex, void** ske
|
||||
postLimbDraw, actor, dListIndex, mtx);
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
SysMatrix_StatePop();
|
||||
|
||||
if (limbEntry->nextLimbIndex != LIMB_DONE) {
|
||||
SkelAnime_LodDrawLimbSV(globalCtx, limbEntry->nextLimbIndex, skeleton, limbDrawTable, overrideLimbDraw,
|
||||
@@ -217,7 +217,7 @@ void SkelAnime_LodDrawSV(GlobalContext* globalCtx, void** skeleton, Vec3s* limbD
|
||||
gfxCtx = globalCtx->state.gfxCtx;
|
||||
|
||||
gSPSegment(gfxCtx->polyOpa.p++, 0xD, mtx);
|
||||
Matrix_Push();
|
||||
SysMatrix_StatePush();
|
||||
|
||||
limbEntry = (StandardLimb*)Lib_SegmentedToVirtual(skeleton[0]);
|
||||
pos.x = limbDrawTable[0].x;
|
||||
@@ -253,7 +253,7 @@ void SkelAnime_LodDrawSV(GlobalContext* globalCtx, void** skeleton, Vec3s* limbD
|
||||
postLimbDraw, actor, dListIndex, &mtx);
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
SysMatrix_StatePop();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -268,7 +268,7 @@ void SkelAnime_DrawLimb(GlobalContext* globalCtx, s32 limbIndex, void** skeleton
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
s32 pad;
|
||||
|
||||
Matrix_Push();
|
||||
SysMatrix_StatePush();
|
||||
|
||||
limbEntry = (StandardLimb*)Lib_SegmentedToVirtual(skeleton[limbIndex]);
|
||||
limbIndex++;
|
||||
@@ -298,7 +298,7 @@ void SkelAnime_DrawLimb(GlobalContext* globalCtx, s32 limbIndex, void** skeleton
|
||||
postLimbDraw, actor);
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
SysMatrix_StatePop();
|
||||
|
||||
if (limbEntry->nextLimbIndex != LIMB_DONE) {
|
||||
SkelAnime_DrawLimb(globalCtx, limbEntry->nextLimbIndex, skeleton, limbDrawTable, overrideLimbDraw, postLimbDraw,
|
||||
@@ -322,7 +322,7 @@ void SkelAnime_Draw(GlobalContext* globalCtx, void** skeleton, Vec3s* limbDrawTa
|
||||
|
||||
gfxCtx = globalCtx->state.gfxCtx;
|
||||
|
||||
Matrix_Push();
|
||||
SysMatrix_StatePush();
|
||||
rootLimb = (StandardLimb*)Lib_SegmentedToVirtual(skeleton[0]);
|
||||
|
||||
pos.x = limbDrawTable[0].x;
|
||||
@@ -352,7 +352,7 @@ void SkelAnime_Draw(GlobalContext* globalCtx, void** skeleton, Vec3s* limbDrawTa
|
||||
postLimbDraw, actor);
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
SysMatrix_StatePop();
|
||||
}
|
||||
|
||||
void SkelAnime_DrawLimbSV(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* limbDrawTable,
|
||||
@@ -365,7 +365,7 @@ void SkelAnime_DrawLimbSV(GlobalContext* globalCtx, s32 limbIndex, void** skelet
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
s32 pad;
|
||||
|
||||
Matrix_Push();
|
||||
SysMatrix_StatePush();
|
||||
|
||||
limbEntry = (StandardLimb*)Lib_SegmentedToVirtual(skeleton[limbIndex]);
|
||||
limbIndex++;
|
||||
@@ -400,7 +400,7 @@ void SkelAnime_DrawLimbSV(GlobalContext* globalCtx, s32 limbIndex, void** skelet
|
||||
postLimbDraw, actor, limbMatricies);
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
SysMatrix_StatePop();
|
||||
|
||||
if (limbEntry->nextLimbIndex != LIMB_DONE) {
|
||||
SkelAnime_DrawLimbSV(globalCtx, limbEntry->nextLimbIndex, skeleton, limbDrawTable, overrideLimbDraw,
|
||||
@@ -429,7 +429,7 @@ void SkelAnime_DrawSV(GlobalContext* globalCtx, void** skeleton, Vec3s* limbDraw
|
||||
|
||||
gSPSegment(gfxCtx->polyOpa.p++, 0xD, mtx);
|
||||
|
||||
Matrix_Push();
|
||||
SysMatrix_StatePush();
|
||||
|
||||
limbEntry = (StandardLimb*)Lib_SegmentedToVirtual(skeleton[0]);
|
||||
|
||||
@@ -467,7 +467,7 @@ void SkelAnime_DrawSV(GlobalContext* globalCtx, void** skeleton, Vec3s* limbDraw
|
||||
postLimbDraw, actor, &mtx);
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
SysMatrix_StatePop();
|
||||
}
|
||||
|
||||
void func_80134148(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* limbDrawTable,
|
||||
@@ -480,7 +480,7 @@ void func_80134148(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
s32 pad2;
|
||||
|
||||
Matrix_Push();
|
||||
SysMatrix_StatePush();
|
||||
|
||||
limbEntry = (StandardLimb*)Lib_SegmentedToVirtual(skeleton[limbIndex]);
|
||||
limbIndex++;
|
||||
@@ -495,7 +495,7 @@ void func_80134148(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec
|
||||
|
||||
if ((overrideLimbDraw == NULL) || (overrideLimbDraw(globalCtx, limbIndex, &dList[1], &pos, &rot, actor) == 0)) {
|
||||
SysMatrix_RotateAndTranslateState(&pos, &rot);
|
||||
Matrix_Push();
|
||||
SysMatrix_StatePush();
|
||||
unkDraw(globalCtx, limbIndex, actor);
|
||||
if (dList[1] != NULL) {
|
||||
Gfx* polyTemp = gfxCtx->polyOpa.p;
|
||||
@@ -510,7 +510,7 @@ void func_80134148(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec
|
||||
(*mtx)++;
|
||||
}
|
||||
}
|
||||
Matrix_Pop();
|
||||
SysMatrix_StatePop();
|
||||
}
|
||||
|
||||
if (postLimbDraw != NULL) {
|
||||
@@ -522,7 +522,7 @@ void func_80134148(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec
|
||||
unkDraw, actor, mtx);
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
SysMatrix_StatePop();
|
||||
|
||||
if (limbEntry->nextLimbIndex != LIMB_DONE) {
|
||||
func_80134148(globalCtx, limbEntry->nextLimbIndex, skeleton, limbDrawTable, overrideLimbDraw, postLimbDraw,
|
||||
@@ -551,7 +551,7 @@ void func_801343C0(GlobalContext* globalCtx, void** skeleton, Vec3s* limbDrawTab
|
||||
|
||||
gSPSegment(gfxCtx->polyOpa.p++, 0xD, mtx);
|
||||
|
||||
Matrix_Push();
|
||||
SysMatrix_StatePush();
|
||||
|
||||
limbEntry = (StandardLimb*)Lib_SegmentedToVirtual(skeleton[0]);
|
||||
|
||||
@@ -565,7 +565,7 @@ void func_801343C0(GlobalContext* globalCtx, void** skeleton, Vec3s* limbDrawTab
|
||||
|
||||
if ((overrideLimbDraw == NULL) || (overrideLimbDraw(globalCtx, 1, &dList[1], &pos, &rot, actor) == 0)) {
|
||||
SysMatrix_RotateAndTranslateState(&pos, &rot);
|
||||
Matrix_Push();
|
||||
SysMatrix_StatePush();
|
||||
unkDraw(globalCtx, 1, actor);
|
||||
if (dList[1] != NULL) {
|
||||
Gfx* polyTemp = gfxCtx->polyOpa.p;
|
||||
@@ -579,7 +579,7 @@ void func_801343C0(GlobalContext* globalCtx, void** skeleton, Vec3s* limbDrawTab
|
||||
SysMatrix_GetStateAsRSPMatrix(mtx++);
|
||||
}
|
||||
}
|
||||
Matrix_Pop();
|
||||
SysMatrix_StatePop();
|
||||
}
|
||||
|
||||
if (postLimbDraw != NULL) {
|
||||
@@ -591,7 +591,7 @@ void func_801343C0(GlobalContext* globalCtx, void** skeleton, Vec3s* limbDrawTab
|
||||
unkDraw, actor, &mtx);
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
SysMatrix_StatePop();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -641,7 +641,7 @@ Gfx* SkelAnime_Draw2Limb(GlobalContext* globalCtx, s32 limbIndex, void** skeleto
|
||||
Vec3f pos;
|
||||
Vec3s rot;
|
||||
|
||||
Matrix_Push();
|
||||
SysMatrix_StatePush();
|
||||
|
||||
limbEntry = (StandardLimb*)Lib_SegmentedToVirtual(skeleton[limbIndex]);
|
||||
limbIndex++;
|
||||
@@ -671,7 +671,7 @@ Gfx* SkelAnime_Draw2Limb(GlobalContext* globalCtx, s32 limbIndex, void** skeleto
|
||||
postLimbDraw, actor, gfx);
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
SysMatrix_StatePop();
|
||||
|
||||
if (limbEntry->nextLimbIndex != LIMB_DONE) {
|
||||
gfx = SkelAnime_Draw2Limb(globalCtx, limbEntry->nextLimbIndex, skeleton, limbDrawTable, overrideLimbDraw,
|
||||
@@ -697,7 +697,7 @@ Gfx* SkelAnime_Draw2(GlobalContext* globalCtx, void** skeleton, Vec3s* limbDrawT
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Matrix_Push();
|
||||
SysMatrix_StatePush();
|
||||
|
||||
limbEntry = (StandardLimb*)Lib_SegmentedToVirtual(skeleton[0]);
|
||||
|
||||
@@ -726,7 +726,7 @@ Gfx* SkelAnime_Draw2(GlobalContext* globalCtx, void** skeleton, Vec3s* limbDrawT
|
||||
postLimbDraw, actor, gfx);
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
SysMatrix_StatePop();
|
||||
|
||||
return gfx;
|
||||
}
|
||||
@@ -744,7 +744,7 @@ Gfx* SkelAnime_DrawLimbSV2(GlobalContext* globalCtx, s32 limbIndex, void** skele
|
||||
Vec3f pos;
|
||||
Vec3s rot;
|
||||
|
||||
Matrix_Push();
|
||||
SysMatrix_StatePush();
|
||||
|
||||
limbEntry = (StandardLimb*)Lib_SegmentedToVirtual(skeleton[limbIndex]);
|
||||
limbIndex++;
|
||||
@@ -780,7 +780,7 @@ Gfx* SkelAnime_DrawLimbSV2(GlobalContext* globalCtx, s32 limbIndex, void** skele
|
||||
postLimbDraw, actor, mtx, gfx);
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
SysMatrix_StatePop();
|
||||
|
||||
if (limbEntry->nextLimbIndex != LIMB_DONE) {
|
||||
gfx = SkelAnime_DrawLimbSV2(globalCtx, limbEntry->nextLimbIndex, skeleton, limbDrawTable, overrideLimbDraw,
|
||||
@@ -808,7 +808,7 @@ Gfx* SkelAnime_DrawSV2(GlobalContext* globalCtx, void** skeleton, Vec3s* limbDra
|
||||
|
||||
gSPSegment(gfx++, 0xD, mtx);
|
||||
|
||||
Matrix_Push();
|
||||
SysMatrix_StatePush();
|
||||
|
||||
limbEntry = (StandardLimb*)Lib_SegmentedToVirtual(skeleton[0]);
|
||||
|
||||
@@ -844,7 +844,7 @@ Gfx* SkelAnime_DrawSV2(GlobalContext* globalCtx, void** skeleton, Vec3s* limbDra
|
||||
postLimbDraw, actor, &mtx, gfx);
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
SysMatrix_StatePop();
|
||||
|
||||
return gfx;
|
||||
}
|
||||
|
||||
+1
-1
@@ -258,7 +258,7 @@ s32 View_StepQuake(View* view, RSPMatrix* matrix) {
|
||||
}
|
||||
|
||||
SysMatrix_FromRSPMatrix(matrix, &mf);
|
||||
Matrix_Put(&mf);
|
||||
SysMatrix_SetCurrentState(&mf);
|
||||
SysMatrix_RotateStateAroundXAxis(view->currQuakeRot.x);
|
||||
SysMatrix_InsertYRotation_f(view->currQuakeRot.y, 1);
|
||||
SysMatrix_InsertZRotation_f(view->currQuakeRot.z, 1);
|
||||
|
||||
+6
-6
@@ -38,7 +38,7 @@ void func_80143148(SkyboxContext* skyboxCtx, s32 arg1) {
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// Matches besides rodata, since rodata is not merged into the asm in code files yet.
|
||||
void func_801431E8(GameState* state, SkyboxContext* skyboxCtx, s16 skyType) {
|
||||
void func_801431E8(GameState* gamestate, SkyboxContext* skyboxCtx, s16 skyType) {
|
||||
GlobalContext* globalCtx = (GlobalContext*)state;
|
||||
u32 size;
|
||||
void* offset;
|
||||
@@ -139,22 +139,22 @@ void func_80143324(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skyTy
|
||||
}
|
||||
}
|
||||
|
||||
void func_801434E4(GameState* state, SkyboxContext* skyboxCtx, s16 skyType) {
|
||||
void func_801434E4(GameState* gamestate, SkyboxContext* skyboxCtx, s16 skyType) {
|
||||
skyboxCtx->skyboxShouldDraw = 0;
|
||||
skyboxCtx->rotX = skyboxCtx->rotY = skyboxCtx->rotZ = 0.0f;
|
||||
|
||||
func_801431E8(state, skyboxCtx, skyType);
|
||||
func_801431E8(gamestate, skyboxCtx, skyType);
|
||||
|
||||
if (skyType != 0) {
|
||||
skyboxCtx->unk17C = THA_AllocEndAlign16(&state->heap, 0x3840);
|
||||
skyboxCtx->unk17C = THA_AllocEndAlign16(&gamestate->heap, 0x3840);
|
||||
|
||||
if (skyType == 5) {
|
||||
// Allocate enough space for the vertices for a 6 sided skybox (cube)
|
||||
skyboxCtx->roomVtx = THA_AllocEndAlign16(&state->heap, sizeof(Vtx) * 32 * 6);
|
||||
skyboxCtx->roomVtx = THA_AllocEndAlign16(&gamestate->heap, sizeof(Vtx) * 32 * 6);
|
||||
func_80143148(skyboxCtx, 6);
|
||||
} else {
|
||||
// Allocate enough space for the vertices for a 5 sided skybox (bottom is missing)
|
||||
skyboxCtx->roomVtx = THA_AllocEndAlign16(&state->heap, sizeof(Vtx) * 32 * 5);
|
||||
skyboxCtx->roomVtx = THA_AllocEndAlign16(&gamestate->heap, sizeof(Vtx) * 32 * 5);
|
||||
func_80143148(skyboxCtx, 5);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
|
||||
return;
|
||||
}
|
||||
|
||||
func_800B8F98(&player->base, 0x100B);
|
||||
func_800B8F98(&player->base, NA_SE_IT_HOOKSHOT_CHAIN - SFX_FLAG);
|
||||
ArmsHook_CheckForCancel(this);
|
||||
|
||||
if (this->timer != 0 && (this->collider.base.atFlags & AT_HIT) &&
|
||||
|
||||
@@ -223,7 +223,7 @@ void BgIkninSusceil_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
if ((this->unk168 == 0) && (this->unk166 > 0) && ((player->unkA74 & 0x100) != 0) && (player->unkB48 > 1000.0f)) {
|
||||
this->unk168 = 2;
|
||||
if ((func_80C0A95C(this, globalCtx) != 0) && (this->actionFunc != func_80C0AE5C)) {
|
||||
func_800B8E58(player, 0x83E);
|
||||
func_800B8E58(&player->base, NA_SE_PL_BODY_HIT);
|
||||
func_80C0AE3C(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -360,11 +360,11 @@ void EnFg_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec
|
||||
|
||||
if ((limbIndex == 7) || (limbIndex == 8)) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
Matrix_Push();
|
||||
SysMatrix_StatePush();
|
||||
SysMatrix_NormalizeXYZ(&globalCtx->unk187FC);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, *dList);
|
||||
Matrix_Pop();
|
||||
SysMatrix_StatePop();
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
@@ -381,9 +381,9 @@ void EnFg_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
{ 120, 130, 230, 255 }, { 190, 190, 190, 255 }, { 0, 0, 0, 255 },
|
||||
};
|
||||
|
||||
Matrix_Push();
|
||||
SysMatrix_StatePush();
|
||||
EnFg_DrawDust(globalCtx, &this->dustEffect[0]);
|
||||
Matrix_Pop();
|
||||
SysMatrix_StatePop();
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
|
||||
@@ -143,7 +143,8 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) {
|
||||
this->curTextId = 0x44E; //" ...So, what'll it be? Deposit Rupees Don't deposit Rupees"
|
||||
} else {
|
||||
func_801518B0(globalCtx, 0x44D, &this->actor);
|
||||
this->curTextId = 0x44D; // "For example, if you deposit 200 Rupees, you'll get an item that holds a lot of Rupees."
|
||||
this->curTextId =
|
||||
0x44D; // "For example, if you deposit 200 Rupees, you'll get an item that holds a lot of Rupees."
|
||||
}
|
||||
break;
|
||||
case 0x44D: // "For example, if you deposit 200 Rupees, you'll get an item that holds a lot of Rupees."
|
||||
@@ -189,7 +190,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) {
|
||||
func_801518B0(globalCtx, 0x45B, &this->actor);
|
||||
this->curTextId = 0x45B; // "What's this? You've already saved up 200 Rupees!?!
|
||||
} else if (((gSaveContext.roomInf[127][0] & 0xFFFF) >= 1000) && ((this->previousBankValue) < 1000) &&
|
||||
!(gSaveContext.weekEventReg[59] & 0x80)) {
|
||||
!(gSaveContext.weekEventReg[59] & 0x80)) {
|
||||
gSaveContext.weekEventReg[59] |= 0x80;
|
||||
func_801518B0(globalCtx, 0x45C, &this->actor);
|
||||
this->curTextId = 0x45C; // "What's this? You've already saved up 1000 Rupees!?!
|
||||
@@ -201,7 +202,8 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) {
|
||||
} else if (this->previousBankValue < (s16)(gSaveContext.roomInf[127][0] & 0xFFFF)) {
|
||||
func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING);
|
||||
func_801518B0(globalCtx, 0x45E, &this->actor);
|
||||
this->curTextId = 0x45E; // "...Hang on there, little guy. I can't take any more deposits. Sorry..."
|
||||
this->curTextId =
|
||||
0x45E; // "...Hang on there, little guy. I can't take any more deposits. Sorry..."
|
||||
} else {
|
||||
func_800BDC5C(&this->skelAnime, animations, GINKO_FLOORSMACKING);
|
||||
func_801518B0(globalCtx, 0x460, &this->actor);
|
||||
@@ -248,7 +250,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) {
|
||||
func_801518B0(globalCtx, 0x468, &this->actor);
|
||||
this->curTextId = 0x468; // " Deposit Rupees Withdraw Rupees Nothing really"
|
||||
break;
|
||||
case 0x469: // "Excuse me, but let me take a look at you..."
|
||||
case 0x469: // "Excuse me, but let me take a look at you..."
|
||||
EnGinkoMan_SetupStamp(this); // stamp player
|
||||
break;
|
||||
case 0x46A: // "Ah, yes...[Link]. If I remember, you're the little guy who deposited [rupees]."
|
||||
@@ -281,7 +283,8 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) {
|
||||
func_801518B0(globalCtx, 0x46E, &this->actor);
|
||||
this->curTextId = 0x46E; // "How much do you want? [rupee prompt]
|
||||
break;
|
||||
case 0x46D: // "Look, little guy, if it's 'cause of the bad rumors going around, forget it! They're just rumors!"
|
||||
case 0x46D: // "Look, little guy, if it's 'cause of the bad rumors going around, forget it! They're just
|
||||
// rumors!"
|
||||
func_801518B0(globalCtx, 0x46B, &this->actor);
|
||||
this->curTextId = 0x46B; // So...
|
||||
break;
|
||||
@@ -292,7 +295,8 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) {
|
||||
EnGinkoMan_SetupIdle(this); // change to waiting for approach
|
||||
}
|
||||
break;
|
||||
case 0x476: // "...You haven't deposited that many Rupees, so that much isn't available for withdrawal. Do the math!
|
||||
case 0x476: // "...You haven't deposited that many Rupees, so that much isn't available for withdrawal. Do the
|
||||
// math!
|
||||
func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING);
|
||||
case 0x475: // "What's this? Look, little guy, you can't hold this many rupees! You got that?"
|
||||
case 0x47C: // "Is that so? Think it over, little guy! So what are you gonna do?"
|
||||
@@ -302,7 +306,8 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) {
|
||||
break;
|
||||
case 0x472: // "What's this? It's a waste to take out such a tiny bit! ...But if you say so!"
|
||||
case 0x473: // Use it wisely...
|
||||
case 0x474: // "Aw, you're taking out all that? If you spend it like that, it'll all be gone before you know it!"
|
||||
case 0x474: // "Aw, you're taking out all that? If you spend it like that, it'll all be gone before you know
|
||||
// it!"
|
||||
if ((gSaveContext.roomInf[127][0] & 0xFFFF) == 0) {
|
||||
func_801518B0(globalCtx, 0x478, &this->actor);
|
||||
// "Look, little guy, all the Rupees you deposited are gone, so you can't use that stamp anymore."
|
||||
@@ -375,16 +380,17 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx)
|
||||
func_801518B0(globalCtx, 0x453, &this->actor);
|
||||
this->curTextId = 0x453; // That's it? That aint nothing at all
|
||||
}
|
||||
|
||||
|
||||
if ((gSaveContext.roomInf[127][0] & 0xFFFF) == 0) {
|
||||
this->isNewAccount = true;
|
||||
}
|
||||
|
||||
func_801159EC((s16) -globalCtx->msgCtx.bankRupeesSelected);
|
||||
func_801159EC((s16)-globalCtx->msgCtx.bankRupeesSelected);
|
||||
this->previousBankValue = gSaveContext.roomInf[127][0] & 0xFFFF;
|
||||
if (1) {} // Needed to match
|
||||
gSaveContext.roomInf[127][0] =
|
||||
(gSaveContext.roomInf[127][0] & 0xFFFF0000) | ((gSaveContext.roomInf[127][0] & 0xFFFF) + globalCtx->msgCtx.bankRupeesSelected);
|
||||
(gSaveContext.roomInf[127][0] & 0xFFFF0000) |
|
||||
((gSaveContext.roomInf[127][0] & 0xFFFF) + globalCtx->msgCtx.bankRupeesSelected);
|
||||
}
|
||||
} else { // GINKOMAN_CHOICE_NO
|
||||
func_8019F230();
|
||||
@@ -444,7 +450,9 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx)
|
||||
|
||||
this->previousBankValue = (s16)(gSaveContext.roomInf[127][0] & 0xFFFF);
|
||||
gSaveContext.roomInf[127][0] =
|
||||
(gSaveContext.roomInf[127][0] & 0xFFFF0000) | (((gSaveContext.roomInf[127][0] & 0xFFFF) - globalCtx->msgCtx.bankRupeesSelected) - this->serviceFee);
|
||||
(gSaveContext.roomInf[127][0] & 0xFFFF0000) |
|
||||
(((gSaveContext.roomInf[127][0] & 0xFFFF) - globalCtx->msgCtx.bankRupeesSelected) -
|
||||
this->serviceFee);
|
||||
func_801159EC(globalCtx->msgCtx.bankRupeesSelected);
|
||||
}
|
||||
} else {
|
||||
@@ -554,7 +562,8 @@ void EnGinkoMan_SetupBankAward2(EnGinkoMan* this) {
|
||||
void EnGinkoMan_BankAward2(EnGinkoMan* this, GlobalContext* globalCtx) {
|
||||
if (func_800B84D0(&this->actor, globalCtx)) {
|
||||
if (!(gSaveContext.weekEventReg[10] & 8) && (this->curTextId == 0x45B)) {
|
||||
// "What's this? You've already saved up 200 Rupees!?! Well, little guy, here's your special gift. Take it!"
|
||||
// "What's this? You've already saved up 200 Rupees!?! Well, little guy, here's your special gift. Take
|
||||
// it!"
|
||||
gSaveContext.weekEventReg[10] |= 8;
|
||||
func_801518B0(globalCtx, 0x47A, &this->actor);
|
||||
this->curTextId = 0x47A; // "See! Doesn't it hold more than your old one?
|
||||
@@ -646,7 +655,8 @@ void EnGinkoMan_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnGinkoMan_FacePlayer(this, globalCtx);
|
||||
}
|
||||
|
||||
s32 EnGinkoMan_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
|
||||
s32 EnGinkoMan_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
|
||||
Actor* thisx) {
|
||||
EnGinkoMan* this = THIS;
|
||||
|
||||
if (limbIndex == 15) {
|
||||
|
||||
@@ -75,7 +75,7 @@ static UNK_TYPE4* D_808A4D74[] = {
|
||||
// gSaveContext.weekEventReg[KEY] = VALUE
|
||||
// KEY | VALUE
|
||||
static u16 isFrogReturnedFlags[] = {
|
||||
(0 << 8) | 0x00, // NULL
|
||||
(0 << 8) | 0x00, // NULL
|
||||
(32 << 8) | 0x40, // Woodfall Temple Frog Returned
|
||||
(32 << 8) | 0x80, // Great Bay Temple Frog Returned
|
||||
(33 << 8) | 0x01, // Southern Swamp Frog Returned
|
||||
@@ -94,7 +94,8 @@ void EnMinifrog_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
Actor_ProcessInitChain(&this->actor, sInitChain);
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 15.0f);
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_0600B538, &D_06001534, this->limbDrawTable, this->transitionDrawTable, 24);
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_0600B538, &D_06001534, this->limbDrawTable,
|
||||
this->transitionDrawTable, 24);
|
||||
CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
|
||||
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
|
||||
|
||||
@@ -118,7 +119,9 @@ void EnMinifrog_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
if (1) {}
|
||||
if (!EN_MINIFROG_IS_RETURNED(this)) {
|
||||
if ((this->frogIndex == MINIFROG_YELLOW) || ((gSaveContext.weekEventReg[isFrogReturnedFlags[this->frogIndex] >> 8] & (u8)isFrogReturnedFlags[this->frogIndex]))) {
|
||||
if ((this->frogIndex == MINIFROG_YELLOW) ||
|
||||
((gSaveContext.weekEventReg[isFrogReturnedFlags[this->frogIndex] >> 8] &
|
||||
(u8)isFrogReturnedFlags[this->frogIndex]))) {
|
||||
Actor_MarkForDeath(&this->actor);
|
||||
} else {
|
||||
this->timer = 30;
|
||||
@@ -143,7 +146,8 @@ void EnMinifrog_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
this->actor.flags &= ~1;
|
||||
|
||||
// Frog has been returned
|
||||
if ((gSaveContext.weekEventReg[isFrogReturnedFlags[this->frogIndex] >> 8] & (u8)isFrogReturnedFlags[this->frogIndex])) {
|
||||
if ((gSaveContext.weekEventReg[isFrogReturnedFlags[this->frogIndex] >> 8] &
|
||||
(u8)isFrogReturnedFlags[this->frogIndex])) {
|
||||
this->actionFunc = EnMinifrog_SetupNextFrogInit;
|
||||
} else {
|
||||
this->actor.draw = NULL;
|
||||
@@ -272,7 +276,7 @@ void EnMinifrog_ReturnFrogCutscene(EnMinifrog* this, GlobalContext* globalCtx) {
|
||||
case 0xD87: // "Ah! You need not say a thing. Upon seeing that face, I understand!" ...
|
||||
func_80151938(globalCtx, globalCtx->msgCtx.unk11F04 + 1);
|
||||
break;
|
||||
case 0xD82: // "What has brought you all this way?"
|
||||
case 0xD82: // "What has brought you all this way?"
|
||||
if (gSaveContext.weekEventReg[33] & 0x80) { // Mountain village is unfrozen
|
||||
func_80151938(globalCtx, 0xD83); // "Could it be... Has spring finally come to the mountains?"
|
||||
} else {
|
||||
@@ -280,7 +284,8 @@ void EnMinifrog_ReturnFrogCutscene(EnMinifrog* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
flag = gSaveContext.weekEventReg[isFrogReturnedFlags[this->frogIndex] >> 8];
|
||||
gSaveContext.weekEventReg[isFrogReturnedFlags[this->frogIndex] >> 8] = flag | (u8)isFrogReturnedFlags[this->frogIndex];
|
||||
gSaveContext.weekEventReg[isFrogReturnedFlags[this->frogIndex] >> 8] =
|
||||
flag | (u8)isFrogReturnedFlags[this->frogIndex];
|
||||
break;
|
||||
case 0xD85: // "I understand. I shall head for the mountains immediately."
|
||||
default:
|
||||
@@ -332,7 +337,8 @@ void EnMinifrog_Idle(EnMinifrog* this, GlobalContext* globalCtx) {
|
||||
if (this->actor.cutscene != -1) {
|
||||
this->flags |= 1;
|
||||
}
|
||||
} else if ((this->actor.xzDistToPlayer < 100.0f) && Actor_IsLinkFacingActor(&this->actor, 0x3000, globalCtx) && (func_8012403C(globalCtx) == 0xD)) {
|
||||
} else if ((this->actor.xzDistToPlayer < 100.0f) && Actor_IsLinkFacingActor(&this->actor, 0x3000, globalCtx) &&
|
||||
(func_8012403C(globalCtx) == 0xD)) {
|
||||
func_800B8614(&this->actor, globalCtx, 110.0f);
|
||||
}
|
||||
}
|
||||
@@ -346,7 +352,8 @@ void EnMinifrog_SetupNextFrogInit(EnMinifrog* this, GlobalContext* globalCtx) {
|
||||
if (nextFrog != NULL) {
|
||||
missingFrog = nextFrog->frog;
|
||||
if (nextFrog->frog != NULL) {
|
||||
this->actor.home.rot.y = (s16)Actor_YawBetweenActors(&this->actor, &missingFrog->actor); // Set home to missing frog
|
||||
this->actor.home.rot.y =
|
||||
(s16)Actor_YawBetweenActors(&this->actor, &missingFrog->actor); // Set home to missing frog
|
||||
EnMinifrog_TurnToMissingFrog(this);
|
||||
} else {
|
||||
EnMinifrog_TurnToPlayer(this);
|
||||
@@ -364,7 +371,8 @@ void EnMinifrog_CheckChoirSuccess(EnMinifrog* this, GlobalContext* globalCtx) {
|
||||
if (this->frog != NULL) {
|
||||
func_80151938(globalCtx, 0xD78); // "Unfortunately, it seems not all of our members have gathered."
|
||||
} else {
|
||||
func_80151938(globalCtx, 0xD7C); // "The conducting was spectacular. And all of our members rose to the occasion!"
|
||||
func_80151938(globalCtx,
|
||||
0xD7C); // "The conducting was spectacular. And all of our members rose to the occasion!"
|
||||
}
|
||||
|
||||
EnMinifrog_SetJumpState(this);
|
||||
@@ -562,13 +570,17 @@ void EnMinifrog_SetupYellowFrogDialog(EnMinifrog* this, GlobalContext* globalCtx
|
||||
EnMinifrog_JumpTimer(this);
|
||||
if (func_800B84D0(&this->actor, globalCtx)) {
|
||||
this->actionFunc = EnMinifrog_YellowFrogDialog;
|
||||
if (!(gSaveContext.weekEventReg[34] & 1)) { // Not spoken with MINIFROG_YELLOW
|
||||
func_801518B0(globalCtx, 0xD76, &this->actor); // "I have been waiting for you, Don Gero. Forgive me if I'm mistaken, but it
|
||||
// looks like you've lost a little weight..."
|
||||
if (!(gSaveContext.weekEventReg[34] & 1)) { // Not spoken with MINIFROG_YELLOW
|
||||
func_801518B0(globalCtx, 0xD76,
|
||||
&this->actor); // "I have been waiting for you, Don Gero. Forgive me if I'm mistaken, but it
|
||||
// looks like you've lost a little weight..."
|
||||
} else {
|
||||
func_801518B0(globalCtx, 0xD7F, &this->actor); // "Well, if it isn't the great Don Gero."
|
||||
}
|
||||
} else if ((this->actor.xzDistToPlayer < 150.0f) && (Actor_IsLinkFacingActor(&this->actor, 0x3000, globalCtx) || ((this->actor.flags & 0x10000) == 0x10000)) && func_8012403C(globalCtx) == 0xD) {
|
||||
} else if ((this->actor.xzDistToPlayer < 150.0f) &&
|
||||
(Actor_IsLinkFacingActor(&this->actor, 0x3000, globalCtx) ||
|
||||
((this->actor.flags & 0x10000) == 0x10000)) &&
|
||||
func_8012403C(globalCtx) == 0xD) {
|
||||
func_800B8614(&this->actor, globalCtx, 160.0f);
|
||||
}
|
||||
}
|
||||
@@ -595,7 +607,8 @@ void EnMinifrog_UpdateMissingFrog(Actor* thisx, GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
s32 EnMinifrog_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
|
||||
s32 EnMinifrog_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
|
||||
Actor* thisx) {
|
||||
if (limbIndex == 1) {
|
||||
pos->z -= 500.0f;
|
||||
}
|
||||
@@ -617,7 +630,7 @@ void EnMinifrog_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLis
|
||||
gSPDisplayList(POLY_OPA_DISP++, *dList);
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
|
||||
if (limbIndex == 4) {
|
||||
SysMatrix_GetStateTranslation(&this->actor.focus.pos);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user