1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-05-11 19:43:44 +00:00

Actor Cleanups (#177)

* rename init chains, colchkinfo, colider inits, damage tables

* actor cleanups

* fix collider init script names

* small fixes

* ichain arg name

* change dynapoly types and names

* revert enru1 data name

* and the type

* pr suggestions
This commit is contained in:
fig02 2020-05-31 05:55:48 -04:00 committed by GitHub
parent 13a94482e5
commit 78d0883f04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
108 changed files with 786 additions and 869 deletions

View file

@ -1,19 +0,0 @@
.include "macro.inc"
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64 # allow use of 64-bit general purpose registers
.section .data
.balign 16
glabel D_80115440
.incbin "baserom.z64", 0xB8C5E0, 0x2C
glabel D_8011546C
.incbin "baserom.z64", 0xB8C60C, 0x18
glabel D_80115484
.incbin "baserom.z64", 0xB8C624, 0x3C

View file

@ -445,8 +445,8 @@ void func_80034CC4(GlobalContext* globalCtx, SkelAnime* skelAnime, OverrideLimbD
void func_80034EC0(SkelAnime* skelAnime, struct_80034EC0_Entry* arg1, s32 arg2); void func_80034EC0(SkelAnime* skelAnime, struct_80034EC0_Entry* arg1, s32 arg2);
void func_80034F54(GlobalContext* globalCtx, s16* arg1, s16* arg2, s32 arg3); void func_80034F54(GlobalContext* globalCtx, s16* arg1, s16* arg2, s32 arg3);
void Actor_Noop(Actor* actor, GlobalContext* globalCtx); void Actor_Noop(Actor* actor, GlobalContext* globalCtx);
void Gfx_DrawDListOpa(GlobalContext* globalCtx, u32 dlist); void Gfx_DrawDListOpa(GlobalContext* globalCtx, Gfx* dlist);
void Gfx_DrawDListXlu(GlobalContext* globalCtx, u32 dlist); void Gfx_DrawDListXlu(GlobalContext* globalCtx, Gfx* dlist);
Actor* Actor_FindNearby(GlobalContext* globalCtx, Actor* refActor, s16 actorId, u8 actorType, f32 range); Actor* Actor_FindNearby(GlobalContext* globalCtx, Actor* refActor, s16 actorId, u8 actorType, f32 range);
s32 func_800354B4(GlobalContext* globalCtx, Actor* actor, f32 range, s16 arg3, s16 arg4, s16 arg5); s32 func_800354B4(GlobalContext* globalCtx, Actor* actor, f32 range, s16 arg3, s16 arg4, s16 arg5);
void func_8003555C(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3); void func_8003555C(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3);
@ -556,11 +556,11 @@ s32 func_8003DF10(CollisionContext*, Vec3f*, Vec3f*, Vec3f*, CollisionPoly**, u3
// ? func_8003E934(?); // ? func_8003E934(?);
// ? func_8003E954(?); // ? func_8003E954(?);
// ? func_8003E9A0(?); // ? func_8003E9A0(?);
void func_8003EBF8(GlobalContext* globalCtx, DynaCollisionContext* dynaColCtx, u32 dynaPolyId); void func_8003EBF8(GlobalContext* globalCtx, DynaCollisionContext* dynaColCtx, UNK_TYPE dynaPolyId);
void func_8003EC50(GlobalContext* globalCtx, DynaCollisionContext* dynaColCtx, u32 dynaPolyId); void func_8003EC50(GlobalContext* globalCtx, DynaCollisionContext* dynaColCtx, UNK_TYPE dynaPolyId);
u32 DynaPolyInfo_RegisterActor(GlobalContext* globalCtx, DynaCollisionContext* dynaColCtx, Actor* actor, u32 arg3); u32 DynaPolyInfo_RegisterActor(GlobalContext* globalCtx, DynaCollisionContext* dynaColCtx, Actor* actor, UNK_TYPE arg3);
DynaPolyActor* DynaPolyInfo_GetActor(CollisionContext* colCtx, u32 dynaPolyId); DynaPolyActor* DynaPolyInfo_GetActor(CollisionContext* colCtx, UNK_TYPE dynaPolyId);
void DynaPolyInfo_Free(GlobalContext* globalCtx, DynaCollisionContext* dynaColCtx, u32 dynaPolyId); void DynaPolyInfo_Free(GlobalContext* globalCtx, DynaCollisionContext* dynaColCtx, UNK_TYPE dynaPolyId);
// ? func_8003EE80(?); // ? func_8003EE80(?);
// ? func_8003F8EC(?); // ? func_8003F8EC(?);
// ? func_8003F984(?); // ? func_8003F984(?);
@ -578,7 +578,7 @@ void DynaPolyInfo_Free(GlobalContext* globalCtx, DynaCollisionContext* dynaColCt
// ? func_80041510(?); // ? func_80041510(?);
// ? func_80041648(?); // ? func_80041648(?);
// ? func_800417A0(?); // ? func_800417A0(?);
void DynaPolyInfo_Alloc(u32 collision, void* collisionPtr); void DynaPolyInfo_Alloc(UNK_PTR arg0, UNK_PTR arg1);
// ? func_80041978(?); // ? func_80041978(?);
// ? func_800419B0(?); // ? func_800419B0(?);
// ? func_80041A28(?); // ? func_80041A28(?);

1
spec
View file

@ -270,7 +270,6 @@ beginseg
name "code" name "code"
address 0x8001CE60 address 0x8001CE60
include "build/src/code/z_en_a_keep.o" include "build/src/code/z_en_a_keep.o"
include "build/data/z_en_a_keep.data.o"
include "build/src/code/z_en_item00.o" include "build/src/code/z_en_item00.o"
include "build/data/z_en_item00.data.o" include "build/data/z_en_item00.data.o"
include "build/data/z_en_item00.bss.o" include "build/data/z_en_item00.bss.o"

View file

@ -1,7 +1,7 @@
#include <ultra64.h> #include <ultra64.h>
#include <global.h> #include <global.h>
void Gfx_DrawDListOpa(GlobalContext* globalCtx, u32 dlist) { void Gfx_DrawDListOpa(GlobalContext* globalCtx, Gfx* dlist) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* dispRefs[4]; Gfx* dispRefs[4];
@ -15,7 +15,7 @@ void Gfx_DrawDListOpa(GlobalContext* globalCtx, u32 dlist) {
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_cheap_proc.c", 219); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_cheap_proc.c", 219);
} }
void Gfx_DrawDListXlu(GlobalContext* globalCtx, u32 dlist) { void Gfx_DrawDListXlu(GlobalContext* globalCtx, Gfx* dlist) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* dispRefs[4]; Gfx* dispRefs[4];

View file

@ -65,10 +65,20 @@ const ActorInit En_A_Obj_InitVars = {
(ActorFunc)EnAObj_Draw, (ActorFunc)EnAObj_Draw,
}; };
// TODO: Define this section of .data here and rename the symbols static ColliderCylinderInit sCylinderInit = {
extern ColliderCylinderInit D_80115440; { COLTYPE_UNK10, 0x00, 0x39, 0x39, 0x20, COLSHAPE_CYLINDER },
extern u32 D_8011546C[]; { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 },
extern u32 D_80115484[]; { 25, 60, 0, { 0, 0, 0 } },
};
static UNK_PTR D_8011546C[] = {
0x040394B0, 0x040394B0, 0x0403A120, 0x0403A480, 0x0403A7F0, 0x06000730,
};
static Gfx* D_80115484[] = {
0x04039C00, 0x04039C00, 0x04039C00, 0x0403A2D0, 0x0403A2D0, 0x0403A630,
0x06000210, 0x0403AB80, 0x0403A9B0, 0x0403C050, 0x0403C5B0, 0x0400D340,
};
void EnAObj_SetupAction(EnAObj* this, EnAObjActionFunc actionFunc) { void EnAObj_SetupAction(EnAObj* this, EnAObjActionFunc actionFunc) {
this->actionFunc = actionFunc; this->actionFunc = actionFunc;
@ -153,7 +163,7 @@ void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_178 = 45.0f; this->unk_178 = 45.0f;
func_8001D234(this, thisx->params); func_8001D234(this, thisx->params);
Collider_InitCylinder(globalCtx, &this->collider); Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, thisx, &D_80115440); Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit);
thisx->colChkInfo.mass = 0xFF; thisx->colChkInfo.mass = 0xFF;
thisx->unk_1F = 0; thisx->unk_1F = 0;
break; break;

View file

@ -74,8 +74,8 @@ const ActorInit En_Item00_InitVars = {
}; };
// TODO: Define this section of .data here and rename the symbols // TODO: Define this section of .data here and rename the symbols
extern ColliderCylinderInit D_801154E0; extern ColliderCylinderInit D_801154E0; // rename to sCylinderInit when data is moved
extern InitChainEntry D_8011550C[]; extern InitChainEntry D_8011550C[]; // rename to sInitChain when data is moved
extern Color_RGB8 D_80115510; extern Color_RGB8 D_80115510;
extern Color_RGB8 D_80115514; extern Color_RGB8 D_80115514;
extern UNK_TYPE D_80115518; extern UNK_TYPE D_80115518;

View file

@ -1,11 +1,10 @@
/* /*
* File: z_arrow_fire.c * File: z_arrow_fire.c
* Overlay: ovl_Arrow_Fire * Overlay: ovl_Arrow_Fire
* Description: Fire Arrow actor. Spawned by and attached to a normal arrow. * Description: Fire Arrow. Spawned by and attached to a normal arrow.
*/ */
#include "z_arrow_fire.h" #include "z_arrow_fire.h"
#include "overlays/actors/ovl_En_Arrow/z_en_arrow.h" #include "overlays/actors/ovl_En_Arrow/z_en_arrow.h"
#define FLAGS 0x02000010 #define FLAGS 0x02000010
@ -35,7 +34,7 @@ const ActorInit Arrow_Fire_InitVars = {
(ActorFunc)ArrowFire_Draw, (ActorFunc)ArrowFire_Draw,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_F32(unk_F4, 2000, ICHAIN_STOP), ICHAIN_F32(unk_F4, 2000, ICHAIN_STOP),
}; };
@ -46,7 +45,7 @@ void ArrowFire_SetupAction(ArrowFire* this, ArrowFireActionFunc actionFunc) {
void ArrowFire_Init(Actor* thisx, GlobalContext* globalCtx) { void ArrowFire_Init(Actor* thisx, GlobalContext* globalCtx) {
ArrowFire* this = THIS; ArrowFire* this = THIS;
Actor_ProcessInitChain(&this->actor, initChain); Actor_ProcessInitChain(&this->actor, sInitChain);
this->radius = 0; this->radius = 0;
this->unk_158 = 1.0f; this->unk_158 = 1.0f;
ArrowFire_SetupAction(&this->actor, ArrowFire_Charge); ArrowFire_SetupAction(&this->actor, ArrowFire_Charge);
@ -240,11 +239,11 @@ void ArrowFire_Draw(Actor* thisx, GlobalContext* globalCtx) {
Matrix_Translate(0.0f, -700.0f, 0.0f, MTXMODE_APPLY); Matrix_Translate(0.0f, -700.0f, 0.0f, MTXMODE_APPLY);
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_arrow_fire.c", 666), gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_arrow_fire.c", 666),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxCtx->polyXlu.p++, textureDL); gSPDisplayList(gfxCtx->polyXlu.p++, sTextureDL);
gSPDisplayList(gfxCtx->polyXlu.p++, gSPDisplayList(gfxCtx->polyXlu.p++,
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 255 - (stateFrames * 2) % 256, 0, 64, 32, 1, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 255 - (stateFrames * 2) % 256, 0, 64, 32, 1,
255 - stateFrames % 256, 511 - (stateFrames * 10) % 512, 64, 64)); 255 - stateFrames % 256, 511 - (stateFrames * 10) % 512, 64, 64));
gSPDisplayList(gfxCtx->polyXlu.p++, vertexDL); gSPDisplayList(gfxCtx->polyXlu.p++, sVertexDL);
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_arrow_fire.c", 682); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_arrow_fire.c", 682);
} }
} }

View file

@ -146,7 +146,7 @@ static UNK_TYPE vertices2[] = {
0x000002BC, 0x00000000, 0x07000800, 0x007800FF, 0xFFA30271, 0x00000000, 0x080006C2, 0xA95200FF, 0x000002BC, 0x00000000, 0x07000800, 0x007800FF, 0xFFA30271, 0x00000000, 0x080006C2, 0xA95200FF,
}; };
static Gfx textureDL[] = { static Gfx sTextureDL[] = {
gsDPPipeSync(), gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE), gsDPSetTextureLUT(G_TT_NONE),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
@ -162,7 +162,7 @@ static Gfx textureDL[] = {
gsSPEndDisplayList(), gsSPEndDisplayList(),
}; };
static Gfx vertexDL[] = { static Gfx sVertexDL[] = {
gsSPVertex(vertices1, 32, 0), gsSPVertex(vertices1, 32, 0),
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0), gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
gsSP2Triangles(3, 2, 4, 0, 3, 4, 5, 0), gsSP2Triangles(3, 2, 4, 0, 3, 4, 5, 0),

View file

@ -1,7 +1,7 @@
/* /*
* File: z_arrow_ice.c * File: z_arrow_ice.c
* Overlay: ovl_Arrow_Ice * Overlay: ovl_Arrow_Ice
* Description: Ice Arrow actor. Spawned by and attached to a normal arrow. * Description: Ice Arrow. Spawned by and attached to a normal arrow.
*/ */
#include "z_arrow_ice.h" #include "z_arrow_ice.h"
@ -35,7 +35,7 @@ const ActorInit Arrow_Ice_InitVars = {
(ActorFunc)ArrowIce_Draw, (ActorFunc)ArrowIce_Draw,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_F32(unk_F4, 2000, ICHAIN_STOP), ICHAIN_F32(unk_F4, 2000, ICHAIN_STOP),
}; };
@ -46,7 +46,7 @@ void ArrowIce_SetupAction(ArrowIce* this, ArrowIceActionFunc actionFunc) {
void ArrowIce_Init(Actor* thisx, GlobalContext* globalCtx) { void ArrowIce_Init(Actor* thisx, GlobalContext* globalCtx) {
ArrowIce* this = THIS; ArrowIce* this = THIS;
Actor_ProcessInitChain(&this->actor, initChain); Actor_ProcessInitChain(&this->actor, sInitChain);
this->radius = 0; this->radius = 0;
this->unk_160 = 1.0f; this->unk_160 = 1.0f;
ArrowIce_SetupAction(this, ArrowIce_Charge); ArrowIce_SetupAction(this, ArrowIce_Charge);
@ -240,11 +240,11 @@ void ArrowIce_Draw(Actor* thisx, GlobalContext* globalCtx) {
Matrix_Translate(0.0f, -700.0f, 0.0f, MTXMODE_APPLY); Matrix_Translate(0.0f, -700.0f, 0.0f, MTXMODE_APPLY);
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_arrow_ice.c", 660), gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_arrow_ice.c", 660),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxCtx->polyXlu.p++, textureDL); gSPDisplayList(gfxCtx->polyXlu.p++, sTextureDL);
gSPDisplayList(gfxCtx->polyXlu.p++, gSPDisplayList(gfxCtx->polyXlu.p++,
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 511 - (stateFrames * 5) % 512, 0, 128, 32, 1, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 511 - (stateFrames * 5) % 512, 0, 128, 32, 1,
511 - (stateFrames * 10) % 512, 511 - (stateFrames * 10) % 512, 4, 16)); 511 - (stateFrames * 10) % 512, 511 - (stateFrames * 10) % 512, 4, 16));
gSPDisplayList(gfxCtx->polyXlu.p++, vertexDL); gSPDisplayList(gfxCtx->polyXlu.p++, sVertexDL);
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_arrow_ice.c", 676); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_arrow_ice.c", 676);
} }
} }

View file

@ -146,7 +146,7 @@ static UNK_TYPE vertices2[] = {
0x000002BC, 0x00000000, 0x07000800, 0x007800FF, 0xFFA30271, 0x00000000, 0x080006C2, 0xA95200FF, 0x000002BC, 0x00000000, 0x07000800, 0x007800FF, 0xFFA30271, 0x00000000, 0x080006C2, 0xA95200FF,
}; };
static Gfx textureDL[] = { static Gfx sTextureDL[] = {
gsDPPipeSync(), gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE), gsDPSetTextureLUT(G_TT_NONE),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
@ -162,7 +162,7 @@ static Gfx textureDL[] = {
gsSPEndDisplayList(), gsSPEndDisplayList(),
}; };
static Gfx vertexDL[] = { static Gfx sVertexDL[] = {
gsSPVertex(vertices1, 32, 0), gsSPVertex(vertices1, 32, 0),
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0), gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
gsSP2Triangles(3, 2, 4, 0, 3, 4, 5, 0), gsSP2Triangles(3, 2, 4, 0, 3, 4, 5, 0),

View file

@ -1,7 +1,7 @@
/* /*
* File: z_arrow_light.c * File: z_arrow_light.c
* Overlay: ovl_Arrow_Light * Overlay: ovl_Arrow_Light
* Description: Light Arrow actor. Spawned by and attached to a normal arrow. * Description: Light Arrow. Spawned by and attached to a normal arrow.
*/ */
#include "z_arrow_light.h" #include "z_arrow_light.h"
@ -35,7 +35,7 @@ const ActorInit Arrow_Light_InitVars = {
(ActorFunc)ArrowLight_Draw, (ActorFunc)ArrowLight_Draw,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_F32(unk_F4, 2000, ICHAIN_STOP), ICHAIN_F32(unk_F4, 2000, ICHAIN_STOP),
}; };
@ -46,7 +46,7 @@ void ArrowLight_SetupAction(ArrowLight* this, ArrowLightActionFunc actionFunc) {
void ArrowLight_Init(Actor* thisx, GlobalContext* globalCtx) { void ArrowLight_Init(Actor* thisx, GlobalContext* globalCtx) {
ArrowLight* this = THIS; ArrowLight* this = THIS;
Actor_ProcessInitChain(&this->actor, initChain); Actor_ProcessInitChain(&this->actor, sInitChain);
this->radius = 0; this->radius = 0;
this->unk_160 = 1.0f; this->unk_160 = 1.0f;
ArrowLight_SetupAction(this, ArrowLight_Charge); ArrowLight_SetupAction(this, ArrowLight_Charge);
@ -240,11 +240,11 @@ void ArrowLight_Draw(Actor* thisx, GlobalContext* globalCtx) {
Matrix_Translate(0.0f, -700.0f, 0.0f, MTXMODE_APPLY); Matrix_Translate(0.0f, -700.0f, 0.0f, MTXMODE_APPLY);
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_arrow_light.c", 648), gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_arrow_light.c", 648),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxCtx->polyXlu.p++, textureDL); gSPDisplayList(gfxCtx->polyXlu.p++, sTextureDL);
gSPDisplayList(gfxCtx->polyXlu.p++, gSPDisplayList(gfxCtx->polyXlu.p++,
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 511 - (stateFrames * 5) % 512, 0, 4, 32, 1, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 511 - (stateFrames * 5) % 512, 0, 4, 32, 1,
511 - (stateFrames * 10) % 512, 511 - (stateFrames * 30) % 512, 8, 16)); 511 - (stateFrames * 10) % 512, 511 - (stateFrames * 30) % 512, 8, 16));
gSPDisplayList(gfxCtx->polyXlu.p++, vertexDL); gSPDisplayList(gfxCtx->polyXlu.p++, sVertexDL);
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_arrow_light.c", 664); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_arrow_light.c", 664);
} }
} }

View file

@ -146,7 +146,7 @@ static UNK_TYPE vertices2[] = {
0x000002BC, 0x00000000, 0x07000800, 0x007800FF, 0xFFA30271, 0x00000000, 0x080006C2, 0xA95200FF, 0x000002BC, 0x00000000, 0x07000800, 0x007800FF, 0xFFA30271, 0x00000000, 0x080006C2, 0xA95200FF,
}; };
static Gfx textureDL[] = { static Gfx sTextureDL[] = {
gsDPPipeSync(), gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE), gsDPSetTextureLUT(G_TT_NONE),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
@ -162,7 +162,7 @@ static Gfx textureDL[] = {
gsSPEndDisplayList(), gsSPEndDisplayList(),
}; };
static Gfx vertexDL[] = { static Gfx sVertexDL[] = {
gsSPVertex(vertices1, 32, 0), gsSPVertex(vertices1, 32, 0),
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0), gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
gsSP2Triangles(3, 2, 4, 0, 3, 4, 5, 0), gsSP2Triangles(3, 2, 4, 0, 3, 4, 5, 0),

View file

@ -24,7 +24,7 @@ void func_8086C618(BgBdanObjects* this, GlobalContext* globalCtx);
void func_8086C6EC(BgBdanObjects* this, GlobalContext* globalCtx); void func_8086C6EC(BgBdanObjects* this, GlobalContext* globalCtx);
void func_8086C76C(BgBdanObjects* this, GlobalContext* globalCtx); void func_8086C76C(BgBdanObjects* this, GlobalContext* globalCtx);
void func_8086C7D0(BgBdanObjects* this, GlobalContext* globalCtx); void func_8086C7D0(BgBdanObjects* this, GlobalContext* globalCtx);
void func_8086C868(BgBdanObjects* this, GlobalContext* globalCtx); void BgBdanObjects_DoNothing(BgBdanObjects* this, GlobalContext* globalCtx);
void func_8086C874(BgBdanObjects* this, GlobalContext* globalCtx); void func_8086C874(BgBdanObjects* this, GlobalContext* globalCtx);
void func_8086C9A8(BgBdanObjects* this, GlobalContext* globalCtx); void func_8086C9A8(BgBdanObjects* this, GlobalContext* globalCtx);
void func_8086C9F0(BgBdanObjects* this, GlobalContext* globalCtx); void func_8086C9F0(BgBdanObjects* this, GlobalContext* globalCtx);
@ -44,24 +44,24 @@ const ActorInit Bg_Bdan_Objects_InitVars = {
(ActorFunc)BgBdanObjects_Draw, (ActorFunc)BgBdanObjects_Draw,
}; };
static ColliderCylinderInit D_8086CD70 = { static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x20, COLSHAPE_CYLINDER }, { COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x20, COLSHAPE_CYLINDER },
{ 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x09, 0x00, 0x00 }, { 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x09, 0x00, 0x00 },
{ 0x00BB, 0x0050, 0x0000, { 0 } }, { 0x00BB, 0x0050, 0x0000, { 0 } },
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 0x64, ICHAIN_STOP), ICHAIN_VEC3F_DIV1000(scale, 0x64, ICHAIN_STOP),
}; };
static u32 D_8086CDA0[] = { static Gfx* D_8086CDA0[] = {
0x06008618, 0x06008618,
0x06004BE8, 0x06004BE8,
0x060038E8, 0x060038E8,
0x06005200, 0x06005200,
}; };
extern UNK_TYPE D_060038E8; extern Gfx D_060038E8[];
extern UNK_TYPE D_06005048; extern UNK_TYPE D_06005048;
extern UNK_TYPE D_06005580; extern UNK_TYPE D_06005580;
extern UNK_TYPE D_06008CE0; extern UNK_TYPE D_06008CE0;
@ -101,7 +101,7 @@ void BgBdanObjects_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad; s32 pad;
s32 localC = 0; s32 localC = 0;
Actor_ProcessInitChain(this, initChain); Actor_ProcessInitChain(this, sInitChain);
DynaPolyInfo_SetActorMove(this, 1); DynaPolyInfo_SetActorMove(this, 1);
this->unk_168 = (thisx->params >> 8) & 0x3F; this->unk_168 = (thisx->params >> 8) & 0x3F;
thisx->params &= 0xFF; thisx->params &= 0xFF;
@ -114,7 +114,7 @@ void BgBdanObjects_Init(Actor* thisx, GlobalContext* globalCtx) {
if (thisx->params == 0) { if (thisx->params == 0) {
DynaPolyInfo_Alloc(&D_06008CE0, &localC); DynaPolyInfo_Alloc(&D_06008CE0, &localC);
Collider_InitCylinder(globalCtx, &this->collider); Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, this, &D_8086CD70); Collider_SetCylinder(globalCtx, &this->collider, this, &sCylinderInit);
thisx->posRot.pos.y = (f32)(thisx->posRot.pos.y + -79.0f); thisx->posRot.pos.y = (f32)(thisx->posRot.pos.y + -79.0f);
if (Flags_GetClear(globalCtx, thisx->room)) { if (Flags_GetClear(globalCtx, thisx->room)) {
Flags_SetSwitch(globalCtx, this->unk_168); Flags_SetSwitch(globalCtx, this->unk_168);
@ -144,7 +144,7 @@ void BgBdanObjects_Init(Actor* thisx, GlobalContext* globalCtx) {
} else { } else {
DynaPolyInfo_Alloc(&D_06005580, &localC); DynaPolyInfo_Alloc(&D_06005580, &localC);
if (Flags_GetSwitch(globalCtx, this->unk_168)) { if (Flags_GetSwitch(globalCtx, this->unk_168)) {
this->actionFunc = func_8086C868; this->actionFunc = BgBdanObjects_DoNothing;
thisx->posRot.pos.y = thisx->initPosRot.pos.y - 400.0f; thisx->posRot.pos.y = thisx->initPosRot.pos.y - 400.0f;
} else { } else {
this->actionFunc = func_8086CB10; this->actionFunc = func_8086CB10;
@ -312,6 +312,7 @@ void func_8086C618(BgBdanObjects* this, GlobalContext* globalCtx) {
void func_8086C6EC(BgBdanObjects* this, GlobalContext* globalCtx) { void func_8086C6EC(BgBdanObjects* this, GlobalContext* globalCtx) {
s32 cond = Math_ApproxUpdateScaledS(&this->dyna.actor.shape.rot.y, this->dyna.actor.initPosRot.rot.y, 0x200); s32 cond = Math_ApproxUpdateScaledS(&this->dyna.actor.shape.rot.y, this->dyna.actor.initPosRot.rot.y, 0x200);
if (Math_ApproxF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + -125.0f, 3.0f)) { if (Math_ApproxF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + -125.0f, 3.0f)) {
if (cond) { if (cond) {
this->actionFunc = func_8086C76C; this->actionFunc = func_8086C76C;
@ -332,13 +333,13 @@ void func_8086C7D0(BgBdanObjects* this, GlobalContext* globalCtx) {
if (Math_SmoothScaleMaxMinF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 965.0f, 0.5f, 15.0f, if (Math_SmoothScaleMaxMinF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 965.0f, 0.5f, 15.0f,
0.2f) < 0.01f) { 0.2f) < 0.01f) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_A); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_A);
this->actionFunc = func_8086C868; this->actionFunc = BgBdanObjects_DoNothing;
} else { } else {
func_8002F974(&this->dyna.actor, 0x208F); func_8002F974(&this->dyna.actor, 0x208F);
} }
} }
void func_8086C868(BgBdanObjects* this, GlobalContext* globalCtx) { void BgBdanObjects_DoNothing(BgBdanObjects* this, GlobalContext* globalCtx) {
} }
void func_8086C874(BgBdanObjects* this, GlobalContext* globalCtx) { void func_8086C874(BgBdanObjects* this, GlobalContext* globalCtx) {
@ -423,7 +424,7 @@ void func_8086CB8C(BgBdanObjects* this, GlobalContext* globalCtx) {
this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y - (cosf(this->unk_16A * (M_PI / 50.0f)) * 200.0f); this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y - (cosf(this->unk_16A * (M_PI / 50.0f)) * 200.0f);
if (this->unk_16A == 0) { if (this->unk_16A == 0) {
Audio_PlayActorSound2(this, NA_SE_EV_BUYOSTAND_STOP_U); Audio_PlayActorSound2(this, NA_SE_EV_BUYOSTAND_STOP_U);
this->actionFunc = func_8086C868; this->actionFunc = BgBdanObjects_DoNothing;
func_800C078C(globalCtx, 0, -1); func_800C078C(globalCtx, 0, -1);
} else { } else {
func_8002F974(&this->dyna.actor, 0x2090); func_8002F974(&this->dyna.actor, 0x2090);
@ -449,7 +450,7 @@ void BgBdanObjects_Draw(Actor* thisx, GlobalContext* globalCtx) {
} }
if (thisx->params == 2) { if (thisx->params == 2) {
Gfx_DrawDListXlu(globalCtx, &D_060038E8); Gfx_DrawDListXlu(globalCtx, D_060038E8);
} else { } else {
Gfx_DrawDListOpa(globalCtx, D_8086CDA0[thisx->params]); Gfx_DrawDListOpa(globalCtx, D_8086CDA0[thisx->params]);
} }

View file

@ -1,7 +1,7 @@
/* /*
* File: z_bg_bdan_switch.c * File: z_bg_bdan_switch.c
* Overlay: Bg_Bdan_Switch * Overlay: Bg_Bdan_Switch
* Description: Switches (Inside Lord Jabu-Jabu) * Description: Switches Inside Lord Jabu-Jabu
*/ */
#include "z_bg_bdan_switch.h" #include "z_bg_bdan_switch.h"
@ -56,23 +56,23 @@ const ActorInit Bg_Bdan_Switch_InitVars = {
}; };
extern UNK_PTR D_06005CF8; extern UNK_PTR D_06005CF8;
extern UNK_PTR D_060061A0; extern Gfx D_060061A0[];
extern UNK_PTR D_06005A20; extern Gfx D_06005A20[];
static ColliderJntSphItemInit colliderItemsInit[] = { static ColliderJntSphItemInit sJntSphItemsInit[] = {
{ {
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0xEFC1FFFE, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xEFC1FFFE, 0x00, 0x00 }, 0x00, 0x01, 0x01 },
{ 0x00, { { 0x0000, 0x0078, 0x0000 }, 370 }, 100 }, { 0x00, { { 0x0000, 0x0078, 0x0000 }, 370 }, 100 },
}, },
}; };
static ColliderJntSphInit colliderInit = { static ColliderJntSphInit sJntSphInit = {
{ COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x20, COLSHAPE_JNTSPH }, { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x20, COLSHAPE_JNTSPH },
1, 1,
&colliderItemsInit, &sJntSphItemsInit,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_F32(unk_F4, 1400, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 1400, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F8, 500, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 500, ICHAIN_CONTINUE),
ICHAIN_F32(unk_FC, 1200, ICHAIN_STOP), ICHAIN_F32(unk_FC, 1200, ICHAIN_STOP),
@ -97,7 +97,7 @@ void func_8086D010(BgBdanSwitch* this, GlobalContext* globalCtx, u32 collision,
void func_8086D098(BgBdanSwitch* this, GlobalContext* globalCtx) { void func_8086D098(BgBdanSwitch* this, GlobalContext* globalCtx) {
Actor* actor = &this->actor; Actor* actor = &this->actor;
Collider_InitJntSph(globalCtx, &this->collider); Collider_InitJntSph(globalCtx, &this->collider);
Collider_SetJntSph(globalCtx, &this->collider, actor, &colliderInit, &this->colliderItems); Collider_SetJntSph(globalCtx, &this->collider, actor, &sJntSphInit, &this->colliderItems);
} }
void func_8086D0EC(BgBdanSwitch* this) { void func_8086D0EC(BgBdanSwitch* this) {
@ -131,7 +131,7 @@ void BgBdanSwitch_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 flag; s32 flag;
type = this->actor.params & 0xFF; type = this->actor.params & 0xFF;
Actor_ProcessInitChain(&this->actor, initChain); Actor_ProcessInitChain(&this->actor, sInitChain);
if (type == YELLOW_TALL_1 || type == YELLOW_TALL_2) { if (type == YELLOW_TALL_1 || type == YELLOW_TALL_2) {
this->actor.scale.z = 0.05f; this->actor.scale.z = 0.05f;
this->actor.scale.x = 0.05f; this->actor.scale.x = 0.05f;
@ -490,11 +490,11 @@ void BgBdanSwitch_Update(Actor* thisx, GlobalContext* globalCtx) {
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider);
} }
void func_8086DF58(BgBdanSwitch* this, GlobalContext* globalCtx, UNK_TYPE arg2) { void func_8086DF58(BgBdanSwitch* this, GlobalContext* globalCtx, Gfx* dlist) {
func_800D1694(this->actor.posRot.pos.x, this->actor.posRot.pos.y + (this->actor.shape.unk_08 * this->unk_1D0), func_800D1694(this->actor.posRot.pos.x, this->actor.posRot.pos.y + (this->actor.shape.unk_08 * this->unk_1D0),
this->actor.posRot.pos.z, &this->actor.shape.rot); this->actor.posRot.pos.z, &this->actor.shape.rot);
Matrix_Scale(this->unk_1D4, this->unk_1D0, this->unk_1D4, MTXMODE_APPLY); Matrix_Scale(this->unk_1D4, this->unk_1D0, this->unk_1D4, MTXMODE_APPLY);
Gfx_DrawDListOpa(globalCtx, arg2); Gfx_DrawDListOpa(globalCtx, dlist);
} }
void BgBdanSwitch_Draw(Actor* thisx, GlobalContext* globalCtx) { void BgBdanSwitch_Draw(Actor* thisx, GlobalContext* globalCtx) {

View file

@ -1,13 +1,11 @@
/* /*
* File: z_bg_bom_guard.c * File: z_bg_bom_guard.c
* Overlay: Bg_Bom_Guard * Overlay: Bg_Bom_Guard
* Description: Bombchu Bowling Alley Game * Description: Bombchu Bowling Alley Walls
*/ */
#include "z_bg_bom_guard.h" #include "z_bg_bom_guard.h"
#include "overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h" #include "overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h"
#include <vt.h> #include <vt.h>
#define FLAGS 0x00000010 #define FLAGS 0x00000010
@ -32,7 +30,7 @@ const ActorInit Bg_Bom_Guard_InitVars = {
NULL, NULL,
}; };
extern u32 D_06001C40; extern UNK_TYPE D_06001C40;
void BgBomGuard_SetupAction(BgBomGuard* this, BgBomGuardActionFunc actionFunc) { void BgBomGuard_SetupAction(BgBomGuard* this, BgBomGuardActionFunc actionFunc) {
this->actionFunc = actionFunc; this->actionFunc = actionFunc;

View file

@ -1,7 +1,7 @@
/* /*
* File: z_bg_ddan_kd.c * File: z_bg_ddan_kd.c
* Overlay: ovl_Bg_Ddan_Kd * Overlay: ovl_Bg_Ddan_Kd
* Description: Stone stairs in Dodongo's Cavern * Description: Falling stairs in Dodongo's Cavern
*/ */
#include "z_bg_ddan_kd.h" #include "z_bg_ddan_kd.h"
@ -31,13 +31,13 @@ const ActorInit Bg_Ddan_Kd_InitVars = {
(ActorFunc)BgDdanKd_Draw, (ActorFunc)BgDdanKd_Draw,
}; };
static ColliderCylinderInit cylinderInit = { static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK10, 0x00, 0x39, 0x00, 0x00, COLSHAPE_CYLINDER }, { COLTYPE_UNK10, 0x00, 0x39, 0x00, 0x00, COLSHAPE_CYLINDER },
{ 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 },
{ 245, 180, -400, { 0, 0, 0 } }, { 245, 180, -400, { 0, 0, 0 } },
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F8, 32767, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 32767, ICHAIN_CONTINUE),
ICHAIN_F32(unk_FC, 32767, ICHAIN_CONTINUE), ICHAIN_F32(unk_FC, 32767, ICHAIN_CONTINUE),
@ -49,7 +49,7 @@ static f32 D_80871904[] = { 0.0f };
static f32 D_80871908[] = { 0.0f, -0.45f, 0.0f, 0.0f, 0.0f, 0.0f }; static f32 D_80871908[] = { 0.0f, -0.45f, 0.0f, 0.0f, 0.0f, 0.0f };
extern UNK_TYPE D_06004F30; extern UNK_TYPE D_06004F30;
extern UNK_TYPE D_060048A8; extern Gfx D_060048A8[];
void BgDdanKd_SetupAction(BgDdanKd* this, BgDdanKdActionFunc actionFunc) { void BgDdanKd_SetupAction(BgDdanKd* this, BgDdanKdActionFunc actionFunc) {
this->actionFunc = actionFunc; this->actionFunc = actionFunc;
@ -62,10 +62,10 @@ void BgDdanKd_Init(Actor* thisx, GlobalContext* globalCtx) {
this->previousCollidingExplosion = NULL; this->previousCollidingExplosion = NULL;
Actor_ProcessInitChain(&this->dyna.actor, &initChain); Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyInfo_SetActorMove(&this->dyna.actor, 1); DynaPolyInfo_SetActorMove(&this->dyna.actor, 1);
Collider_InitCylinder(globalCtx, &this->collider); Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->dyna.actor, &cylinderInit); Collider_SetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit);
DynaPolyInfo_Alloc(&D_06004F30, &sp24); DynaPolyInfo_Alloc(&D_06004F30, &sp24);
this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, sp24); this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, sp24);

View file

@ -5,7 +5,6 @@
*/ */
#include "z_bg_gate_shutter.h" #include "z_bg_gate_shutter.h"
#include <vt.h> #include <vt.h>
#define FLAGS 0x00000000 #define FLAGS 0x00000000
@ -35,7 +34,7 @@ const ActorInit Bg_Gate_Shutter_InitVars = {
}; };
extern Gfx D_06001CD0[]; extern Gfx D_06001CD0[];
extern Gfx D_06001DA8[]; extern UNK_TYPE D_06001DA8;
void BgGateShutter_Init(Actor* thisx, GlobalContext* globalCtx) { void BgGateShutter_Init(Actor* thisx, GlobalContext* globalCtx) {
BgGateShutter* this = THIS; BgGateShutter* this = THIS;
@ -136,7 +135,7 @@ void BgGateShutter_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_gate_shutter.c", 328), gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_gate_shutter.c", 328),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxCtx->polyOpa.p++, &D_06001CD0); gSPDisplayList(gfxCtx->polyOpa.p++, D_06001CD0);
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_gate_shutter.c", 333); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_gate_shutter.c", 333);
} }

View file

@ -31,14 +31,14 @@ const ActorInit Bg_Gjyo_Bridge_InitVars = {
(ActorFunc)BgGjyoBridge_Draw, (ActorFunc)BgGjyoBridge_Draw,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_F32(unk_F8, 800, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 800, ICHAIN_CONTINUE),
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
}; };
extern UNK_TYPE D_06000600; extern Gfx D_06000600[];
extern UNK_TYPE D_06000DB8; extern UNK_TYPE D_06000DB8;
extern UNK_TYPE D_02002640; extern CutsceneData D_02002640[];
void BgGjyoBridge_Init(Actor* thisx, GlobalContext* globalCtx) { void BgGjyoBridge_Init(Actor* thisx, GlobalContext* globalCtx) {
BgGjyoBridge* this = THIS; BgGjyoBridge* this = THIS;
@ -47,7 +47,7 @@ void BgGjyoBridge_Init(Actor* thisx, GlobalContext* globalCtx) {
local_c = 0; local_c = 0;
Actor_ProcessInitChain(thisx, &initChain); Actor_ProcessInitChain(thisx, sInitChain);
DynaPolyInfo_SetActorMove(&this->dyna, 0); DynaPolyInfo_SetActorMove(&this->dyna, 0);
DynaPolyInfo_Alloc(&D_06000DB8, &local_c); DynaPolyInfo_Alloc(&D_06000DB8, &local_c);
@ -121,7 +121,7 @@ void BgGjyoBridge_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_gjyo_bridge.c", 281), gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_gjyo_bridge.c", 281),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxCtx->polyXlu.p++, &D_06000600); gSPDisplayList(gfxCtx->polyXlu.p++, D_06000600);
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_gjyo_bridge.c", 285); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_gjyo_bridge.c", 285);
} }

View file

@ -1,7 +1,7 @@
/* /*
* File: z_bg_gnd_nisekabe.c * File: z_bg_gnd_nisekabe.c
* Overlay: ovl_Bg_Gnd_Nisekabe * Overlay: ovl_Bg_Gnd_Nisekabe
* Description: 2D Stone Wall * Description: Ganon's Castle Fake Wall
*/ */
#include "z_bg_gnd_nisekabe.h" #include "z_bg_gnd_nisekabe.h"
@ -27,7 +27,7 @@ const ActorInit Bg_Gnd_Nisekabe_InitVars = {
(ActorFunc)BgGndNisekabe_Draw, (ActorFunc)BgGndNisekabe_Draw,
}; };
static u32 segmentAddr[] = { 0x06009230, 0x0600A390, 0x0600B4A0 }; static Gfx* sDLists[] = { 0x06009230, 0x0600A390, 0x0600B4A0 };
void BgGndNisekabe_Init(Actor* thisx, GlobalContext* globalCtx) { void BgGndNisekabe_Init(Actor* thisx, GlobalContext* globalCtx) {
BgGndNisekabe* this = THIS; BgGndNisekabe* this = THIS;
@ -54,8 +54,8 @@ void BgGndNisekabe_Draw(Actor* thisx, GlobalContext* globalCtx) {
u32 index = this->actor.params & 0xFF; u32 index = this->actor.params & 0xFF;
if ((this->actor.flags & 0x80) == 0x80) { if ((this->actor.flags & 0x80) == 0x80) {
Gfx_DrawDListXlu(globalCtx, segmentAddr[index]); Gfx_DrawDListXlu(globalCtx, sDLists[index]);
} else { } else {
Gfx_DrawDListOpa(globalCtx, segmentAddr[index]); Gfx_DrawDListOpa(globalCtx, sDLists[index]);
} }
} }

View file

@ -17,7 +17,7 @@ void BgHakaMegane_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_8087DB24(BgHakaMegane* this, GlobalContext* globalCtx); void func_8087DB24(BgHakaMegane* this, GlobalContext* globalCtx);
void func_8087DBF0(BgHakaMegane* this, GlobalContext* globalCtx); void func_8087DBF0(BgHakaMegane* this, GlobalContext* globalCtx);
void func_8087DC64(BgHakaMegane* this, GlobalContext* globalCtx); void BgHakaMegane_DoNothing(BgHakaMegane* this, GlobalContext* globalCtx);
const ActorInit Bg_Haka_Megane_InitVars = { const ActorInit Bg_Haka_Megane_InitVars = {
ACTOR_BG_HAKA_MEGANE, ACTOR_BG_HAKA_MEGANE,
@ -31,26 +31,26 @@ const ActorInit Bg_Haka_Megane_InitVars = {
NULL, NULL,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
}; };
static UNK_TYPE collisions[] = { static UNK_PTR sDynaAllocArg0[] = {
0x06001830, 0x06001AB8, 0x00000000, 0x06004330, 0x060044D0, 0x00000000, 0x06004780, 0x06001830, 0x06001AB8, 0x00000000, 0x06004330, 0x060044D0, 0x00000000, 0x06004780,
0x06004940, 0x00000000, 0x06004B00, 0x00000000, 0x06004CC0, 0x00000000, 0x06004940, 0x00000000, 0x06004B00, 0x00000000, 0x06004CC0, 0x00000000,
}; };
static UNK_TYPE dlists[] = { static Gfx* sDLists[] = {
0x06001060, 0x06001920, 0x060003F0, 0x060040F0, 0x060043B0, 0x06001120, 0x060045A0, 0x06001060, 0x06001920, 0x060003F0, 0x060040F0, 0x060043B0, 0x06001120, 0x060045A0,
0x060047F0, 0x060018F0, 0x060049B0, 0x06003CF0, 0x06004B70, 0x06002ED0, 0x060047F0, 0x060018F0, 0x060049B0, 0x06003CF0, 0x06004B70, 0x06002ED0,
}; };
extern UNK_TYPE D_06001250; extern Gfx D_06001250[];
void BgHakaMegane_Init(Actor* thisx, GlobalContext* globalCtx) { void BgHakaMegane_Init(Actor* thisx, GlobalContext* globalCtx) {
BgHakaMegane* this = THIS; BgHakaMegane* this = THIS;
Actor_ProcessInitChain(thisx, initChain); Actor_ProcessInitChain(thisx, sInitChain);
DynaPolyInfo_SetActorMove(&this->dyna, 0); DynaPolyInfo_SetActorMove(&this->dyna, 0);
if (thisx->params < 3) { if (thisx->params < 3) {
@ -74,7 +74,7 @@ void BgHakaMegane_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void func_8087DB24(BgHakaMegane* this, GlobalContext* globalCtx) { void func_8087DB24(BgHakaMegane* this, GlobalContext* globalCtx) {
s32 localC; s32 localC;
UNK_TYPE collision; UNK_TYPE arg0;
if (Object_IsLoaded(&globalCtx->objectCtx, this->objBankIndex)) { if (Object_IsLoaded(&globalCtx->objectCtx, this->objBankIndex)) {
this->dyna.actor.objBankIndex = this->objBankIndex; this->dyna.actor.objBankIndex = this->objBankIndex;
@ -82,20 +82,21 @@ void func_8087DB24(BgHakaMegane* this, GlobalContext* globalCtx) {
Actor_SetObjectDependency(globalCtx, &this->dyna.actor); Actor_SetObjectDependency(globalCtx, &this->dyna.actor);
if (globalCtx->roomCtx.curRoom.showInvisActors) { if (globalCtx->roomCtx.curRoom.showInvisActors) {
this->actionFunc = func_8087DBF0; this->actionFunc = func_8087DBF0;
collision = collisions[this->dyna.actor.params]; arg0 = sDynaAllocArg0[this->dyna.actor.params];
if (collision != 0) { if (arg0 != 0) {
DynaPolyInfo_Alloc(collision, &localC); DynaPolyInfo_Alloc(arg0, &localC);
this->dyna.dynaPolyId = this->dyna.dynaPolyId =
DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, localC); DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, localC);
} }
} else { } else {
this->actionFunc = func_8087DC64; this->actionFunc = BgHakaMegane_DoNothing;
} }
} }
} }
void func_8087DBF0(BgHakaMegane* this, GlobalContext* globalCtx) { void func_8087DBF0(BgHakaMegane* this, GlobalContext* globalCtx) {
Actor* thisx = &this->dyna.actor; Actor* thisx = &this->dyna.actor;
if (globalCtx->actorCtx.unk_03 != 0) { if (globalCtx->actorCtx.unk_03 != 0) {
thisx->flags |= 0x80; thisx->flags |= 0x80;
func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId);
@ -105,7 +106,7 @@ void func_8087DBF0(BgHakaMegane* this, GlobalContext* globalCtx) {
} }
} }
void func_8087DC64(BgHakaMegane* this, GlobalContext* globalCtx) { void BgHakaMegane_DoNothing(BgHakaMegane* this, GlobalContext* globalCtx) {
} }
void BgHakaMegane_Update(Actor* thisx, GlobalContext* globalCtx) { void BgHakaMegane_Update(Actor* thisx, GlobalContext* globalCtx) {
@ -118,12 +119,12 @@ void BgHakaMegane_Draw(Actor* thisx, GlobalContext* globalCtx) {
BgHakaMegane* this = THIS; BgHakaMegane* this = THIS;
if ((thisx->flags & 0x80) == 0x80) { if ((thisx->flags & 0x80) == 0x80) {
Gfx_DrawDListXlu(globalCtx, dlists[thisx->params]); Gfx_DrawDListXlu(globalCtx, sDLists[thisx->params]);
} else { } else {
Gfx_DrawDListOpa(globalCtx, dlists[thisx->params]); Gfx_DrawDListOpa(globalCtx, sDLists[thisx->params]);
} }
if (thisx->params == 0) { if (thisx->params == 0) {
Gfx_DrawDListXlu(globalCtx, &D_06001250); Gfx_DrawDListXlu(globalCtx, D_06001250);
} }
} }

View file

@ -1,7 +1,7 @@
/* /*
* File: z_bg_hidan_firewall.c * File: z_bg_hidan_firewall.c
* Overlay: ovl_Bg_Hidan_Firewall * Overlay: ovl_Bg_Hidan_Firewall
* Description: Proximity Flame Wall * Description: Proximity Triggered Flame Wall
*/ */
#include "z_bg_hidan_firewall.h" #include "z_bg_hidan_firewall.h"
@ -36,13 +36,13 @@ const ActorInit Bg_Hidan_Firewall_InitVars = {
NULL, NULL,
}; };
static ColliderCylinderInit cylinderInitData = { static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK10, 0x11, 0x00, 0x09, 0x20, COLSHAPE_CYLINDER }, { COLTYPE_UNK10, 0x11, 0x00, 0x09, 0x20, COLSHAPE_CYLINDER },
{ 0x00, { 0x20000000, 0x01, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x19, 0x00, 0x01 }, { 0x00, { 0x20000000, 0x01, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x19, 0x00, 0x01 },
{ 30, 83, 0, { 0 } }, { 30, 83, 0, { 0 } },
}; };
static CollisionCheckInfoInit colChkInfoInit = { static CollisionCheckInfoInit sColChkInfoInit = {
0x01, 0x01,
0x0050, 0x0050,
0x0064, 0x0064,
@ -63,11 +63,11 @@ void BgHidanFirewall_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_150 = 0; this->unk_150 = 0;
Collider_InitCylinder(globalCtx, &this->collider); Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInitData); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
this->collider.dim.pos.y = this->actor.posRot.pos.y; this->collider.dim.pos.y = this->actor.posRot.pos.y;
func_80061ED4(&this->actor.colChkInfo, NULL, &colChkInfoInit); func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
this->actionFunc = BgHidanFirewall_Wait; this->actionFunc = BgHidanFirewall_Wait;
} }

View file

@ -1,7 +1,7 @@
/* /*
* File: z_bg_hidan_fslift.c * File: z_bg_hidan_fslift.c
* Overlay: Bg_Hidan_Fslift * Overlay: Bg_Hidan_Fslift
* Description: * Description: Hookshot Elevator
*/ */
#include "z_bg_hidan_fslift.h" #include "z_bg_hidan_fslift.h"
@ -19,8 +19,8 @@ void func_80886FCC(BgHidanFslift* this, GlobalContext* globalCtx);
void func_8088706C(BgHidanFslift* this, GlobalContext* globalCtx); void func_8088706C(BgHidanFslift* this, GlobalContext* globalCtx);
void func_808870D8(BgHidanFslift* this, GlobalContext* globalCtx); void func_808870D8(BgHidanFslift* this, GlobalContext* globalCtx);
extern u32 D_0600B630; extern Gfx D_0600B630[];
extern u32 D_0600E1E8; extern UNK_TYPE D_0600E1E8;
const ActorInit Bg_Hidan_Fslift_InitVars = { const ActorInit Bg_Hidan_Fslift_InitVars = {
ACTOR_BG_HIDAN_FSLIFT, ACTOR_BG_HIDAN_FSLIFT,
@ -34,7 +34,7 @@ const ActorInit Bg_Hidan_Fslift_InitVars = {
(ActorFunc)BgHidanFslift_Draw, (ActorFunc)BgHidanFslift_Draw,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F8, 300, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 300, ICHAIN_CONTINUE),
ICHAIN_F32(unk_FC, 350, ICHAIN_CONTINUE), ICHAIN_F32(unk_FC, 350, ICHAIN_CONTINUE),
@ -47,7 +47,7 @@ void BgHidanFslift_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 local_c = 0; s32 local_c = 0;
s32 pad2; s32 pad2;
Actor_ProcessInitChain(thisx, initChain); Actor_ProcessInitChain(thisx, sInitChain);
DynaPolyInfo_SetActorMove(thisx, 1); DynaPolyInfo_SetActorMove(thisx, 1);
DynaPolyInfo_Alloc(&D_0600E1E8, &local_c); DynaPolyInfo_Alloc(&D_0600E1E8, &local_c);
this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c); this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c);
@ -83,23 +83,23 @@ void func_80886FB4(BgHidanFslift* this) {
} }
void func_80886FCC(BgHidanFslift* this, GlobalContext* globalCtx) { void func_80886FCC(BgHidanFslift* this, GlobalContext* globalCtx) {
UNK_TYPE somebool; s32 heightBool;
Actor* thisx = &this->dyna.actor; Actor* thisx = &this->dyna.actor;
DECR(this->unk_168); DECR(this->unk_168);
if (this->unk_168 == 0) { if (this->unk_168 == 0) {
somebool = 0; heightBool = false;
if ((thisx->posRot.pos.y - thisx->initPosRot.pos.y) < 0.5f) { if ((thisx->posRot.pos.y - thisx->initPosRot.pos.y) < 0.5f) {
somebool = 1; heightBool = true;
} }
if (func_80043590(thisx)) { if (func_80043590(thisx)) {
if (somebool) { if (heightBool) {
this->actionFunc = func_808870D8; this->actionFunc = func_808870D8;
return; return;
} }
} }
if (!somebool) { if (!heightBool) {
this->actionFunc = func_8088706C; this->actionFunc = func_8088706C;
} }
} }
@ -142,9 +142,7 @@ void BgHidanFslift_Update(Actor* thisx, GlobalContext* globalCtx) {
this->unk_16A = 3; this->unk_16A = 3;
} }
func_8005A77C(globalCtx->cameraPtrs[0], 0x30); func_8005A77C(globalCtx->cameraPtrs[0], 0x30);
return; } else if (func_8004356C(thisx) == 0) {
}
if (func_8004356C(thisx) == 0) {
if (this->unk_16A != 0) { if (this->unk_16A != 0) {
func_8005A77C(globalCtx->cameraPtrs[0], 3); func_8005A77C(globalCtx->cameraPtrs[0], 3);
} }
@ -153,5 +151,5 @@ void BgHidanFslift_Update(Actor* thisx, GlobalContext* globalCtx) {
} }
void BgHidanFslift_Draw(Actor* thisx, GlobalContext* globalCtx) { void BgHidanFslift_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx_DrawDListOpa(globalCtx, &D_0600B630); Gfx_DrawDListOpa(globalCtx, D_0600B630);
} }

View file

@ -22,11 +22,7 @@ void func_80889C18(BgHidanKousi* this, GlobalContext* globalCtx);
void func_80889C90(BgHidanKousi* this, GlobalContext* globalCtx); void func_80889C90(BgHidanKousi* this, GlobalContext* globalCtx);
void func_80889D28(BgHidanKousi* this, GlobalContext* globalCtx); void func_80889D28(BgHidanKousi* this, GlobalContext* globalCtx);
f32 D_80889E40[] = { f32 D_80889E40[] = { 120.0f, 150.0f, 150.0f };
120.0f,
150.0f,
150.0f,
};
const ActorInit Bg_Hidan_Kousi_InitVars = { const ActorInit Bg_Hidan_Kousi_InitVars = {
ACTOR_BG_HIDAN_KOUSI, ACTOR_BG_HIDAN_KOUSI,
@ -40,22 +36,24 @@ const ActorInit Bg_Hidan_Kousi_InitVars = {
(ActorFunc)BgHidanKousi_Draw, (ActorFunc)BgHidanKousi_Draw,
}; };
static InitChainEntry D_80889E6C[] = { static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
}; };
u32 D_80889E70[] = { UNK_PTR D_80889E70[] = {
0x0600E2CC, 0x0600E2CC,
0x0600E380, 0x0600E380,
0x0600E430, 0x0600E430,
}; };
s16 D_80889E7C[] = { s16 D_80889E7C[] = {
0x4000, 0x4000,
0xC000, 0xC000,
0xC000, 0xC000,
0x0000, 0x0000,
}; };
u32 D_80889E84[] = {
Gfx* D_80889E84[] = {
0x0600C798, 0x0600C798,
0x0600BFA8, 0x0600BFA8,
0x0600BB58, 0x0600BB58,
@ -75,7 +73,7 @@ void BgHidanKousi_Init(Actor* thisx, GlobalContext* globalCtx) {
osSyncPrintf("◯◯◯炎の神殿オブジェクト【格子(arg_data : %0x)】出現 (%d %d)\n", thisx->params, thisx->params & 0xFF, osSyncPrintf("◯◯◯炎の神殿オブジェクト【格子(arg_data : %0x)】出現 (%d %d)\n", thisx->params, thisx->params & 0xFF,
((s32)thisx->params >> 8) & 0xFF); ((s32)thisx->params >> 8) & 0xFF);
Actor_ProcessInitChain(thisx, D_80889E6C); Actor_ProcessInitChain(thisx, sInitChain);
if (((thisx->params & 0xFF) < 0) || ((thisx->params & 0xFF) >= 3)) { if (((thisx->params & 0xFF) < 0) || ((thisx->params & 0xFF) >= 3)) {
osSyncPrintf("arg_data おかしい 【格子】\n"); osSyncPrintf("arg_data おかしい 【格子】\n");
} }
@ -149,6 +147,7 @@ void func_80889D28(BgHidanKousi* this, GlobalContext* globalCtx) {
void BgHidanKousi_Update(Actor* thisx, GlobalContext* globalCtx) { void BgHidanKousi_Update(Actor* thisx, GlobalContext* globalCtx) {
BgHidanKousi* this = THIS; BgHidanKousi* this = THIS;
this->actionFunc(this, globalCtx); this->actionFunc(this, globalCtx);
} }

View file

@ -31,19 +31,19 @@ const ActorInit Bg_Hidan_Syoku_InitVars = {
(ActorFunc)BgHidanSyoku_Draw, (ActorFunc)BgHidanSyoku_Draw,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
}; };
extern UNK_PTR D_0600A7E0; extern Gfx D_0600A7E0[];
extern UNK_PTR D_0600E568; extern UNK_TYPE D_0600E568;
void BgHidanSyoku_Init(Actor* thisx, GlobalContext* globalCtx) { void BgHidanSyoku_Init(Actor* thisx, GlobalContext* globalCtx) {
BgHidanSyoku* this = THIS; BgHidanSyoku* this = THIS;
s32 pad; s32 pad;
u32 local_c = 0; u32 local_c = 0;
Actor_ProcessInitChain(&this->dyna.actor, initChain); Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyInfo_SetActorMove(&this->dyna, 1); DynaPolyInfo_SetActorMove(&this->dyna, 1);
DynaPolyInfo_Alloc(&D_0600E568, &local_c); DynaPolyInfo_Alloc(&D_0600E568, &local_c);
this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, local_c); this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, local_c);
@ -117,9 +117,7 @@ void BgHidanSyoku_Update(Actor* thisx, GlobalContext* globalCtx) {
this->unk_168 = 3; this->unk_168 = 3;
} }
func_8005A77C(globalCtx->cameraPtrs[0], 0x30); func_8005A77C(globalCtx->cameraPtrs[0], 0x30);
return; } else if (!func_8004356C(&this->dyna.actor)) {
}
if (!func_8004356C(&this->dyna.actor)) {
if (this->unk_168 != 0) { if (this->unk_168 != 0) {
func_8005A77C(globalCtx->cameraPtrs[0], 3); func_8005A77C(globalCtx->cameraPtrs[0], 3);
} }
@ -128,5 +126,5 @@ void BgHidanSyoku_Update(Actor* thisx, GlobalContext* globalCtx) {
} }
void BgHidanSyoku_Draw(Actor* thisx, GlobalContext* globalCtx) { void BgHidanSyoku_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx_DrawDListOpa(globalCtx, &D_0600A7E0); Gfx_DrawDListOpa(globalCtx, D_0600A7E0);
} }

View file

@ -1,7 +1,7 @@
/* /*
* File: z_bg_jya_amishutter.c * File: z_bg_jya_amishutter.c
* Overlay: Bg_Jya_Amishutter * Overlay: Bg_Jya_Amishutter
* Description: Circular Metal Grate (Spirit Temple) * Description: Circular metal grate. Lifts up when you get close to it.
*/ */
#include "z_bg_jya_amishutter.h" #include "z_bg_jya_amishutter.h"
@ -36,7 +36,7 @@ const ActorInit Bg_Jya_Amishutter_InitVars = {
(ActorFunc)BgJyaAmishutter_Draw, (ActorFunc)BgJyaAmishutter_Draw,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F4, 1000, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 1000, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F8, 200, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 200, ICHAIN_CONTINUE),
@ -44,7 +44,7 @@ static InitChainEntry initChain[] = {
}; };
extern UNK_TYPE D_0600C4C8; extern UNK_TYPE D_0600C4C8;
extern UNK_TYPE D_0600C0A0; extern Gfx D_0600C0A0[];
void func_808932C0(BgJyaAmishutter* this, GlobalContext* globalCtx, u32 collision, DynaPolyMoveFlag flag) { void func_808932C0(BgJyaAmishutter* this, GlobalContext* globalCtx, u32 collision, DynaPolyMoveFlag flag) {
s16 pad1; s16 pad1;
@ -64,7 +64,7 @@ void BgJyaAmishutter_Init(Actor* thisx, GlobalContext* globalCtx) {
BgJyaAmishutter* this = THIS; BgJyaAmishutter* this = THIS;
func_808932C0(this, globalCtx, &D_0600C4C8, 0); func_808932C0(this, globalCtx, &D_0600C4C8, 0);
Actor_ProcessInitChain(&this->actor, initChain); Actor_ProcessInitChain(&this->actor, sInitChain);
func_808933BC(this); func_808933BC(this);
} }
@ -129,5 +129,5 @@ void BgJyaAmishutter_Update(Actor* thisx, GlobalContext* globalCtx) {
} }
void BgJyaAmishutter_Draw(Actor* thisx, GlobalContext* globalCtx) { void BgJyaAmishutter_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx_DrawDListOpa(globalCtx, &D_0600C0A0); Gfx_DrawDListOpa(globalCtx, D_0600C0A0);
} }

View file

@ -33,23 +33,23 @@ const ActorInit Bg_Jya_Kanaami_InitVars = {
(ActorFunc)BgJyaKanaami_Draw, (ActorFunc)BgJyaKanaami_Draw,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F4, 1000, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 1000, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F8, 700, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 700, ICHAIN_CONTINUE),
ICHAIN_F32(unk_FC, 1000, ICHAIN_STOP), ICHAIN_F32(unk_FC, 1000, ICHAIN_STOP),
}; };
extern u32 D_0600F000; extern Gfx D_0600F000[];
extern u32 D_0600F208; extern UNK_TYPE D_0600F208;
void func_80899740(BgJyaKanaami* this, GlobalContext* globalCtx, u32 collision, DynaPolyMoveFlag flag) { void func_80899740(BgJyaKanaami* this, GlobalContext* globalCtx, UNK_TYPE arg2, DynaPolyMoveFlag flag) {
s32 pad; s32 pad;
s32 local_c = 0; s32 local_c = 0;
s32 pad2; s32 pad2;
DynaPolyInfo_SetActorMove(&this->actor, flag); DynaPolyInfo_SetActorMove(&this->actor, flag);
DynaPolyInfo_Alloc(collision, &local_c); DynaPolyInfo_Alloc(arg2, &local_c);
this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, local_c); this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, local_c);
if (this->dynaPolyId == 0x32) { if (this->dynaPolyId == 0x32) {
osSyncPrintf("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_kanaami.c", 145, osSyncPrintf("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_kanaami.c", 145,
@ -61,7 +61,7 @@ void BgJyaKanaami_Init(Actor* thisx, GlobalContext* globalCtx) {
BgJyaKanaami* this = THIS; BgJyaKanaami* this = THIS;
func_80899740(this, globalCtx, &D_0600F208, 0); func_80899740(this, globalCtx, &D_0600F208, 0);
Actor_ProcessInitChain(&this->actor, initChain); Actor_ProcessInitChain(&this->actor, sInitChain);
if (Flags_GetSwitch(globalCtx, this->actor.params & 0x3F)) { if (Flags_GetSwitch(globalCtx, this->actor.params & 0x3F)) {
func_80899A08(this); func_80899A08(this);
} else { } else {
@ -127,5 +127,5 @@ void BgJyaKanaami_Update(Actor* thisx, GlobalContext* globalCtx) {
} }
void BgJyaKanaami_Draw(Actor* thisx, GlobalContext* globalCtx) { void BgJyaKanaami_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx_DrawDListOpa(globalCtx, &D_0600F000); Gfx_DrawDListOpa(globalCtx, D_0600F000);
} }

View file

@ -27,19 +27,19 @@ const ActorInit Bg_Menkuri_Kaiten_InitVars = {
(ActorFunc)BgMenkuriKaiten_Draw, (ActorFunc)BgMenkuriKaiten_Draw,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
}; };
extern u32 D_060038D0; extern Gfx D_060038D0[];
extern u32 D_060042D8; extern UNK_TYPE D_060042D8;
void BgMenkuriKaiten_Init(Actor* thisx, GlobalContext* globalCtx) { void BgMenkuriKaiten_Init(Actor* thisx, GlobalContext* globalCtx) {
BgMenkuriKaiten* this = THIS; BgMenkuriKaiten* this = THIS;
s32 pad; s32 pad;
u32 local_c = 0; u32 local_c = 0;
Actor_ProcessInitChain(&this->actor, initChain); Actor_ProcessInitChain(&this->actor, sInitChain);
DynaPolyInfo_SetActorMove(&this->actor, 3); DynaPolyInfo_SetActorMove(&this->actor, 3);
DynaPolyInfo_Alloc(&D_060042D8, &local_c); DynaPolyInfo_Alloc(&D_060042D8, &local_c);
this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, local_c); this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, local_c);
@ -61,5 +61,5 @@ void BgMenkuriKaiten_Update(Actor* thisx, GlobalContext* globalCtx) {
} }
void BgMenkuriKaiten_Draw(Actor* thisx, GlobalContext* globalCtx) { void BgMenkuriKaiten_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx_DrawDListOpa(globalCtx, &D_060038D0); Gfx_DrawDListOpa(globalCtx, D_060038D0);
} }

View file

@ -27,13 +27,13 @@ const ActorInit Bg_Mizu_Uzu_InitVars = {
(ActorFunc)BgMizuUzu_Draw, (ActorFunc)BgMizuUzu_Draw,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_F32(unk_F8, 1000, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 1000, ICHAIN_CONTINUE),
ICHAIN_F32(unk_FC, 1000, ICHAIN_CONTINUE), ICHAIN_F32(unk_FC, 1000, ICHAIN_CONTINUE),
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
}; };
extern u32 D_060074EC; extern UNK_TYPE D_060074EC;
void func_8089F788(BgMizuUzu* this, GlobalContext* globalCtx); void func_8089F788(BgMizuUzu* this, GlobalContext* globalCtx);
@ -43,7 +43,7 @@ void BgMizuUzu_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 local_c = 0; s32 local_c = 0;
s32 pad2; s32 pad2;
Actor_ProcessInitChain(thisx, initChain); Actor_ProcessInitChain(thisx, sInitChain);
DynaPolyInfo_SetActorMove(thisx, 0); DynaPolyInfo_SetActorMove(thisx, 0);
DynaPolyInfo_Alloc(&D_060074EC, &local_c); DynaPolyInfo_Alloc(&D_060074EC, &local_c);
this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c); this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c);

View file

@ -30,20 +30,21 @@ const ActorInit Bg_Mjin_InitVars = {
NULL, NULL,
}; };
extern u32 D_06000000; extern UNK_TYPE D_06000000;
extern u32 D_06000140; extern Gfx D_06000140[];
extern u32 D_06000330; extern Gfx D_06000330[];
extern u32 D_06000658; extern UNK_TYPE D_06000330_;
extern UNK_TYPE D_06000658;
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F4, 4000, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 4000, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F8, 400, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 400, ICHAIN_CONTINUE),
ICHAIN_F32(unk_FC, 400, ICHAIN_STOP), ICHAIN_F32(unk_FC, 400, ICHAIN_STOP),
}; };
static s16 objectTbl[] = { OBJECT_MJIN_FLASH, OBJECT_MJIN_DARK, OBJECT_MJIN_FLAME, static s16 sObjectIDs[] = { OBJECT_MJIN_FLASH, OBJECT_MJIN_DARK, OBJECT_MJIN_FLAME,
OBJECT_MJIN_ICE, OBJECT_MJIN_SOUL, OBJECT_MJIN_WIND }; OBJECT_MJIN_ICE, OBJECT_MJIN_SOUL, OBJECT_MJIN_WIND };
void BgMjin_SetupAction(BgMjin* this, BgMjinActionFunc actionFunc) { void BgMjin_SetupAction(BgMjin* this, BgMjinActionFunc actionFunc) {
this->actionFunc = actionFunc; this->actionFunc = actionFunc;
@ -53,7 +54,7 @@ void BgMjin_Init(Actor* thisx, GlobalContext* globalCtx) {
BgMjin* this = THIS; BgMjin* this = THIS;
s8 objBankIndex; s8 objBankIndex;
Actor_ProcessInitChain(thisx, initChain); Actor_ProcessInitChain(thisx, sInitChain);
objBankIndex = Object_GetIndex(&globalCtx->objectCtx, (thisx->params != 0 ? OBJECT_MJIN : OBJECT_MJIN_OKA)); objBankIndex = Object_GetIndex(&globalCtx->objectCtx, (thisx->params != 0 ? OBJECT_MJIN : OBJECT_MJIN_OKA));
this->objBankIndex = objBankIndex; this->objBankIndex = objBankIndex;
if (objBankIndex < 0) { if (objBankIndex < 0) {
@ -71,7 +72,7 @@ void BgMjin_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void func_808A0850(BgMjin* this, GlobalContext* globalCtx) { void func_808A0850(BgMjin* this, GlobalContext* globalCtx) {
u32 local_c; u32 local_c;
u32 collision; UNK_TYPE arg0;
if (Object_IsLoaded(&globalCtx->objectCtx, this->objBankIndex)) { if (Object_IsLoaded(&globalCtx->objectCtx, this->objBankIndex)) {
local_c = 0; local_c = 0;
@ -79,8 +80,8 @@ void func_808A0850(BgMjin* this, GlobalContext* globalCtx) {
this->dyna.actor.objBankIndex = this->objBankIndex; this->dyna.actor.objBankIndex = this->objBankIndex;
Actor_SetObjectDependency(globalCtx, &this->dyna.actor); Actor_SetObjectDependency(globalCtx, &this->dyna.actor);
DynaPolyInfo_SetActorMove(&this->dyna.actor, 0); DynaPolyInfo_SetActorMove(&this->dyna.actor, 0);
collision = this->dyna.actor.params != 0 ? &D_06000658 : &D_06000330; arg0 = this->dyna.actor.params != 0 ? &D_06000658 : &D_06000330_;
DynaPolyInfo_Alloc(collision, &local_c); DynaPolyInfo_Alloc(arg0, &local_c);
this->dyna.dynaPolyId = this->dyna.dynaPolyId =
DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, local_c); DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, local_c);
BgMjin_SetupAction(this, func_808A0920); BgMjin_SetupAction(this, func_808A0920);
@ -106,14 +107,14 @@ void BgMjin_Draw(Actor* thisx, GlobalContext* globalCtx) {
Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_mjin.c", 250); Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_mjin.c", 250);
if (thisx->params != 0) { if (thisx->params != 0) {
objBankIndex = Object_GetIndex(&globalCtx->objectCtx, objectTbl[thisx->params - 1]); objBankIndex = Object_GetIndex(&globalCtx->objectCtx, sObjectIDs[thisx->params - 1]);
if (objBankIndex >= 0) { if (objBankIndex >= 0) {
gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[objBankIndex].segment); gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[objBankIndex].segment);
} }
gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(&D_06000000)); gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(&D_06000000));
dlist = &D_06000330; dlist = D_06000330;
} else { } else {
dlist = &D_06000140; dlist = D_06000140;
} }
func_80093D18(globalCtx->state.gfxCtx); func_80093D18(globalCtx->state.gfxCtx);
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_mjin.c", 285), gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_mjin.c", 285),

View file

@ -29,10 +29,10 @@ const ActorInit Bg_Pushbox_InitVars = {
(ActorFunc)BgPushbox_Draw, (ActorFunc)BgPushbox_Draw,
}; };
extern u32 D_06000000; extern Gfx D_06000000[];
extern u32 D_06000350; extern UNK_TYPE D_06000350;
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_STOP), ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_STOP),
}; };
@ -46,7 +46,7 @@ void BgPushbox_Init(Actor* thisx, GlobalContext* globalCtx) {
u32 local_c = 0; u32 local_c = 0;
s32 pad2; s32 pad2;
Actor_ProcessInitChain(thisx, initChain); Actor_ProcessInitChain(thisx, sInitChain);
DynaPolyInfo_SetActorMove(&this->dyna, 0); DynaPolyInfo_SetActorMove(&this->dyna, 0);
DynaPolyInfo_Alloc(&D_06000350, &local_c); DynaPolyInfo_Alloc(&D_06000350, &local_c);
this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c); this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c);

View file

@ -27,24 +27,24 @@ const ActorInit Bg_Spot00_Break_InitVars = {
(ActorFunc)BgSpot00Break_Draw, (ActorFunc)BgSpot00Break_Draw,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_F32(unk_F8, 1200, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 1200, ICHAIN_CONTINUE),
ICHAIN_F32(unk_FC, 1200, ICHAIN_CONTINUE), ICHAIN_F32(unk_FC, 1200, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F4, 2000, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 2000, ICHAIN_CONTINUE),
ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP), ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP),
}; };
extern D_06000AF0; // segmented address: 0x06000AF0 extern UNK_TYPE D_06000AF0;
extern D_06000908; // segmented address: 0x06000908 extern UNK_TYPE D_06000908;
extern D_06000980; // segmented address: 0x06000980 extern Gfx D_06000980[];
extern D_06000440; // segmented address: 0x06000440 extern Gfx D_06000440[];
void BgSpot00Break_Init(Actor* thisx, GlobalContext* globalCtx) { void BgSpot00Break_Init(Actor* thisx, GlobalContext* globalCtx) {
BgSpot00Break* this = THIS; BgSpot00Break* this = THIS;
s32 pad; s32 pad;
u32 local_c = 0; u32 local_c = 0;
Actor_ProcessInitChain(&this->actor, initChain); Actor_ProcessInitChain(&this->actor, sInitChain);
DynaPolyInfo_SetActorMove(&this->actor, 0); DynaPolyInfo_SetActorMove(&this->actor, 0);
if (this->actor.params == 1) { if (this->actor.params == 1) {
@ -73,8 +73,8 @@ void BgSpot00Break_Draw(Actor* thisx, GlobalContext* globalCtx) {
BgSpot00Break* this = THIS; BgSpot00Break* this = THIS;
if (this->actor.params == 1) { if (this->actor.params == 1) {
Gfx_DrawDListOpa(globalCtx, &D_06000980); Gfx_DrawDListOpa(globalCtx, D_06000980);
} else { } else {
Gfx_DrawDListOpa(globalCtx, &D_06000440); Gfx_DrawDListOpa(globalCtx, D_06000440);
} }
} }

View file

@ -29,14 +29,14 @@ const ActorInit Bg_Spot01_Fusya_InitVars = {
(ActorFunc)BgSpot01Fusya_Draw, (ActorFunc)BgSpot01Fusya_Draw,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F4, 12800, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 12800, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F8, 1300, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 1300, ICHAIN_CONTINUE),
ICHAIN_F32(unk_FC, 1300, ICHAIN_STOP), ICHAIN_F32(unk_FC, 1300, ICHAIN_STOP),
}; };
extern u32 D_06000100; extern Gfx D_06000100[];
void BgSpot01Fusya_SetupAction(BgSpot01Fusya* this, BgSpot01FusyaActionFunc actionFunc) { void BgSpot01Fusya_SetupAction(BgSpot01Fusya* this, BgSpot01FusyaActionFunc actionFunc) {
this->actionFunc = actionFunc; this->actionFunc = actionFunc;
@ -45,7 +45,7 @@ void BgSpot01Fusya_SetupAction(BgSpot01Fusya* this, BgSpot01FusyaActionFunc acti
void BgSpot01Fusya_Init(Actor* thisx, GlobalContext* globalCtx) { void BgSpot01Fusya_Init(Actor* thisx, GlobalContext* globalCtx) {
BgSpot01Fusya* this = THIS; BgSpot01Fusya* this = THIS;
Actor_ProcessInitChain(&this->actor, initChain); Actor_ProcessInitChain(&this->actor, sInitChain);
this->unk_154 = 100.0f; this->unk_154 = 100.0f;
this->unk_158 = 100.0f; this->unk_158 = 100.0f;
this->unk_15C = 0.5f; this->unk_15C = 0.5f;
@ -86,7 +86,7 @@ void BgSpot01Fusya_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_spot01_fusya.c", 214), gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_spot01_fusya.c", 214),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxCtx->polyOpa.p++, &D_06000100); gSPDisplayList(gfxCtx->polyOpa.p++, D_06000100);
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_spot01_fusya.c", 219); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_spot01_fusya.c", 219);
} }

View file

@ -1,7 +1,7 @@
/* /*
* File: z_bg_spot01_idosoko.c * File: z_bg_spot01_idosoko.c
* Overlay: Bg_Spot01_Idosoko * Overlay: Bg_Spot01_Idosoko
* Description: Stone blocking entrance to Bottom of the Well * Description: Stone that blocks the entrance to Bottom of the Well
*/ */
#include "z_bg_spot01_idosoko.h" #include "z_bg_spot01_idosoko.h"
@ -29,11 +29,11 @@ const ActorInit Bg_Spot01_Idosoko_InitVars = {
(ActorFunc)BgSpot01Idosoko_Draw, (ActorFunc)BgSpot01Idosoko_Draw,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
}; };
extern u32 D_06003C64; extern UNK_TYPE D_06003C64;
void BgSpot01Idosoko_SetupAction(BgSpot01Idosoko* this, BgSpot01IdosokoActionFunc actionFunc) { void BgSpot01Idosoko_SetupAction(BgSpot01Idosoko* this, BgSpot01IdosokoActionFunc actionFunc) {
this->actionFunc = actionFunc; this->actionFunc = actionFunc;
@ -46,7 +46,7 @@ void BgSpot01Idosoko_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad2; s32 pad2;
DynaPolyInfo_SetActorMove(thisx, 1); DynaPolyInfo_SetActorMove(thisx, 1);
Actor_ProcessInitChain(thisx, initChain); Actor_ProcessInitChain(thisx, sInitChain);
DynaPolyInfo_Alloc(&D_06003C64, &local_c); DynaPolyInfo_Alloc(&D_06003C64, &local_c);
this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c); this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c);
if (LINK_IS_CHILD) { if (LINK_IS_CHILD) {

View file

@ -18,8 +18,8 @@ void func_808AE5A8(BgSpot05Soko* this, GlobalContext* globalCtx);
void func_808AE5B4(BgSpot05Soko* this, GlobalContext* globalCtx); void func_808AE5B4(BgSpot05Soko* this, GlobalContext* globalCtx);
void func_808AE630(BgSpot05Soko* this, GlobalContext* globalCtx); void func_808AE630(BgSpot05Soko* this, GlobalContext* globalCtx);
extern Gfx* D_060012C0; extern UNK_TYPE D_060012C0;
extern Gfx* D_06000918; extern UNK_TYPE D_06000918;
const ActorInit Bg_Spot05_Soko_InitVars = { const ActorInit Bg_Spot05_Soko_InitVars = {
ACTOR_BG_SPOT05_SOKO, ACTOR_BG_SPOT05_SOKO,
@ -33,11 +33,11 @@ const ActorInit Bg_Spot05_Soko_InitVars = {
(ActorFunc)BgSpot05Soko_Draw, (ActorFunc)BgSpot05Soko_Draw,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
}; };
static Gfx* dListTbl[] = { static Gfx* sDLists[] = {
0x06000840, 0x06000840,
0x06001190, 0x06001190,
}; };
@ -49,7 +49,7 @@ void BgSpot05Soko_Init(Actor* thisx, GlobalContext* globalCtx) {
u32 pad2; u32 pad2;
sp24 = 0; sp24 = 0;
Actor_ProcessInitChain(thisx, initChain); Actor_ProcessInitChain(thisx, sInitChain);
this->switchFlag = (thisx->params >> 8) & 0xFF; this->switchFlag = (thisx->params >> 8) & 0xFF;
thisx->params &= 0xFF; thisx->params &= 0xFF;
DynaPolyInfo_SetActorMove(thisx, DPM_UNK); DynaPolyInfo_SetActorMove(thisx, DPM_UNK);
@ -83,6 +83,7 @@ void func_808AE5A8(BgSpot05Soko* this, GlobalContext* globalCtx) {
void func_808AE5B4(BgSpot05Soko* this, GlobalContext* globalCtx) { void func_808AE5B4(BgSpot05Soko* this, GlobalContext* globalCtx) {
Actor* thisx = &this->dyna.actor; Actor* thisx = &this->dyna.actor;
if (Flags_GetSwitch(globalCtx, this->switchFlag)) { if (Flags_GetSwitch(globalCtx, this->switchFlag)) {
Audio_PlaySoundAtPosition(globalCtx, &thisx->posRot.pos, 30, NA_SE_EV_METALDOOR_CLOSE); Audio_PlaySoundAtPosition(globalCtx, &thisx->posRot.pos, 30, NA_SE_EV_METALDOOR_CLOSE);
Actor_SetHeight(thisx, 50.0f); Actor_SetHeight(thisx, 50.0f);
@ -108,5 +109,5 @@ void BgSpot05Soko_Update(Actor* thisx, GlobalContext* globalCtx) {
} }
void BgSpot05Soko_Draw(Actor* thisx, GlobalContext* globalCtx) { void BgSpot05Soko_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx_DrawDListOpa(globalCtx, dListTbl[thisx->params]); Gfx_DrawDListOpa(globalCtx, sDLists[thisx->params]);
} }

View file

@ -31,7 +31,7 @@ const ActorInit Bg_Spot09_Obj_InitVars = {
(ActorFunc)BgSpot09Obj_Draw, (ActorFunc)BgSpot09Obj_Draw,
}; };
static u32 D_808B1F90[] = { 0x00000000, 0x06005520, 0x0600283C, 0x06008458, 0x06007580 }; static UNK_PTR D_808B1F90[] = { NULL, 0x06005520, 0x0600283C, 0x06008458, 0x06007580 };
static s32 (*D_808B1FA4[])(BgSpot09Obj* this, GlobalContext* globalCtx) = { static s32 (*D_808B1FA4[])(BgSpot09Obj* this, GlobalContext* globalCtx) = {
func_808B1BEC, func_808B1BEC,
@ -39,21 +39,21 @@ static s32 (*D_808B1FA4[])(BgSpot09Obj* this, GlobalContext* globalCtx) = {
func_808B1BA0, func_808B1BA0,
}; };
static InitChainEntry initChain1[] = { static InitChainEntry sInitChain1[] = {
ICHAIN_F32(unk_F4, 7200, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 7200, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F8, 3000, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 3000, ICHAIN_CONTINUE),
ICHAIN_F32(unk_FC, 7200, ICHAIN_STOP), ICHAIN_F32(unk_FC, 7200, ICHAIN_STOP),
}; };
static InitChainEntry initChain2[] = { static InitChainEntry sInitChain2[] = {
ICHAIN_F32(unk_F4, 7200, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 7200, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F8, 800, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 800, ICHAIN_CONTINUE),
ICHAIN_F32(unk_FC, 1500, ICHAIN_STOP), ICHAIN_F32(unk_FC, 1500, ICHAIN_STOP),
}; };
static u32 dlists[] = { 0x06000100, 0x06003970, 0x06001120, 0x06007D40, 0x06006210 }; static Gfx* sDLists[] = { 0x06000100, 0x06003970, 0x06001120, 0x06007D40, 0x06006210 };
extern UNK_TYPE D_06008010; extern Gfx D_06008010[];
s32 func_808B1AE0(BgSpot09Obj* this, GlobalContext* globalCtx) { s32 func_808B1AE0(BgSpot09Obj* this, GlobalContext* globalCtx) {
s32 carpentersRescued; s32 carpentersRescued;
@ -119,12 +119,12 @@ s32 func_808B1C70(BgSpot09Obj* this, GlobalContext* globalCtx) {
} }
s32 func_808B1CEC(BgSpot09Obj* this, GlobalContext* globalCtx) { s32 func_808B1CEC(BgSpot09Obj* this, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->dyna.actor, &initChain1); Actor_ProcessInitChain(&this->dyna.actor, sInitChain1);
return 1; return 1;
} }
s32 func_808B1D18(BgSpot09Obj* this, GlobalContext* globalCtx) { s32 func_808B1D18(BgSpot09Obj* this, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->dyna.actor, &initChain2); Actor_ProcessInitChain(&this->dyna.actor, sInitChain2);
return 1; return 1;
} }
@ -171,7 +171,7 @@ void BgSpot09Obj_Draw(Actor* thisx, GlobalContext* globalCtx) {
GraphicsContext* gfxCtx; GraphicsContext* gfxCtx;
Gfx* dispRefs[3]; Gfx* dispRefs[3];
Gfx_DrawDListOpa(globalCtx, dlists[thisx->params]); Gfx_DrawDListOpa(globalCtx, sDLists[thisx->params]);
if (thisx->params == 3) { if (thisx->params == 3) {
gfxCtx = globalCtx->state.gfxCtx; gfxCtx = globalCtx->state.gfxCtx;
Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_spot09_obj.c", 388); Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_spot09_obj.c", 388);
@ -179,7 +179,7 @@ void BgSpot09Obj_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_spot09_obj.c", 391), gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_spot09_obj.c", 391),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxCtx->polyXlu.p++, &D_06008010); gSPDisplayList(gfxCtx->polyXlu.p++, D_06008010);
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_spot09_obj.c", 396); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_spot09_obj.c", 396);
} }

View file

@ -1,7 +1,7 @@
/* /*
* File: z_bg_spot12_gate.c * File: z_bg_spot12_gate.c
* Overlay: Bg_Spot12_Gate * Overlay: Bg_Spot12_Gate
* Description: * Description: Haunted Wasteland Gate
*/ */
#include "z_bg_spot12_gate.h" #include "z_bg_spot12_gate.h"
@ -36,14 +36,14 @@ const ActorInit Bg_Spot12_Gate_InitVars = {
(ActorFunc)BgSpot12Gate_Draw, (ActorFunc)BgSpot12Gate_Draw,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F4, 2500, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 2500, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F8, 500, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 500, ICHAIN_CONTINUE),
ICHAIN_F32(unk_FC, 1200, ICHAIN_STOP), ICHAIN_F32(unk_FC, 1200, ICHAIN_STOP),
}; };
extern UNK_TYPE D_06001080; extern Gfx D_06001080[];
extern UNK_TYPE D_060011EC; extern UNK_TYPE D_060011EC;
void func_808B2F90(BgSpot12Gate* this, GlobalContext* globalCtx, UNK_TYPE collision, DynaPolyMoveFlag flags) { void func_808B2F90(BgSpot12Gate* this, GlobalContext* globalCtx, UNK_TYPE collision, DynaPolyMoveFlag flags) {
@ -64,7 +64,7 @@ void BgSpot12Gate_Init(Actor* thisx, GlobalContext* globalCtx) {
BgSpot12Gate* this = THIS; BgSpot12Gate* this = THIS;
func_808B2F90(this, globalCtx, &D_060011EC, 0); func_808B2F90(this, globalCtx, &D_060011EC, 0);
Actor_ProcessInitChain(thisx, initChain); Actor_ProcessInitChain(thisx, sInitChain);
if (Flags_GetSwitch(globalCtx, thisx->params & 0x3F)) { if (Flags_GetSwitch(globalCtx, thisx->params & 0x3F)) {
func_808B3274(this); func_808B3274(this);
@ -147,5 +147,5 @@ void BgSpot12Gate_Update(Actor* thisx, GlobalContext* globalCtx) {
} }
void BgSpot12Gate_Draw(Actor* thisx, GlobalContext* globalCtx) { void BgSpot12Gate_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx_DrawDListOpa(globalCtx, &D_06001080); Gfx_DrawDListOpa(globalCtx, D_06001080);
} }

View file

@ -34,7 +34,7 @@ const ActorInit Bg_Spot12_Saku_InitVars = {
(ActorFunc)BgSpot12Saku_Draw, (ActorFunc)BgSpot12Saku_Draw,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F4, 1200, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 1200, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F8, 500, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 500, ICHAIN_CONTINUE),
@ -62,7 +62,7 @@ void BgSpot12Saku_Init(Actor* thisx, GlobalContext* globalCtx) {
BgSpot12Saku* this = THIS; BgSpot12Saku* this = THIS;
func_808B3420(this, globalCtx, &D_0600238C, 0); func_808B3420(this, globalCtx, &D_0600238C, 0);
Actor_ProcessInitChain(thisx, initChain); Actor_ProcessInitChain(thisx, sInitChain);
if (Flags_GetSwitch(globalCtx, thisx->params & 0x3F)) { if (Flags_GetSwitch(globalCtx, thisx->params & 0x3F)) {
func_808B3714(this); func_808B3714(this);
} else { } else {
@ -139,5 +139,5 @@ void BgSpot12Saku_Update(Actor* thisx, GlobalContext* globalCtx) {
} }
void BgSpot12Saku_Draw(Actor* thisx, GlobalContext* globalCtx) { void BgSpot12Saku_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx_DrawDListOpa(globalCtx, &D_06002260); Gfx_DrawDListOpa(globalCtx, D_06002260);
} }

View file

@ -31,8 +31,8 @@ const ActorInit Bg_Spot15_Saku_InitVars = {
(ActorFunc)BgSpot15Saku_Draw, (ActorFunc)BgSpot15Saku_Draw,
}; };
extern u32 D_060003C0; extern Gfx D_060003C0[];
extern u32 D_060004D0; extern UNK_TYPE D_060004D0;
void BgSpot15Saku_Init(Actor* thisx, GlobalContext* globalCtx) { void BgSpot15Saku_Init(Actor* thisx, GlobalContext* globalCtx) {
BgSpot15Saku* this = THIS; BgSpot15Saku* this = THIS;
@ -103,7 +103,7 @@ void BgSpot15Saku_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_spot15_saku.c", 263), gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_spot15_saku.c", 263),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxCtx->polyXlu.p++, &D_060003C0); gSPDisplayList(gfxCtx->polyXlu.p++, D_060003C0);
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_spot15_saku.c", 268); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_spot15_saku.c", 268);
} }

View file

@ -28,7 +28,7 @@ const ActorInit Bg_Spot17_Funen_InitVars = {
NULL, NULL,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
}; };
@ -37,7 +37,7 @@ extern Gfx D_06000B40[];
void BgSpot17Funen_Init(Actor* thisx, GlobalContext* globalCtx) { void BgSpot17Funen_Init(Actor* thisx, GlobalContext* globalCtx) {
BgSpot17Funen* this = THIS; BgSpot17Funen* this = THIS;
Actor_ProcessInitChain(&this->actor, initChain); Actor_ProcessInitChain(&this->actor, sInitChain);
osSyncPrintf("spot17 obj. 噴煙 (arg_data 0x%04x)\n", this->actor.params); osSyncPrintf("spot17 obj. 噴煙 (arg_data 0x%04x)\n", this->actor.params);
} }

View file

@ -1,7 +1,7 @@
/* /*
* File: z_bg_spot18_futa.c * File: z_bg_spot18_futa.c
* Overlay: ovl_Bg_Spot18_Futa * Overlay: ovl_Bg_Spot18_Futa
* Description: The lid to a goron jar. * Description: The lid to the spinning goron vase.
*/ */
#include "z_bg_spot18_futa.h" #include "z_bg_spot18_futa.h"
@ -27,15 +27,15 @@ const ActorInit Bg_Spot18_Futa_InitVars = {
(ActorFunc)BgSpot18Futa_Draw, (ActorFunc)BgSpot18Futa_Draw,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F4, 1000, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 1000, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F8, 500, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 500, ICHAIN_CONTINUE),
ICHAIN_F32(unk_FC, 1000, ICHAIN_STOP), ICHAIN_F32(unk_FC, 1000, ICHAIN_STOP),
}; };
extern u32 DL_SPOT18_FUTA; // 0x6000368 extern UNK_TYPE D_06000368;
extern u32 DL_SPOT18_FUTA2; // 0x6000150 extern Gfx D_06000150[];
void BgSpot18Futa_Init(Actor* thisx, GlobalContext* globalCtx) { void BgSpot18Futa_Init(Actor* thisx, GlobalContext* globalCtx) {
BgSpot18Futa* this = THIS; BgSpot18Futa* this = THIS;
@ -43,9 +43,9 @@ void BgSpot18Futa_Init(Actor* thisx, GlobalContext* globalCtx) {
u32 sp1C = 0; u32 sp1C = 0;
DynaPolyInfo_SetActorMove(&this->actor, 0); DynaPolyInfo_SetActorMove(&this->actor, 0);
DynaPolyInfo_Alloc(&DL_SPOT18_FUTA, &sp1C); DynaPolyInfo_Alloc(&D_06000368, &sp1C);
this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, sp1C); this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, sp1C);
Actor_ProcessInitChain(&this->actor, initChain); Actor_ProcessInitChain(&this->actor, sInitChain);
} }
void BgSpot18Futa_Destroy(Actor* thisx, GlobalContext* globalCtx) { void BgSpot18Futa_Destroy(Actor* thisx, GlobalContext* globalCtx) {
@ -71,5 +71,5 @@ void BgSpot18Futa_Update(Actor* thisx, GlobalContext* globalCtx) {
} }
void BgSpot18Futa_Draw(Actor* thisx, GlobalContext* globalCtx) { void BgSpot18Futa_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx_DrawDListOpa(globalCtx, &DL_SPOT18_FUTA2); Gfx_DrawDListOpa(globalCtx, D_06000150);
} }

View file

@ -19,7 +19,7 @@ void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx);
void func_808BB0AC(BgTokiSwd* this, GlobalContext* globalCtx); void func_808BB0AC(BgTokiSwd* this, GlobalContext* globalCtx);
void func_808BB128(BgTokiSwd* this, GlobalContext* globalCtx); void func_808BB128(BgTokiSwd* this, GlobalContext* globalCtx);
extern u32 D_06001BD0; extern Gfx D_06001BD0[];
#include "z_bg_toki_swd_cutscene_data.c" EARLY #include "z_bg_toki_swd_cutscene_data.c" EARLY
@ -35,20 +35,20 @@ const ActorInit Bg_Toki_Swd_InitVars = {
(ActorFunc)BgTokiSwd_Draw, (ActorFunc)BgTokiSwd_Draw,
}; };
static ColliderCylinderInit colliderInit = { static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x12, COLSHAPE_CYLINDER }, { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x12, COLSHAPE_CYLINDER },
{ 0x00, { 0xFFCFFFFF, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 0x00, { 0xFFCFFFFF, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x00, 0x01 },
{ 10, 70, 0, { 0 } } { 10, 70, 0, { 0 } }
}; };
static CollisionCheckInfoInit colChkInfoInit = { static CollisionCheckInfoInit sColChkInfoInit = {
0x0A, 0x0A,
0x0023, 0x0023,
0x0064, 0x0064,
0xFF, 0xFF,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 0x19, ICHAIN_STOP), ICHAIN_VEC3F_DIV1000(scale, 0x19, ICHAIN_STOP),
}; };
@ -60,7 +60,7 @@ void BgTokiSwd_Init(Actor* thisx, GlobalContext* globalCtx) {
BgTokiSwd* this = THIS; BgTokiSwd* this = THIS;
s32 pad; s32 pad;
Actor_ProcessInitChain(thisx, initChain); Actor_ProcessInitChain(thisx, sInitChain);
this->actor.shape.unk_08 = 800.0f; this->actor.shape.unk_08 = 800.0f;
BgTokiSwd_SetupAction(thisx, func_808BAF40); BgTokiSwd_SetupAction(thisx, func_808BAF40);
@ -73,9 +73,9 @@ void BgTokiSwd_Init(Actor* thisx, GlobalContext* globalCtx) {
} }
Collider_InitCylinder(globalCtx, &this->collider); Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, thisx, &colliderInit); Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit);
Collider_CylinderUpdate(thisx, &this->collider); Collider_CylinderUpdate(thisx, &this->collider);
func_80061ED4(&thisx->colChkInfo, 0, &colChkInfoInit); func_80061ED4(&thisx->colChkInfo, 0, &sColChkInfoInit);
} }
void BgTokiSwd_Destroy(Actor* thisx, GlobalContext* globalCtx) { void BgTokiSwd_Destroy(Actor* thisx, GlobalContext* globalCtx) {
@ -91,7 +91,7 @@ void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx) {
globalCtx->csCtx.segment = D_808BBD90; globalCtx->csCtx.segment = D_808BBD90;
gSaveContext.cutsceneTrigger = 1; gSaveContext.cutsceneTrigger = 1;
} }
if (LINK_IS_CHILD || ((gSaveContext.eventChkInf[5] & 0x20) != 0)) { if (LINK_IS_CHILD || ((gSaveContext.eventChkInf[5] & 0x20))) {
if (func_8002F410(&this->actor, globalCtx) != 0) { if (func_8002F410(&this->actor, globalCtx) != 0) {
if (LINK_IS_CHILD) { if (LINK_IS_CHILD) {
Item_Give(globalCtx, ITEM_SWORD_MASTER); Item_Give(globalCtx, ITEM_SWORD_MASTER);
@ -102,7 +102,7 @@ void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx) {
Audio_SetBGM(NA_BGM_STOP); Audio_SetBGM(NA_BGM_STOP);
Audio_SetBGM(NA_SE_PL_BOUND_DIRT); Audio_SetBGM(NA_SE_PL_BOUND_DIRT);
gSaveContext.cutsceneTrigger = 1; gSaveContext.cutsceneTrigger = 1;
this->actor.attachedA = 0; this->actor.attachedA = NULL;
BgTokiSwd_SetupAction(this, func_808BB0AC); BgTokiSwd_SetupAction(this, func_808BB0AC);
} else { } else {
if (func_8002E084(&this->actor, 0x2000) != 0) { if (func_8002E084(&this->actor, 0x2000) != 0) {
@ -169,7 +169,7 @@ void BgTokiSwd_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx_TexScroll(globalCtx->state.gfxCtx, 0, -(globalCtx->gameplayFrames % 0x80), 32, 32)); Gfx_TexScroll(globalCtx->state.gfxCtx, 0, -(globalCtx->gameplayFrames % 0x80), 32, 32));
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_toki_swd.c", 742), gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_toki_swd.c", 742),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxCtx->polyOpa.p++, &D_06001BD0); gSPDisplayList(gfxCtx->polyOpa.p++, D_06001BD0);
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_toki_swd.c", 776); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_toki_swd.c", 776);
} }

View file

@ -27,10 +27,10 @@ const ActorInit Bg_Umajump_InitVars = {
(ActorFunc)BgUmaJump_Draw, (ActorFunc)BgUmaJump_Draw,
}; };
extern D_06001438; // segmented address: 0x06001438 extern UNK_TYPE D_06001438;
extern D_06001220; // segmented address: 0x06001220 extern Gfx D_06001220[];
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
}; };
@ -39,7 +39,7 @@ void BgUmaJump_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad; s32 pad;
u32 sp24 = 0; u32 sp24 = 0;
Actor_ProcessInitChain(&this->actor, initChain); Actor_ProcessInitChain(&this->actor, sInitChain);
DynaPolyInfo_SetActorMove(&this->actor, DPM_UNK); DynaPolyInfo_SetActorMove(&this->actor, DPM_UNK);
DynaPolyInfo_Alloc(&D_06001438, &sp24); DynaPolyInfo_Alloc(&D_06001438, &sp24);
this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, sp24); this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, sp24);
@ -63,5 +63,5 @@ void BgUmaJump_Update(Actor* thisx, GlobalContext* globalCtx) {
} }
void BgUmaJump_Draw(Actor* thisx, GlobalContext* globalCtx) { void BgUmaJump_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx_DrawDListOpa(globalCtx, &D_06001220); Gfx_DrawDListOpa(globalCtx, D_06001220);
} }

View file

@ -5,7 +5,6 @@
*/ */
#include "z_bg_zg.h" #include "z_bg_zg.h"
#include <vt.h> #include <vt.h>
#define FLAGS 0x00000010 #define FLAGS 0x00000010
@ -24,16 +23,16 @@ void func_808C0CD4(BgZg* this, GlobalContext* globalCtx);
void func_808C0D08(BgZg* this, GlobalContext* globalCtx); void func_808C0D08(BgZg* this, GlobalContext* globalCtx);
void func_808C0EEC(BgZg* this, GlobalContext* globalCtx); void func_808C0EEC(BgZg* this, GlobalContext* globalCtx);
static const BgZgActionFunc actionFuncs[] = { static BgZgActionFunc sActionFuncs[] = {
func_808C0CD4, func_808C0CD4,
func_808C0D08, func_808C0D08,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP), ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP),
}; };
static const BgZgDrawFunc drawFuncs[] = { static BgZgDrawFunc sDrawFuncs[] = {
func_808C0EEC, func_808C0EEC,
}; };
@ -49,8 +48,8 @@ const ActorInit Bg_Zg_InitVars = {
(ActorFunc)BgZg_Draw, (ActorFunc)BgZg_Draw,
}; };
extern u32 D_06001080; extern Gfx D_06001080[];
extern u32 D_060011D4; extern UNK_TYPE D_060011D4;
void BgZg_Destroy(Actor* thisx, GlobalContext* globalCtx) { void BgZg_Destroy(Actor* thisx, GlobalContext* globalCtx) {
BgZg* this = THIS; BgZg* this = THIS;
@ -65,11 +64,13 @@ void func_808C0C50(BgZg* this) {
s32 func_808C0C98(BgZg* this, GlobalContext* globalCtx) { s32 func_808C0C98(BgZg* this, GlobalContext* globalCtx) {
Actor* thisx = &this->dyna.actor; Actor* thisx = &this->dyna.actor;
s32 flag = (thisx->params >> 8) & 0xFF; s32 flag = (thisx->params >> 8) & 0xFF;
return Flags_GetSwitch(globalCtx, flag); return Flags_GetSwitch(globalCtx, flag);
} }
s32 func_808C0CC8(BgZg* this) { s32 func_808C0CC8(BgZg* this) {
s32 flag = this->dyna.actor.params & 0xFF; s32 flag = this->dyna.actor.params & 0xFF;
return flag; return flag;
} }
@ -93,11 +94,11 @@ void BgZg_Update(Actor* thisx, GlobalContext* globalCtx) {
BgZg* this = THIS; BgZg* this = THIS;
s32 action = this->action; s32 action = this->action;
if (((action < 0) || (1 < action)) || (actionFuncs[action] == NULL)) { if (((action < 0) || (1 < action)) || (sActionFuncs[action] == NULL)) {
// Translates to: "Main Mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!" // Translates to: "Main Mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!"
osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
} else { } else {
actionFuncs[action](&this->dyna.actor, globalCtx); sActionFuncs[action](&this->dyna.actor, globalCtx);
} }
} }
@ -106,7 +107,7 @@ void BgZg_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad[2]; s32 pad[2];
u32 local_c; u32 local_c;
Actor_ProcessInitChain(thisx, initChain); Actor_ProcessInitChain(thisx, sInitChain);
DynaPolyInfo_SetActorMove(thisx, DPM_UNK); DynaPolyInfo_SetActorMove(thisx, DPM_UNK);
local_c = 0; local_c = 0;
DynaPolyInfo_Alloc(&D_060011D4, &local_c); DynaPolyInfo_Alloc(&D_060011D4, &local_c);
@ -137,18 +138,18 @@ void func_808C0EEC(BgZg* this, GlobalContext* globalCtx) {
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(gfxCtx, "../z_bg_zg.c", 315), gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(gfxCtx, "../z_bg_zg.c", 315),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxCtx->polyOpa.p++, &D_06001080); gSPDisplayList(gfxCtx->polyOpa.p++, D_06001080);
Graph_CloseDisps(dispRefs, gfxCtx, "../z_bg_zg.c", 320); Graph_CloseDisps(dispRefs, gfxCtx, "../z_bg_zg.c", 320);
} }
void BgZg_Draw(Actor* thisx, GlobalContext* globalCtx) { void BgZg_Draw(Actor* thisx, GlobalContext* globalCtx) {
BgZg* this = THIS; BgZg* this = THIS;
s32 action = this->drawConfig; s32 drawConfig = this->drawConfig;
if (((action < 0) || (action > 0)) || drawFuncs[action] == NULL) { if (((drawConfig < 0) || (drawConfig > 0)) || sDrawFuncs[drawConfig] == NULL) {
// Translates to: "Drawing mode is wrong !!!!!!!!!!!!!!!!!!!!!!!!!" // Translates to: "Drawing mode is wrong !!!!!!!!!!!!!!!!!!!!!!!!!"
osSyncPrintf(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); osSyncPrintf(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
} else { } else {
drawFuncs[action](this, globalCtx); sDrawFuncs[drawConfig](this, globalCtx);
} }
} }

View file

@ -1,7 +1,7 @@
/* /*
* File: z_demo_geff.c * File: z_demo_geff.c
* Overlay: Demo_Geff * Overlay: Demo_Geff
* Description: * Description: Ganon's Lair Rubble Fragment
*/ */
#include "z_demo_geff.h" #include "z_demo_geff.h"
@ -25,21 +25,21 @@ void func_80978308(DemoGeff* this, GlobalContext* globalCtx);
void func_809784D4(DemoGeff* this, GlobalContext* globalCtx); void func_809784D4(DemoGeff* this, GlobalContext* globalCtx);
void func_80978344(DemoGeff* this, GlobalContext* globalCtx); void func_80978344(DemoGeff* this, GlobalContext* globalCtx);
s16 objectIds[] = { static s16 sObjectIDs[] = {
OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF,
}; };
DemoGeffInitFunc initFuncs[] = { static DemoGeffInitFunc sInitFuncs[] = {
func_80978030, func_80978030, func_80978030, func_80978030, func_80978030, func_80978030, func_80978030, func_80978030, func_80978030, func_80978030,
func_80978030, func_80978030, func_80978030, func_80978030, func_80978030, func_80978030, func_80978030, func_80978030,
}; };
DemoGeffActionFunc actionFuncs[] = { static DemoGeffActionFunc sActionFuncs[] = {
func_809783D4, func_809783D4,
func_80978308, func_80978308,
}; };
DemoGeffDrawFunc drawFuncs[] = { static DemoGeffDrawFunc sDrawFuncs[] = {
func_809784D4, func_809784D4,
func_80978344, func_80978344,
}; };
@ -56,7 +56,7 @@ const ActorInit Demo_Geff_InitVars = {
(ActorFunc)DemoGeff_Draw, (ActorFunc)DemoGeff_Draw,
}; };
extern UNK_TYPE D_06000EA0; extern Gfx D_06000EA0[];
void DemoGeff_Destroy(Actor* thisx, GlobalContext* globalCtx) { void DemoGeff_Destroy(Actor* thisx, GlobalContext* globalCtx) {
} }
@ -73,7 +73,7 @@ void DemoGeff_Init(Actor* thisx, GlobalContext* globalCtx) {
this->drawConfig = 0; this->drawConfig = 0;
} }
void func_80977EA8(GlobalContext* globalCtx, u32 dlist) { void func_80977EA8(GlobalContext* globalCtx, Gfx* dlist) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* dispRefs[5]; Gfx* dispRefs[5];
@ -174,12 +174,12 @@ void func_80978308(DemoGeff* this, GlobalContext* globalCtx) {
} }
void func_80978344(DemoGeff* this, GlobalContext* globalCtx) { void func_80978344(DemoGeff* this, GlobalContext* globalCtx) {
func_80977EA8(globalCtx, &D_06000EA0); func_80977EA8(globalCtx, D_06000EA0);
} }
void func_80978370(DemoGeff* this, GlobalContext* globalCtx) { void func_80978370(DemoGeff* this, GlobalContext* globalCtx) {
s16 params = this->actor.params; s16 params = this->actor.params;
DemoGeffInitFunc initFunc = initFuncs[params]; DemoGeffInitFunc initFunc = sInitFuncs[params];
if (initFunc == NULL) { if (initFunc == NULL) {
osSyncPrintf(VT_FGCOL(RED) " Demo_Geff_main_init:初期化処理がおかしいarg_data = %d!\n" VT_RST, params); osSyncPrintf(VT_FGCOL(RED) " Demo_Geff_main_init:初期化処理がおかしいarg_data = %d!\n" VT_RST, params);
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
@ -192,7 +192,7 @@ void func_809783D4(DemoGeff* this, GlobalContext* globalCtx) {
ObjectContext* objCtx = &globalCtx->objectCtx; ObjectContext* objCtx = &globalCtx->objectCtx;
Actor* thisx = &this->actor; Actor* thisx = &this->actor;
s32 params = thisx->params; s32 params = thisx->params;
s16 objectId = objectIds[params]; s16 objectId = sObjectIDs[params];
s32 objBankIndex = Object_GetIndex(objCtx, objectId); s32 objBankIndex = Object_GetIndex(objCtx, objectId);
s32 pad; s32 pad;
@ -210,11 +210,11 @@ void func_809783D4(DemoGeff* this, GlobalContext* globalCtx) {
void DemoGeff_Update(Actor* thisx, GlobalContext* globalCtx) { void DemoGeff_Update(Actor* thisx, GlobalContext* globalCtx) {
DemoGeff* this = THIS; DemoGeff* this = THIS;
if (this->action < 0 || this->action >= 2 || actionFuncs[this->action] == NULL) { if (this->action < 0 || this->action >= 2 || sActionFuncs[this->action] == NULL) {
osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
return; return;
} }
actionFuncs[this->action](this, globalCtx); sActionFuncs[this->action](this, globalCtx);
} }
void func_809784D4(DemoGeff* this, GlobalContext* globalCtx) { void func_809784D4(DemoGeff* this, GlobalContext* globalCtx) {
@ -224,12 +224,12 @@ void DemoGeff_Draw(Actor* thisx, GlobalContext* globalCtx) {
DemoGeff* this = THIS; DemoGeff* this = THIS;
s32 drawConfig = this->drawConfig; s32 drawConfig = this->drawConfig;
if (drawConfig < 0 || drawConfig >= 2 || drawFuncs[drawConfig] == NULL) { if (drawConfig < 0 || drawConfig >= 2 || sDrawFuncs[drawConfig] == NULL) {
osSyncPrintf(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); osSyncPrintf(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
return; return;
} }
if (drawConfig != 0) { if (drawConfig != 0) {
func_80977F80(this, globalCtx); func_80977F80(this, globalCtx);
} }
drawFuncs[drawConfig](this, globalCtx); sDrawFuncs[drawConfig](this, globalCtx);
} }

View file

@ -15,9 +15,9 @@ void DoorAna_Destroy(Actor* thisx, GlobalContext* globalCtx);
void DoorAna_Update(Actor* thisx, GlobalContext* globalCtx); void DoorAna_Update(Actor* thisx, GlobalContext* globalCtx);
void DoorAna_Draw(Actor* thisx, GlobalContext* globalCtx); void DoorAna_Draw(Actor* thisx, GlobalContext* globalCtx);
void DoorAna_Update_Hidden(DoorAna* this, GlobalContext* globalCtx); void DoorAna_WaitClosed(DoorAna* this, GlobalContext* globalCtx);
void DoorAna_Update_Open(DoorAna* this, GlobalContext* globalCtx); void DoorAna_WaitOpen(DoorAna* this, GlobalContext* globalCtx);
void DoorAna_Update_Entering(DoorAna* this, GlobalContext* globalCtx); void DoorAna_GrabLink(DoorAna* this, GlobalContext* globalCtx);
const ActorInit Door_Ana_InitVars = { const ActorInit Door_Ana_InitVars = {
ACTOR_DOOR_ANA, ACTOR_DOOR_ANA,
@ -31,8 +31,7 @@ const ActorInit Door_Ana_InitVars = {
(ActorFunc)DoorAna_Draw, (ActorFunc)DoorAna_Draw,
}; };
// initial collision data static ColliderCylinderInit sCylinderInit = {
static ColliderCylinderInit colliderInit = {
{ COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_CYLINDER }, { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_CYLINDER },
{ 0x02, { 0x00000000, 0x00, 0x00 }, { 0x00000048, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, { 0x02, { 0x00000000, 0x00, 0x00 }, { 0x00000048, 0x00, 0x00 }, 0x00, 0x01, 0x00 },
{ 50, 10, 0, { 0 } }, { 50, 10, 0, { 0 } },
@ -44,7 +43,6 @@ static s16 entrances[] = {
0x05B0, 0x05B4, 0x05B8, 0x05BC, 0x05C0, 0x05C4, 0x05FC, 0x05B0, 0x05B4, 0x05B8, 0x05BC, 0x05C0, 0x05C4, 0x05FC,
}; };
// display list
extern Gfx D_05001390[]; extern Gfx D_05001390[];
void DoorAna_SetupAction(DoorAna* this, DoorAnaActionFunc actionFunc) { void DoorAna_SetupAction(DoorAna* this, DoorAnaActionFunc actionFunc) {
@ -61,14 +59,14 @@ void DoorAna_Init(Actor* thisx, GlobalContext* globalCtx) {
// only allocate collider for grottos that need bombing/hammering open // only allocate collider for grottos that need bombing/hammering open
if ((this->actor.params & 0x200) != 0) { if ((this->actor.params & 0x200) != 0) {
Collider_InitCylinder(globalCtx, &this->collider); Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &colliderInit); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
} else { } else {
this->actor.flags |= 0x10; this->actor.flags |= 0x10;
} }
Actor_SetScale(&this->actor, 0); Actor_SetScale(&this->actor, 0);
DoorAna_SetupAction(this, DoorAna_Update_Hidden); DoorAna_SetupAction(this, DoorAna_WaitClosed);
} else { } else {
DoorAna_SetupAction(this, DoorAna_Update_Open); DoorAna_SetupAction(this, DoorAna_WaitOpen);
} }
this->actor.unk_1F = 0; this->actor.unk_1F = 0;
} }
@ -83,7 +81,7 @@ void DoorAna_Destroy(Actor* thisx, GlobalContext* globalCtx) {
} }
// update routine for grottos that are currently "hidden"/unopened // update routine for grottos that are currently "hidden"/unopened
void DoorAna_Update_Hidden(DoorAna* this, GlobalContext* globalCtx) { void DoorAna_WaitClosed(DoorAna* this, GlobalContext* globalCtx) {
u32 openGrotto = false; u32 openGrotto = false;
if ((this->actor.params & 0x200) == 0) { if ((this->actor.params & 0x200) == 0) {
// opening with song of storms // opening with song of storms
@ -104,14 +102,14 @@ void DoorAna_Update_Hidden(DoorAna* this, GlobalContext* globalCtx) {
// open the grotto // open the grotto
if (openGrotto) { if (openGrotto) {
this->actor.params &= ~0x0300; this->actor.params &= ~0x0300;
DoorAna_SetupAction(this, DoorAna_Update_Open); DoorAna_SetupAction(this, DoorAna_WaitOpen);
Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
} }
func_8002F5F0(&this->actor, globalCtx); func_8002F5F0(&this->actor, globalCtx);
} }
// update routine for grottos that are open // update routine for grottos that are open
void DoorAna_Update_Open(DoorAna* this, GlobalContext* globalCtx) { void DoorAna_WaitOpen(DoorAna* this, GlobalContext* globalCtx) {
Player* player; Player* player;
s32 destinationIdx; s32 destinationIdx;
@ -128,7 +126,7 @@ void DoorAna_Update_Open(DoorAna* this, GlobalContext* globalCtx) {
destinationIdx = this->actor.initPosRot.rot.z + 1; destinationIdx = this->actor.initPosRot.rot.z + 1;
} }
globalCtx->nextEntranceIndex = entrances[destinationIdx]; globalCtx->nextEntranceIndex = entrances[destinationIdx];
DoorAna_SetupAction(this, DoorAna_Update_Entering); DoorAna_SetupAction(this, DoorAna_GrabLink);
} else { } else {
if (!func_8008E988(globalCtx) && !(player->stateFlags1 & 0x8800000) && if (!func_8008E988(globalCtx) && !(player->stateFlags1 & 0x8800000) &&
this->actor.xzDistanceFromLink <= 15.0f && -50.0f <= this->actor.yDistanceFromLink && this->actor.xzDistanceFromLink <= 15.0f && -50.0f <= this->actor.yDistanceFromLink &&
@ -144,7 +142,7 @@ void DoorAna_Update_Open(DoorAna* this, GlobalContext* globalCtx) {
} }
// update function for after the player has triggered the grotto // update function for after the player has triggered the grotto
void DoorAna_Update_Entering(DoorAna* this, GlobalContext* globalCtx) { void DoorAna_GrabLink(DoorAna* this, GlobalContext* globalCtx) {
Player* player; Player* player;
if (this->actor.yDistanceFromLink <= 0.0f && 15.0f < this->actor.xzDistanceFromLink) { if (this->actor.yDistanceFromLink <= 0.0f && 15.0f < this->actor.xzDistanceFromLink) {

View file

@ -1,7 +1,7 @@
/* /*
* File: z_door_toki.c * File: z_door_toki.c
* Overlay: ovl_Door_Toki * Overlay: ovl_Door_Toki
* Description: Manages collision for the Door of Time. * Description: Door of Time Collision
*/ */
#include "z_door_toki.h" #include "z_door_toki.h"
@ -26,10 +26,9 @@ const ActorInit Door_Toki_InitVars = {
NULL, NULL,
}; };
// This has to be defined in the linker to produce a proper lui addiu pair extern UNK_TYPE D_06007888;
extern u32 DOOR_TOKI_COLLISION_DATA;
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP), ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP),
}; };
@ -38,9 +37,9 @@ void DoorToki_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad; s32 pad;
u32 sp1C = 0; u32 sp1C = 0;
Actor_ProcessInitChain(&this->actor, initChain); Actor_ProcessInitChain(&this->actor, sInitChain);
DynaPolyInfo_SetActorMove(&this->actor, 0); DynaPolyInfo_SetActorMove(&this->actor, 0);
DynaPolyInfo_Alloc(&DOOR_TOKI_COLLISION_DATA, &sp1C); DynaPolyInfo_Alloc(&D_06007888, &sp1C);
this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, sp1C); this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, sp1C);
} }

View file

@ -44,18 +44,18 @@ const ActorInit En_Ani_InitVars = {
(ActorFunc)EnAni_Draw, (ActorFunc)EnAni_Draw,
}; };
static ColliderCylinderInit cylinderInitData = { static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK10, 0x00, 0x11, 0x39, 0x10, COLSHAPE_CYLINDER }, { COLTYPE_UNK10, 0x00, 0x11, 0x39, 0x10, COLSHAPE_CYLINDER },
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 },
{ 30, 40, 0, { 0 } }, { 30, 40, 0, { 0 } },
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F4, 850, ICHAIN_STOP), ICHAIN_F32(unk_F4, 850, ICHAIN_STOP),
}; };
static Vec3f EnAniVec = { 800.0f, 500.0f, 0.0f }; static Vec3f sMultVec = { 800.0f, 500.0f, 0.0f };
UNK_PTR D_809B0F80[] = { UNK_PTR D_809B0F80[] = {
0x06000408, 0x06000408,
@ -71,13 +71,13 @@ void EnAni_Init(Actor* thisx, GlobalContext* globalCtx) {
EnAni* this = THIS; EnAni* this = THIS;
s32 pad; s32 pad;
Actor_ProcessInitChain(&this->actor, initChain); Actor_ProcessInitChain(&this->actor, sInitChain);
ActorShape_Init(&this->actor.shape, -2800.0f, ActorShadow_DrawFunc_Circle, 36.0f); ActorShape_Init(&this->actor.shape, -2800.0f, ActorShadow_DrawFunc_Circle, 36.0f);
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_060000F0, &D_060076EC, this->limbDrawTable, SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_060000F0, &D_060076EC, this->limbDrawTable,
this->transitionDrawTable, 0x10); this->transitionDrawTable, 0x10);
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_060076EC); SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_060076EC);
Collider_InitCylinder(globalCtx, &this->collider); Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInitData); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
this->actor.colChkInfo.mass = 0xFF; this->actor.colChkInfo.mass = 0xFF;
if (LINK_IS_CHILD) { if (LINK_IS_CHILD) {
EnAni_SetupAction(this, func_809B064C); EnAni_SetupAction(this, func_809B064C);
@ -307,7 +307,7 @@ s32 EnAni_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
void EnAni_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { void EnAni_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
if (limbIndex == 15) { if (limbIndex == 15) {
Matrix_MultVec3f(&EnAniVec, &thisx->posRot2.pos); Matrix_MultVec3f(&sMultVec, &thisx->posRot2.pos);
} }
} }

View file

@ -5,7 +5,6 @@
*/ */
#include "z_en_anubice_tag.h" #include "z_en_anubice_tag.h"
#include <vt.h> #include <vt.h>
#define FLAGS 0x00000010 #define FLAGS 0x00000010
@ -67,7 +66,6 @@ void EnAnubiceTag_ManageAnubis(EnAnubiceTag* this, GlobalContext* globalCtx) {
if (this->anubis != NULL) { if (this->anubis != NULL) {
anubis = this->anubis; anubis = this->anubis;
if (anubis->actor.update == NULL) { if (anubis->actor.update == NULL) {
return; return;
} }

View file

@ -3,8 +3,7 @@
#include <ultra64.h> #include <ultra64.h>
#include <global.h> #include <global.h>
#include "overlays/actors/ovl_En_Anubice/z_en_anubice.h"
#include "../ovl_En_Anubice/z_en_anubice.h"
struct EnAnubiceTag; struct EnAnubiceTag;

View file

@ -1,7 +1,7 @@
/* /*
* File: z_en_bird.c * File: z_en_bird.c
* Overlay: ovl_En_Bird * Overlay: ovl_En_Bird
* Description: A brown bird. Tweet tweet. * Description: An unused brown bird
*/ */
#include "z_en_bird.h" #include "z_en_bird.h"
@ -32,7 +32,7 @@ const ActorInit En_Bird_InitVars = {
(ActorFunc)EnBird_Draw, (ActorFunc)EnBird_Draw,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_F32(unk_4C, 5600, ICHAIN_STOP), ICHAIN_F32(unk_4C, 5600, ICHAIN_STOP),
}; };
@ -46,7 +46,7 @@ void EnBird_SetupAction(EnBird* this, EnBirdActionFunc actionFunc) {
void EnBird_Init(Actor* thisx, GlobalContext* globalCtx) { void EnBird_Init(Actor* thisx, GlobalContext* globalCtx) {
EnBird* this = THIS; EnBird* this = THIS;
Actor_ProcessInitChain(&this->actor, initChain); Actor_ProcessInitChain(&this->actor, sInitChain);
Actor_SetScale(&this->actor, 0.01); Actor_SetScale(&this->actor, 0.01);
SkelAnime_Init(globalCtx, &this->skelAnime, &D_06002190, &D_0600006C, 0, 0, 0); SkelAnime_Init(globalCtx, &this->skelAnime, &D_06002190, &D_0600006C, 0, 0, 0);
ActorShape_Init(&this->actor.shape, 5500, ActorShadow_DrawFunc_Circle, 4); ActorShape_Init(&this->actor.shape, 5500, ActorShadow_DrawFunc_Circle, 4);

View file

@ -29,21 +29,18 @@ const ActorInit En_Boom_InitVars = {
(ActorFunc)EnBoom_Draw, (ActorFunc)EnBoom_Draw,
}; };
static ColliderQuadInit col = { static ColliderQuadInit sQuadInit = {
{ COLTYPE_UNK10, 0x09, 0x00, 0x00, 0x08, COLSHAPE_QUAD }, { COLTYPE_UNK10, 0x09, 0x00, 0x00, 0x08, COLSHAPE_QUAD },
{ 0x02, { 0x00000010, 0x00, 0x01 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x05, 0x00, 0x00 }, { 0x02, { 0x00000010, 0x00, 0x01 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x05, 0x00, 0x00 },
{ 0 }, { 0 },
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_S8(unk_1F, 5, ICHAIN_CONTINUE), ICHAIN_S8(unk_1F, 5, ICHAIN_CONTINUE),
ICHAIN_VEC3S(shape.rot, 0, ICHAIN_STOP), ICHAIN_VEC3S(shape.rot, 0, ICHAIN_STOP),
}; };
static Vec3f mult1 = { -960.0f, 0.0f, 0.0f }; extern Gfx D_0400C808[];
static Vec3f mult2 = { 960.0f, 0.0f, 0.0f };
extern D_0400C808;
void EnBoom_SetupAction(EnBoom* this, EnBoomActionFunc actionFunc) { void EnBoom_SetupAction(EnBoom* this, EnBoomActionFunc actionFunc) {
this->actionFunc = actionFunc; this->actionFunc = actionFunc;
@ -55,7 +52,7 @@ void EnBoom_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.room = -1; this->actor.room = -1;
Actor_ProcessInitChain(&this->actor, initChain); Actor_ProcessInitChain(&this->actor, sInitChain);
trail.p1StartColor.r = 0xFF; trail.p1StartColor.r = 0xFF;
trail.p1StartColor.g = 0xFF; trail.p1StartColor.g = 0xFF;
@ -84,7 +81,7 @@ void EnBoom_Init(Actor* thisx, GlobalContext* globalCtx) {
Effect_Add(globalCtx, &this->effectIndex, EFFECT_BLURE1, 0, 0, &trail); Effect_Add(globalCtx, &this->effectIndex, EFFECT_BLURE1, 0, 0, &trail);
Collider_InitQuad(globalCtx, &this->collider); Collider_InitQuad(globalCtx, &this->collider);
Collider_SetQuad(globalCtx, &this->collider, this, &col); Collider_SetQuad(globalCtx, &this->collider, this, &sQuadInit);
EnBoom_SetupAction(this, EnBoom_Fly); EnBoom_SetupAction(this, EnBoom_Fly);
} }
@ -240,6 +237,8 @@ void EnBoom_Update(Actor* thisx, GlobalContext* globalCtx) {
} }
void EnBoom_Draw(Actor* thisx, GlobalContext* globalCtx) { void EnBoom_Draw(Actor* thisx, GlobalContext* globalCtx) {
static Vec3f sMultVec1 = { -960.0f, 0.0f, 0.0f };
static Vec3f sMultVec2 = { 960.0f, 0.0f, 0.0f };
EnBoom* this = THIS; EnBoom* this = THIS;
Vec3f vec1; Vec3f vec1;
Vec3f vec2; Vec3f vec2;
@ -251,8 +250,8 @@ void EnBoom_Draw(Actor* thisx, GlobalContext* globalCtx) {
Matrix_RotateY(this->actor.posRot.rot.y * 0.0000958738f, MTXMODE_APPLY); Matrix_RotateY(this->actor.posRot.rot.y * 0.0000958738f, MTXMODE_APPLY);
Matrix_RotateZ(0.7669904f, MTXMODE_APPLY); Matrix_RotateZ(0.7669904f, MTXMODE_APPLY);
Matrix_RotateX(this->actor.posRot.rot.x * 0.0000958738f, MTXMODE_APPLY); Matrix_RotateX(this->actor.posRot.rot.x * 0.0000958738f, MTXMODE_APPLY);
Matrix_MultVec3f(&mult1, &vec1); Matrix_MultVec3f(&sMultVec1, &vec1);
Matrix_MultVec3f(&mult2, &vec2); Matrix_MultVec3f(&sMultVec2, &vec2);
if (func_80090480(globalCtx, &this->collider, &this->unk_1DC, &vec1, &vec2) != 0) { if (func_80090480(globalCtx, &this->collider, &this->unk_1DC, &vec1, &vec2) != 0) {
EffectBlure_AddVertex(Effect_GetByIndex(this->effectIndex), &vec1, &vec2); EffectBlure_AddVertex(Effect_GetByIndex(this->effectIndex), &vec1, &vec2);
@ -263,7 +262,7 @@ void EnBoom_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_boom.c", 601), gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_boom.c", 601),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxCtx->polyOpa.p++, &D_0400C808); gSPDisplayList(gfxCtx->polyOpa.p++, D_0400C808);
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_boom.c", 604); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_boom.c", 604);
} }

View file

@ -38,17 +38,13 @@ const ActorInit En_Cow_InitVars = {
(ActorFunc)EnCow_Draw, (ActorFunc)EnCow_Draw,
}; };
static ColliderCylinderInit cylinderInit = { static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK10, 0x00, 0x11, 0x39, 0x10, COLSHAPE_CYLINDER }, { COLTYPE_UNK10, 0x00, 0x11, 0x39, 0x10, COLSHAPE_CYLINDER },
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 },
{ 30, 40, 0, { 0, 0, 0 } }, { 30, 40, 0, { 0, 0, 0 } },
}; };
Vec3f D_809E010C = { static Vec3f D_809E010C = { 0.0f, -1300.0f, 1100.0f };
0.0f,
-1300.0f,
1100.0f,
};
extern AnimationHeader D_060001CC; extern AnimationHeader D_060001CC;
extern SkeletonHeader D_06004010; extern SkeletonHeader D_06004010;
@ -91,9 +87,7 @@ void func_809DEE9C(EnCow* this) {
void func_809DEF94(EnCow* this) { void func_809DEF94(EnCow* this) {
Vec3f vec; Vec3f vec;
// clang-format off VEC_SET(vec, 0.0f, 57.0f, -36.0f);
vec.x = 0.0f; vec.y = 57.0f; vec.z = -36.0f;
// clang-format on
func_809DEE00(&vec, this->actor.shape.rot.y); func_809DEE00(&vec, this->actor.shape.rot.y);
this->actor.posRot.pos.x += vec.x; this->actor.posRot.pos.x += vec.x;
@ -112,9 +106,9 @@ void EnCow_Init(Actor* thisx, GlobalContext* globalCtx) {
this->transitionDrawTable, 6); this->transitionDrawTable, 6);
SkelAnime_ChangeAnimDefaultRepeat(&this->skelAnime, &D_060001CC); SkelAnime_ChangeAnimDefaultRepeat(&this->skelAnime, &D_060001CC);
Collider_InitCylinder(globalCtx, &this->colliders[0]); Collider_InitCylinder(globalCtx, &this->colliders[0]);
Collider_SetCylinder(globalCtx, &this->colliders[0], &this->actor, &cylinderInit); Collider_SetCylinder(globalCtx, &this->colliders[0], &this->actor, &sCylinderInit);
Collider_InitCylinder(globalCtx, &this->colliders[1]); Collider_InitCylinder(globalCtx, &this->colliders[1]);
Collider_SetCylinder(globalCtx, &this->colliders[1], &this->actor, &cylinderInit); Collider_SetCylinder(globalCtx, &this->colliders[1], &this->actor, &sCylinderInit);
func_809DEE9C(this); func_809DEE9C(this);
this->actionFunc = func_809DF96C; this->actionFunc = func_809DF96C;
if (globalCtx->sceneNum == SCENE_LINK_HOME) { if (globalCtx->sceneNum == SCENE_LINK_HOME) {

View file

@ -23,9 +23,6 @@ void EnDha_SetupDeath(EnDha* this);
void EnDha_Die(EnDha* this, GlobalContext* globalCtx); void EnDha_Die(EnDha* this, GlobalContext* globalCtx);
void EnDha_UpdateHealth(EnDha* this, GlobalContext* globalCtx); void EnDha_UpdateHealth(EnDha* this, GlobalContext* globalCtx);
extern SkeletonHeader D_06000BD8;
extern AnimationHeader D_060015B0;
const ActorInit En_Dha_InitVars = { const ActorInit En_Dha_InitVars = {
ACTOR_EN_DHA, ACTOR_EN_DHA,
ACTORTYPE_ENEMY, ACTORTYPE_ENEMY,
@ -38,12 +35,12 @@ const ActorInit En_Dha_InitVars = {
(ActorFunc)EnDha_Draw, (ActorFunc)EnDha_Draw,
}; };
static DamageTable damageTable = { { static DamageTable sDamageTable = { {
0x00, 0xF2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0xF2, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0xF2, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0xF4, 0xF2, 0xF4, 0xF8, 0xF4, 0x00, 0x00, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0xF4, 0xF2, 0xF4, 0xF8, 0xF4, 0x00, 0x00, 0xF4, 0x00,
} }; } };
static ColliderJntSphItemInit colliderItemsInit[] = { static ColliderJntSphItemInit sJntSphItemsInit[] = {
{ {
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 },
{ 1, { { 0, 0, 0 }, 12 }, 100 }, { 1, { { 0, 0, 0 }, 12 }, 100 },
@ -66,18 +63,21 @@ static ColliderJntSphItemInit colliderItemsInit[] = {
}, },
}; };
static ColliderJntSphInit colliderInit = { static ColliderJntSphInit sJntSphInit = {
{ COLTYPE_UNK6, 0x00, 0x09, 0x19, 0x10, COLSHAPE_JNTSPH }, { COLTYPE_UNK6, 0x00, 0x09, 0x19, 0x10, COLSHAPE_JNTSPH },
5, 5,
&colliderItemsInit, &sJntSphItemsInit,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_S8(naviEnemyId, 0x2E, ICHAIN_CONTINUE), ICHAIN_S8(naviEnemyId, 0x2E, ICHAIN_CONTINUE),
ICHAIN_F32(unk_4C, 2000, ICHAIN_CONTINUE), ICHAIN_F32(unk_4C, 2000, ICHAIN_CONTINUE),
ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_STOP), ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_STOP),
}; };
extern SkeletonHeader D_06000BD8;
extern AnimationHeader D_060015B0;
void EnDha_SetupAction(EnDha* this, EnDhaActionFunc actionFunc) { void EnDha_SetupAction(EnDha* this, EnDhaActionFunc actionFunc) {
this->actionFunc = actionFunc; this->actionFunc = actionFunc;
} }
@ -85,8 +85,8 @@ void EnDha_SetupAction(EnDha* this, EnDhaActionFunc actionFunc) {
void EnDha_Init(Actor* thisx, GlobalContext* globalCtx) { void EnDha_Init(Actor* thisx, GlobalContext* globalCtx) {
EnDha* this = THIS; EnDha* this = THIS;
Actor_ProcessInitChain(&this->actor, initChain); Actor_ProcessInitChain(&this->actor, sInitChain);
this->actor.colChkInfo.damageTable = &damageTable; this->actor.colChkInfo.damageTable = &sDamageTable;
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06000BD8, &D_060015B0, this->limbDrawTable, SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06000BD8, &D_060015B0, this->limbDrawTable,
this->transitionDrawTable, 4); this->transitionDrawTable, 4);
ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawFunc_Teardrop, 90.0f); ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawFunc_Teardrop, 90.0f);
@ -96,7 +96,7 @@ void EnDha_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.colChkInfo.health = 8; this->actor.colChkInfo.health = 8;
this->unk_1CE = -0x4000; this->unk_1CE = -0x4000;
Collider_InitJntSph(globalCtx, &this->collider); Collider_InitJntSph(globalCtx, &this->collider);
Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &colliderInit, &this->colliderItem); Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, &this->colliderItem);
this->actor.flags &= ~1; this->actor.flags &= ~1;
func_809EC9C8(this); func_809EC9C8(this);
} }

View file

@ -1,7 +1,7 @@
/* /*
* File: z_en_dog.c * File: z_en_dog.c
* Overlay: ovl_En_Dog * Overlay: ovl_En_Dog
* Description: Dog actor that Link can interact with * Description: Dog
*/ */
#include "z_en_dog.h" #include "z_en_dog.h"
@ -34,13 +34,13 @@ const ActorInit En_Dog_InitVars = {
(ActorFunc)EnDog_Draw, (ActorFunc)EnDog_Draw,
}; };
static ColliderCylinderInit cylinderInit = { static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK6, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, { COLTYPE_UNK6, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER },
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 },
{ 16, 20, 0, { 0 } }, { 16, 20, 0, { 0 } },
}; };
static CollisionCheckInfoInit2 colChkInfoInit = { static CollisionCheckInfoInit2 sColChkInfoInit = {
0x00, // health 0x00, // health
0x0000, // unk_10 0x0000, // unk_10
0x0000, // unk_12 0x0000, // unk_12
@ -48,7 +48,7 @@ static CollisionCheckInfoInit2 colChkInfoInit = {
0x32, // mass 0x32, // mass
}; };
static struct_80034EC0_Entry animations[] = { static struct_80034EC0_Entry sAnimations[] = {
{ 0x06001368, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, { 0x06001368, 1.0f, 0.0f, -1.0f, 0x00, -6.0f }, { 0x06001368, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, { 0x06001368, 1.0f, 0.0f, -1.0f, 0x00, -6.0f },
{ 0x06000D78, 1.0f, 0.0f, -1.0f, 0x00, -6.0f }, { 0x06000278, 1.0f, 0.0f, -1.0f, 0x00, -6.0f }, { 0x06000D78, 1.0f, 0.0f, -1.0f, 0x00, -6.0f }, { 0x06000278, 1.0f, 0.0f, -1.0f, 0x00, -6.0f },
{ 0x06001150, 1.0f, 0.0f, 4.0f, 0x02, -6.0f }, { 0x06001150, 1.0f, 5.0f, 25.0f, 0x04, -6.0f }, { 0x06001150, 1.0f, 0.0f, 4.0f, 0x02, -6.0f }, { 0x06001150, 1.0f, 5.0f, 25.0f, 0x04, -6.0f },
@ -126,19 +126,19 @@ s32 EnDog_PlayAnimAndSFX(EnDog* this) {
animation = 6; animation = 6;
break; break;
} }
func_80034EC0(&this->skelAnime, &animations, animation); func_80034EC0(&this->skelAnime, sAnimations, animation);
} }
switch (this->behavior) { switch (this->behavior) {
case DOG_SIT: case DOG_SIT:
if (func_800A56C8(&this->skelAnime, this->skelAnime.animFrameCount) != 0) { if (func_800A56C8(&this->skelAnime, this->skelAnime.animFrameCount) != 0) {
func_80034EC0(&this->skelAnime, &animations, 5); func_80034EC0(&this->skelAnime, sAnimations, 5);
this->behavior = this->nextBehavior = DOG_SIT_2; this->behavior = this->nextBehavior = DOG_SIT_2;
} }
break; break;
case DOG_BOW: case DOG_BOW:
if (func_800A56C8(&this->skelAnime, this->skelAnime.animFrameCount) != 0) { if (func_800A56C8(&this->skelAnime, this->skelAnime.animFrameCount) != 0) {
func_80034EC0(&this->skelAnime, &animations, 7); func_80034EC0(&this->skelAnime, sAnimations, 7);
this->behavior = this->nextBehavior = DOG_BOW_2; this->behavior = this->nextBehavior = DOG_BOW_2;
} }
break; break;
@ -227,7 +227,7 @@ void EnDog_Init(Actor* thisx, GlobalContext* globalCtx) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 24.0f); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 24.0f);
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06007290, NULL, &this->unk_1F4, &this->unk_242, 13); SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06007290, NULL, &this->unk_1F4, &this->unk_242, 13);
func_80034EC0(&this->skelAnime, animations, 0); func_80034EC0(&this->skelAnime, sAnimations, 0);
if ((this->actor.params & 0x8000) == 0) { if ((this->actor.params & 0x8000) == 0) {
this->actor.params = (this->actor.params & 0xF0FF) | ((((this->actor.params & 0x0F00) >> 8) + 1) << 8); this->actor.params = (this->actor.params & 0xF0FF) | ((((this->actor.params & 0x0F00) >> 8) + 1) << 8);
@ -240,8 +240,8 @@ void EnDog_Init(Actor* thisx, GlobalContext* globalCtx) {
} }
Collider_InitCylinder(globalCtx, &this->collider); Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInit); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
func_80061EFC(&this->actor.colChkInfo, 0, &colChkInfoInit); func_80061EFC(&this->actor.colChkInfo, 0, &sColChkInfoInit);
Actor_SetScale(&this->actor, 0.0075f); Actor_SetScale(&this->actor, 0.0075f);
this->waypoint = 0; this->waypoint = 0;
this->actor.gravity = -1.0f; this->actor.gravity = -1.0f;

View file

@ -15,19 +15,6 @@ void EnDs_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnDs_Update(Actor* thisx, GlobalContext* globalCtx); void EnDs_Update(Actor* thisx, GlobalContext* globalCtx);
void EnDs_Draw(Actor* thisx, GlobalContext* globalCtx); void EnDs_Draw(Actor* thisx, GlobalContext* globalCtx);
void EnDs_Talk(EnDs* this, GlobalContext* globalCtx);
void EnDs_TalkNoEmptyBottle(EnDs* this, GlobalContext* globalCtx);
void EnDs_TalkAfterGiveOddPotion(EnDs* this, GlobalContext* globalCtx);
void EnDs_DisplayOddPotionText(EnDs* this, GlobalContext* globalCtx);
void EnDs_GiveOddPotion(EnDs* this, GlobalContext* globalCtx);
void EnDs_TalkAfterBrewOddPotion(EnDs* this, GlobalContext* globalCtx);
void EnDs_BrewOddPotion3(EnDs* this, GlobalContext* globalCtx);
void EnDs_BrewOddPotion2(EnDs* this, GlobalContext* globalCtx);
void EnDs_BrewOddPotion1(EnDs* this, GlobalContext* globalCtx);
void EnDs_OfferOddPotion(EnDs* this, GlobalContext* globalCtx);
int EnDs_CheckRupeesAndBottle();
void EnDs_GiveBluePotion(EnDs* this, GlobalContext* globalCtx);
void EnDs_OfferBluePotion(EnDs* this, GlobalContext* globalCtx);
void EnDs_Wait(EnDs* this, GlobalContext* globalCtx); void EnDs_Wait(EnDs* this, GlobalContext* globalCtx);
const ActorInit En_Ds_InitVars = { const ActorInit En_Ds_InitVars = {
@ -45,8 +32,6 @@ const ActorInit En_Ds_InitVars = {
extern SkeletonHeader D_06004768; extern SkeletonHeader D_06004768;
extern AnimationHeader D_0600039C; extern AnimationHeader D_0600039C;
Vec3f mtxSrc = { 1100.0f, 500.0f, 0.0f };
void EnDs_Init(Actor* thisx, GlobalContext* globalCtx) { void EnDs_Init(Actor* thisx, GlobalContext* globalCtx) {
EnDs* this = THIS; EnDs* this = THIS;
@ -221,7 +206,7 @@ void EnDs_OfferBluePotion(EnDs* this, GlobalContext* globalCtx) {
void EnDs_Wait(EnDs* this, GlobalContext* globalCtx) { void EnDs_Wait(EnDs* this, GlobalContext* globalCtx) {
Player* player = PLAYER; Player* player = PLAYER;
s16 unkAngle; s16 yawDiff;
if (func_8002F194(&this->actor, globalCtx) != 0) { if (func_8002F194(&this->actor, globalCtx) != 0) {
if (func_8002F368(globalCtx) == 8) { if (func_8002F368(globalCtx) == 8) {
@ -240,10 +225,10 @@ void EnDs_Wait(EnDs* this, GlobalContext* globalCtx) {
this->actionFunc = EnDs_Talk; this->actionFunc = EnDs_Talk;
} }
} else { } else {
unkAngle = this->actor.rotTowardsLinkY - this->actor.shape.rot.y; yawDiff = this->actor.rotTowardsLinkY - this->actor.shape.rot.y;
this->actor.textId = 0x5048; this->actor.textId = 0x5048;
if ((ABS(unkAngle) < 0x2151) && (this->actor.xzDistanceFromLink < 200.0f)) { if ((ABS(yawDiff) < 0x2151) && (this->actor.xzDistanceFromLink < 200.0f)) {
func_8002F298(this, globalCtx, 100.0f, 8); func_8002F298(this, globalCtx, 100.0f, 8);
this->unk_1E8 |= 1; this->unk_1E8 |= 1;
} }
@ -280,8 +265,10 @@ s32 EnDs_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
} }
void EnDs_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { void EnDs_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
static Vec3f sMultVec = { 1100.0f, 500.0f, 0.0f };
if (limbIndex == 5) { if (limbIndex == 5) {
Matrix_MultVec3f(&mtxSrc, &thisx->posRot2.pos); Matrix_MultVec3f(&sMultVec, &thisx->posRot2.pos);
} }
} }

View file

@ -1,11 +1,10 @@
/* /*
* File: z_en_eg.c * File: z_en_eg.c
* Overlay: ovl_En_Eg * Overlay: ovl_En_Eg
* Description: Zelda's Path in Ganon Castle Escape? * Description: Triggers a void out (used in the tower collapse sequence?)
*/ */
#include "z_en_eg.h" #include "z_en_eg.h"
#include <vt.h> #include <vt.h>
#define FLAGS 0x00000010 #define FLAGS 0x00000010
@ -19,8 +18,9 @@ void EnEg_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_809FFDC8(EnEg* this, GlobalContext* globalCtx); void func_809FFDC8(EnEg* this, GlobalContext* globalCtx);
static bool hasVoidedOut = false; static s32 voided = false;
static const EnEgActionFunc actionFuncs[] = {
static EnEgActionFunc sActionFuncs[] = {
func_809FFDC8, func_809FFDC8,
}; };
@ -50,14 +50,14 @@ void EnEg_Init(Actor* thisx, GlobalContext* globalCtx) {
} }
void func_809FFDC8(EnEg* this, GlobalContext* globalCtx) { void func_809FFDC8(EnEg* this, GlobalContext* globalCtx) {
if (!hasVoidedOut && (gSaveContext.timer2Value < 1) && Flags_GetSwitch(globalCtx, 0x36) && (kREG(0) == 0)) { if (!voided && (gSaveContext.timer2Value < 1) && Flags_GetSwitch(globalCtx, 0x36) && (kREG(0) == 0)) {
// Void the player out // Void the player out
Gameplay_TriggerRespawn(globalCtx); Gameplay_TriggerRespawn(globalCtx);
gSaveContext.respawnFlag = -2; gSaveContext.respawnFlag = -2;
Audio_SetBGM(NA_BGM_STOP); Audio_SetBGM(NA_BGM_STOP);
globalCtx->fadeTransition = 2; globalCtx->fadeTransition = 2;
EnEg_PlayVoidOutSFX(); EnEg_PlayVoidOutSFX();
hasVoidedOut = true; voided = true;
} }
} }
@ -65,11 +65,11 @@ void EnEg_Update(Actor* thisx, GlobalContext* globalCtx) {
EnEg* this = THIS; EnEg* this = THIS;
s32 action = this->action; s32 action = this->action;
if (((action < 0) || (0 < action)) || (actionFuncs[action] == NULL)) { if (((action < 0) || (0 < action)) || (sActionFuncs[action] == NULL)) {
// Translates to: "Main Mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!" // Translates to: "Main Mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!"
osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
} else { } else {
actionFuncs[action](this, globalCtx); sActionFuncs[action](this, globalCtx);
} }
} }

View file

@ -27,7 +27,7 @@ void EnFloormas_Split(EnFloormas* this, GlobalContext* globalCtx);
void EnFloormas_Recover(EnFloormas* this, GlobalContext* globalCtx); void EnFloormas_Recover(EnFloormas* this, GlobalContext* globalCtx);
void EnFloormas_DrawHighlighted(Actor* this, GlobalContext* globalCtx); void EnFloormas_DrawHighlighted(Actor* this, GlobalContext* globalCtx);
void EnFloormas_SmWait(EnFloormas* this, GlobalContext* globalCtx); void EnFloormas_SmWait(EnFloormas* this, GlobalContext* globalCtx);
void EnFloormas_BigDecideActionBegin(EnFloormas* this); void EnFloormas_SetupBigDecideAction(EnFloormas* this);
void EnFloormas_Freeze(EnFloormas* this, GlobalContext* globalCtx); void EnFloormas_Freeze(EnFloormas* this, GlobalContext* globalCtx);
void EnFloormas_TakeDamage(EnFloormas* this, GlobalContext* globalCtx); void EnFloormas_TakeDamage(EnFloormas* this, GlobalContext* globalCtx);
void EnFloormas_Merge(EnFloormas* this, GlobalContext* globalCtx); void EnFloormas_Merge(EnFloormas* this, GlobalContext* globalCtx);
@ -58,20 +58,20 @@ const ActorInit En_Floormas_InitVars = {
(ActorFunc)EnFloormas_Draw, (ActorFunc)EnFloormas_Draw,
}; };
static ColliderCylinderInit cylinderInit = { static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK0, 0x11, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, { COLTYPE_UNK0, 0x11, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER },
{ 0x00, { 0xFFCFFFFF, 0x04, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x09, 0x05, 0x01 }, { 0x00, { 0xFFCFFFFF, 0x04, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x09, 0x05, 0x01 },
{ 25, 40, 0, { 0, 0, 0 } }, { 25, 40, 0, { 0, 0, 0 } },
}; };
static CollisionCheckInfoInit colCheckInfoInit = { 0x04, 0x001E, 0x0028, 0x96 }; static CollisionCheckInfoInit sColChkInfoInit = { 0x04, 0x001E, 0x0028, 0x96 };
static DamageTable damageTable = { { static DamageTable sDamageTable = { {
0x10, 0x02, 0x01, 0x02, 0x10, 0x02, 0x02, 0x10, 0x01, 0x02, 0x04, 0x24, 0x02, 0x44, 0x04, 0x02, 0x10, 0x02, 0x01, 0x02, 0x10, 0x02, 0x02, 0x10, 0x01, 0x02, 0x04, 0x24, 0x02, 0x44, 0x04, 0x02,
0x02, 0x24, 0x00, 0x44, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x04, 0x00, 0x02, 0x24, 0x00, 0x44, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x04, 0x00,
} }; } };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_S8(naviEnemyId, 0x31, ICHAIN_CONTINUE), ICHAIN_S8(naviEnemyId, 0x31, ICHAIN_CONTINUE),
ICHAIN_F32(unk_4C, 0x157C, ICHAIN_CONTINUE), ICHAIN_F32(unk_4C, 0x157C, ICHAIN_CONTINUE),
ICHAIN_F32_DIV1000(gravity, 0xFC18, ICHAIN_STOP), ICHAIN_F32_DIV1000(gravity, 0xFC18, ICHAIN_STOP),
@ -89,13 +89,13 @@ static Vec3f D_80A1A4DC = {
0.0f, 0.0f,
}; };
static Vec3f dustPos = { static Vec3f sDustPos = {
0.0f, 0.0f,
0.0f, 0.0f,
0.0f, 0.0f,
}; };
static Color_RGBA8 mergeColor = { static Color_RGBA8 sMergeColor = {
0x00, 0x00,
0xFF, 0xFF,
0x00, 0x00,
@ -126,13 +126,13 @@ void EnFloormas_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 invisble; s32 invisble;
s32 pad; s32 pad;
Actor_ProcessInitChain(&this->actor, initChain); Actor_ProcessInitChain(&this->actor, sInitChain);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 50.0f); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 50.0f);
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06008FB0, &D_06009DB0, &this->limbDrawTable, SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06008FB0, &D_06009DB0, &this->limbDrawTable,
&this->transitionDrawTable, 25); &this->transitionDrawTable, 25);
Collider_InitCylinder(globalCtx, &this->collider); Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInit); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
func_80061ED4(&this->actor.colChkInfo, &damageTable, &colCheckInfoInit); func_80061ED4(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
this->zOffset = -1600; this->zOffset = -1600;
invisble = this->actor.params & SPAWN_INVISIBLE; invisble = this->actor.params & SPAWN_INVISIBLE;
@ -171,7 +171,7 @@ void EnFloormas_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.attachedA->attachedA = this->actor.attachedB; this->actor.attachedA->attachedA = this->actor.attachedB;
this->actor.attachedB->attachedA = &this->actor; this->actor.attachedB->attachedA = &this->actor;
this->actor.attachedB->attachedB = this->actor.attachedA; this->actor.attachedB->attachedB = this->actor.attachedA;
EnFloormas_BigDecideActionBegin(this); EnFloormas_SetupBigDecideAction(this);
} }
} }
@ -193,18 +193,18 @@ void EnFloormas_MakeVulnerable(EnFloormas* this) {
this->collider.base.acFlags &= ~4; this->collider.base.acFlags &= ~4;
} }
void EnFloormas_BigDecideActionBegin(EnFloormas* this) { void EnFloormas_SetupBigDecideAction(EnFloormas* this) {
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06009DB0); SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06009DB0);
this->actionFunc = EnFloormas_BigDecideAction; this->actionFunc = EnFloormas_BigDecideAction;
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
} }
void EnFloormas_StandBegin(EnFloormas* this) { void EnFloormas_SetupStand(EnFloormas* this) {
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_0600A054, -3.0f); SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_0600A054, -3.0f);
this->actionFunc = EnFloormas_Stand; this->actionFunc = EnFloormas_Stand;
} }
void EnFloormas_BigWalkBegin(EnFloormas* this) { void EnFloormas_SetupBigWalk(EnFloormas* this) {
if (this->actionFunc != EnFloormas_Run) { if (this->actionFunc != EnFloormas_Run) {
SkelAnime_ChangeAnimPlaybackRepeat(&this->skelAnime, &D_060041F4, 1.5f); SkelAnime_ChangeAnimPlaybackRepeat(&this->skelAnime, &D_060041F4, 1.5f);
} else { } else {
@ -216,20 +216,20 @@ void EnFloormas_BigWalkBegin(EnFloormas* this) {
this->actor.speedXZ = 1.5f; this->actor.speedXZ = 1.5f;
} }
void EnFloormas_BigStopWalkBegin(EnFloormas* this) { void EnFloormas_SetupBigStopWalk(EnFloormas* this) {
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06009244); SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06009244);
this->actionFunc = EnFloormas_BigStopWalk; this->actionFunc = EnFloormas_BigStopWalk;
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
} }
void EnFloormas_RunBegin(EnFloormas* this) { void EnFloormas_SetupRun(EnFloormas* this) {
this->actionTimer = 0; this->actionTimer = 0;
this->actionFunc = EnFloormas_Run; this->actionFunc = EnFloormas_Run;
this->actor.speedXZ = 5.0f; this->actor.speedXZ = 5.0f;
this->skelAnime.animPlaybackSpeed = 3.0f; this->skelAnime.animPlaybackSpeed = 3.0f;
} }
void EnFloormas_TurnBegin(EnFloormas* this) { void EnFloormas_SetupTurn(EnFloormas* this) {
s16 rotDelta = this->actionTarget - this->actor.shape.rot.y; s16 rotDelta = this->actionTarget - this->actor.shape.rot.y;
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
if (rotDelta > 0) { if (rotDelta > 0) {
@ -248,7 +248,7 @@ void EnFloormas_TurnBegin(EnFloormas* this) {
this->actionFunc = EnFloormas_Turn; this->actionFunc = EnFloormas_Turn;
} }
void EnFloormas_HoverBegin(EnFloormas* this, GlobalContext* globalCtx) { void EnFloormas_SetupHover(EnFloormas* this, GlobalContext* globalCtx) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_06009520, 3.0f, 0, SkelAnime_GetFrameCount(&D_06009520), 2, -3.0f); SkelAnime_ChangeAnim(&this->skelAnime, &D_06009520, 3.0f, 0, SkelAnime_GetFrameCount(&D_06009520), 2, -3.0f);
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
this->actor.gravity = 0.0f; this->actor.gravity = 0.0f;
@ -258,14 +258,14 @@ void EnFloormas_HoverBegin(EnFloormas* this, GlobalContext* globalCtx) {
this->actionFunc = EnFloormas_Hover; this->actionFunc = EnFloormas_Hover;
} }
void EnFloormas_ChargeBegin(EnFloormas* this) { void EnFloormas_SetupCharge(EnFloormas* this) {
this->actionTimer = 25; this->actionTimer = 25;
this->actor.gravity = -0.15f; this->actor.gravity = -0.15f;
this->actionFunc = EnFloormas_Charge; this->actionFunc = EnFloormas_Charge;
this->actor.speedXZ = 0.5f; this->actor.speedXZ = 0.5f;
} }
void EnFloormas_LandBegin(EnFloormas* this) { void EnFloormas_SetupLand(EnFloormas* this) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_060019CC, 1.0f, 41.0f, 42.0f, 2, 5.0f); SkelAnime_ChangeAnim(&this->skelAnime, &D_060019CC, 1.0f, 41.0f, 42.0f, 2, 5.0f);
if ((this->actor.speedXZ < 0.0f) || (this->actionFunc != EnFloormas_Charge)) { if ((this->actor.speedXZ < 0.0f) || (this->actionFunc != EnFloormas_Charge)) {
this->actionTimer = 30; this->actionTimer = 30;
@ -276,7 +276,7 @@ void EnFloormas_LandBegin(EnFloormas* this) {
this->actionFunc = EnFloormas_Land; this->actionFunc = EnFloormas_Land;
} }
void EnFloormas_SplitBegin(EnFloormas* this) { void EnFloormas_SetupSplit(EnFloormas* this) {
Actor_SetScale(&this->actor, 0.004f); Actor_SetScale(&this->actor, 0.004f);
this->actor.flags |= 0x10; this->actor.flags |= 0x10;
@ -289,23 +289,23 @@ void EnFloormas_SplitBegin(EnFloormas* this) {
this->actor.posRot.pos = this->actor.attachedA->posRot.pos; this->actor.posRot.pos = this->actor.attachedA->posRot.pos;
this->actor.params = 0x10; this->actor.params = 0x10;
SkelAnime_ChangeAnim(&this->skelAnime, &D_060019CC, 1.0f, 41.0f, SkelAnime_GetFrameCount(&D_060019CC), 2, 0.0f); SkelAnime_ChangeAnim(&this->skelAnime, &D_060019CC, 1.0f, 41.0f, SkelAnime_GetFrameCount(&D_060019CC), 2, 0.0f);
this->collider.dim.radius = cylinderInit.dim.radius * 0.6f; this->collider.dim.radius = sCylinderInit.dim.radius * 0.6f;
this->collider.dim.height = cylinderInit.dim.height * 0.6f; this->collider.dim.height = sCylinderInit.dim.height * 0.6f;
this->collider.body.bumperFlags &= ~4; this->collider.body.bumperFlags &= ~4;
this->actor.speedXZ = 4.0f; this->actor.speedXZ = 4.0f;
this->actor.velocity.y = 7.0f; this->actor.velocity.y = 7.0f;
// using div creates a signed check. // using div creates a signed check.
this->actor.colChkInfo.health = colCheckInfoInit.health >> 1; this->actor.colChkInfo.health = sColChkInfoInit.health >> 1;
this->actionFunc = EnFloormas_Split; this->actionFunc = EnFloormas_Split;
} }
void EnFloormas_SmWalkBegin(EnFloormas* this) { void EnFloormas_SetupSmWalk(EnFloormas* this) {
SkelAnime_ChangeAnimPlaybackRepeat(&this->skelAnime, &D_060041F4, 4.5f); SkelAnime_ChangeAnimPlaybackRepeat(&this->skelAnime, &D_060041F4, 4.5f);
this->actionFunc = EnFloormas_SmWalk; this->actionFunc = EnFloormas_SmWalk;
this->actor.speedXZ = 5.0f; this->actor.speedXZ = 5.0f;
} }
void EnFloormas_SmDecideActionBegin(EnFloormas* this) { void EnFloormas_SetupSmDecideAction(EnFloormas* this) {
if (this->actionFunc != EnFloormas_SmWalk) { if (this->actionFunc != EnFloormas_SmWalk) {
SkelAnime_ChangeAnimPlaybackRepeat(&this->skelAnime, &D_060041F4, 4.5f); SkelAnime_ChangeAnimPlaybackRepeat(&this->skelAnime, &D_060041F4, 4.5f);
} }
@ -313,7 +313,7 @@ void EnFloormas_SmDecideActionBegin(EnFloormas* this) {
this->actor.speedXZ = 5.0f; this->actor.speedXZ = 5.0f;
} }
void EnFloormas_SmShrinkBegin(EnFloormas* this, GlobalContext* globalCtx) { void EnFloormas_SetupSmShrink(EnFloormas* this, GlobalContext* globalCtx) {
Vec3f pos; Vec3f pos;
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
@ -325,19 +325,19 @@ void EnFloormas_SmShrinkBegin(EnFloormas* this, GlobalContext* globalCtx) {
this->actionFunc = EnFloormas_SmShrink; this->actionFunc = EnFloormas_SmShrink;
} }
void EnFloormas_SmSlaveJumpAtMasterBegin(EnFloormas* this) { void EnFloormas_SetupSlaveJumpAtMaster(EnFloormas* this) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_060019CC, 2.0f, 0.0f, 41.0f, 2, 0.0f); SkelAnime_ChangeAnim(&this->skelAnime, &D_060019CC, 2.0f, 0.0f, 41.0f, 2, 0.0f);
this->actionFunc = EnFloormas_SmSlaveJumpAtMaster; this->actionFunc = EnFloormas_SmSlaveJumpAtMaster;
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
} }
void EnFloormas_JumpAtLinkBegin(EnFloormas* this) { void EnFloormas_SetupJumpAtLink(EnFloormas* this) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_060019CC, 2.0f, 0.0f, 41.0f, 2, 0.0f); SkelAnime_ChangeAnim(&this->skelAnime, &D_060019CC, 2.0f, 0.0f, 41.0f, 2, 0.0f);
this->actionFunc = EnFloormas_JumpAtLink; this->actionFunc = EnFloormas_JumpAtLink;
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
} }
void EnFloormas_GrabLinkBegin(EnFloormas* this, Player* player) { void EnFloormas_SetupGrabLink(EnFloormas* this, Player* player) {
f32 yDelta; f32 yDelta;
f32 xzDelta; f32 xzDelta;
@ -360,7 +360,7 @@ void EnFloormas_GrabLinkBegin(EnFloormas* this, Player* player) {
this->actionFunc = EnFloormas_GrabLink; this->actionFunc = EnFloormas_GrabLink;
} }
void EnFloormas_MergeBegin(EnFloormas* this) { void EnFloormas_SetupMerge(EnFloormas* this) {
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06009DB0); SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06009DB0);
this->actionTimer = 0; this->actionTimer = 0;
this->smActionTimer += 1500; this->smActionTimer += 1500;
@ -368,7 +368,7 @@ void EnFloormas_MergeBegin(EnFloormas* this) {
this->actionFunc = EnFloormas_Merge; this->actionFunc = EnFloormas_Merge;
} }
void EnFloormas_SmWaitBegin(EnFloormas* this) { void EnFloormas_SetupSmWait(EnFloormas* this) {
EnFloormas* attachedA = (EnFloormas*)this->actor.attachedA; EnFloormas* attachedA = (EnFloormas*)this->actor.attachedA;
EnFloormas* attachedB = (EnFloormas*)this->actor.attachedB; EnFloormas* attachedB = (EnFloormas*)this->actor.attachedB;
@ -384,7 +384,7 @@ void EnFloormas_SmWaitBegin(EnFloormas* this) {
this->actor.flags &= ~0x11; this->actor.flags &= ~0x11;
} }
void EnFloormas_TakeDamageBegin(EnFloormas* this) { void EnFloormas_SetupTakeDamage(EnFloormas* this) {
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06000590, -3.0f); SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06000590, -3.0f);
if ((this->collider.body.acHitItem->toucher.flags & 0x1F824) != 0) { if ((this->collider.body.acHitItem->toucher.flags & 0x1F824) != 0) {
this->actor.posRot.rot.y = this->collider.base.ac->posRot.rot.y; this->actor.posRot.rot.y = this->collider.base.ac->posRot.rot.y;
@ -397,14 +397,14 @@ void EnFloormas_TakeDamageBegin(EnFloormas* this) {
this->actor.velocity.y = 5.5f; this->actor.velocity.y = 5.5f;
} }
void EnFloormas_RecoverBegin(EnFloormas* this) { void EnFloormas_SetupRecover(EnFloormas* this) {
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06000EA4); SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06000EA4);
this->actor.velocity.y = this->actor.speedXZ = 0.0f; this->actor.velocity.y = this->actor.speedXZ = 0.0f;
this->actor.posRot.rot.y = this->actor.shape.rot.y; this->actor.posRot.rot.y = this->actor.shape.rot.y;
this->actionFunc = EnFloormas_Recover; this->actionFunc = EnFloormas_Recover;
} }
void EnFloormas_FreezeBegin(EnFloormas* this) { void EnFloormas_SetupFreeze(EnFloormas* this) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_060019CC, 1.5f, 0, 20.0f, 2, -3.0f); SkelAnime_ChangeAnim(&this->skelAnime, &D_060019CC, 1.5f, 0, 20.0f, 2, -3.0f);
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
if (this->actor.colChkInfo.damageEffect == 4) { if (this->actor.colChkInfo.damageEffect == 4) {
@ -425,14 +425,14 @@ void EnFloormas_Die(EnFloormas* this, GlobalContext* globalCtx) {
if (this->actor.scale.x > 0.004f) { if (this->actor.scale.x > 0.004f) {
// split // split
this->actor.shape.rot.y = this->actor.rotTowardsLinkY + 0x8000; this->actor.shape.rot.y = this->actor.rotTowardsLinkY + 0x8000;
EnFloormas_SplitBegin((EnFloormas*)this->actor.attachedB); EnFloormas_SetupSplit((EnFloormas*)this->actor.attachedB);
EnFloormas_SplitBegin((EnFloormas*)this->actor.attachedA); EnFloormas_SetupSplit((EnFloormas*)this->actor.attachedA);
EnFloormas_SplitBegin(this); EnFloormas_SetupSplit(this);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SPLIT); Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SPLIT);
} else { } else {
// Die // Die
Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0x90); Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0x90);
EnFloormas_SmShrinkBegin(this, globalCtx); EnFloormas_SetupSmShrink(this, globalCtx);
} }
} }
@ -441,12 +441,12 @@ void EnFloormas_BigDecideAction(EnFloormas* this, GlobalContext* globalCtx) {
// within 400 units of link and within 90 degrees rotation of him // within 400 units of link and within 90 degrees rotation of him
if (this->actor.xzDistanceFromLink < 400.0f && !func_8002E084(&this->actor, 0x4000)) { if (this->actor.xzDistanceFromLink < 400.0f && !func_8002E084(&this->actor, 0x4000)) {
this->actionTarget = this->actor.rotTowardsLinkY; this->actionTarget = this->actor.rotTowardsLinkY;
EnFloormas_TurnBegin(this); EnFloormas_SetupTurn(this);
// within 280 units of link and within 45 degrees rotation of him // within 280 units of link and within 45 degrees rotation of him
} else if (this->actor.xzDistanceFromLink < 280.0f && func_8002E084(&this->actor, 0x2000)) { } else if (this->actor.xzDistanceFromLink < 280.0f && func_8002E084(&this->actor, 0x2000)) {
EnFloormas_HoverBegin(this, globalCtx); EnFloormas_SetupHover(this, globalCtx);
} else { } else {
EnFloormas_StandBegin(this); EnFloormas_SetupStand(this);
} }
} }
} }
@ -454,11 +454,11 @@ void EnFloormas_BigDecideAction(EnFloormas* this, GlobalContext* globalCtx) {
void EnFloormas_Stand(EnFloormas* this, GlobalContext* globalCtx) { void EnFloormas_Stand(EnFloormas* this, GlobalContext* globalCtx) {
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) { if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
if (this->actor.scale.x > 0.004f) { if (this->actor.scale.x > 0.004f) {
EnFloormas_BigWalkBegin(this); EnFloormas_SetupBigWalk(this);
} else if (this->actor.params == MERGE_SLAVE) { } else if (this->actor.params == MERGE_SLAVE) {
EnFloormas_SmDecideActionBegin(this); EnFloormas_SetupSmDecideAction(this);
} else { } else {
EnFloormas_SmWalkBegin(this); EnFloormas_SetupSmWalk(this);
} }
} }
} }
@ -479,23 +479,23 @@ void EnFloormas_BigWalk(EnFloormas* this, GlobalContext* globalCtx) {
} }
if ((this->actor.xzDistanceFromLink < 320.0f) && (func_8002E084(&this->actor, 0x4000))) { if ((this->actor.xzDistanceFromLink < 320.0f) && (func_8002E084(&this->actor, 0x4000))) {
EnFloormas_RunBegin(this); EnFloormas_SetupRun(this);
} else if (this->actor.bgCheckFlags & 8) { } else if (this->actor.bgCheckFlags & 8) {
// set target rotation to the colliding wall's rotation // set target rotation to the colliding wall's rotation
this->actionTarget = this->actor.wallPolyRot; this->actionTarget = this->actor.wallPolyRot;
EnFloormas_TurnBegin(this); EnFloormas_SetupTurn(this);
} else if ((this->actor.xzDistanceFromLink < 400.0f) && !func_8002E084(&this->actor, 0x4000)) { } else if ((this->actor.xzDistanceFromLink < 400.0f) && !func_8002E084(&this->actor, 0x4000)) {
// set target rotation to link. // set target rotation to link.
this->actionTarget = this->actor.rotTowardsLinkY; this->actionTarget = this->actor.rotTowardsLinkY;
EnFloormas_TurnBegin(this); EnFloormas_SetupTurn(this);
} else if (this->actionTimer == 0) { } else if (this->actionTimer == 0) {
EnFloormas_BigStopWalkBegin(this); EnFloormas_SetupBigStopWalk(this);
} }
} }
void EnFloormas_BigStopWalk(EnFloormas* this, GlobalContext* globalCtx) { void EnFloormas_BigStopWalk(EnFloormas* this, GlobalContext* globalCtx) {
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) { if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
EnFloormas_BigDecideActionBegin(this); EnFloormas_SetupBigDecideAction(this);
} }
} }
@ -511,9 +511,9 @@ void EnFloormas_Run(EnFloormas* this, GlobalContext* globalCtx) {
if ((this->actor.xzDistanceFromLink < 280.0f) && func_8002E084(&this->actor, 0x2000) && if ((this->actor.xzDistanceFromLink < 280.0f) && func_8002E084(&this->actor, 0x2000) &&
!(this->actor.bgCheckFlags & 8)) { !(this->actor.bgCheckFlags & 8)) {
EnFloormas_HoverBegin(this, globalCtx); EnFloormas_SetupHover(this, globalCtx);
} else if (this->actor.xzDistanceFromLink > 400.0f) { } else if (this->actor.xzDistanceFromLink > 400.0f) {
EnFloormas_BigWalkBegin(this); EnFloormas_SetupBigWalk(this);
} }
} }
@ -523,7 +523,7 @@ void EnFloormas_Turn(EnFloormas* this, GlobalContext* globalCtx) {
f32 sp2C; f32 sp2C;
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) { if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
EnFloormas_StandBegin(this); EnFloormas_SetupStand(this);
} }
if (((this->skelAnime.animPlaybackSpeed > 0.0f) && func_800A56C8(&this->skelAnime, 21.0f)) || if (((this->skelAnime.animPlaybackSpeed > 0.0f) && func_800A56C8(&this->skelAnime, 21.0f)) ||
@ -549,7 +549,7 @@ void EnFloormas_Turn(EnFloormas* this, GlobalContext* globalCtx) {
void EnFloormas_Hover(EnFloormas* this, GlobalContext* globalCtx) { void EnFloormas_Hover(EnFloormas* this, GlobalContext* globalCtx) {
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) { if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
EnFloormas_ChargeBegin(this); EnFloormas_SetupCharge(this);
} }
this->actor.shape.rot.x += 0x140; this->actor.shape.rot.x += 0x140;
this->actor.posRot.pos.y += 10.0f; this->actor.posRot.pos.y += 10.0f;
@ -570,13 +570,13 @@ void EnFloormas_Slide(EnFloormas* this, GlobalContext* globalCtx) {
pos2.z = Math_Coss(this->actor.shape.rot.y + 0x6000) * 7.0f; pos2.z = Math_Coss(this->actor.shape.rot.y + 0x6000) * 7.0f;
// create dust particle // create dust particle
func_800286CC(globalCtx, &pos, &pos2, &dustPos, 0x1C2, 0x64); func_800286CC(globalCtx, &pos, &pos2, &sDustPos, 0x1C2, 0x64);
pos2.x = Math_Sins(this->actor.shape.rot.y - 0x6000) * 7.0f; pos2.x = Math_Sins(this->actor.shape.rot.y - 0x6000) * 7.0f;
pos2.z = Math_Coss(this->actor.shape.rot.y - 0x6000) * 7.0f; pos2.z = Math_Coss(this->actor.shape.rot.y - 0x6000) * 7.0f;
// create dust particle // create dust particle
func_800286CC(globalCtx, &pos, &pos2, &dustPos, 0x1C2, 0x64); func_800286CC(globalCtx, &pos, &pos2, &sDustPos, 0x1C2, 0x64);
func_8002F974(this, NA_SE_EN_FLOORMASTER_SLIDING); func_8002F974(this, NA_SE_EN_FLOORMASTER_SLIDING);
} }
@ -603,7 +603,7 @@ void EnFloormas_Charge(EnFloormas* this, GlobalContext* globalCtx) {
} }
if ((this->actor.bgCheckFlags & 8) || (this->actionTimer == 0)) { if ((this->actor.bgCheckFlags & 8) || (this->actionTimer == 0)) {
EnFloormas_LandBegin(this); EnFloormas_SetupLand(this);
} }
} }
@ -645,9 +645,9 @@ void EnFloormas_Land(EnFloormas* this, GlobalContext* globalCtx) {
if (this->skelAnime.animFrameCount < 45.0f) { if (this->skelAnime.animFrameCount < 45.0f) {
this->skelAnime.animFrameCount = SkelAnime_GetFrameCount(&D_060019CC); this->skelAnime.animFrameCount = SkelAnime_GetFrameCount(&D_060019CC);
} else if (this->actor.params == MERGE_MASTER) { } else if (this->actor.params == MERGE_MASTER) {
EnFloormas_MergeBegin(this); EnFloormas_SetupMerge(this);
} else { } else {
EnFloormas_StandBegin(this); EnFloormas_SetupStand(this);
this->smActionTimer = 50; this->smActionTimer = 50;
} }
} }
@ -662,7 +662,7 @@ void EnFloormas_Split(EnFloormas* this, GlobalContext* globalCtx) {
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) { if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
this->actor.flags |= 1; this->actor.flags |= 1;
this->smActionTimer = 50; this->smActionTimer = 50;
EnFloormas_StandBegin(this); EnFloormas_SetupStand(this);
} }
Math_ApproxF(&this->actor.speedXZ, 0.0f, 1.0f); Math_ApproxF(&this->actor.speedXZ, 0.0f, 1.0f);
} }
@ -681,10 +681,10 @@ void EnFloormas_SmWalk(EnFloormas* this, GlobalContext* globalCtx) {
} }
if (this->smActionTimer == 0) { if (this->smActionTimer == 0) {
EnFloormas_SmDecideActionBegin(this); EnFloormas_SetupSmDecideAction(this);
} else if (this->actor.bgCheckFlags & 8) { } else if (this->actor.bgCheckFlags & 8) {
this->actionTarget = this->actor.wallPolyRot; this->actionTarget = this->actor.wallPolyRot;
EnFloormas_TurnBegin(this); EnFloormas_SetupTurn(this);
} else if (this->actor.xzDistanceFromLink < 120.0f) { } else if (this->actor.xzDistanceFromLink < 120.0f) {
Math_ApproxUpdateScaledS(&this->actor.shape.rot.y, this->actor.rotTowardsLinkY + 0x8000, 0x38E); Math_ApproxUpdateScaledS(&this->actor.shape.rot.y, this->actor.rotTowardsLinkY + 0x8000, 0x38E);
} }
@ -701,7 +701,7 @@ void EnFloormas_SmDecideAction(EnFloormas* this, GlobalContext* globalCtx) {
isAgainstWall = this->actor.bgCheckFlags & 8; isAgainstWall = this->actor.bgCheckFlags & 8;
if (isAgainstWall) { if (isAgainstWall) {
this->actionTarget = this->actor.wallPolyRot; this->actionTarget = this->actor.wallPolyRot;
EnFloormas_TurnBegin(this); EnFloormas_SetupTurn(this);
return; return;
} }
@ -717,19 +717,19 @@ void EnFloormas_SmDecideAction(EnFloormas* this, GlobalContext* globalCtx) {
Math_ApproxUpdateScaledS(&this->actor.shape.rot.y, func_8002DA78(&this->actor, primaryFloormas), 0x38E); Math_ApproxUpdateScaledS(&this->actor.shape.rot.y, func_8002DA78(&this->actor, primaryFloormas), 0x38E);
if (func_8002DB8C(&this->actor, primaryFloormas) < 80.0f) { if (func_8002DB8C(&this->actor, primaryFloormas) < 80.0f) {
EnFloormas_SmSlaveJumpAtMasterBegin(this); EnFloormas_SetupSlaveJumpAtMaster(this);
} }
} else { } else {
Math_SmoothScaleMaxS(&this->actor.shape.rot.y, this->actor.rotTowardsLinkY, 3, 0x71C); Math_SmoothScaleMaxS(&this->actor.shape.rot.y, this->actor.rotTowardsLinkY, 3, 0x71C);
if (this->actor.xzDistanceFromLink < 80.0f) { if (this->actor.xzDistanceFromLink < 80.0f) {
EnFloormas_JumpAtLinkBegin(this); EnFloormas_SetupJumpAtLink(this);
} }
} }
} }
void EnFloormas_SmShrink(EnFloormas* this, GlobalContext* globalCtx) { void EnFloormas_SmShrink(EnFloormas* this, GlobalContext* globalCtx) {
if (Math_ApproxF(&this->actor.scale.x, 0.0f, 0.0015f)) { if (Math_ApproxF(&this->actor.scale.x, 0.0f, 0.0015f)) {
EnFloormas_SmWaitBegin(this); EnFloormas_SetupSmWait(this);
} }
this->actor.scale.z = this->actor.scale.x; this->actor.scale.z = this->actor.scale.x;
this->actor.scale.y = this->actor.scale.x; this->actor.scale.y = this->actor.scale.x;
@ -748,11 +748,11 @@ void EnFloormas_JumpAtLink(EnFloormas* this, GlobalContext* globalCtx) {
this->actionTimer = 0x32; this->actionTimer = 0x32;
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND);
EnFloormas_LandBegin(this); EnFloormas_SetupLand(this);
} else if ((this->actor.yDistanceFromLink < -10.0f) && this->collider.base.maskA & 2 && } else if ((this->actor.yDistanceFromLink < -10.0f) && this->collider.base.maskA & 2 &&
(&player->actor == this->collider.base.oc)) { (&player->actor == this->collider.base.oc)) {
globalCtx->unk_11D4C(globalCtx, player); globalCtx->unk_11D4C(globalCtx, player);
EnFloormas_GrabLinkBegin(this, player); EnFloormas_SetupGrabLink(this, player);
} }
} }
@ -804,7 +804,7 @@ void EnFloormas_GrabLink(EnFloormas* this, GlobalContext* globalCtx) {
this->actor.velocity.y = 6.0f; this->actor.velocity.y = 6.0f;
this->actor.flags |= 1; this->actor.flags |= 1;
this->actor.speedXZ = -3.0f; this->actor.speedXZ = -3.0f;
EnFloormas_LandBegin(this); EnFloormas_SetupLand(this);
} else { } else {
// Damage link every 20 frames // Damage link every 20 frames
if ((this->actionTarget % 20) == 0) { if ((this->actionTarget % 20) == 0) {
@ -831,7 +831,7 @@ void EnFloormas_SmSlaveJumpAtMaster(EnFloormas* this, GlobalContext* globalCtx)
} else { } else {
if (this->actor.bgCheckFlags & 2) { if (this->actor.bgCheckFlags & 2) {
this->actor.params = 0x10; this->actor.params = 0x10;
EnFloormas_LandBegin(this); EnFloormas_SetupLand(this);
} }
return; return;
} }
@ -843,12 +843,12 @@ void EnFloormas_SmSlaveJumpAtMaster(EnFloormas* this, GlobalContext* globalCtx)
} else if ((((primFloormas->posRot.pos.y - this->actor.posRot.pos.y) < -10.0f) && } else if ((((primFloormas->posRot.pos.y - this->actor.posRot.pos.y) < -10.0f) &&
(fabsf(this->actor.posRot.pos.x - primFloormas->posRot.pos.x) < 10.0f)) && (fabsf(this->actor.posRot.pos.x - primFloormas->posRot.pos.x) < 10.0f)) &&
(fabsf(this->actor.posRot.pos.z - primFloormas->posRot.pos.z) < 10.0f)) { (fabsf(this->actor.posRot.pos.z - primFloormas->posRot.pos.z) < 10.0f)) {
EnFloormas_SmWaitBegin(this); EnFloormas_SetupSmWait(this);
this->collider.base.maskA |= 1; this->collider.base.maskA |= 1;
} else if (this->actor.bgCheckFlags & 2) { } else if (this->actor.bgCheckFlags & 2) {
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND);
EnFloormas_LandBegin(this); EnFloormas_SetupLand(this);
} }
if (fabsf(this->actor.posRot.pos.x - primFloormas->posRot.pos.x) < 5.0f && if (fabsf(this->actor.posRot.pos.x - primFloormas->posRot.pos.x) < 5.0f &&
@ -873,11 +873,11 @@ void EnFloormas_Merge(EnFloormas* this, GlobalContext* globalCtx) {
if (this->smActionTimer == 0) { if (this->smActionTimer == 0) {
if (attachedA->actionFunc != EnFloormas_SmWait) { if (attachedA->actionFunc != EnFloormas_SmWait) {
EnFloormas_SmShrinkBegin(attachedA, globalCtx); EnFloormas_SetupSmShrink(attachedA, globalCtx);
} }
if (attachedB->actionFunc != EnFloormas_SmWait) { if (attachedB->actionFunc != EnFloormas_SmWait) {
EnFloormas_SmShrinkBegin(attachedB, globalCtx); EnFloormas_SetupSmShrink(attachedB, globalCtx);
} }
} else { } else {
if ((attachedA->actionFunc != EnFloormas_SmWait) && (attachedA->actionFunc != EnFloormas_SmShrink)) { if ((attachedA->actionFunc != EnFloormas_SmWait) && (attachedA->actionFunc != EnFloormas_SmShrink)) {
@ -904,8 +904,8 @@ void EnFloormas_Merge(EnFloormas* this, GlobalContext* globalCtx) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_EXPAND); Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_EXPAND);
} }
this->collider.dim.radius = (cylinderInit.dim.radius * 100.0f) * this->actor.scale.x; this->collider.dim.radius = (sCylinderInit.dim.radius * 100.0f) * this->actor.scale.x;
this->collider.dim.height = (cylinderInit.dim.height * 100.0f) * this->actor.scale.x; this->collider.dim.height = (sCylinderInit.dim.height * 100.0f) * this->actor.scale.x;
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) { if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) {
if (this->actor.scale.x >= 0.01f) { if (this->actor.scale.x >= 0.01f) {
@ -913,8 +913,8 @@ void EnFloormas_Merge(EnFloormas* this, GlobalContext* globalCtx) {
EnFloormas_MakeVulnerable(this); EnFloormas_MakeVulnerable(this);
this->actor.params = 0; this->actor.params = 0;
this->collider.body.bumperFlags |= 4; this->collider.body.bumperFlags |= 4;
this->actor.colChkInfo.health = colCheckInfoInit.health; this->actor.colChkInfo.health = sColChkInfoInit.health;
EnFloormas_StandBegin(this); EnFloormas_SetupStand(this);
} else { } else {
if (this->actionTimer == 0) { if (this->actionTimer == 0) {
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_060039B0); SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_060039B0);
@ -936,7 +936,7 @@ void EnFloormas_TakeDamage(EnFloormas* this, GlobalContext* globalCtx) {
if (this->actor.colChkInfo.health == 0) { if (this->actor.colChkInfo.health == 0) {
EnFloormas_Die(this, globalCtx); EnFloormas_Die(this, globalCtx);
} else { } else {
EnFloormas_RecoverBegin(this); EnFloormas_SetupRecover(this);
} }
} }
@ -952,7 +952,7 @@ void EnFloormas_TakeDamage(EnFloormas* this, GlobalContext* globalCtx) {
void EnFloormas_Recover(EnFloormas* this, GlobalContext* globalCtx) { void EnFloormas_Recover(EnFloormas* this, GlobalContext* globalCtx) {
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) { if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) {
EnFloormas_StandBegin(this); EnFloormas_SetupStand(this);
} }
} }
@ -966,7 +966,7 @@ void EnFloormas_Freeze(EnFloormas* this, GlobalContext* globalCtx) {
EnFloormas_Die(this, globalCtx); EnFloormas_Die(this, globalCtx);
return; return;
} }
EnFloormas_StandBegin(this); EnFloormas_SetupStand(this);
} }
} }
@ -1001,14 +1001,14 @@ void EnFloormas_ColliderCheck(EnFloormas* this, GlobalContext* globalCtx) {
if ((this->actor.colChkInfo.damageEffect == 4) || (this->actor.colChkInfo.damageEffect == 1)) { if ((this->actor.colChkInfo.damageEffect == 4) || (this->actor.colChkInfo.damageEffect == 1)) {
if (this->actionFunc != EnFloormas_Freeze) { if (this->actionFunc != EnFloormas_Freeze) {
EnFloormas_FreezeBegin(this); EnFloormas_SetupFreeze(this);
} }
} else { } else {
if (this->actor.colChkInfo.damageEffect == 2) { if (this->actor.colChkInfo.damageEffect == 2) {
func_8002A65C(globalCtx, &this->actor, &this->actor.posRot.pos, this->actor.scale.x * 4000.f, func_8002A65C(globalCtx, &this->actor, &this->actor.posRot.pos, this->actor.scale.x * 4000.f,
this->actor.scale.x * 4000.f); this->actor.scale.x * 4000.f);
} }
EnFloormas_TakeDamageBegin(this); EnFloormas_SetupTakeDamage(this);
} }
} }
} }
@ -1032,7 +1032,7 @@ void EnFloormas_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actor.velocity.y = 5.0f; this->actor.velocity.y = 5.0f;
EnFloormas_LandBegin(this); EnFloormas_SetupLand(this);
} }
EnFloormas_ColliderCheck(this, globalCtx); EnFloormas_ColliderCheck(this, globalCtx);
this->actionFunc(this, globalCtx); this->actionFunc(this, globalCtx);
@ -1108,7 +1108,7 @@ void EnFloormas_Draw(Actor* thisx, GlobalContext* globalCtx) {
Graph_OpenDisps(gfx, globalCtx->state.gfxCtx, "../z_en_floormas.c", 2318); Graph_OpenDisps(gfx, globalCtx->state.gfxCtx, "../z_en_floormas.c", 2318);
func_80093D18(globalCtx->state.gfxCtx); func_80093D18(globalCtx->state.gfxCtx);
if (this->collider.base.type == COLTYPE_UNK12) { if (this->collider.base.type == COLTYPE_UNK12) {
func_80026230(globalCtx, &mergeColor, this->actionTarget % 0x28, 0x28); func_80026230(globalCtx, &sMergeColor, this->actionTarget % 0x28, 0x28);
} }
gfxCtx->polyOpa.p = gfxCtx->polyOpa.p =
@ -1128,7 +1128,7 @@ void EnFloormas_DrawHighlighted(Actor* thisx, GlobalContext* globalCtx) {
Graph_OpenDisps(gfx, globalCtx->state.gfxCtx, "../z_en_floormas.c", 2352); Graph_OpenDisps(gfx, globalCtx->state.gfxCtx, "../z_en_floormas.c", 2352);
func_80093D84(globalCtx->state.gfxCtx); func_80093D84(globalCtx->state.gfxCtx);
if (this->collider.base.type == COLTYPE_UNK12) { if (this->collider.base.type == COLTYPE_UNK12) {
func_80026690(globalCtx, &mergeColor, this->actionTarget % 0x28, 0x28); func_80026690(globalCtx, &sMergeColor, this->actionTarget % 0x28, 0x28);
} }
gfxCtx->polyXlu.p = gfxCtx->polyXlu.p =
SkelAnime_DrawSV2(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount, SkelAnime_DrawSV2(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount,

View file

@ -65,7 +65,7 @@ static UNK_PTR sMouthSegments[] = {
extern AnimationHeader D_0600057C; extern AnimationHeader D_0600057C;
extern AnimationHeader D_06000B04; extern AnimationHeader D_06000B04;
extern SkeletonHeader D_06006C90; extern SkeletonHeader D_06006C90;
extern UNK_TYPE D_0200E080; extern CutsceneData D_0200E080[];
typedef enum { typedef enum {
/* 0x00 */ FU_FACE_CALM, /* 0x00 */ FU_FACE_CALM,

View file

@ -5,7 +5,6 @@
*/ */
#include "z_en_ganon_organ.h" #include "z_en_ganon_organ.h"
#include "overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h" #include "overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h"
#define FLAGS 0x00000030 #define FLAGS 0x00000030
@ -29,8 +28,8 @@ const ActorInit En_Ganon_Organ_InitVars = {
(ActorFunc)EnGanonOrgan_Draw, (ActorFunc)EnGanonOrgan_Draw,
}; };
extern D_80A2CCA8; // remove when data is decompiled extern Gfx D_80A2CCA8[];
extern D_80A2EAB0; // remove when data is decompiled extern Gfx D_80A2EAB0[];
void EnGanonOrgan_Init(Actor* thisx, GlobalContext* globalCtx) { void EnGanonOrgan_Init(Actor* thisx, GlobalContext* globalCtx) {
thisx->flags &= ~1; thisx->flags &= ~1;
@ -114,8 +113,8 @@ void EnGanonOrgan_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_ganon_organ.c", 221), gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_ganon_organ.c", 221),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxCtx->polyOpa.p++, &D_80A2CCA8); gSPDisplayList(gfxCtx->polyOpa.p++, D_80A2CCA8);
gSPDisplayList(gfxCtx->polyOpa.p++, &D_80A2EAB0); gSPDisplayList(gfxCtx->polyOpa.p++, D_80A2EAB0);
osSyncPrintf("ORGAN DRAW 2\n"); osSyncPrintf("ORGAN DRAW 2\n");
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_ganon_organ.c", 230); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_ganon_organ.c", 230);
} }

View file

@ -1,3 +1,9 @@
/*
* File: z_en_guest.c
* Overlay: ovl_En_Guest
* Description: Happy Mask Shop Customer
*/
#include "z_en_guest.h" #include "z_en_guest.h"
#include <vt.h> #include <vt.h>
@ -14,13 +20,6 @@ void func_80A50518(EnGuest* this, GlobalContext* globalCtx);
void func_80A5057C(EnGuest* this, GlobalContext* globalCtx); void func_80A5057C(EnGuest* this, GlobalContext* globalCtx);
void func_80A505CC(Actor* thisx, GlobalContext* globalCtx); void func_80A505CC(Actor* thisx, GlobalContext* globalCtx);
extern SkeletonHeader D_060000F0;
extern AnimationHeader D_060042AC;
extern UNK_TYPE D_060005FC;
extern UNK_TYPE D_060006FC;
extern UNK_TYPE D_060007FC;
extern Gfx D_060059B0[];
const ActorInit En_Guest_InitVars = { const ActorInit En_Guest_InitVars = {
ACTOR_EN_GUEST, ACTOR_EN_GUEST,
ACTORTYPE_NPC, ACTORTYPE_NPC,
@ -33,7 +32,7 @@ const ActorInit En_Guest_InitVars = {
NULL, NULL,
}; };
static ColliderCylinderInit_Set3 sColliderInit = { static ColliderCylinderInit_Set3 sCylinderInit = {
{ COLTYPE_UNK10, 0x00, 0x00, 0x39, COLSHAPE_CYLINDER }, { COLTYPE_UNK10, 0x00, 0x00, 0x39, COLSHAPE_CYLINDER },
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 },
{ 10, 60, 0, { 0, 0, 0 } }, { 10, 60, 0, { 0, 0, 0 } },
@ -45,11 +44,15 @@ static InitChainEntry sInitChain[] = {
}; };
UNK_PTR D_80A50BA4[] = { UNK_PTR D_80A50BA4[] = {
&D_060005FC, 0x060005FC,
&D_060006FC, 0x060006FC,
&D_060007FC, 0x060007FC,
}; };
extern SkeletonHeader D_060000F0;
extern AnimationHeader D_060042AC;
extern Gfx D_060059B0[];
void EnGuest_Init(Actor* thisx, GlobalContext* globalCtx) { void EnGuest_Init(Actor* thisx, GlobalContext* globalCtx) {
EnGuest* this = THIS; EnGuest* this = THIS;
@ -75,7 +78,7 @@ void EnGuest_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void EnGuest_Update(Actor* thisx, GlobalContext* globalCtx) { void EnGuest_Update(Actor* thisx, GlobalContext* globalCtx) {
EnGuest* this = THIS; EnGuest* this = THIS;
u32 padding; u32 pad;
if (Object_IsLoaded(&globalCtx->objectCtx, this->osAnimeBankIndex) != 0) { if (Object_IsLoaded(&globalCtx->objectCtx, this->osAnimeBankIndex) != 0) {
this->actor.flags &= ~0x10; this->actor.flags &= ~0x10;
@ -91,7 +94,7 @@ void EnGuest_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actor.update = func_80A505CC; this->actor.update = func_80A505CC;
Collider_InitCylinder(globalCtx, &this->collider); Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder_Set3(globalCtx, &this->collider, &this->actor, &sColliderInit); Collider_SetCylinder_Set3(globalCtx, &this->collider, &this->actor, &sCylinderInit);
Actor_SetHeight(&this->actor, 60.0f); Actor_SetHeight(&this->actor, 60.0f);
@ -144,7 +147,7 @@ void func_80A5057C(EnGuest* this, GlobalContext* globalCtx) {
void func_80A505CC(Actor* thisx, GlobalContext* globalCtx) { void func_80A505CC(Actor* thisx, GlobalContext* globalCtx) {
EnGuest* this = THIS; EnGuest* this = THIS;
u32 padding; u32 pad;
Player* player; Player* player;
player = PLAYER; player = PLAYER;

View file

@ -27,7 +27,7 @@ const ActorInit En_Hata_InitVars = {
(ActorFunc)EnHata_Draw, (ActorFunc)EnHata_Draw,
}; };
static UNK_TYPE4 sUnusedData[] = { static UNK_TYPE sUnusedData[] = {
0x0A000939, 0x20010000, 0x00000000, 0x00000000, 0x00000000, 0x00000080, 0x00000000, 0x0A000939, 0x20010000, 0x00000000, 0x00000000, 0x00000000, 0x00000080, 0x00000000,
0x00050100, 0x001000F6, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFF000000, 0x00050100, 0x001000F6, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFF000000,
}; };
@ -45,7 +45,7 @@ void EnHata_Init(Actor* thisx, GlobalContext* globalCtx) {
f32 frameCount; f32 frameCount;
temp = 0; temp = 0;
frameCount = (f32)SkelAnime_GetFrameCount(&D_06000444.genericHeader); frameCount = SkelAnime_GetFrameCount(&D_06000444.genericHeader);
Actor_SetScale(&this->dyna.actor, 1.0f / 75.0f); Actor_SetScale(&this->dyna.actor, 1.0f / 75.0f);
SkelAnime_Init(globalCtx, &this->skelAnime, &D_06002FD0, &D_06000444, NULL, NULL, 0); SkelAnime_Init(globalCtx, &this->skelAnime, &D_06002FD0, &D_06000444, NULL, NULL, 0);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06000444, 1.0f, 0.0f, frameCount, 0, 0.0f); SkelAnime_ChangeAnim(&this->skelAnime, &D_06000444, 1.0f, 0.0f, frameCount, 0, 0.0f);
@ -58,7 +58,7 @@ void EnHata_Init(Actor* thisx, GlobalContext* globalCtx) {
this->invScale = 6; this->invScale = 6;
this->maxStep = 1000; this->maxStep = 1000;
this->minStep = 1; this->minStep = 1;
this->unk_278 = (s16)(Math_Rand_ZeroOne() * 65535.0f); this->unk_278 = Math_Rand_ZeroOne() * 65535.0f;
} }
void EnHata_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnHata_Destroy(Actor* thisx, GlobalContext* globalCtx) {

View file

@ -54,7 +54,7 @@ extern AnimationHeader D_06005C30;
extern AnimationHeader D_06005500; extern AnimationHeader D_06005500;
extern SkeletonHeader D_0600BAC8; extern SkeletonHeader D_0600BAC8;
extern Gfx D_0602B060[]; // Keaton Mask extern Gfx D_0602B060[]; // Keaton Mask
extern Gfx D_06002C10[]; extern Gfx D_06002C10[]; // 2D Guard in Window
const ActorInit En_Heishi2_InitVars = { const ActorInit En_Heishi2_InitVars = {
ACTOR_EN_HEISHI2, ACTOR_EN_HEISHI2,
@ -68,7 +68,7 @@ const ActorInit En_Heishi2_InitVars = {
(ActorFunc)EnHeishi2_Draw, (ActorFunc)EnHeishi2_Draw,
}; };
static ColliderCylinderInit cylinderInit = { static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER },
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 },
{ 33, 40, 0, { 0, 0, 0 } }, { 33, 40, 0, { 0, 0, 0 } },
@ -80,7 +80,7 @@ void EnHeishi2_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetScale(&this->actor, 0.01f); Actor_SetScale(&this->actor, 0.01f);
this->initParams = this->actor.params & 0xFF; this->initParams = this->actor.params & 0xFF;
this->actor.colChkInfo.mass = 0xFF; this->actor.colChkInfo.mass = 255;
if ((this->initParams == 6) || (this->initParams == 9)) { if ((this->initParams == 6) || (this->initParams == 9)) {
this->actor.draw = func_80A54C6C; this->actor.draw = func_80A54C6C;
@ -114,7 +114,7 @@ void EnHeishi2_Init(Actor* thisx, GlobalContext* globalCtx) {
this->transitionDrawTable, 17); this->transitionDrawTable, 17);
collider = &this->collider; collider = &this->collider;
Collider_InitCylinder(globalCtx, collider); Collider_InitCylinder(globalCtx, collider);
Collider_SetCylinder(globalCtx, collider, &this->actor, &cylinderInit); Collider_SetCylinder(globalCtx, collider, &this->actor, &sCylinderInit);
this->collider.dim.yShift = 0; this->collider.dim.yShift = 0;
this->collider.dim.radius = 0xF; this->collider.dim.radius = 0xF;
this->collider.dim.height = 0x46; this->collider.dim.height = 0x46;
@ -855,7 +855,7 @@ void func_80A54C6C(Actor* thisx, GlobalContext* globalCtx) {
Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_heishi2.c", 1772); Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_heishi2.c", 1772);
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_heishi2.c", 1774), gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_heishi2.c", 1774),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxCtx->polyOpa.p++, &D_06002C10); // 2D Guard in Window gSPDisplayList(gfxCtx->polyOpa.p++, &D_06002C10);
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_heishi2.c", 1777); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_heishi2.c", 1777);
} }

View file

@ -42,7 +42,7 @@ const ActorInit En_Heishi3_InitVars = {
(ActorFunc)EnHeishi3_Draw, (ActorFunc)EnHeishi3_Draw,
}; };
static ColliderCylinderInit cylinderInit = { static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER },
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 },
{ 15, 70, 0, { 0, 0, 0 } }, { 15, 70, 0, { 0, 0, 0 } },
@ -64,10 +64,10 @@ void EnHeishi3_Init(Actor* thisx, GlobalContext* globalCtx) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f);
SkelAnime_Init(globalCtx, &this->skelAnime, &D_0600BAC8, &D_06005C30, this->limbDrawTable, SkelAnime_Init(globalCtx, &this->skelAnime, &D_0600BAC8, &D_06005C30, this->limbDrawTable,
this->transitionDrawTable, 17); this->transitionDrawTable, 17);
this->actor.colChkInfo.mass = -1; this->actor.colChkInfo.mass = 0xFF;
this->actor.unk_1F = 6; this->actor.unk_1F = 6;
Collider_InitCylinder(globalCtx, &this->collider); Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInit); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
// "Castle Gate Soldier - Power Up" // "Castle Gate Soldier - Power Up"
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 城門兵パワーアップ ☆☆☆☆☆ \n" VT_RST); osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 城門兵パワーアップ ☆☆☆☆☆ \n" VT_RST);

View file

@ -36,37 +36,32 @@ const ActorInit En_Horse_Ganon_InitVars = {
(ActorFunc)EnHorseGanon_Draw, (ActorFunc)EnHorseGanon_Draw,
}; };
extern SkeletonHeader D_06008668; AnimationHeader* D_80A691B0[] = { 0x06004AA4, 0x06005264, 0x06005B78, 0x06002CE4 };
extern AnimationHeader D_06004AA4; AnimationHeader* D_80A691C0[] = { 0x06002650, 0x06003858 };
extern AnimationHeader D_06005264;
extern AnimationHeader D_06005B78;
extern AnimationHeader D_06002CE4;
extern AnimationHeader D_06002650;
extern AnimationHeader D_06003858;
AnimationHeader* D_80A691B0[] = { &D_06004AA4, &D_06005264, &D_06005B78, &D_06002CE4 }; static f32 sAnimPlaybackSpeeds[] = { 0.66666666f, 0.66666666f, 1.0f, 1.0f, 1.0f, 0.66666666f };
AnimationHeader* D_80A691C0[] = { &D_06002650, &D_06003858 };
static f32 animPlaybackSpeed[] = { 0.66666666f, 0.66666666f, 1.0f, 1.0f, 1.0f, 0.66666666f };
static ColliderCylinderInit cylinderInit = { static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x12, COLSHAPE_CYLINDER }, { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x12, COLSHAPE_CYLINDER },
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 },
{ 40, 100, 0, { 0, 0, 0 } }, { 40, 100, 0, { 0, 0, 0 } },
}; };
static ColliderJntSphItemInit jntsphItemsInit[1] = {
static ColliderJntSphItemInit sJntSphItemsInit[] = {
{ {
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 },
{ 13, { { 0, 0, 0 }, 20 }, 100 }, { 13, { { 0, 0, 0 }, 20 }, 100 },
}, },
}; };
static ColliderJntSphInit jntsphInit = {
static ColliderJntSphInit sJntSphInit = {
{ COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x12, COLSHAPE_JNTSPH }, { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x12, COLSHAPE_JNTSPH },
1, 1,
jntsphItemsInit, sJntSphItemsInit,
}; };
static CollisionCheckInfoInit collisionCheckInfoInit = { static CollisionCheckInfoInit sColChkInfoInit = {
0x0A, 0x0A,
0x0023, 0x0023,
0x0064, 0x0064,
@ -83,14 +78,17 @@ unk_D_80A69248 D_80A69248[] = { { 0x09B8, 0x0126, 0x0E2C, 0x07 }, { 0x0C11, 0x01
s32 D_80A692B8[] = { 0, 0x00000010 }; s32 D_80A692B8[] = { 0, 0x00000010 };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_F32(unk_F8, 1200, ICHAIN_STOP), ICHAIN_F32(unk_F8, 1200, ICHAIN_STOP),
}; };
static EnHorseGanonActionFunc actionFuncs[] = { func_80A68AF0, func_80A68DB0, NULL }; static EnHorseGanonActionFunc sActionFuncs[] = { func_80A68AF0, func_80A68DB0, NULL };
const f32 D_80A692D0 = 10430.3779f; const f32 D_80A692D0 = 10430.3779f;
extern SkeletonHeader D_06008668;
extern AnimationHeader D_06004AA4;
void func_80A68660(unk_D_80A69248* data, s32 index, Vec3f* vec) { void func_80A68660(unk_D_80A69248* data, s32 index, Vec3f* vec) {
vec->x = data[index].unk_0.x; vec->x = data[index].unk_0.x;
vec->y = data[index].unk_0.y; vec->y = data[index].unk_0.y;
@ -156,7 +154,7 @@ void func_80A68870(EnHorseGanon* this) {
void EnHorseGanon_Init(Actor* thisx, GlobalContext* globalCtx) { void EnHorseGanon_Init(Actor* thisx, GlobalContext* globalCtx) {
EnHorseGanon* this = THIS; EnHorseGanon* this = THIS;
Actor_ProcessInitChain(&this->actor, initChain); Actor_ProcessInitChain(&this->actor, sInitChain);
Actor_SetScale(&this->actor, 0.0115f); Actor_SetScale(&this->actor, 0.0115f);
this->actor.gravity = -3.5f; this->actor.gravity = -3.5f;
@ -171,11 +169,11 @@ void EnHorseGanon_Init(Actor* thisx, GlobalContext* globalCtx) {
SkelAnime_ChangeAnimDefaultStop(&this->skin.skelAnime, D_80A691B0[0]); SkelAnime_ChangeAnimDefaultStop(&this->skin.skelAnime, D_80A691B0[0]);
Collider_InitCylinder(globalCtx, &this->colliderCylinder); Collider_InitCylinder(globalCtx, &this->colliderCylinder);
Collider_SetCylinder(globalCtx, &this->colliderCylinder, &this->actor, &cylinderInit); Collider_SetCylinder(globalCtx, &this->colliderCylinder, &this->actor, &sCylinderInit);
Collider_InitJntSph(globalCtx, &this->colliderSphere); Collider_InitJntSph(globalCtx, &this->colliderSphere);
Collider_SetJntSph(globalCtx, &this->colliderSphere, &this->actor, &jntsphInit, &this->colliderSphereItem); Collider_SetJntSph(globalCtx, &this->colliderSphere, &this->actor, &sJntSphInit, &this->colliderSphereItem);
func_80061ED4(&this->actor.colChkInfo, 0, &collisionCheckInfoInit); func_80061ED4(&this->actor.colChkInfo, 0, &sColChkInfoInit);
func_80A68AC4(this); func_80A68AC4(this);
} }
@ -234,11 +232,11 @@ void func_80A68B20(EnHorseGanon* this) {
if (animationChanged == 1) { if (animationChanged == 1) {
SkelAnime_ChangeAnim(&this->skin.skelAnime, D_80A691B0[this->currentAnimation], SkelAnime_ChangeAnim(&this->skin.skelAnime, D_80A691B0[this->currentAnimation],
animPlaybackSpeed[this->currentAnimation] * sp30 * 1.5f, 0.0f, sAnimPlaybackSpeeds[this->currentAnimation] * sp30 * 1.5f, 0.0f,
SkelAnime_GetFrameCount(&D_80A691B0[this->currentAnimation]->genericHeader), 2, -3.0f); SkelAnime_GetFrameCount(&D_80A691B0[this->currentAnimation]->genericHeader), 2, -3.0f);
} else { } else {
SkelAnime_ChangeAnim(&this->skin.skelAnime, D_80A691B0[this->currentAnimation], SkelAnime_ChangeAnim(&this->skin.skelAnime, D_80A691B0[this->currentAnimation],
animPlaybackSpeed[this->currentAnimation] * sp30 * 1.5f, 0.0f, sAnimPlaybackSpeeds[this->currentAnimation] * sp30 * 1.5f, 0.0f,
SkelAnime_GetFrameCount(&D_80A691B0[this->currentAnimation]->genericHeader), 2, 0.0f); SkelAnime_GetFrameCount(&D_80A691B0[this->currentAnimation]->genericHeader), 2, 0.0f);
} }
} }
@ -276,7 +274,7 @@ void EnHorseGanon_Update(Actor* thisx, GlobalContext* globalCtx) {
EnHorseGanon* this = THIS; EnHorseGanon* this = THIS;
s32 pad; s32 pad;
actionFuncs[this->action](this, globalCtx); sActionFuncs[this->action](this, globalCtx);
Actor_MoveForward(&this->actor); Actor_MoveForward(&this->actor);
func_8002E4B4(globalCtx, &this->actor, 20.0f, 55.0f, 100.0f, 29); func_8002E4B4(globalCtx, &this->actor, 20.0f, 55.0f, 100.0f, 29);
this->actor.posRot2.pos = this->actor.posRot.pos; this->actor.posRot2.pos = this->actor.posRot.pos;

View file

@ -14,13 +14,13 @@ void EnIt_Init(Actor* thisx, GlobalContext* globalCtx);
void EnIt_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnIt_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnIt_Update(Actor* thisx, GlobalContext* globalCtx); void EnIt_Update(Actor* thisx, GlobalContext* globalCtx);
static ColliderCylinderInit cylinderInitData = { static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK10, 0x00, 0x00, 0x05, 0x10, COLSHAPE_CYLINDER }, { COLTYPE_UNK10, 0x00, 0x00, 0x05, 0x10, COLSHAPE_CYLINDER },
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 },
{ 40, 10, 0, { 0 } }, { 40, 10, 0, { 0 } },
}; };
static CollisionCheckInfoInit2 colChkInfoInit = { static CollisionCheckInfoInit2 sColChkInfoInit = {
0x00, 0x0000, 0x0000, 0x0000, 0xFF, 0x00, 0x0000, 0x0000, 0x0000, 0xFF,
}; };
@ -41,8 +41,8 @@ void EnIt_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.params = 0x0D05; this->actor.params = 0x0D05;
Collider_InitCylinder(globalCtx, &this->collider); Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInitData); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
func_80061EFC(&this->actor.colChkInfo, 0, &colChkInfoInit); // Init Damage Chart func_80061EFC(&this->actor.colChkInfo, 0, &sColChkInfoInit);
} }
void EnIt_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnIt_Destroy(Actor* thisx, GlobalContext* globalCtx) {

View file

@ -27,8 +27,8 @@ const ActorInit En_Lightbox_InitVars = {
(ActorFunc)EnLightbox_Draw, (ActorFunc)EnLightbox_Draw,
}; };
extern u32 D_06000B70; extern Gfx D_06000B70[];
extern u32 D_06001F10; extern UNK_TYPE D_06001F10;
void EnLightbox_Init(Actor* thisx, GlobalContext* globalCtx) { void EnLightbox_Init(Actor* thisx, GlobalContext* globalCtx) {
u32 local_c = 0; u32 local_c = 0;
@ -111,5 +111,5 @@ void EnLightbox_Update(Actor* thisx, GlobalContext* globalCtx) {
} }
void EnLightbox_Draw(Actor* thisx, GlobalContext* globalCtx) { void EnLightbox_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx_DrawDListOpa(globalCtx, &D_06000B70); Gfx_DrawDListOpa(globalCtx, D_06000B70);
} }

View file

@ -1,7 +1,7 @@
/* /*
* File: z_en_m_fire1.c * File: z_en_m_fire1.c
* Overlay: ovl_En_M_Fire1 * Overlay: ovl_En_M_Fire1
* Description: The attack from a Deku Nut. Spawned by ovl_En_Arrow. * Description: Deku Nut Hitbox
*/ */
#include "z_en_m_fire1.h" #include "z_en_m_fire1.h"
@ -26,7 +26,7 @@ const ActorInit En_M_Fire1_InitVars = {
NULL, NULL,
}; };
static ColliderCylinderInit cylinderInitData = { static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK10, 0x09, 0x00, 0x00, 0x08, COLSHAPE_CYLINDER }, { COLTYPE_UNK10, 0x09, 0x00, 0x00, 0x08, COLSHAPE_CYLINDER },
{ 0x02, { 0x00000001, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x19, 0x00, 0x00 }, { 0x02, { 0x00000001, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x19, 0x00, 0x00 },
{ 200, 200, 0, { 0 } } { 200, 200, 0, { 0 } }
@ -41,7 +41,7 @@ void EnMFire1_Init(Actor* thisx, GlobalContext* globalCtx) {
} }
Collider_InitCylinder(globalCtx, &this->collider); Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInitData); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
} }
void EnMFire1_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnMFire1_Destroy(Actor* thisx, GlobalContext* globalCtx) {

View file

@ -1,7 +1,7 @@
/* /*
* File: z_en_ma1.c * File: z_en_ma1.c
* Overlay: En_Ma1 * Overlay: En_Ma1
* Description: * Description: Child Malon
*/ */
#include "z_en_ma1.h" #include "z_en_ma1.h"
@ -39,13 +39,13 @@ const ActorInit En_Ma1_InitVars = {
(ActorFunc)EnMa1_Draw, (ActorFunc)EnMa1_Draw,
}; };
static ColliderCylinderInit cylinderInit = { static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER },
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 },
{ 18, 46, 0, { 0, 0, 0 } }, { 18, 46, 0, { 0, 0, 0 } },
}; };
CollisionCheckInfoInit2 D_80AA166C = { CollisionCheckInfoInit2 sColChkInfoInit = {
0x00, 0x0000, 0x0000, 0x0000, 0xFF, 0x00, 0x0000, 0x0000, 0x0000, 0xFF,
}; };
@ -58,13 +58,13 @@ struct_D_80AA1678 D_80AA1678[] = {
Vec3f D_80AA16B8 = { 800.0f, 0.0f, 0.0f }; Vec3f D_80AA16B8 = { 800.0f, 0.0f, 0.0f };
u32 D_80AA16C4[] = { UNK_PTR D_80AA16C4[] = {
0x06001F18, 0x06001F18,
0x06002B18, 0x06002B18,
0x06002F18, 0x06002F18,
}; };
u32 D_80AA16D0[] = { UNK_PTR D_80AA16D0[] = {
0x06001B18, 0x06001B18,
0x06002318, 0x06002318,
0x06002718, 0x06002718,
@ -251,8 +251,8 @@ void EnMa1_Init(Actor* thisx, GlobalContext* globalCtx) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 18.0f); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 18.0f);
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06008460, NULL, NULL, NULL, 0); SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06008460, NULL, NULL, NULL, 0);
Collider_InitCylinder(globalCtx, &this->collider); Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInit); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(0x16), &D_80AA166C); func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit);
if (!func_80AA08C4(this, globalCtx)) { if (!func_80AA08C4(this, globalCtx)) {
Actor_Kill(&this->actor); Actor_Kill(&this->actor);

View file

@ -33,63 +33,36 @@ const ActorInit En_Ma2_InitVars = {
(ActorFunc)EnMa2_Draw, (ActorFunc)EnMa2_Draw,
}; };
static ColliderCylinderInit cylinderInit = { static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER },
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 },
{ 18, 46, 0, { 0, 0, 0 } }, { 18, 46, 0, { 0, 0, 0 } },
}; };
CollisionCheckInfoInit2 D_80AA284C = { static CollisionCheckInfoInit2 sColChkInfoInit = {
0x00, 0x0000, 0x0000, 0x0000, 0xFF, 0x00, 0x0000, 0x0000, 0x0000, 0xFF,
}; };
struct_D_80AA1678 D_80AA2858[] = { static struct_D_80AA1678 D_80AA2858[] = {
{ { 0x060007D4, 1.0f, 0x00, 0.0f }, { 0x060007D4, 1.0f, 0x00, -10.0f }, { 0x060093BC, 1.0f, 0x00, 0.0f },
0x060007D4, { 0x06009EE0, 1.0f, 0x00, 0.0f }, { 0x06009EE0, 1.0f, 0x00, -10.0f },
1.0f,
0x00,
0.0f,
},
{
0x060007D4,
1.0f,
0x00,
-10.0f,
},
{
0x060093BC,
1.0f,
0x00,
0.0f,
},
{
0x06009EE0,
1.0f,
0x00,
0.0f,
},
{
0x06009EE0,
1.0f,
0x00,
-10.0f,
},
}; };
Vec3f D_80AA28A8 = { 900.0f, 0.0f, 0.0f }; static Vec3f D_80AA28A8 = { 900.0f, 0.0f, 0.0f };
u32 D_80AA28B4[] = { static UNK_PTR D_80AA28B4[] = {
0x06002970, 0x06002970,
0x06003570, 0x06003570,
0x06003770, 0x06003770,
}; };
u32 D_80AA28C0[] = {
static UNK_PTR D_80AA28C0[] = {
0x06002570, 0x06002570,
0x06002C70, 0x06002C70,
0x06003070, 0x06003070,
}; };
extern u32 D_06005420; extern Gfx D_06005420[];
extern SkeletonHeader D_06008D90; extern SkeletonHeader D_06008D90;
extern AnimationHeader D_060093BC; extern AnimationHeader D_060093BC;
extern AnimationHeader D_06009EE0; extern AnimationHeader D_06009EE0;
@ -241,8 +214,8 @@ void EnMa2_Init(Actor* thisx, GlobalContext* globalCtx) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 18.0f); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 18.0f);
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06008D90, NULL, NULL, NULL, 0); SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06008D90, NULL, NULL, NULL, 0);
Collider_InitCylinder(globalCtx, &this->collider); Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInit); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(0x16), &D_80AA284C); func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit);
switch (func_80AA1B58(this, globalCtx)) { switch (func_80AA1B58(this, globalCtx)) {
case 1: case 1:
@ -387,7 +360,7 @@ void EnMa2_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
Matrix_MultVec3f(&vec, &this->actor.posRot2.pos); Matrix_MultVec3f(&vec, &this->actor.posRot2.pos);
} }
if ((limbIndex == 14) && (this->skelAnime.animCurrentSeg == &D_060093BC)) { if ((limbIndex == 14) && (this->skelAnime.animCurrentSeg == &D_060093BC)) {
gSPDisplayList(gfxCtx->polyOpa.p++, &D_06005420); gSPDisplayList(gfxCtx->polyOpa.p++, D_06005420);
} }
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_ma2.c", 927); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_ma2.c", 927);

View file

@ -37,56 +37,28 @@ const ActorInit En_Ma3_InitVars = {
(ActorFunc)EnMa3_Draw, (ActorFunc)EnMa3_Draw,
}; };
static ColliderCylinderInit cylinderInit = { static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER },
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 },
{ 18, 46, 0, { 0, 0, 0 } }, { 18, 46, 0, { 0, 0, 0 } },
}; };
CollisionCheckInfoInit2 D_80AA383C = { 0x00, 0x0000, 0x0000, 0x0000, 0xFF }; static CollisionCheckInfoInit2 sColChkInfoInit = { 0x00, 0x0000, 0x0000, 0x0000, 0xFF };
struct_D_80AA1678 D_80AA3848[] = { static struct_D_80AA1678 D_80AA3848[] = {
{ { 0x060007D4, 1.0f, 0x00, 0.0f }, { 0x060007D4, 1.0f, 0x00, -10.0f }, { 0x060093BC, 1.0f, 0x00, 0.0f },
0x060007D4, { 0x06009EE0, 1.0f, 0x00, 0.0f }, { 0x06009EE0, 1.0f, 0x00, -10.0f },
1.0f,
0x00,
0.0f,
},
{
0x060007D4,
1.0f,
0x00,
-10.0f,
},
{
0x060093BC,
1.0f,
0x00,
0.0f,
},
{
0x06009EE0,
1.0f,
0x00,
0.0f,
},
{
0x06009EE0,
1.0f,
0x00,
-10.0f,
},
}; };
Vec3f D_80AA3898 = { 900.0f, 0.0f, 0.0f }; static Vec3f D_80AA3898 = { 900.0f, 0.0f, 0.0f };
u32 D_80AA38A4[] = { static UNK_PTR D_80AA38A4[] = {
0x06002970, 0x06002970,
0x06003570, 0x06003570,
0x06003770, 0x06003770,
}; };
u32 D_80AA38B0[] = { static UNK_PTR D_80AA38B0[] = {
0x06002570, 0x06002570,
0x06002C70, 0x06002C70,
0x06003070, 0x06003070,
@ -271,8 +243,8 @@ void EnMa3_Init(Actor* thisx, GlobalContext* globalCtx) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 18.0f); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 18.0f);
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06008D90, NULL, 0, 0, 0); SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06008D90, NULL, 0, 0, 0);
Collider_InitCylinder(globalCtx, &this->collider); Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInit); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(0x16), &D_80AA383C); func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit);
switch (func_80AA2EC8(this, globalCtx)) { switch (func_80AA2EC8(this, globalCtx)) {
case 0: case 0:

View file

@ -19,7 +19,7 @@ void EnMs_SetOfferText(EnMs* this, GlobalContext* globalCtx);
void EnMs_Wait(EnMs* this, GlobalContext* globalCtx); void EnMs_Wait(EnMs* this, GlobalContext* globalCtx);
void EnMs_Talk(EnMs* this, GlobalContext* globalCtx); void EnMs_Talk(EnMs* this, GlobalContext* globalCtx);
void EnMs_Sell(EnMs* this, GlobalContext* globalCtx); void EnMs_Sell(EnMs* this, GlobalContext* globalCtx);
void EnMs_TalkAfterBuy(EnMs* this, GlobalContext* globalCtx); void EnMs_TalkAfterPurchase(EnMs* this, GlobalContext* globalCtx);
const ActorInit En_Ms_InitVars = { const ActorInit En_Ms_InitVars = {
ACTOR_EN_MS, ACTOR_EN_MS,
@ -33,21 +33,21 @@ const ActorInit En_Ms_InitVars = {
(ActorFunc)EnMs_Draw, (ActorFunc)EnMs_Draw,
}; };
static ColliderCylinderInit_Set3 colliderInit = { static ColliderCylinderInit_Set3 sCylinderInit = {
{ COLTYPE_UNK10, 0x00, 0x09, 0x39, COLSHAPE_CYLINDER }, { COLTYPE_UNK10, 0x00, 0x09, 0x39, COLSHAPE_CYLINDER },
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 },
{ 22, 37, 0, { 0 } }, { 22, 37, 0, { 0 } },
}; };
static s16 prices[] = { static s16 sPrices[] = {
10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100,
}; };
static u16 offerTextIds[] = { static u16 sOfferTextIDs[] = {
0x405E, 0x405F, 0x4060, 0x4061, 0x4062, 0x4063, 0x4064, 0x4065, 0x4066, 0x4067, 0x405E, 0x405F, 0x4060, 0x4061, 0x4062, 0x4063, 0x4064, 0x4065, 0x4066, 0x4067,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_U8(unk_1F, 2, ICHAIN_CONTINUE), ICHAIN_U8(unk_1F, 2, ICHAIN_CONTINUE),
ICHAIN_F32(unk_4C, 500, ICHAIN_STOP), ICHAIN_F32(unk_4C, 500, ICHAIN_STOP),
}; };
@ -61,7 +61,7 @@ void EnMs_SetOfferText(EnMs* this, GlobalContext* globalCtx) {
if (BEANS_BOUGHT >= 10) { if (BEANS_BOUGHT >= 10) {
this->actor.textId = 0x406B; this->actor.textId = 0x406B;
} else { } else {
this->actor.textId = offerTextIds[BEANS_BOUGHT]; this->actor.textId = sOfferTextIDs[BEANS_BOUGHT];
} }
} }
} }
@ -74,11 +74,11 @@ void EnMs_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
return; return;
} }
Actor_ProcessInitChain(&this->actor, initChain); Actor_ProcessInitChain(&this->actor, sInitChain);
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06003DC0, &D_060005EC, &this->unkSkelAnimeStruct, &this->unk_1C6, SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06003DC0, &D_060005EC, &this->unkSkelAnimeStruct, &this->unk_1C6,
9); 9);
Collider_InitCylinder(globalCtx, &this->collider); Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder_Set3(globalCtx, &this->collider, this, &colliderInit); Collider_SetCylinder_Set3(globalCtx, &this->collider, this, &sCylinderInit);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 35.0f); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 35.0f);
Actor_SetScale(&this->actor, 0.015f); Actor_SetScale(&this->actor, 0.015f);
@ -99,16 +99,16 @@ void EnMs_Destroy(Actor* thisx, GlobalContext* globalCtx) {
} }
void EnMs_Wait(EnMs* this, GlobalContext* globalCtx) { void EnMs_Wait(EnMs* this, GlobalContext* globalCtx) {
s16 unkAngle; s16 yawDiff;
unkAngle = this->actor.rotTowardsLinkY - this->actor.shape.rot.y; yawDiff = this->actor.rotTowardsLinkY - this->actor.shape.rot.y;
EnMs_SetOfferText(&this->actor, globalCtx); EnMs_SetOfferText(&this->actor, globalCtx);
if (func_8002F194(&this->actor, globalCtx) != 0) { // if talk is initiated if (func_8002F194(&this->actor, globalCtx) != 0) { // if talk is initiated
this->actionFunc = EnMs_Talk; this->actionFunc = EnMs_Talk;
return; return;
} }
if ((this->actor.xzDistanceFromLink < 90.0f) && (ABS(unkAngle) < 0x2000)) { // talk range if ((this->actor.xzDistanceFromLink < 90.0f) && (ABS(yawDiff) < 0x2000)) { // talk range
func_8002F2CC(&this->actor, globalCtx, 90.0f); func_8002F2CC(&this->actor, globalCtx, 90.0f);
} }
} }
@ -125,7 +125,7 @@ void EnMs_Talk(EnMs* this, GlobalContext* globalCtx) {
if (func_80106BC8(globalCtx) != 0) { if (func_80106BC8(globalCtx) != 0) {
switch (globalCtx->msgCtx.choiceIndex) { switch (globalCtx->msgCtx.choiceIndex) {
case 0: // yes case 0: // yes
if (gSaveContext.rupees < prices[BEANS_BOUGHT]) { if (gSaveContext.rupees < sPrices[BEANS_BOUGHT]) {
func_8010B720(globalCtx, 0x4069); // not enough rupees text func_8010B720(globalCtx, 0x4069); // not enough rupees text
return; return;
} }
@ -143,15 +143,15 @@ void EnMs_Talk(EnMs* this, GlobalContext* globalCtx) {
void EnMs_Sell(EnMs* this, GlobalContext* globalCtx) { void EnMs_Sell(EnMs* this, GlobalContext* globalCtx) {
if (func_8002F410(&this->actor, globalCtx) != 0) { // if attached is set if (func_8002F410(&this->actor, globalCtx) != 0) { // if attached is set
Rupees_ChangeBy(-prices[BEANS_BOUGHT]); Rupees_ChangeBy(-sPrices[BEANS_BOUGHT]);
this->actor.attachedA = NULL; this->actor.attachedA = NULL;
this->actionFunc = EnMs_TalkAfterBuy; this->actionFunc = EnMs_TalkAfterPurchase;
return; return;
} }
func_8002F434(&this->actor, globalCtx, GI_BEAN, 90.0f, 10.0f); func_8002F434(&this->actor, globalCtx, GI_BEAN, 90.0f, 10.0f);
} }
void EnMs_TalkAfterBuy(EnMs* this, GlobalContext* globalCtx) { void EnMs_TalkAfterPurchase(EnMs* this, GlobalContext* globalCtx) {
// if dialog state is 6 and player responded to textbox // if dialog state is 6 and player responded to textbox
if ((func_8010BDBC(&globalCtx->msgCtx)) == 6 && (func_80106BC8(globalCtx) != 0)) { if ((func_8010BDBC(&globalCtx->msgCtx)) == 6 && (func_80106BC8(globalCtx) != 0)) {
func_8010B720(globalCtx, 0x406C); func_8010B720(globalCtx, 0x406C);

View file

@ -1,7 +1,7 @@
/* /*
* File: z_en_nutsball.c * File: z_en_nutsball.c
* Overlay: ovl_En_Nutsball * Overlay: ovl_En_Nutsball
* Description: The projectile fired by deku scrubs and octoroks. * Description: Projectile fired by deku scrubs
*/ */
#include "z_en_nutsball.h" #include "z_en_nutsball.h"
@ -30,14 +30,15 @@ const ActorInit En_Nutsball_InitVars = {
(ActorFunc)NULL, (ActorFunc)NULL,
}; };
static ColliderCylinderInit cylinderInitData = { static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK10, 0x11, 0x09, 0x39, 0x20, COLSHAPE_CYLINDER }, { COLTYPE_UNK10, 0x11, 0x09, 0x39, 0x20, COLSHAPE_CYLINDER },
{ 0x00, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x11, 0x01, 0x01 }, { 0x00, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x11, 0x01, 0x01 },
{ 13, 13, 0, { 0 } }, { 13, 13, 0, { 0 } },
}; };
static s16 objectTbl[] = { OBJECT_DEKUNUTS, OBJECT_HINTNUTS, OBJECT_SHOPNUTS, OBJECT_DNS, OBJECT_DNK }; static s16 sObjectIDs[] = { OBJECT_DEKUNUTS, OBJECT_HINTNUTS, OBJECT_SHOPNUTS, OBJECT_DNS, OBJECT_DNK };
static u32 dListTbl[] = { 0x06002028, 0x060012F0, 0x06004008, 0x06002410, 0x06001890 };
static Gfx* sDLists[] = { 0x06002028, 0x060012F0, 0x06004008, 0x06002410, 0x06001890 };
void EnNutsball_Init(Actor* thisx, GlobalContext* globalCtx) { void EnNutsball_Init(Actor* thisx, GlobalContext* globalCtx) {
EnNutsball* this = THIS; EnNutsball* this = THIS;
@ -45,8 +46,8 @@ void EnNutsball_Init(Actor* thisx, GlobalContext* globalCtx) {
ActorShape_Init(&this->actor.shape, 400.0f, ActorShadow_DrawFunc_Circle, 13.0f); ActorShape_Init(&this->actor.shape, 400.0f, ActorShadow_DrawFunc_Circle, 13.0f);
Collider_InitCylinder(globalCtx, &this->collider); Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInitData); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
this->objBankIndex = Object_GetIndex(&globalCtx->objectCtx, objectTbl[this->actor.params]); this->objBankIndex = Object_GetIndex(&globalCtx->objectCtx, sObjectIDs[this->actor.params]);
if (this->objBankIndex < 0) { if (this->objBankIndex < 0) {
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
@ -80,7 +81,7 @@ void func_80ABBBA8(EnNutsball* this, GlobalContext* globalCtx) {
this->timer--; this->timer--;
if (this->timer == 0) { if (this->timer == 0) {
this->actor.gravity = -1; this->actor.gravity = -1.0f;
} }
this->actor.initPosRot.rot.z += 0x2AA8; this->actor.initPosRot.rot.z += 0x2AA8;
@ -126,7 +127,7 @@ void EnNutsball_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc(this, globalCtx); this->actionFunc(this, globalCtx);
Actor_MoveForward(&this->actor); Actor_MoveForward(&this->actor);
func_8002E4B4(globalCtx, &this->actor, 10, cylinderInitData.dim.radius, cylinderInitData.dim.height, 5); func_8002E4B4(globalCtx, &this->actor, 10, sCylinderInit.dim.radius, sCylinderInit.dim.height, 5);
Collider_CylinderUpdate(&this->actor, &this->collider); Collider_CylinderUpdate(&this->actor, &this->collider);
this->actor.flags |= 0x1000000; this->actor.flags |= 0x1000000;
@ -148,7 +149,7 @@ void EnNutsball_Draw(Actor* thisx, GlobalContext* globalCtx) {
Matrix_RotateZ(thisx->initPosRot.rot.z * 9.58738e-05f, MTXMODE_APPLY); Matrix_RotateZ(thisx->initPosRot.rot.z * 9.58738e-05f, MTXMODE_APPLY);
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_nutsball.c", 333), gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_nutsball.c", 333),
G_MTX_MODELVIEW | G_MTX_LOAD); G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, dListTbl[thisx->params]); gSPDisplayList(gfxCtx->polyOpa.p++, sDLists[thisx->params]);
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_nutsball.c", 337); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_nutsball.c", 337);
} }

View file

@ -1,7 +1,7 @@
/* /*
* File: z_en_oe2.c * File: z_en_oe2.c
* Overlay: ovl_En_Oe2 * Overlay: ovl_En_Oe2
* Description: Blue Navi Target. Probably unused since NPC's are blue and they do not use this actor. * Description: Blue Navi Target Spot
*/ */
#include "z_en_oe2.h" #include "z_en_oe2.h"
@ -15,7 +15,7 @@ void EnOE2_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnOE2_Update(Actor* thisx, GlobalContext* globalCtx); void EnOE2_Update(Actor* thisx, GlobalContext* globalCtx);
void EnOE2_Draw(Actor* thisx, GlobalContext* globalCtx); void EnOE2_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_80ABE6DC(EnOE2* this, GlobalContext* globalCtx); void EnOE2_DoNothing(EnOE2* this, GlobalContext* globalCtx);
const ActorInit En_OE2_InitVars = { const ActorInit En_OE2_InitVars = {
ACTOR_EN_OE2, ACTOR_EN_OE2,
@ -36,13 +36,13 @@ void EnOE2_SetupAction(EnOE2* this, EnOE2ActionFunc actionFunc) {
void EnOE2_Init(Actor* thisx, GlobalContext* globalCtx) { void EnOE2_Init(Actor* thisx, GlobalContext* globalCtx) {
EnOE2* this = THIS; EnOE2* this = THIS;
EnOE2_SetupAction(this, func_80ABE6DC); EnOE2_SetupAction(this, EnOE2_DoNothing);
} }
void EnOE2_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnOE2_Destroy(Actor* thisx, GlobalContext* globalCtx) {
} }
void func_80ABE6DC(EnOE2* this, GlobalContext* globalCtx) { void EnOE2_DoNothing(EnOE2* this, GlobalContext* globalCtx) {
} }
void EnOE2_Update(Actor* thisx, GlobalContext* globalCtx) { void EnOE2_Update(Actor* thisx, GlobalContext* globalCtx) {

View file

@ -5,7 +5,6 @@
*/ */
#include "z_en_okarina_effect.h" #include "z_en_okarina_effect.h"
#include <vt.h> #include <vt.h>
#define FLAGS 0x02000010 #define FLAGS 0x02000010

View file

@ -1,7 +1,7 @@
/* /*
* File: z_en_pu_box.c * File: z_en_pu_box.c
* Overlay: ovl_En_Pu_Box * Overlay: ovl_En_Pu_Box
* Description: An unused stone cube. * Description: An unused stone cube
*/ */
#include "z_en_pu_box.h" #include "z_en_pu_box.h"
@ -27,8 +27,8 @@ const ActorInit En_Pu_box_InitVars = {
(ActorFunc)EnPubox_Draw, (ActorFunc)EnPubox_Draw,
}; };
extern u32 D_06000380; extern Gfx D_06000380[];
extern u32 D_060006D0; extern UNK_TYPE D_060006D0;
void EnPubox_Init(Actor* thisx, GlobalContext* globalCtx) { void EnPubox_Init(Actor* thisx, GlobalContext* globalCtx) {
u32 local_c = 0; u32 local_c = 0;

View file

@ -70,35 +70,35 @@ void func_80AF03F4(EnRu1* this, GlobalContext* globalCtx);
void func_80AF0400(EnRu1* this, GlobalContext* globalCtx); void func_80AF0400(EnRu1* this, GlobalContext* globalCtx);
void func_80AF05D4(EnRu1* this, GlobalContext* globalCtx); void func_80AF05D4(EnRu1* this, GlobalContext* globalCtx);
ColliderCylinderInit_Set3 D_80AF0800 = { ColliderCylinderInit_Set3 sCylinderInit1 = {
{ COLTYPE_UNK0, 0x00, 0x00, 0x09, COLSHAPE_CYLINDER }, { COLTYPE_UNK0, 0x00, 0x00, 0x09, COLSHAPE_CYLINDER },
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 },
{ 25, 80, 0, { 0 } }, { 25, 80, 0, { 0 } },
}; };
ColliderCylinderInit_Set3 D_80AF082C = { ColliderCylinderInit_Set3 sCylinderInit2 = {
{ COLTYPE_UNK0, 0x09, 0x00, 0x09, COLSHAPE_CYLINDER }, { COLTYPE_UNK0, 0x09, 0x00, 0x09, COLSHAPE_CYLINDER },
{ 0x00, { 0x00000101, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x01 }, { 0x00, { 0x00000101, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x01 },
{ 20, 30, 0, { 0 } }, { 20, 30, 0, { 0 } },
}; };
u32 D_80AF0858[] = { UNK_PTR D_80AF0858[] = {
0x0600E3B8, 0x0600F238, 0x0600F638, 0x0600FE38, 0x06010238, 0x06010A38, 0x0600E3B8, 0x0600F238, 0x0600F638, 0x0600FE38, 0x06010238, 0x06010A38,
}; };
u32 D_80AF0870[] = { UNK_PTR D_80AF0870[] = {
0x0600E838, 0x0600E838,
0x0600FA38, 0x0600FA38,
0x06010638, 0x06010638,
}; };
s32 D_80AF087C = 0; s32 sUnused = 0;
#include "z_en_ru1_cutscene_data.c" EARLY #include "z_en_ru1_cutscene_data.c" EARLY
u32 D_80AF1938 = 0; u32 D_80AF1938 = 0;
EnRu1ActionFunc D_80AF193C[] = { EnRu1ActionFunc sActionFuncs[] = {
func_80AEC0B4, func_80AEC100, func_80AEC130, func_80AEC17C, func_80AEC1D4, func_80AEC244, func_80AEC2C0, func_80AEC0B4, func_80AEC100, func_80AEC130, func_80AEC17C, func_80AEC1D4, func_80AEC244, func_80AEC2C0,
func_80AECA94, func_80AECAB4, func_80AECAD4, func_80AECB18, func_80AECB60, func_80AECBB8, func_80AECC1C, func_80AECA94, func_80AECAB4, func_80AECAD4, func_80AECB18, func_80AECB60, func_80AECBB8, func_80AECC1C,
func_80AECC84, func_80AED304, func_80AED324, func_80AED344, func_80AED374, func_80AED3A4, func_80AED3E0, func_80AECC84, func_80AED304, func_80AED324, func_80AED344, func_80AED374, func_80AED3A4, func_80AED3E0,
@ -108,13 +108,13 @@ EnRu1ActionFunc D_80AF193C[] = {
func_80AEFBC8, func_80AEFC24, func_80AEFECC, func_80AEFF40, func_80AEFBC8, func_80AEFC24, func_80AEFECC, func_80AEFF40,
}; };
EnRu1PreLimbDrawFunc D_80AF19F4[] = { EnRu1PreLimbDrawFunc sPreLimbDrawFuncs[] = {
func_80AF0278, func_80AF0278,
}; };
Vec3f D_80AF19F8 = { 0.0f, 10.0f, 0.0f }; Vec3f sMultVec = { 0.0f, 10.0f, 0.0f };
EnRu1DrawFunc D_80AF1A04[] = { EnRu1DrawFunc sDrawFuncs[] = {
func_80AF03F4, func_80AF03F4,
func_80AF0400, func_80AF0400,
func_80AF05D4, func_80AF05D4,
@ -190,10 +190,10 @@ void func_80AEAD20(EnRu1* this, GlobalContext* globalCtx) {
Collider_InitCylinder(globalCtx, &this->collider); Collider_InitCylinder(globalCtx, &this->collider);
if (!thisx) {} // necessary to match if (!thisx) {} // necessary to match
Collider_SetCylinder_Set3(globalCtx, &this->collider, thisx, &D_80AF0800); Collider_SetCylinder_Set3(globalCtx, &this->collider, thisx, &sCylinderInit1);
Collider_InitCylinder(globalCtx, &this->collider2); Collider_InitCylinder(globalCtx, &this->collider2);
Collider_SetCylinder_Set3(globalCtx, &this->collider2, thisx, &D_80AF082C); Collider_SetCylinder_Set3(globalCtx, &this->collider2, thisx, &sCylinderInit2);
} }
void func_80AEAD98(EnRu1* this, GlobalContext* globalCtx) { void func_80AEAD98(EnRu1* this, GlobalContext* globalCtx) {
@ -207,11 +207,13 @@ void func_80AEADD8(EnRu1* this) {
u8 func_80AEADE0(EnRu1* this) { u8 func_80AEADE0(EnRu1* this) {
u8 params = this->actor.params >> 8; u8 params = this->actor.params >> 8;
return params; return params;
} }
u8 func_80AEADF0(EnRu1* this) { u8 func_80AEADF0(EnRu1* this) {
s16 params = this->actor.params; s16 params = this->actor.params;
return params; return params;
} }
@ -272,6 +274,7 @@ CsCmdActorAction* func_80AEAF58(GlobalContext* globalCtx, s32 npcActionIdx) {
s32 func_80AEAFA0(GlobalContext* globalCtx, u16 action, s32 npcActionIdx) { s32 func_80AEAFA0(GlobalContext* globalCtx, u16 action, s32 npcActionIdx) {
CsCmdActorAction* csCmdNPCAction = func_80AEAF58(globalCtx, npcActionIdx); CsCmdActorAction* csCmdNPCAction = func_80AEAF58(globalCtx, npcActionIdx);
if ((csCmdNPCAction != NULL) && (csCmdNPCAction->action == action)) { if ((csCmdNPCAction != NULL) && (csCmdNPCAction->action == action)) {
return 1; return 1;
} }
@ -280,6 +283,7 @@ s32 func_80AEAFA0(GlobalContext* globalCtx, u16 action, s32 npcActionIdx) {
s32 func_80AEAFE0(GlobalContext* globalCtx, u16 action, s32 npcActionIdx) { s32 func_80AEAFE0(GlobalContext* globalCtx, u16 action, s32 npcActionIdx) {
CsCmdActorAction* csCmdNPCAction = func_80AEAF58(globalCtx, npcActionIdx); CsCmdActorAction* csCmdNPCAction = func_80AEAF58(globalCtx, npcActionIdx);
if ((csCmdNPCAction != NULL) && (csCmdNPCAction->action != action)) { if ((csCmdNPCAction != NULL) && (csCmdNPCAction->action != action)) {
return 1; return 1;
} }
@ -591,6 +595,7 @@ void func_80AEBB3C(EnRu1* this) {
void func_80AEBB78(EnRu1* this) { void func_80AEBB78(EnRu1* this) {
SkelAnime* skelAnime = &this->skelAnime; SkelAnime* skelAnime = &this->skelAnime;
if ((((func_800A56C8(skelAnime, 4.0f)) || (func_800A56C8(skelAnime, 13.0f))) || if ((((func_800A56C8(skelAnime, 4.0f)) || (func_800A56C8(skelAnime, 13.0f))) ||
(func_800A56C8(skelAnime, 22.0f))) || (func_800A56C8(skelAnime, 22.0f))) ||
(func_800A56C8(skelAnime, 31.0f))) { (func_800A56C8(skelAnime, 31.0f))) {
@ -727,6 +732,7 @@ void func_80AEC100(EnRu1* this, GlobalContext* globalCtx) {
void func_80AEC130(EnRu1* this, GlobalContext* globalCtx) { void func_80AEC130(EnRu1* this, GlobalContext* globalCtx) {
s32 something = EnRu1_FrameUpdateMatrix(this); s32 something = EnRu1_FrameUpdateMatrix(this);
func_80AEAECC(this, globalCtx); func_80AEAECC(this, globalCtx);
func_80AEBB3C(this); func_80AEBB3C(this);
func_80AEBE3C(this, globalCtx, something); func_80AEBE3C(this, globalCtx, something);
@ -807,6 +813,7 @@ void func_80AEC320(EnRu1* this, GlobalContext* globalCtx) {
void func_80AEC40C(EnRu1* this) { void func_80AEC40C(EnRu1* this) {
Actor* thisx = &this->actor; Actor* thisx = &this->actor;
f32 unk_26C = this->unk_26C; f32 unk_26C = this->unk_26C;
if (unk_26C < 8.0f) { if (unk_26C < 8.0f) {
thisx->speedXZ = (((kREG(3) * 0.01f) + 2.7f) * 0.125f) * unk_26C; thisx->speedXZ = (((kREG(3) * 0.01f) + 2.7f) * 0.125f) * unk_26C;
} else { } else {
@ -843,6 +850,7 @@ s32 func_80AEC5FC(EnRu1* this, GlobalContext* globalCtx) {
Actor* thisx = &this->actor; Actor* thisx = &this->actor;
f32 thisPosZ = thisx->posRot.pos.z; f32 thisPosZ = thisx->posRot.pos.z;
f32 playerPosZ = player->actor.posRot.pos.z; f32 playerPosZ = player->actor.posRot.pos.z;
if ((playerPosZ - thisPosZ <= 265.0f) && (player->actor.posRot.pos.y >= thisx->posRot.pos.y)) { if ((playerPosZ - thisPosZ <= 265.0f) && (player->actor.posRot.pos.y >= thisx->posRot.pos.y)) {
return 1; return 1;
} }
@ -890,6 +898,7 @@ void func_80AEC81C(EnRu1* this, GlobalContext* globalCtx) {
Actor* thisx = &this->actor; Actor* thisx = &this->actor;
CsCmdActorAction* csCmdNPCAction; CsCmdActorAction* csCmdNPCAction;
s16 newRotY; s16 newRotY;
if (func_80AEAFE0(globalCtx, 1, 3)) { if (func_80AEAFE0(globalCtx, 1, 3)) {
csCmdNPCAction = globalCtx->csCtx.npcActions[3]; csCmdNPCAction = globalCtx->csCtx.npcActions[3];
thisx->posRot.pos.x = csCmdNPCAction->startPos.x; thisx->posRot.pos.x = csCmdNPCAction->startPos.x;
@ -1259,12 +1268,14 @@ s32 func_80AED624(EnRu1* this, GlobalContext* globalCtx) {
void func_80AED6DC(EnRu1* this, GlobalContext* globalCtx) { void func_80AED6DC(EnRu1* this, GlobalContext* globalCtx) {
s8 curRoomNum = globalCtx->roomCtx.curRoom.num; s8 curRoomNum = globalCtx->roomCtx.curRoom.num;
this->roomNum2 = curRoomNum; this->roomNum2 = curRoomNum;
this->unk_288 = 0.0f; this->unk_288 = 0.0f;
} }
void func_80AED6F8(GlobalContext* globalCtx) { void func_80AED6F8(GlobalContext* globalCtx) {
s8 curRoomNum; s8 curRoomNum;
if ((!(gSaveContext.infTable[20] & 0x80))) { if ((!(gSaveContext.infTable[20] & 0x80))) {
curRoomNum = globalCtx->roomCtx.curRoom.num; curRoomNum = globalCtx->roomCtx.curRoom.num;
if (curRoomNum == 2) { if (curRoomNum == 2) {
@ -1539,6 +1550,7 @@ s32 func_80AEE264(EnRu1* this, GlobalContext* globalCtx) {
void func_80AEE2F8(EnRu1* this, GlobalContext* globalCtx) { void func_80AEE2F8(EnRu1* this, GlobalContext* globalCtx) {
DynaPolyActor* dyna; DynaPolyActor* dyna;
u32 floorPolySource; u32 floorPolySource;
if ((this->actor.bgCheckFlags & 1) && (this->actor.floorPolySource != 0x32)) { if ((this->actor.bgCheckFlags & 1) && (this->actor.floorPolySource != 0x32)) {
floorPolySource = this->actor.floorPolySource; floorPolySource = this->actor.floorPolySource;
dyna = DynaPolyInfo_GetActor(&globalCtx->colCtx, floorPolySource); dyna = DynaPolyInfo_GetActor(&globalCtx->colCtx, floorPolySource);
@ -1839,6 +1851,7 @@ void func_80AEF080(EnRu1* this) {
s32 func_80AEF0BC(EnRu1* this, GlobalContext* globalCtx) { s32 func_80AEF0BC(EnRu1* this, GlobalContext* globalCtx) {
s32 frameCount; s32 frameCount;
if (gSaveContext.infTable[20] & 4) { if (gSaveContext.infTable[20] & 4) {
frameCount = SkelAnime_GetFrameCount(&D_06007534.genericHeader); frameCount = SkelAnime_GetFrameCount(&D_06007534.genericHeader);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06007534, 1.0f, 0, frameCount, 2, -8.0f); SkelAnime_ChangeAnim(&this->skelAnime, &D_06007534, 1.0f, 0, frameCount, 2, -8.0f);
@ -1955,6 +1968,7 @@ void func_80AEF540(EnRu1* this) {
void func_80AEF5B8(EnRu1* this) { void func_80AEF5B8(EnRu1* this) {
f32 animCurrentFrame; f32 animCurrentFrame;
if (D_80AF1938 == 0) { if (D_80AF1938 == 0) {
animCurrentFrame = this->skelAnime.animCurrentFrame; animCurrentFrame = this->skelAnime.animCurrentFrame;
if (animCurrentFrame >= 60.0f) { if (animCurrentFrame >= 60.0f) {
@ -2241,11 +2255,11 @@ void func_80AF0050(EnRu1* this, GlobalContext* globalCtx) {
void EnRu1_Update(Actor* thisx, GlobalContext* globalCtx) { void EnRu1_Update(Actor* thisx, GlobalContext* globalCtx) {
EnRu1* this = THIS; EnRu1* this = THIS;
if (this->action < 0 || this->action >= 46 || D_80AF193C[this->action] == NULL) { if (this->action < 0 || this->action >= 46 || sActionFuncs[this->action] == NULL) {
osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
return; return;
} }
D_80AF193C[this->action](this, globalCtx); sActionFuncs[this->action](this, globalCtx);
} }
void EnRu1_Init(Actor* thisx, GlobalContext* globalCtx) { void EnRu1_Init(Actor* thisx, GlobalContext* globalCtx) {
@ -2308,10 +2322,10 @@ s32 EnRu1_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
Gfx** gfx) { Gfx** gfx) {
EnRu1* this = THIS; EnRu1* this = THIS;
if ((this->unk_290 < 0) || (this->unk_290 > 0) || (*D_80AF19F4[this->unk_290] == NULL)) { if ((this->unk_290 < 0) || (this->unk_290 > 0) || (*sPreLimbDrawFuncs[this->unk_290] == NULL)) {
osSyncPrintf(VT_FGCOL(RED) "首回しモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); osSyncPrintf(VT_FGCOL(RED) "首回しモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
} else { } else {
D_80AF19F4[this->unk_290](this, globalCtx, limbIndex, rot); sPreLimbDrawFuncs[this->unk_290](this, globalCtx, limbIndex, rot);
} }
return 0; return 0;
} }
@ -2322,7 +2336,7 @@ void EnRu1_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
Vec3f vec2; Vec3f vec2;
if (limbIndex == 15) { if (limbIndex == 15) {
vec1 = D_80AF19F8; vec1 = sMultVec;
Matrix_MultVec3f(&vec1, &vec2); Matrix_MultVec3f(&vec1, &vec2);
thisx->posRot2.pos.x = vec2.x; thisx->posRot2.pos.x = vec2.x;
thisx->posRot2.pos.y = vec2.y; thisx->posRot2.pos.y = vec2.y;
@ -2389,9 +2403,9 @@ void func_80AF05D4(EnRu1* this, GlobalContext* globalCtx) {
void EnRu1_Draw(Actor* thisx, GlobalContext* globalCtx) { void EnRu1_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnRu1* this = THIS; EnRu1* this = THIS;
if (this->drawConfig < 0 || this->drawConfig >= 3 || D_80AF1A04[this->drawConfig] == 0) { if (this->drawConfig < 0 || this->drawConfig >= 3 || sDrawFuncs[this->drawConfig] == 0) {
osSyncPrintf(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); osSyncPrintf(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
return; return;
} }
D_80AF1A04[this->drawConfig](this, globalCtx); sDrawFuncs[this->drawConfig](this, globalCtx);
} }

View file

@ -5,7 +5,6 @@
*/ */
#include "z_en_ru2.h" #include "z_en_ru2.h"
#include <vt.h> #include <vt.h>
#define FLAGS 0x00000010 #define FLAGS 0x00000010
@ -44,29 +43,29 @@ void func_80AF321C(EnRu2* this, GlobalContext* globalCtx);
void func_80AF2AB4(EnRu2* this, GlobalContext* globalCtx); void func_80AF2AB4(EnRu2* this, GlobalContext* globalCtx);
static ColliderCylinderInit_Set3 colliderInit = { static ColliderCylinderInit_Set3 sCylinderInit = {
{ COLTYPE_UNK10, 0x00, 0x09, 0x00, COLSHAPE_CYLINDER }, { COLTYPE_UNK10, 0x00, 0x09, 0x00, COLSHAPE_CYLINDER },
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000080, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000080, 0x00, 0x00 }, 0x00, 0x01, 0x00 },
{ 30, 100, 0, { 0 } }, { 30, 100, 0, { 0 } },
}; };
static u32 D_80AF410C[] = { static UNK_PTR D_80AF410C[] = {
0x06000F20, 0x06000F20,
0x060022E0, 0x060022E0,
0x06002AE0, 0x06002AE0,
}; };
static u32 D_80AF4118 = 0; static UNK_TYPE D_80AF4118 = 0;
#include "z_en_ru2_cutscene_data.c" EARLY #include "z_en_ru2_cutscene_data.c" EARLY
static EnRu2ActionFunc D_80AF50BC[] = { static EnRu2ActionFunc sActionFuncs[] = {
func_80AF2CB4, func_80AF2CD4, func_80AF2CF4, func_80AF2D2C, func_80AF2D6C, func_80AF2DAC, func_80AF2DEC, func_80AF2CB4, func_80AF2CD4, func_80AF2CF4, func_80AF2D2C, func_80AF2D6C, func_80AF2DAC, func_80AF2DEC,
func_80AF3144, func_80AF3174, func_80AF31C8, func_80AF3604, func_80AF3624, func_80AF366C, func_80AF36AC, func_80AF3144, func_80AF3174, func_80AF31C8, func_80AF3604, func_80AF3624, func_80AF366C, func_80AF36AC,
func_80AF3BC8, func_80AF3C04, func_80AF3C64, func_80AF3CB8, func_80AF3D0C, func_80AF3D60, func_80AF3BC8, func_80AF3C04, func_80AF3C64, func_80AF3CB8, func_80AF3D0C, func_80AF3D60,
}; };
static EnRu2DrawFunc D_80AF510C[] = { static EnRu2DrawFunc sDrawFuncs[] = {
func_80AF3F14, func_80AF3F14,
func_80AF3F20, func_80AF3F20,
func_80AF321C, func_80AF321C,
@ -97,7 +96,7 @@ void func_80AF2550(Actor* thisx, GlobalContext* globalCtx) {
EnRu2* this = THIS; EnRu2* this = THIS;
Collider_InitCylinder(globalCtx, &this->collider); Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder_Set3(globalCtx, &this->collider, &this->actor, &colliderInit); Collider_SetCylinder_Set3(globalCtx, &this->collider, &this->actor, &sCylinderInit);
} }
void func_80AF259C(EnRu2* this, GlobalContext* globalCtx) { void func_80AF259C(EnRu2* this, GlobalContext* globalCtx) {
@ -133,11 +132,13 @@ void func_80AF2608(EnRu2* this) {
s32 func_80AF2690(EnRu2* this) { s32 func_80AF2690(EnRu2* this) {
s32 params_shift = this->actor.params >> 8; s32 params_shift = this->actor.params >> 8;
return params_shift & 0xFF; return params_shift & 0xFF;
} }
s32 func_80AF26A0(EnRu2* this) { s32 func_80AF26A0(EnRu2* this) {
s16 params = this->actor.params; s16 params = this->actor.params;
return params & 0xFF; return params & 0xFF;
} }
@ -152,6 +153,7 @@ void func_80AF26AC(EnRu2* this) {
void func_80AF26D0(EnRu2* this, GlobalContext* globalCtx) { void func_80AF26D0(EnRu2* this, GlobalContext* globalCtx) {
s32 one; // Needed to match s32 one; // Needed to match
if (globalCtx->csCtx.state == 0) { if (globalCtx->csCtx.state == 0) {
if (D_80AF4118 != 0) { if (D_80AF4118 != 0) {
if (this->actor.params == 2) { if (this->actor.params == 2) {
@ -249,6 +251,7 @@ void func_80AF29DC(EnRu2* this, GlobalContext* globalCtx) {
f32 posX = thisx->posRot.pos.x; f32 posX = thisx->posRot.pos.x;
f32 posY = thisx->posRot.pos.y; f32 posY = thisx->posRot.pos.y;
f32 posZ = thisx->posRot.pos.z; f32 posZ = thisx->posRot.pos.z;
Actor_SpawnAttached(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, 2); Actor_SpawnAttached(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, 2);
} }
@ -283,6 +286,7 @@ void func_80AF2AB4(EnRu2* this, GlobalContext* globalCtx) {
void func_80AF2B44(EnRu2* this, GlobalContext* globalCtx) { void func_80AF2B44(EnRu2* this, GlobalContext* globalCtx) {
CutsceneContext* csCtx = &globalCtx->csCtx; CutsceneContext* csCtx = &globalCtx->csCtx;
CsCmdActorAction* csCmdNPCAction; CsCmdActorAction* csCmdNPCAction;
if (csCtx->state != 0) { if (csCtx->state != 0) {
csCmdNPCAction = csCtx->npcActions[3]; csCmdNPCAction = csCtx->npcActions[3];
if (csCmdNPCAction != NULL && csCmdNPCAction->action == 2) { if (csCmdNPCAction != NULL && csCmdNPCAction->action == 2) {
@ -303,6 +307,7 @@ void func_80AF2B94(EnRu2* this) {
void func_80AF2BC0(EnRu2* this, GlobalContext* globalCtx) { void func_80AF2BC0(EnRu2* this, GlobalContext* globalCtx) {
AnimationHeader* animation = &D_0600D3DC; AnimationHeader* animation = &D_0600D3DC;
CsCmdActorAction* csCmdNPCAction; CsCmdActorAction* csCmdNPCAction;
if (globalCtx->csCtx.state != 0) { if (globalCtx->csCtx.state != 0) {
csCmdNPCAction = globalCtx->csCtx.npcActions[3]; csCmdNPCAction = globalCtx->csCtx.npcActions[3];
if (csCmdNPCAction != NULL && csCmdNPCAction->action == 3) { if (csCmdNPCAction != NULL && csCmdNPCAction->action == 3) {
@ -321,6 +326,7 @@ void func_80AF2C54(EnRu2* this, UNK_TYPE arg1) {
void func_80AF2C68(EnRu2* this, GlobalContext* globalCtx) { void func_80AF2C68(EnRu2* this, GlobalContext* globalCtx) {
CsCmdActorAction* csCmdNPCAction; CsCmdActorAction* csCmdNPCAction;
if (globalCtx->csCtx.state != 0) { if (globalCtx->csCtx.state != 0) {
csCmdNPCAction = globalCtx->csCtx.npcActions[6]; csCmdNPCAction = globalCtx->csCtx.npcActions[6];
if (csCmdNPCAction != NULL && csCmdNPCAction->action == 2) { if (csCmdNPCAction != NULL && csCmdNPCAction->action == 2) {
@ -613,6 +619,7 @@ void func_80AF37AC() {
void func_80AF37CC(EnRu2* this) { void func_80AF37CC(EnRu2* this) {
f32 funcFloat; f32 funcFloat;
this->unk_2C0 += 1; this->unk_2C0 += 1;
funcFloat = func_8006F9BC((kREG(2) + 0x96) & 0xFFFF, 0, this->unk_2C0, 8, 0); funcFloat = func_8006F9BC((kREG(2) + 0x96) & 0xFFFF, 0, this->unk_2C0, 8, 0);
this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + (300.0f * funcFloat); this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + (300.0f * funcFloat);
@ -622,6 +629,7 @@ s32 func_80AF383C(EnRu2* this, GlobalContext* globalCtx) {
Player* player = PLAYER; Player* player = PLAYER;
f32 thisPosX = this->actor.posRot.pos.x; f32 thisPosX = this->actor.posRot.pos.x;
f32 playerPosX = player->actor.posRot.pos.x; f32 playerPosX = player->actor.posRot.pos.x;
if (playerPosX - thisPosX >= -202.0f) { if (playerPosX - thisPosX >= -202.0f) {
return 1; return 1;
} }
@ -642,6 +650,7 @@ void func_80AF38D0(EnRu2* this, GlobalContext* globalCtx) {
void func_80AF390C(EnRu2* this, GlobalContext* globalCtx) { void func_80AF390C(EnRu2* this, GlobalContext* globalCtx) {
f32* unk_2C4 = &this->unk_2C4; f32* unk_2C4 = &this->unk_2C4;
*unk_2C4 += 1.0f; *unk_2C4 += 1.0f;
if (*unk_2C4 == kREG(6) + 40.0f) { if (*unk_2C4 == kREG(6) + 40.0f) {
func_80AF37AC(); func_80AF37AC();
@ -751,11 +760,11 @@ void func_80AF3D60(EnRu2* this, GlobalContext* globalCtx) {
void EnRu2_Update(Actor* thisx, GlobalContext* globalCtx) { void EnRu2_Update(Actor* thisx, GlobalContext* globalCtx) {
EnRu2* this = THIS; EnRu2* this = THIS;
if (this->action < 0 || this->action >= 20 || D_80AF50BC[this->action] == 0) { if (this->action < 0 || this->action >= 20 || sActionFuncs[this->action] == 0) {
osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
return; return;
} }
D_80AF50BC[this->action](this, globalCtx); sActionFuncs[this->action](this, globalCtx);
} }
void EnRu2_Init(Actor* thisx, GlobalContext* globalCtx) { void EnRu2_Init(Actor* thisx, GlobalContext* globalCtx) {
@ -812,9 +821,9 @@ void func_80AF3F20(EnRu2* this, GlobalContext* globalCtx) {
void EnRu2_Draw(Actor* thisx, GlobalContext* globalCtx) { void EnRu2_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnRu2* this = THIS; EnRu2* this = THIS;
if (this->drawConfig < 0 || this->drawConfig >= 3 || D_80AF510C[this->drawConfig] == 0) { if (this->drawConfig < 0 || this->drawConfig >= 3 || sDrawFuncs[this->drawConfig] == 0) {
osSyncPrintf(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); osSyncPrintf(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
return; return;
} }
D_80AF510C[this->drawConfig](this, globalCtx); sDrawFuncs[this->drawConfig](this, globalCtx);
} }

View file

@ -81,7 +81,7 @@ void EnSb_Init(Actor* thisx, GlobalContext* globalCtx) {
EnSb* this = THIS; EnSb* this = THIS;
Actor_ProcessInitChain(&this->actor, sInitChain); Actor_ProcessInitChain(&this->actor, sInitChain);
this->actor.colChkInfo.damageTable = sDamageTable; this->actor.colChkInfo.damageTable = &sDamageTable;
this->actor.colChkInfo.health = 2; this->actor.colChkInfo.health = 2;
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06002BF0, &D_06000194, NULL, NULL, 0); SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06002BF0, &D_06000194, NULL, NULL, 0);
Collider_InitCylinder(globalCtx, &this->collider); Collider_InitCylinder(globalCtx, &this->collider);

View file

@ -15,7 +15,7 @@ void EnSceneChange_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnSceneChange_Update(Actor* thisx, GlobalContext* globalCtx); void EnSceneChange_Update(Actor* thisx, GlobalContext* globalCtx);
void EnSceneChange_Draw(Actor* thisx, GlobalContext* globalCtx); void EnSceneChange_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_80AF8CAC(EnSceneChange* this, GlobalContext* globalCtx); void EnSceneChange_DoNothing(EnSceneChange* this, GlobalContext* globalCtx);
const ActorInit En_Scene_Change_InitVars = { const ActorInit En_Scene_Change_InitVars = {
ACTOR_EN_SCENE_CHANGE, ACTOR_EN_SCENE_CHANGE,
@ -36,13 +36,13 @@ void EnSceneChange_SetupAction(EnSceneChange* this, EnSceneChangeActionFunc acti
void EnSceneChange_Init(Actor* thisx, GlobalContext* globalCtx) { void EnSceneChange_Init(Actor* thisx, GlobalContext* globalCtx) {
EnSceneChange* this = THIS; EnSceneChange* this = THIS;
EnSceneChange_SetupAction(this, func_80AF8CAC); EnSceneChange_SetupAction(this, EnSceneChange_DoNothing);
} }
void EnSceneChange_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnSceneChange_Destroy(Actor* thisx, GlobalContext* globalCtx) {
} }
void func_80AF8CAC(EnSceneChange* this, GlobalContext* globalCtx) { void EnSceneChange_DoNothing(EnSceneChange* this, GlobalContext* globalCtx) {
} }
void EnSceneChange_Update(Actor* thisx, GlobalContext* globalCtx) { void EnSceneChange_Update(Actor* thisx, GlobalContext* globalCtx) {

View file

@ -28,24 +28,24 @@ const ActorInit En_Tana_InitVars = {
NULL, NULL,
}; };
static char* shelfTypes[] = { static char* sShelfTypes[] = {
"木の棚", // "Wooden Shelves" "木の棚", // "Wooden Shelves"
"石の棚", // "Stone Shelves" "石の棚", // "Stone Shelves"
}; };
static const ActorFunc drawFuncs[] = { static const ActorFunc sDrawFuncs[] = {
func_80B17FC4, func_80B17FC4,
func_80B1809C, func_80B1809C,
func_80B1809C, func_80B1809C,
}; };
static Gfx* dListTbl[] = { static Gfx* sDLists1[] = {
0x06000B80, 0x06000B80,
0x060027E8, 0x060027E8,
0x060027E8, 0x060027E8,
}; };
static Gfx* dListTbl2[] = { static UNK_PTR sUnkSegments[] = {
NULL, NULL,
0x06000E08, 0x06000E08,
0x06001608, 0x06001608,
@ -54,10 +54,10 @@ static Gfx* dListTbl2[] = {
void EnTana_Init(Actor* thisx, GlobalContext* globalCtx) { void EnTana_Init(Actor* thisx, GlobalContext* globalCtx) {
EnTana* this = THIS; EnTana* this = THIS;
osSyncPrintf("☆☆☆ %s ☆☆☆\n", shelfTypes[thisx->params]); osSyncPrintf("☆☆☆ %s ☆☆☆\n", sShelfTypes[thisx->params]);
Actor_SetScale(thisx, 1.0f); Actor_SetScale(thisx, 1.0f);
thisx->flags &= ~1; thisx->flags &= ~1;
thisx->draw = drawFuncs[thisx->params]; thisx->draw = sDrawFuncs[thisx->params];
} }
void EnTana_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnTana_Destroy(Actor* thisx, GlobalContext* globalCtx) {
@ -76,7 +76,7 @@ void func_80B17FC4(Actor* thisx, GlobalContext* globalCtx) {
func_80093D18(globalCtx->state.gfxCtx); func_80093D18(globalCtx->state.gfxCtx);
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_tana.c", 152), gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_tana.c", 152),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxCtx->polyOpa.p++, dListTbl[thisx->params]); gSPDisplayList(gfxCtx->polyOpa.p++, sDLists1[thisx->params]);
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_tana.c", 157); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_tana.c", 157);
} }
@ -88,9 +88,9 @@ void func_80B1809C(Actor* thisx, GlobalContext* globalCtx) {
gfxCtx = globalCtx->state.gfxCtx; gfxCtx = globalCtx->state.gfxCtx;
Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_tana.c", 163); Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_tana.c", 163);
func_80093D18(globalCtx->state.gfxCtx); func_80093D18(globalCtx->state.gfxCtx);
gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(dListTbl2[thisx->params])); gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(sUnkSegments[thisx->params]));
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_tana.c", 169), gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_tana.c", 169),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxCtx->polyOpa.p++, dListTbl[thisx->params]); gSPDisplayList(gfxCtx->polyOpa.p++, sDLists1[thisx->params]);
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_tana.c", 174); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_tana.c", 174);
} }

View file

@ -171,13 +171,13 @@ s32 EnTkEff_CreateDflt(EnTk* this, Vec3f* pos, u8 duration, f32 size, f32 growth
/** z_en_tk_eff.c ends here probably **/ /** z_en_tk_eff.c ends here probably **/
static ColliderCylinderInit D_80B1D508 = { static ColliderCylinderInit sCylinderInit = {
{ 0x0A, 0x00, 0x00, 0x39, 0x20, 0x01 }, { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER },
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 },
{ 0x001E, 0x0034, 0x0000, { 0 } }, { 30, 52, 0, { 0, 0, 0 } },
}; };
static CollisionCheckInfoInit2 colChkInfoInit = { static CollisionCheckInfoInit2 sColChkInfoInit = {
0x00, 0x0000, 0x0000, 0x0000, 0xFF, 0x00, 0x0000, 0x0000, 0x0000, 0xFF,
}; };
@ -506,9 +506,9 @@ void EnTk_Init(Actor* thisx, GlobalContext* globalCtx) {
0.f); 0.f);
Collider_InitCylinder(globalCtx, &this->collider); Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &D_80B1D508); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
func_80061EFC(&this->actor.colChkInfo, NULL, &colChkInfoInit); func_80061EFC(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
if (gSaveContext.dayTime <= 0xC000 || gSaveContext.dayTime >= 0xE000 || !LINK_IS_CHILD || if (gSaveContext.dayTime <= 0xC000 || gSaveContext.dayTime >= 0xE000 || !LINK_IS_CHILD ||
globalCtx->sceneNum != SCENE_SPOT02) { globalCtx->sceneNum != SCENE_SPOT02) {
@ -599,7 +599,7 @@ void EnTk_Walk(EnTk* this, GlobalContext* globalCtx) {
void EnTk_Dig(EnTk* this, GlobalContext* globalCtx) { void EnTk_Dig(EnTk* this, GlobalContext* globalCtx) {
Vec3f rewardOrigin; Vec3f rewardOrigin;
Vec3f rewardPos; Vec3f rewardPos;
s32 rewardParams[] = { s32 sRewardParams[] = {
0x0000, /* Green rupee */ 0x0000, /* Green rupee */
0x0001, /* Blue rupee */ 0x0001, /* Blue rupee */
0x0002, /* Red rupee */ 0x0002, /* Red rupee */
@ -639,7 +639,7 @@ void EnTk_Dig(EnTk* this, GlobalContext* globalCtx) {
} }
} }
Item_DropCollectible(globalCtx, &rewardPos, rewardParams[this->currentReward]); Item_DropCollectible(globalCtx, &rewardPos, sRewardParams[this->currentReward]);
} }
} }
@ -742,12 +742,11 @@ void EnTk_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec
} }
void EnTk_Draw(Actor* thisx, GlobalContext* globalCtx) { void EnTk_Draw(Actor* thisx, GlobalContext* globalCtx) {
static UNK_PTR eyeImages[] = { static UNK_PTR sEyesSegments[] = {
&D_06003B40, 0x06003B40,
&D_06004340, 0x06004340,
&D_06004B40, 0x06004B40,
}; };
EnTk* this = THIS; EnTk* this = THIS;
GraphicsContext* gfxCtx; GraphicsContext* gfxCtx;
Gfx* dispRefs[4]; Gfx* dispRefs[4];
@ -761,7 +760,7 @@ void EnTk_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_80093D18(globalCtx->state.gfxCtx); func_80093D18(globalCtx->state.gfxCtx);
gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(eyeImages[this->eyeImageIdx])); gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(sEyesSegments[this->eyeImageIdx]));
SkelAnime_DrawSV(globalCtx, this->skelAnim.skeleton, this->skelAnim.limbDrawTbl, this->skelAnim.dListCount, SkelAnime_DrawSV(globalCtx, this->skelAnim.skeleton, this->skelAnim.limbDrawTbl, this->skelAnim.dListCount,
EnTk_OverrideLimbDraw, EnTk_PostLimbDraw, &this->actor); EnTk_OverrideLimbDraw, EnTk_PostLimbDraw, &this->actor);

View file

@ -21,7 +21,7 @@ void EnTuboTrap_WaitForProximity(EnTuboTrap* this, GlobalContext* globalCtx);
void EnTuboTrap_Levitate(EnTuboTrap* this, GlobalContext* globalCtx); void EnTuboTrap_Levitate(EnTuboTrap* this, GlobalContext* globalCtx);
void EnTuboTrap_Fly(EnTuboTrap* this, GlobalContext* globalCtx); void EnTuboTrap_Fly(EnTuboTrap* this, GlobalContext* globalCtx);
static ColliderCylinderInit cylinderInitData = { static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK10, 0x11, 0x09, 0x00, 0x20, COLSHAPE_CYLINDER }, { COLTYPE_UNK10, 0x11, 0x09, 0x00, 0x20, COLSHAPE_CYLINDER },
{ 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x01, 0x00 }, { 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x01, 0x00 },
{ 9, 23, 0, { 0 } }, { 9, 23, 0, { 0 } },
@ -49,7 +49,7 @@ void EnTuboTrap_Init(Actor* thisx, GlobalContext* globalCtx) {
osSyncPrintf("\n\n"); osSyncPrintf("\n\n");
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 壷トラップ ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); // "Urn Trap" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 壷トラップ ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); // "Urn Trap"
Collider_InitCylinder(globalCtx, &this->collider); Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInitData); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
Actor_SetScale(&this->actor, 0.1f); Actor_SetScale(&this->actor, 0.1f);
this->actionFunc = EnTuboTrap_WaitForProximity; this->actionFunc = EnTuboTrap_WaitForProximity;
} }

View file

@ -26,7 +26,7 @@ const ActorInit En_Vase_InitVars = {
(ActorFunc)EnVase_Draw, (ActorFunc)EnVase_Draw,
}; };
extern u32 DL_VASE; extern Gfx D_06000000[];
void EnVase_Init(Actor* thisx, GlobalContext* globalCtx) { void EnVase_Init(Actor* thisx, GlobalContext* globalCtx) {
EnVase* this = THIS; EnVase* this = THIS;
@ -40,5 +40,5 @@ void EnVase_Destroy(Actor* thisx, GlobalContext* globalCtx) {
} }
void EnVase_Draw(Actor* thisx, GlobalContext* globalCtx) { void EnVase_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx_DrawDListOpa(globalCtx, &DL_VASE); Gfx_DrawDListOpa(globalCtx, &D_06000000);
} }

View file

@ -32,7 +32,7 @@ void EnWallmas_Stand(EnWallmas* this, GlobalContext* globalCtx);
void EnWallmas_JumpToCeiling(EnWallmas* this, GlobalContext* globalCtx); void EnWallmas_JumpToCeiling(EnWallmas* this, GlobalContext* globalCtx);
void EnWallmas_ReturnToCeiling(EnWallmas* this, GlobalContext* globalCtx); void EnWallmas_ReturnToCeiling(EnWallmas* this, GlobalContext* globalCtx);
void EnWallmas_TakeDamage(EnWallmas* this, GlobalContext* globalCtx); void EnWallmas_TakeDamage(EnWallmas* this, GlobalContext* globalCtx);
void EnWallmas_DamageCoolDown(EnWallmas* this, GlobalContext* globalCtx); void EnWallmas_Cooldown(EnWallmas* this, GlobalContext* globalCtx);
void EnWallmas_Die(EnWallmas* this, GlobalContext* globalCtx); void EnWallmas_Die(EnWallmas* this, GlobalContext* globalCtx);
void EnWallmas_TakePlayer(EnWallmas* this, GlobalContext* globalCtx); void EnWallmas_TakePlayer(EnWallmas* this, GlobalContext* globalCtx);
void EnWallmas_WaitForProximity(EnWallmas* this, GlobalContext* globalCtx); void EnWallmas_WaitForProximity(EnWallmas* this, GlobalContext* globalCtx);
@ -52,25 +52,25 @@ const ActorInit En_Wallmas_InitVars = {
(ActorFunc)EnWallmas_Draw, (ActorFunc)EnWallmas_Draw,
}; };
static ColliderCylinderInit colCylinderInit = { static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK0, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, { COLTYPE_UNK0, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER },
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 },
{ 30, 40, 0, { 0 } }, { 30, 40, 0, { 0 } },
}; };
static CollisionCheckInfoInit colChkInfoInit = { static CollisionCheckInfoInit sColChkInfoInit = {
0x04, 0x04,
0x001E, 0x001E,
0x0028, 0x0028,
0x96, 0x96,
}; };
static DamageTable damageTable = { static DamageTable sDamageTable = {
0x10, 0x02, 0x01, 0x02, 0x10, 0x02, 0x02, 0x10, 0x01, 0x02, 0x04, 0x24, 0x02, 0x44, 0x04, 0x02, 0x10, 0x02, 0x01, 0x02, 0x10, 0x02, 0x02, 0x10, 0x01, 0x02, 0x04, 0x24, 0x02, 0x44, 0x04, 0x02,
0x02, 0x24, 0x00, 0x44, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x04, 0x00, 0x02, 0x24, 0x00, 0x44, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x04, 0x00,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_S8(naviEnemyId, 0x30, 1), ICHAIN_S8(naviEnemyId, 0x30, 1),
ICHAIN_F32(unk_4C, 0x157C, 1), ICHAIN_F32(unk_4C, 0x157C, 1),
ICHAIN_F32_DIV1000(gravity, 0xFA24, 0), ICHAIN_F32_DIV1000(gravity, 0xFA24, 0),
@ -93,14 +93,14 @@ extern Gfx D_06008688[];
void EnWallmas_Init(Actor* thisx, GlobalContext* globalCtx) { void EnWallmas_Init(Actor* thisx, GlobalContext* globalCtx) {
EnWallmas* this = THIS; EnWallmas* this = THIS;
Actor_ProcessInitChain(thisx, initChain); Actor_ProcessInitChain(thisx, sInitChain);
ActorShape_Init(&thisx->shape, 0, NULL, 0.5f); ActorShape_Init(&thisx->shape, 0, NULL, 0.5f);
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06008FB0, &D_06009DB0, &this->unkSkelAnimeStruct, &this->unk_22e, SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06008FB0, &D_06009DB0, &this->unkSkelAnimeStruct, &this->unk_22e,
0x19); 0x19);
Collider_InitCylinder(globalCtx, &this->collider); Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, thisx, &colCylinderInit); Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit);
func_80061ED4(&thisx->colChkInfo, &damageTable, &colChkInfoInit); func_80061ED4(&thisx->colChkInfo, &sDamageTable, &sColChkInfoInit);
this->switchFlag = (u8)(thisx->params >> 0x8); this->switchFlag = (u8)(thisx->params >> 0x8);
thisx->params = thisx->params & 0xFF; thisx->params = thisx->params & 0xFF;
@ -137,7 +137,7 @@ void EnWallmas_TimerInit(EnWallmas* this, GlobalContext* globalCtx) {
this->actionFunc = EnWallmas_WaitToDrop; this->actionFunc = EnWallmas_WaitToDrop;
} }
void EnWallmas_DropStart(EnWallmas* this, GlobalContext* globalCtx) { void EnWallmas_SetupDrop(EnWallmas* this, GlobalContext* globalCtx) {
Player* player = PLAYER; Player* player = PLAYER;
AnimationHeader* objSegChangeAnime = &D_0600299C; AnimationHeader* objSegChangeAnime = &D_0600299C;
@ -153,7 +153,7 @@ void EnWallmas_DropStart(EnWallmas* this, GlobalContext* globalCtx) {
this->actionFunc = EnWallmas_Drop; this->actionFunc = EnWallmas_Drop;
} }
void EnWallmas_LandStart(EnWallmas* this, GlobalContext* globalCtx) { void EnWallmas_SetupLand(EnWallmas* this, GlobalContext* globalCtx) {
AnimationHeader* objSegFrameCount = &D_060019CC; AnimationHeader* objSegFrameCount = &D_060019CC;
AnimationHeader* objSegChangeAnime = &D_060019CC; AnimationHeader* objSegChangeAnime = &D_060019CC;
@ -165,23 +165,23 @@ void EnWallmas_LandStart(EnWallmas* this, GlobalContext* globalCtx) {
this->actionFunc = EnWallmas_Land; this->actionFunc = EnWallmas_Land;
} }
void EnWallmas_StandStart(EnWallmas* this) { void EnWallmas_SetupStand(EnWallmas* this) {
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_0600A054); SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_0600A054);
this->actionFunc = EnWallmas_Stand; this->actionFunc = EnWallmas_Stand;
} }
void EnWallmas_WalkStart(EnWallmas* this) { void EnWallmas_SetupWalk(EnWallmas* this) {
SkelAnime_ChangeAnimPlaybackStop(&this->skelAnime, &D_060041F4, 3.0f); SkelAnime_ChangeAnimPlaybackStop(&this->skelAnime, &D_060041F4, 3.0f);
this->actionFunc = EnWallmas_Walk; this->actionFunc = EnWallmas_Walk;
this->actor.speedXZ = 3.0f; this->actor.speedXZ = 3.0f;
} }
void EnWallmas_JumpToCeilingStart(EnWallmas* this) { void EnWallmas_SetupJumpToCeiling(EnWallmas* this) {
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06009244); SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06009244);
this->actionFunc = EnWallmas_JumpToCeiling; this->actionFunc = EnWallmas_JumpToCeiling;
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
} }
void EnWallmas_ReturnToCeilingStart(EnWallmas* this) { void EnWallmas_SetupReturnToCeiling(EnWallmas* this) {
AnimationHeader* objSegFrameCount = &D_060019CC; AnimationHeader* objSegFrameCount = &D_060019CC;
AnimationHeader* objSegChangeAnime = &D_060019CC; AnimationHeader* objSegChangeAnime = &D_060019CC;
@ -194,7 +194,7 @@ void EnWallmas_ReturnToCeilingStart(EnWallmas* this) {
this->actionFunc = EnWallmas_ReturnToCeiling; this->actionFunc = EnWallmas_ReturnToCeiling;
} }
void EnWallmas_TakeDamageStart(EnWallmas* this) { void EnWallmas_SetupTakeDamage(EnWallmas* this) {
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06000590, -3.0f); SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06000590, -3.0f);
if ((this->collider.body.acHitItem->toucher.flags & 0x1F824) != 0) { if ((this->collider.body.acHitItem->toucher.flags & 0x1F824) != 0) {
this->actor.posRot.rot.y = this->collider.base.ac->posRot.rot.y; this->actor.posRot.rot.y = this->collider.base.ac->posRot.rot.y;
@ -208,15 +208,15 @@ void EnWallmas_TakeDamageStart(EnWallmas* this) {
this->actor.velocity.y = 10.0f; this->actor.velocity.y = 10.0f;
} }
void EnWallmas_DamageCoolDownStart(EnWallmas* this) { void EnWallmas_SetupCooldown(EnWallmas* this) {
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06000EA4); SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06000EA4);
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actor.posRot.rot.y = this->actor.shape.rot.y; this->actor.posRot.rot.y = this->actor.shape.rot.y;
this->actionFunc = EnWallmas_DamageCoolDown; this->actionFunc = EnWallmas_Cooldown;
} }
void EnWallMas_DieBegin(EnWallmas* this, GlobalContext* globalCtx) { void EnWallmas_SetupDie(EnWallmas* this, GlobalContext* globalCtx) {
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
@ -227,7 +227,7 @@ void EnWallMas_DieBegin(EnWallmas* this, GlobalContext* globalCtx) {
this->actionFunc = EnWallmas_Die; this->actionFunc = EnWallmas_Die;
} }
void EnWallmas_TakePlayerBegin(EnWallmas* this, GlobalContext* globalCtx) { void EnWallmas_SetupTakePlayer(EnWallmas* this, GlobalContext* globalCtx) {
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06009520, -5.0f); SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06009520, -5.0f);
this->timer = -0x1e; this->timer = -0x1e;
this->actionFunc = EnWallmas_TakePlayer; this->actionFunc = EnWallmas_TakePlayer;
@ -250,7 +250,7 @@ void EnWallmas_ProximityOrSwitchInit(EnWallmas* this) {
} }
} }
void EnWallmas_StunBegin(EnWallmas* this) { void EnWallmas_SetupStun(EnWallmas* this) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_060019CC, 1.5f, 0, 20.0f, 2, -3.0f); SkelAnime_ChangeAnim(&this->skelAnime, &D_060019CC, 1.5f, 0, 20.0f, 2, -3.0f);
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
@ -291,7 +291,7 @@ void EnWallmas_WaitToDrop(EnWallmas* this, GlobalContext* globalCtx) {
} }
if (this->timer == 0) { if (this->timer == 0) {
EnWallmas_DropStart(this, globalCtx); EnWallmas_SetupDrop(this, globalCtx);
} }
} }
@ -300,19 +300,19 @@ void EnWallmas_Drop(EnWallmas* this, GlobalContext* globalCtx) {
if (!func_8008E988(globalCtx) && (player->stateFlags2 & 0x10) == 0 && (player->invincibilityTimer >= 0) && if (!func_8008E988(globalCtx) && (player->stateFlags2 & 0x10) == 0 && (player->invincibilityTimer >= 0) &&
(this->actor.xzDistanceFromLink < 30.0f) && (this->actor.yDistanceFromLink < -5.0f) && (this->actor.xzDistanceFromLink < 30.0f) && (this->actor.yDistanceFromLink < -5.0f) &&
(-(f32)(player->unk_4DA + 0xA) < this->actor.yDistanceFromLink)) { (-(f32)(player->unk_4DA + 0xA) < this->actor.yDistanceFromLink)) {
EnWallmas_TakePlayerBegin(this, globalCtx); EnWallmas_SetupTakePlayer(this, globalCtx);
} }
} }
void EnWallmas_Land(EnWallmas* this, GlobalContext* globalCtx) { void EnWallmas_Land(EnWallmas* this, GlobalContext* globalCtx) {
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) { if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) {
EnWallmas_StandStart(this); EnWallmas_SetupStand(this);
} }
} }
void EnWallmas_Stand(EnWallmas* this, GlobalContext* globalCtx) { void EnWallmas_Stand(EnWallmas* this, GlobalContext* globalCtx) {
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) { if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) {
EnWallmas_WalkStart(this); EnWallmas_SetupWalk(this);
} }
Math_ApproxUpdateScaledS(&this->actor.posRot.rot.y, this->actor.rotTowardsLinkY + 0x8000, 0xB6); Math_ApproxUpdateScaledS(&this->actor.posRot.rot.y, this->actor.rotTowardsLinkY + 0x8000, 0xB6);
@ -320,7 +320,7 @@ void EnWallmas_Stand(EnWallmas* this, GlobalContext* globalCtx) {
void EnWallmas_Walk(EnWallmas* this, GlobalContext* globalCtx) { void EnWallmas_Walk(EnWallmas* this, GlobalContext* globalCtx) {
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) { if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) {
EnWallmas_JumpToCeilingStart(this); EnWallmas_SetupJumpToCeiling(this);
} }
Math_ApproxUpdateScaledS(&this->actor.posRot.rot.y, (s16)((s32)this->actor.rotTowardsLinkY + 0x8000), 0xB6); Math_ApproxUpdateScaledS(&this->actor.posRot.rot.y, (s16)((s32)this->actor.rotTowardsLinkY + 0x8000), 0xB6);
@ -333,7 +333,7 @@ void EnWallmas_Walk(EnWallmas* this, GlobalContext* globalCtx) {
void EnWallmas_JumpToCeiling(EnWallmas* this, GlobalContext* globalCtx) { void EnWallmas_JumpToCeiling(EnWallmas* this, GlobalContext* globalCtx) {
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) { if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) {
EnWallmas_ReturnToCeilingStart(this); EnWallmas_SetupReturnToCeiling(this);
} }
} }
@ -368,9 +368,9 @@ void EnWallmas_ReturnToCeiling(EnWallmas* this, GlobalContext* globalCtx) {
void EnWallmas_TakeDamage(EnWallmas* this, GlobalContext* globalCtx) { void EnWallmas_TakeDamage(EnWallmas* this, GlobalContext* globalCtx) {
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) { if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) {
if (this->actor.colChkInfo.health == 0) { if (this->actor.colChkInfo.health == 0) {
EnWallMas_DieBegin(this, globalCtx); EnWallmas_SetupDie(this, globalCtx);
} else { } else {
EnWallmas_DamageCoolDownStart(this); EnWallmas_SetupCooldown(this);
} }
} }
if (func_800A56C8(&this->skelAnime, 13.0f) != 0) { if (func_800A56C8(&this->skelAnime, 13.0f) != 0) {
@ -380,9 +380,9 @@ void EnWallmas_TakeDamage(EnWallmas* this, GlobalContext* globalCtx) {
Math_ApproxF(&this->actor.speedXZ, 0.0f, 0.2f); Math_ApproxF(&this->actor.speedXZ, 0.0f, 0.2f);
} }
void EnWallmas_DamageCoolDown(EnWallmas* this, GlobalContext* globalCtx) { void EnWallmas_Cooldown(EnWallmas* this, GlobalContext* globalCtx) {
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) { if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) {
EnWallmas_ReturnToCeilingStart(this); EnWallmas_SetupReturnToCeiling(this);
} }
} }
@ -472,9 +472,9 @@ void EnWallmas_Stun(EnWallmas* this, GlobalContext* globalCtx) {
if (this->timer == 0) { if (this->timer == 0) {
if (this->actor.colChkInfo.health == 0) { if (this->actor.colChkInfo.health == 0) {
EnWallMas_DieBegin(this, globalCtx); EnWallmas_SetupDie(this, globalCtx);
} else { } else {
EnWallmas_ReturnToCeilingStart(this); EnWallmas_SetupReturnToCeiling(this);
} }
} }
} }
@ -497,14 +497,14 @@ void EnWallmas_ColUpdate(EnWallmas* this, GlobalContext* globalCtx) {
if ((this->actor.colChkInfo.damageEffect == DAMAGE_EFFECT_STUN_WHITE) || if ((this->actor.colChkInfo.damageEffect == DAMAGE_EFFECT_STUN_WHITE) ||
(this->actor.colChkInfo.damageEffect == DAMAGE_EFFECT_STUN_BLUE)) { (this->actor.colChkInfo.damageEffect == DAMAGE_EFFECT_STUN_BLUE)) {
if (this->actionFunc != EnWallmas_Stun) { if (this->actionFunc != EnWallmas_Stun) {
EnWallmas_StunBegin(this); EnWallmas_SetupStun(this);
} }
} else { } else {
if (this->actor.colChkInfo.damageEffect == DAMAGE_EFFECT_BURN) { if (this->actor.colChkInfo.damageEffect == DAMAGE_EFFECT_BURN) {
func_8002A65C(globalCtx, &this->actor, &this->actor.posRot.pos, 0x28, 0x28); func_8002A65C(globalCtx, &this->actor, &this->actor.posRot.pos, 0x28, 0x28);
} }
EnWallmas_TakeDamageStart(this); EnWallmas_SetupTakeDamage(this);
} }
} }
} }
@ -531,7 +531,7 @@ void EnWallmas_Update(Actor* thisx, GlobalContext* globalCtx) {
} else if (this->actor.posRot.pos.y <= this->unk_2c4) { } else if (this->actor.posRot.pos.y <= this->unk_2c4) {
this->actor.posRot.pos.y = this->unk_2c4; this->actor.posRot.pos.y = this->unk_2c4;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
EnWallmas_LandStart(this, globalCtx); EnWallmas_SetupLand(this, globalCtx);
} }
if ((this->actionFunc != EnWallmas_Die) && (this->actionFunc != EnWallmas_Drop)) { if ((this->actionFunc != EnWallmas_Die) && (this->actionFunc != EnWallmas_Drop)) {

View file

@ -53,8 +53,10 @@ void EndTitle_Draw(Actor* thisx, GlobalContext* globalCtx) {
s32 frameCount = globalCtx->csCtx.frames; s32 frameCount = globalCtx->csCtx.frames;
Player* player = PLAYER; Player* player = PLAYER;
mf = &player->mf_9E0; mf = &player->mf_9E0;
// Draws the Triforce on Link's left hand
{ {
// Draws the Triforce on Link's left hand
GraphicsContext* gfxCtx; GraphicsContext* gfxCtx;
Gfx* dispRefs[4]; Gfx* dispRefs[4];
gfxCtx = globalCtx->state.gfxCtx; gfxCtx = globalCtx->state.gfxCtx;
@ -67,10 +69,11 @@ void EndTitle_Draw(Actor* thisx, GlobalContext* globalCtx) {
Matrix_RotateY(0.0f, MTXMODE_APPLY); Matrix_RotateY(0.0f, MTXMODE_APPLY);
Matrix_RotateZ(0.0f, MTXMODE_APPLY); Matrix_RotateZ(0.0f, MTXMODE_APPLY);
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_end_title.c", 412), G_MTX_LOAD); gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_end_title.c", 412), G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, triforceDL); gSPDisplayList(gfxCtx->polyXlu.p++, sTriforceDList);
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_end_title.c", 417); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_end_title.c", 417);
} }
// Draw title cards on the screen
{ {
GraphicsContext* gfxCtx; GraphicsContext* gfxCtx;
Gfx* dispRefs[4]; Gfx* dispRefs[4];

View file

@ -423,7 +423,7 @@ static UNK_TYPE D_80B69660[] = {
0x01F40195, 0x00000000, 0x00000000, 0xFFFFFFFF, 0x00000500, 0x00000000, 0x00000000, 0xFFFFFFFF, 0x01F40195, 0x00000000, 0x00000000, 0xFFFFFFFF, 0x00000500, 0x00000000, 0x00000000, 0xFFFFFFFF,
}; };
static Gfx triforceDL[] = { static Gfx sTriforceDList[] = {
gsDPPipeSync(), gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE), gsDPSetTextureLUT(G_TT_NONE),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),

View file

@ -1,7 +1,7 @@
/* /*
* File: z_item_inbox.c * File: z_item_inbox.c
* Overlay: ovl_Item_Inbox * Overlay: ovl_Item_Inbox
* Description: Zelda's magic to open gates. * Description: Zelda's magic effect when opening gates in castle collapse
*/ */
#include "z_item_inbox.h" #include "z_item_inbox.h"
@ -15,7 +15,7 @@ void ItemInbox_Destroy(Actor* thisx, GlobalContext* globalCtx);
void ItemInbox_Update(Actor* thisx, GlobalContext* globalCtx); void ItemInbox_Update(Actor* thisx, GlobalContext* globalCtx);
void ItemInbox_Draw(Actor* thisx, GlobalContext* globalCtx); void ItemInbox_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_80B86020(ItemInbox* this, GlobalContext* globalCtx); void ItemInbox_Wait(ItemInbox* this, GlobalContext* globalCtx);
const ActorInit Item_Inbox_InitVars = { const ActorInit Item_Inbox_InitVars = {
ACTOR_ITEM_INBOX, ACTOR_ITEM_INBOX,
@ -32,14 +32,14 @@ const ActorInit Item_Inbox_InitVars = {
void ItemInbox_Init(Actor* thisx, GlobalContext* globalCtx) { void ItemInbox_Init(Actor* thisx, GlobalContext* globalCtx) {
ItemInbox* this = THIS; ItemInbox* this = THIS;
this->actionFunc = func_80B86020; this->actionFunc = ItemInbox_Wait;
Actor_SetScale(&this->actor, 0.2); Actor_SetScale(&this->actor, 0.2);
} }
void ItemInbox_Destroy(Actor* thisx, GlobalContext* globalCtx) { void ItemInbox_Destroy(Actor* thisx, GlobalContext* globalCtx) {
} }
void func_80B86020(ItemInbox* this, GlobalContext* globalCtx) { void ItemInbox_Wait(ItemInbox* this, GlobalContext* globalCtx) {
if (Flags_GetTreasure(globalCtx, (this->actor.params >> 8) & 0x1F)) { if (Flags_GetTreasure(globalCtx, (this->actor.params >> 8) & 0x1F)) {
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
} }

View file

@ -30,47 +30,47 @@ const ActorInit Obj_Bombiwa_InitVars = {
(ActorFunc)ObjBombiwa_Draw, (ActorFunc)ObjBombiwa_Draw,
}; };
static ColliderCylinderInit colliderInit = { static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK12, 0x00, 0x0D, 0x39, 0x20, COLSHAPE_CYLINDER }, { COLTYPE_UNK12, 0x00, 0x0D, 0x39, 0x20, COLSHAPE_CYLINDER },
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x4FC1FFFE, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x4FC1FFFE, 0x00, 0x00 }, 0x00, 0x01, 0x01 },
{ 55, 70, 0, { 0 } }, { 55, 70, 0, { 0 } },
}; };
static CollisionCheckInfoInit colChkInfoInit = { static CollisionCheckInfoInit sColChkInfoInit = {
0x00, 0x00,
0x000C, 0x000C,
0x003C, 0x003C,
0xFF, 0xFF,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 0x64, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 0x64, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F4, 0x7D0, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 0x7D0, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F8, 0x15E, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 0x15E, ICHAIN_CONTINUE),
ICHAIN_F32(unk_FC, 0x3E8, ICHAIN_STOP), ICHAIN_F32(unk_FC, 0x3E8, ICHAIN_STOP),
}; };
static s16 effectScales[] = { static s16 sEffectScales[] = {
17, 14, 10, 8, 7, 5, 3, 2, 17, 14, 10, 8, 7, 5, 3, 2,
}; };
extern Gfx* D_060009E0; // dlist extern Gfx D_060009E0[];
void ObjBombiwa_InitCollision(Actor* thisx, GlobalContext* globalCtx) { void ObjBombiwa_InitCollision(Actor* thisx, GlobalContext* globalCtx) {
ObjBombiwa* this = THIS; ObjBombiwa* this = THIS;
Collider_InitCylinder(globalCtx, &this->collider); Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &colliderInit); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
Collider_CylinderUpdate(&this->actor, &this->collider); Collider_CylinderUpdate(&this->actor, &this->collider);
} }
void ObjBombiwa_Init(Actor* thisx, GlobalContext* globalCtx) { void ObjBombiwa_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(thisx, initChain); Actor_ProcessInitChain(thisx, sInitChain);
ObjBombiwa_InitCollision(thisx, globalCtx); ObjBombiwa_InitCollision(thisx, globalCtx);
if ((Flags_GetSwitch(globalCtx, thisx->params & 0x3F) != 0)) { if ((Flags_GetSwitch(globalCtx, thisx->params & 0x3F) != 0)) {
Actor_Kill(thisx); Actor_Kill(thisx);
} else { } else {
func_80061ED4(&thisx->colChkInfo, NULL, &colChkInfoInit); func_80061ED4(&thisx->colChkInfo, NULL, &sColChkInfoInit);
if (thisx->shape.rot.y == 0) { if (thisx->shape.rot.y == 0) {
s16 rand = (s16)Math_Rand_ZeroFloat(65536.0f); s16 rand = (s16)Math_Rand_ZeroFloat(65536.0f);
thisx->posRot.rot.y = rand; thisx->posRot.rot.y = rand;
@ -93,15 +93,15 @@ void ObjBombiwa_Break(ObjBombiwa* this, GlobalContext* globalCtx) {
s16 scale; s16 scale;
s32 i; s32 i;
dlist = &D_060009E0; dlist = D_060009E0;
for (i = 0; i < ARRAY_COUNT(effectScales); i++) { for (i = 0; i < ARRAY_COUNT(sEffectScales); i++) {
temp_s2.x = ((Math_Rand_ZeroOne() - 0.5f) * 10.0f) + this->actor.initPosRot.pos.x; temp_s2.x = ((Math_Rand_ZeroOne() - 0.5f) * 10.0f) + this->actor.initPosRot.pos.x;
temp_s2.y = ((Math_Rand_ZeroOne() * 5.0f) + this->actor.initPosRot.pos.y) + 8.0f; temp_s2.y = ((Math_Rand_ZeroOne() * 5.0f) + this->actor.initPosRot.pos.y) + 8.0f;
temp_s2.z = ((Math_Rand_ZeroOne() - 0.5f) * 10.0f) + this->actor.initPosRot.pos.z; temp_s2.z = ((Math_Rand_ZeroOne() - 0.5f) * 10.0f) + this->actor.initPosRot.pos.z;
temp_s3.x = (Math_Rand_ZeroOne() - 0.5f) * 15.0f; temp_s3.x = (Math_Rand_ZeroOne() - 0.5f) * 15.0f;
temp_s3.y = (Math_Rand_ZeroOne() * 16.0f) + 5.0f; temp_s3.y = (Math_Rand_ZeroOne() * 16.0f) + 5.0f;
temp_s3.z = (Math_Rand_ZeroOne() - 0.5f) * 15.0f; temp_s3.z = (Math_Rand_ZeroOne() - 0.5f) * 15.0f;
scale = effectScales[i]; scale = sEffectScales[i];
u0 = (scale >= 11) ? 37 : 33; u0 = (scale >= 11) ? 37 : 33;
func_80029E8C(globalCtx, &temp_s2, &temp_s3, &temp_s2, -400, u0, 10, 2, 0, scale, 1, 0, 80, -1, OBJECT_BOMBIWA, func_80029E8C(globalCtx, &temp_s2, &temp_s3, &temp_s2, -400, u0, 10, 2, 0, scale, 1, 0, 80, -1, OBJECT_BOMBIWA,
dlist); dlist);
@ -132,5 +132,5 @@ void ObjBombiwa_Update(Actor* thisx, GlobalContext* globalCtx) {
} }
void ObjBombiwa_Draw(Actor* thisx, GlobalContext* globalCtx) { void ObjBombiwa_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx_DrawDListOpa(globalCtx, &D_060009E0); Gfx_DrawDListOpa(globalCtx, D_060009E0);
} }

View file

@ -17,7 +17,7 @@ void ObjComb_Draw(Actor* thisx, GlobalContext* globalCtx);
void ObjComb_Break(ObjComb* this, GlobalContext* globalCtx); void ObjComb_Break(ObjComb* this, GlobalContext* globalCtx);
void ObjComb_ChooseItemDrop(ObjComb* this, GlobalContext* globalCtx); void ObjComb_ChooseItemDrop(ObjComb* this, GlobalContext* globalCtx);
void ObjComb_SetWait(ObjComb* this); void ObjComb_SetupWait(ObjComb* this);
void ObjComb_Wait(ObjComb* this, GlobalContext* globalCtx); void ObjComb_Wait(ObjComb* this, GlobalContext* globalCtx);
const ActorInit Obj_Comb_InitVars = { const ActorInit Obj_Comb_InitVars = {
@ -32,34 +32,34 @@ const ActorInit Obj_Comb_InitVars = {
(ActorFunc)ObjComb_Draw, (ActorFunc)ObjComb_Draw,
}; };
ColliderJntSphItemInit colliderItemsInit[1] = { ColliderJntSphItemInit sJntSphItemsInit[1] = {
{ {
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x4001FFFE, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x4001FFFE, 0x00, 0x00 }, 0x00, 0x01, 0x01 },
{ 0x00, { { 0, 0, 0 }, 15 }, 100 }, { 0x00, { { 0, 0, 0 }, 15 }, 100 },
}, },
}; };
ColliderJntSphInit colliderInit = { ColliderJntSphInit sJntSphInit = {
{ COLTYPE_UNK10, 0x00, 0x09, 0x09, 0x20, COLSHAPE_JNTSPH }, { COLTYPE_UNK10, 0x00, 0x09, 0x09, 0x20, COLSHAPE_JNTSPH },
1, 1,
&colliderItemsInit, &sJntSphItemsInit,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F4, 1100, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 1100, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F8, 100, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 100, ICHAIN_CONTINUE),
ICHAIN_F32(unk_FC, 900, ICHAIN_STOP), ICHAIN_F32(unk_FC, 900, ICHAIN_STOP),
}; };
extern UNK_TYPE D_050095B0; extern Gfx D_050095B0[];
extern UNK_TYPE D_05009940; extern Gfx D_05009940[];
void ObjComb_Break(ObjComb* this, GlobalContext* globalCtx) { void ObjComb_Break(ObjComb* this, GlobalContext* globalCtx) {
Vec3f pos1; Vec3f pos1;
Vec3f posSum; Vec3f posSum;
Vec3f pos2; Vec3f pos2;
Gfx** dlist = &D_05009940; Gfx** dlist = D_05009940;
s16 scale; s16 scale;
s16 angle = 0; s16 angle = 0;
s16 gravityInfluence; s16 gravityInfluence;
@ -135,17 +135,17 @@ void ObjComb_ChooseItemDrop(ObjComb* this, GlobalContext* globalCtx) {
void ObjComb_Init(Actor* thisx, GlobalContext* globalCtx) { void ObjComb_Init(Actor* thisx, GlobalContext* globalCtx) {
ObjComb* this = THIS; ObjComb* this = THIS;
Actor_ProcessInitChain(&this->actor, &initChain); Actor_ProcessInitChain(&this->actor, sInitChain);
Collider_InitJntSph(globalCtx, &this->collider); Collider_InitJntSph(globalCtx, &this->collider);
Collider_SetJntSph(globalCtx, &this->collider, this, &colliderInit, &this->colliderItems); Collider_SetJntSph(globalCtx, &this->collider, this, &sJntSphInit, &this->colliderItems);
ObjComb_SetWait(this); ObjComb_SetupWait(this);
} }
void ObjComb_Destroy(Actor* thisx, GlobalContext* globalCtx) { void ObjComb_Destroy(Actor* thisx, GlobalContext* globalCtx) {
Collider_DestroyJntSph(globalCtx, &THIS->collider); Collider_DestroyJntSph(globalCtx, &THIS->collider);
} }
void ObjComb_SetWait(ObjComb* this) { void ObjComb_SetupWait(ObjComb* this) {
this->actionFunc = ObjComb_Wait; this->actionFunc = ObjComb_Wait;
} }
@ -205,7 +205,7 @@ void ObjComb_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_obj_comb.c", 394), gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_obj_comb.c", 394),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxCtx->polyOpa.p++, &D_050095B0); gSPDisplayList(gfxCtx->polyOpa.p++, D_050095B0);
func_800628A4(0, &this->collider); func_800628A4(0, &this->collider);
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_obj_comb.c", 402); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_obj_comb.c", 402);

View file

@ -1,7 +1,7 @@
/* /*
* File: z_obj_elevator.c * File: z_obj_elevator.c
* Overlay: Obj_Elevator * Overlay: Obj_Elevator
* Description: Stone Dungeon Elevator * Description: Stone Elevator
*/ */
#include "z_obj_elevator.h" #include "z_obj_elevator.h"
@ -32,16 +32,16 @@ const ActorInit Obj_Elevator_InitVars = {
(ActorFunc)ObjElevator_Draw, (ActorFunc)ObjElevator_Draw,
}; };
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_F32(unk_F4, 2000, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 2000, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F8, 600, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 600, ICHAIN_CONTINUE),
ICHAIN_F32(unk_FC, 2000, ICHAIN_STOP), ICHAIN_F32(unk_FC, 2000, ICHAIN_STOP),
}; };
static f32 sizes[] = { 0.1f, 0.05f }; static f32 sScales[] = { 0.1f, 0.05f };
extern u32 D_06000180; extern Gfx D_06000180[];
extern u32 D_06000360; extern UNK_TYPE D_06000360;
void ObjElevator_SetupAction(ObjElevator* this, ObjElevatorActionFunc actionFunc) { void ObjElevator_SetupAction(ObjElevator* this, ObjElevatorActionFunc actionFunc) {
this->actionFunc = actionFunc; this->actionFunc = actionFunc;
@ -67,8 +67,8 @@ void ObjElevator_Init(Actor* thisx, GlobalContext* globalCtx) {
f32 temp_f0; f32 temp_f0;
func_80B92B08(this, globalCtx, &D_06000360, 1); func_80B92B08(this, globalCtx, &D_06000360, 1);
Actor_SetScale(thisx, sizes[thisx->params & 1]); Actor_SetScale(thisx, sScales[thisx->params & 1]);
Actor_ProcessInitChain(thisx, initChain); Actor_ProcessInitChain(thisx, sInitChain);
temp_f0 = (thisx->params >> 8) & 0xF; temp_f0 = (thisx->params >> 8) & 0xF;
this->unk_16C = temp_f0 + temp_f0; this->unk_16C = temp_f0 + temp_f0;
func_80B92C5C(this); func_80B92C5C(this);
@ -88,6 +88,7 @@ void func_80B92C5C(ObjElevator* this) {
void func_80B92C80(ObjElevator* this, GlobalContext* globalCtx) { void func_80B92C80(ObjElevator* this, GlobalContext* globalCtx) {
f32 sub; f32 sub;
Actor* thisx = &this->dyna.actor; Actor* thisx = &this->dyna.actor;
if ((this->dyna.unk_160 & 2) && !(this->unk_170 & 2)) { if ((this->dyna.unk_160 & 2) && !(this->unk_170 & 2)) {
sub = thisx->posRot.pos.y - thisx->initPosRot.pos.y; sub = thisx->posRot.pos.y - thisx->initPosRot.pos.y;
if (fabsf(sub) < 0.1f) { if (fabsf(sub) < 0.1f) {
@ -105,6 +106,7 @@ void func_80B92D20(ObjElevator* this) {
void func_80B92D44(ObjElevator* this, GlobalContext* globalCtx) { void func_80B92D44(ObjElevator* this, GlobalContext* globalCtx) {
Actor* thisx = &this->dyna.actor; Actor* thisx = &this->dyna.actor;
if (fabsf(Math_SmoothScaleMaxMinF(&thisx->posRot.pos.y, this->unk_168, 1.0f, this->unk_16C, 0.0f)) < 0.001f) { if (fabsf(Math_SmoothScaleMaxMinF(&thisx->posRot.pos.y, this->unk_168, 1.0f, this->unk_16C, 0.0f)) < 0.001f) {
Audio_PlayActorSound2(thisx, NA_SE_EV_FOOT_SWITCH); Audio_PlayActorSound2(thisx, NA_SE_EV_FOOT_SWITCH);
func_80B92C5C(this); func_80B92C5C(this);
@ -123,5 +125,5 @@ void ObjElevator_Update(Actor* thisx, GlobalContext* globalCtx) {
} }
void ObjElevator_Draw(Actor* thisx, GlobalContext* globalCtx) { void ObjElevator_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx_DrawDListOpa(globalCtx, &D_06000180); Gfx_DrawDListOpa(globalCtx, D_06000180);
} }

View file

@ -1,11 +1,10 @@
/* /*
* File: z_obj_makekinsuta.c * File: z_obj_makekinsuta.c
* Overlay: ovl_Obj_Makekinsuta * Overlay: ovl_Obj_Makekinsuta
* Description: Skulltula Sprouting from Bean Spot. * Description: Skulltula Sprouting from Bean Spot
*/ */
#include "z_obj_makekinsuta.h" #include "z_obj_makekinsuta.h"
#include <vt.h> #include <vt.h>
#define FLAGS 0x00000010 #define FLAGS 0x00000010
@ -16,7 +15,7 @@ void ObjMakekinsuta_Init(Actor* thisx, GlobalContext* globalCtx);
void ObjMakekinsuta_Update(Actor* thisx, GlobalContext* globalCtx); void ObjMakekinsuta_Update(Actor* thisx, GlobalContext* globalCtx);
void func_80B98320(ObjMakekinsuta* this, GlobalContext* globalCtx); void func_80B98320(ObjMakekinsuta* this, GlobalContext* globalCtx);
void func_80B983D4(ObjMakekinsuta* this, GlobalContext* globalCtx); void ObjMakekinsuta_DoNothing(ObjMakekinsuta* this, GlobalContext* globalCtx);
const ActorInit Obj_Makekinsuta_InitVars = { const ActorInit Obj_Makekinsuta_InitVars = {
ACTOR_OBJ_MAKEKINSUTA, ACTOR_OBJ_MAKEKINSUTA,
@ -49,20 +48,20 @@ void ObjMakekinsuta_Init(Actor* thisx, GlobalContext* globalCtx) {
void func_80B98320(ObjMakekinsuta* this, GlobalContext* globalCtx) { void func_80B98320(ObjMakekinsuta* this, GlobalContext* globalCtx) {
if (this->unk_152 != 0) { if (this->unk_152 != 0) {
if (this->unk_150 >= 0x3C && !func_8002DEEC(PLAYER)) { if (this->timer >= 60 && !func_8002DEEC(PLAYER)) {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_SW, this->actor.posRot.pos.x, Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_SW, this->actor.posRot.pos.x,
this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.shape.rot.y, 0, this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.shape.rot.y, 0,
(this->actor.params | 0x8000)); (this->actor.params | 0x8000));
this->actionFunc = func_80B983D4; this->actionFunc = ObjMakekinsuta_DoNothing;
return; } else {
this->timer++;
} }
this->unk_150 = this->unk_150 + 1; } else {
return; this->timer = 0;
} }
this->unk_150 = 0;
} }
void func_80B983D4(ObjMakekinsuta* this, GlobalContext* globalCtx) { void ObjMakekinsuta_DoNothing(ObjMakekinsuta* this, GlobalContext* globalCtx) {
} }
void ObjMakekinsuta_Update(Actor* thisx, GlobalContext* globalCtx) { void ObjMakekinsuta_Update(Actor* thisx, GlobalContext* globalCtx) {

View file

@ -11,7 +11,7 @@ typedef void (*ObjMakekinsutaActionFunc)(struct ObjMakekinsuta*, GlobalContext*)
typedef struct ObjMakekinsuta { typedef struct ObjMakekinsuta {
/* 0x0000 */ Actor actor; /* 0x0000 */ Actor actor;
/* 0x014C */ ObjMakekinsutaActionFunc actionFunc; /* 0x014C */ ObjMakekinsutaActionFunc actionFunc;
/* 0x150 */ s16 unk_150; /* 0x150 */ s16 timer;
/* 0x152 */ s16 unk_152; /* 0x152 */ s16 unk_152;
} ObjMakekinsuta; // size = 0x0154 } ObjMakekinsuta; // size = 0x0154

View file

@ -1,7 +1,7 @@
/* /*
* File: z_obj_roomtimer.c * File: z_obj_roomtimer.c
* Overlay: ovl_Obj_Roomtimer * Overlay: ovl_Obj_Roomtimer
* Description: Timer * Description: Starts Timer 1 with a value specified in params
*/ */
#include "z_obj_roomtimer.h" #include "z_obj_roomtimer.h"
@ -51,10 +51,8 @@ void ObjRoomtimer_Init(Actor* thisx, GlobalContext* globalCtx) {
void ObjRoomtimer_Destroy(Actor* thisx, GlobalContext* globalCtx) { void ObjRoomtimer_Destroy(Actor* thisx, GlobalContext* globalCtx) {
ObjRoomtimer* this = THIS; ObjRoomtimer* this = THIS;
if (this->actor.params != 0x3FF) { if ((this->actor.params != 0x3FF) && (gSaveContext.timer1Value > 0)) {
if (gSaveContext.timer1Value > 0) { gSaveContext.timer1State = 10;
gSaveContext.timer1State = 10;
}
} }
} }
@ -72,18 +70,15 @@ void func_80B9D0B0(ObjRoomtimer* this, GlobalContext* globalCtx) {
if (this->actor.params != 0x3FF) { if (this->actor.params != 0x3FF) {
gSaveContext.timer1State = 10; gSaveContext.timer1State = 10;
} }
Flags_SetClear(globalCtx, this->actor.room); Flags_SetClear(globalCtx, this->actor.room);
Flags_SetSwitch(globalCtx, this->switchFlag); Flags_SetSwitch(globalCtx, this->switchFlag);
func_80078884(NA_SE_SY_CORRECT_CHIME); func_80078884(NA_SE_SY_CORRECT_CHIME);
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
} else { } else {
if (this->actor.params != 0x3FF) { if ((this->actor.params != 0x3FF) && (gSaveContext.timer1Value == 0)) {
if (gSaveContext.timer1Value == 0) { Audio_PlaySoundGeneral(NA_SE_OC_ABYSS, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
Audio_PlaySoundGeneral(NA_SE_OC_ABYSS, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); Gameplay_TriggerVoidOut(globalCtx);
Gameplay_TriggerVoidOut(globalCtx); Actor_Kill(&this->actor);
Actor_Kill(&this->actor);
}
} }
} }
} }

View file

@ -32,7 +32,7 @@ const ActorInit Oceff_Spot_InitVars = {
#include "z_oceff_spot_gfx.c" #include "z_oceff_spot_gfx.c"
static InitChainEntry initChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 0, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 0, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F4, 1500, ICHAIN_STOP), ICHAIN_F32(unk_F4, 1500, ICHAIN_STOP),
}; };
@ -45,7 +45,7 @@ void OceffSpot_Init(Actor* thisx, GlobalContext* globalCtx) {
u32 pad; u32 pad;
OceffSpot* this = THIS; OceffSpot* this = THIS;
Actor_ProcessInitChain(&this->actor, initChain); Actor_ProcessInitChain(&this->actor, sInitChain);
OceffSpot_SetupAction(this, OceffSpot_GrowCylinder); OceffSpot_SetupAction(this, OceffSpot_GrowCylinder);
Lights_InitType0PositionalLight(&this->lightInfo1, this->actor.posRot.pos.x, this->actor.posRot.pos.y, Lights_InitType0PositionalLight(&this->lightInfo1, this->actor.posRot.pos.x, this->actor.posRot.pos.y,
@ -160,10 +160,10 @@ void OceffSpot_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_oceff_spot.c", 469), gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_oceff_spot.c", 469),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxCtx->polyXlu.p++, textureDl); gSPDisplayList(gfxCtx->polyXlu.p++, sTextureDL);
gSPDisplayList(gfxCtx->polyXlu.p++, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, scroll * 2, scroll * (-2), 32, 32, gSPDisplayList(gfxCtx->polyXlu.p++, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, scroll * 2, scroll * (-2), 32, 32,
1, 0, scroll * (-8), 32, 32)); 1, 0, scroll * (-8), 32, 32));
gSPDisplayList(gfxCtx->polyXlu.p++, cylinderDl); gSPDisplayList(gfxCtx->polyXlu.p++, sCylinderDl);
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_oceff_spot.c", 485); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_oceff_spot.c", 485);
} }

View file

@ -49,7 +49,7 @@ static Vtx vertices[] = {
VTX(35, 500, 35, 768, 0, 0xFF, 0xFF, 0xFF, 0xFF), VTX(35, 500, 35, 768, 0, 0xFF, 0xFF, 0xFF, 0xFF),
}; };
static Gfx textureDl[] = { static Gfx sTextureDL[] = {
gsDPPipeSync(), gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE), gsDPSetTextureLUT(G_TT_NONE),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
@ -70,7 +70,7 @@ static Gfx textureDl[] = {
gsSPEndDisplayList(), gsSPEndDisplayList(),
}; };
static Gfx cylinderDl[] = { static Gfx sCylinderDl[] = {
gsSPVertex(vertices, 27, 0), gsSPVertex(vertices, 27, 0),
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0), gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
gsSP2Triangles(1, 4, 5, 0, 1, 5, 2, 0), gsSP2Triangles(1, 4, 5, 0, 1, 5, 2, 0),

View file

@ -14,6 +14,7 @@ void OceffStorm_Init(Actor* thisx, GlobalContext* globalCtx);
void OceffStorm_Destroy(Actor* thisx, GlobalContext* globalCtx); void OceffStorm_Destroy(Actor* thisx, GlobalContext* globalCtx);
void OceffStorm_Update(Actor* thisx, GlobalContext* globalCtx); void OceffStorm_Update(Actor* thisx, GlobalContext* globalCtx);
void OceffStorm_Draw(Actor* thisx, GlobalContext* globalCtx); void OceffStorm_Draw(Actor* thisx, GlobalContext* globalCtx);
void OceffStorm_Draw2(Actor* thisx, GlobalContext* globalCtx); void OceffStorm_Draw2(Actor* thisx, GlobalContext* globalCtx);
void OceffStorm_DefaultAction(OceffStorm* this, GlobalContext* globalCtx); void OceffStorm_DefaultAction(OceffStorm* this, GlobalContext* globalCtx);
@ -138,7 +139,7 @@ void OceffStorm_Draw2(Actor* thisx, GlobalContext* globalCtx) {
gDPSetAlphaDither(gfxCtx->polyXlu.p++, G_AD_NOISE); gDPSetAlphaDither(gfxCtx->polyXlu.p++, G_AD_NOISE);
gDPSetColorDither(gfxCtx->polyXlu.p++, G_CD_NOISE); gDPSetColorDither(gfxCtx->polyXlu.p++, G_CD_NOISE);
gDPSetPrimColor(gfxCtx->polyXlu.p++, 0x80, 0x80, 200, 200, 150, this->primColorAlpha); gDPSetPrimColor(gfxCtx->polyXlu.p++, 0x80, 0x80, 200, 200, 150, this->primColorAlpha);
gSPDisplayList(gfxCtx->polyXlu.p++, textureDl); gSPDisplayList(gfxCtx->polyXlu.p++, sTextureDL);
gSPDisplayList(gfxCtx->polyXlu.p++, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, scroll * 8, scroll * 4, 64, 64, 1, gSPDisplayList(gfxCtx->polyXlu.p++, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, scroll * 8, scroll * 4, 64, 64, 1,
scroll * 4, scroll * 4, 64, 64)); scroll * 4, scroll * 4, 64, 64));
gSPTextureRectangle(gfxCtx->polyXlu.p++, 0, 0, (SCREEN_WIDTH << 2), (SCREEN_HEIGHT << 2), G_TX_RENDERTILE, 0, 0, gSPTextureRectangle(gfxCtx->polyXlu.p++, 0, 0, (SCREEN_WIDTH << 2), (SCREEN_HEIGHT << 2), G_TX_RENDERTILE, 0, 0,
@ -173,10 +174,10 @@ void OceffStorm_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_oceff_storm.c", 498), gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_oceff_storm.c", 498),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxCtx->polyXlu.p++, cylinderTexDl); gSPDisplayList(gfxCtx->polyXlu.p++, sCylinderTexDl);
gSPDisplayList(gfxCtx->polyXlu.p++, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, scroll * 4, (0 - scroll) * 8, 32, gSPDisplayList(gfxCtx->polyXlu.p++, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, scroll * 4, (0 - scroll) * 8, 32,
32, 1, scroll * 8, (0 - scroll) * 12, 32, 32)); 32, 1, scroll * 8, (0 - scroll) * 12, 32, 32));
gSPDisplayList(gfxCtx->polyXlu.p++, cylinderDl); gSPDisplayList(gfxCtx->polyXlu.p++, sCylinderDl);
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_oceff_storm.c", 512); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_oceff_storm.c", 512);

View file

@ -120,7 +120,7 @@ static u32 tex0[] = {
0x74AADCEF, 0xD7B4A497, 0x7E562D15, 0x1023405E, 0x7E9FB7B9, 0x95898F97, 0x90734619, 0x74AADCEF, 0xD7B4A497, 0x7E562D15, 0x1023405E, 0x7E9FB7B9, 0x95898F97, 0x90734619,
}; };
static Gfx textureDl[] = { static Gfx sTextureDL[] = {
gsDPPipeSync(), gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE), gsDPSetTextureLUT(G_TT_NONE),
gsDPSetRenderMode(IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1), gsDPSetRenderMode(IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1),
@ -153,7 +153,7 @@ static Vtx vertices[] = {
VTX(35, 500, 35, 768, 0, 0xFF, 0xFF, 0xFF, 0x00), VTX(35, 500, 35, 768, 0, 0xFF, 0xFF, 0xFF, 0x00),
}; };
static Gfx cylinderTexDl[] = { static Gfx sCylinderTexDl[] = {
gsDPPipeSync(), gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE), gsDPSetTextureLUT(G_TT_NONE),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
@ -170,7 +170,7 @@ static Gfx cylinderTexDl[] = {
gsSPEndDisplayList(), gsSPEndDisplayList(),
}; };
static Gfx cylinderDl[] = { static Gfx sCylinderDl[] = {
gsSPVertex(vertices, 27, 0), gsSPVertex(vertices, 27, 0),
gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0), gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
gsSP2Triangles(6, 7, 8, 0, 6, 8, 4, 0), gsSP2Triangles(6, 7, 8, 0, 6, 8, 4, 0),

View file

@ -121,10 +121,10 @@ void OceffWipe_Draw(Actor* thisx, GlobalContext* globalCtx) {
gDPSetEnvColor(gfxCtx->polyXlu.p++, 100, 0x00, 0xFF, 0x80); gDPSetEnvColor(gfxCtx->polyXlu.p++, 100, 0x00, 0xFF, 0x80);
} }
gSPDisplayList(gfxCtx->polyXlu.p++, textureDL); gSPDisplayList(gfxCtx->polyXlu.p++, sTextureDL);
gSPDisplayList(gfxCtx->polyXlu.p++, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 - scroll, scroll * (-2), 32, 32, gSPDisplayList(gfxCtx->polyXlu.p++, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 - scroll, scroll * (-2), 32, 32,
1, 0 - scroll, scroll * (-2), 32, 32)); 1, 0 - scroll, scroll * (-2), 32, 32));
gSPDisplayList(gfxCtx->polyXlu.p++, frustrumDl); gSPDisplayList(gfxCtx->polyXlu.p++, sFrustrumDl);
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_oceff_wipe.c", 398); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_oceff_wipe.c", 398);
} }

View file

@ -55,7 +55,7 @@ static Vtx vertices[] = {
VTX(165, 227, 0, 819, 1024, 0xFF, 0xFF, 0xFF, 0x00), VTX(0, 500, 1000, 1024, 0, 0xFF, 0xFF, 0xFF, 0xFF), VTX(165, 227, 0, 819, 1024, 0xFF, 0xFF, 0xFF, 0x00), VTX(0, 500, 1000, 1024, 0, 0xFF, 0xFF, 0xFF, 0xFF),
}; };
static Gfx textureDL[] = { static Gfx sTextureDL[] = {
gsDPPipeSync(), gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE), gsDPSetTextureLUT(G_TT_NONE),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
@ -74,7 +74,7 @@ static Gfx textureDL[] = {
gsSPEndDisplayList(), gsSPEndDisplayList(),
}; };
static Gfx frustrumDl[] = { static Gfx sFrustrumDl[] = {
gsSPVertex(vertices, 32, 0), gsSPVertex(vertices, 32, 0),
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0), gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
gsSP2Triangles(1, 4, 5, 0, 1, 5, 2, 0), gsSP2Triangles(1, 4, 5, 0, 1, 5, 2, 0),

View file

@ -106,10 +106,10 @@ void OceffWipe2_Draw(Actor* thisx, GlobalContext* globalCtx) {
gDPSetPrimColor(gfxCtx->polyXlu.p++, 0x00, 0x00, 0xFF, 0xFF, 0xAA, 0xFF); gDPSetPrimColor(gfxCtx->polyXlu.p++, 0x00, 0x00, 0xFF, 0xFF, 0xAA, 0xFF);
gDPSetEnvColor(gfxCtx->polyXlu.p++, 0xFF, 0x64, 0x00, 0x80); gDPSetEnvColor(gfxCtx->polyXlu.p++, 0xFF, 0x64, 0x00, 0x80);
gSPDisplayList(gfxCtx->polyXlu.p++, textureDl); gSPDisplayList(gfxCtx->polyXlu.p++, sTextureDL);
gSPDisplayList(gfxCtx->polyXlu.p++, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, scroll * 6, scroll * (-6), 64, 64, gSPDisplayList(gfxCtx->polyXlu.p++, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, scroll * 6, scroll * (-6), 64, 64,
1, scroll * (-6), 0, 64, 64)); 1, scroll * (-6), 0, 64, 64));
gSPDisplayList(gfxCtx->polyXlu.p++, frustrumDl); gSPDisplayList(gfxCtx->polyXlu.p++, sFrustrumDl);
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_oceff_wipe2.c", 417); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_oceff_wipe2.c", 417);
} }

Some files were not shown because too many files have changed in this diff Show more