General Cleanup 4 (#871)

* PartTimerWorker -> PartTimer

* cleanup

* format

* objChan draw macro

* Fix macro

* Fix warning

* PR Review

* Missed 1 ull

* UINT16_MAX

* Remove todo from footmark

* Remove * from tex in AnimatedMat_DrawTexCycle
This commit is contained in:
Derek Hensley 2022-07-11 20:06:21 -07:00 committed by GitHub
parent 81ce7bebcc
commit 85b19de4ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
99 changed files with 447 additions and 438 deletions

View File

@ -53,7 +53,8 @@
<Texture Name="gFsnUnusedEyeHalfTex" OutName="fsn_unused_eye_half" Format="rgba32" Width="32" Height="32" Offset="0x9640" /> <Texture Name="gFsnUnusedEyeHalfTex" OutName="fsn_unused_eye_half" Format="rgba32" Width="32" Height="32" Offset="0x9640" />
<Texture Name="gFsnUnusedEyeClosedTex" OutName="fsn_unused_eye_closed" Format="rgba32" Width="32" Height="32" Offset="0xA640" /> <Texture Name="gFsnUnusedEyeClosedTex" OutName="fsn_unused_eye_closed" Format="rgba32" Width="32" Height="32" Offset="0xA640" />
<!-- <Blob Name="object_fsn_Blob_00B640" Size="398" Offset="0xB640" /> --> <!-- Unused Empty Eye Texture Animation -->
<TextureAnimation Name="gFsnUnusedTexAnim" Offset="0xB664" />
<!-- Animations --> <!-- Animations -->
<Animation Name="gFsnSlamCounterStartAnim" Offset="0xB9D8" /> <Animation Name="gFsnSlamCounterStartAnim" Offset="0xB9D8" />

View File

@ -420,7 +420,7 @@ This leaves one piece of data unnamed, `D_80C106C8`. This is initially set to `0
What is this doing? We need to understand that to name this variable. What is this doing? We need to understand that to name this variable.
The N64's processors cannot use segmented addresses: they need actual RAM addresses. Therefore the segmented addresses have to be converted before being placed on a segment: this is what `Lib_SegmentedToVirtual` does. So (somewhat unusually) this loop is modifying the addresses in the actor's actual data in RAM. Having converted the addresses once, it wouldn't make any sense to convert them again, but `Init` would run every time an instantiation of the actor is created. Therefore `D_80C106C8` is present to ensure that the addresses only get converted once: it is really a boolean that indicates if the addresses have been converted. So let's call it `texturesDesegmented`, and replace its values by `true` and `false`. The N64's processors cannot use segmented addresses: they need actual RAM addresses. Therefore the segmented addresses have to be converted before being placed on a segment: this is what `Lib_SegmentedToVirtual` does. So (somewhat unusually) this loop is modifying the addresses in the actor's actual data in RAM. Having converted the addresses once, it wouldn't make any sense to convert them again, but `Init` would run every time an instantiation of the actor is created. Therefore `D_80C106C8` is present to ensure that the addresses only get converted once: it is really a boolean that indicates if the addresses have been converted. So let's call it `sTexturesDesegmented`, and replace its values by `true` and `false`.
Finally, clearly `4` is linked to the data over which we're iterating: namely it's the size of the array. We have a macro for this, `ARRAY_COUNT(sEyeTextures)`. Finally, clearly `4` is linked to the data over which we're iterating: namely it's the size of the array. We have a macro for this, `ARRAY_COUNT(sEyeTextures)`.

View File

@ -9,7 +9,6 @@
#define FLT_MAX 340282346638528859811704183484516925440.0f #define FLT_MAX 340282346638528859811704183484516925440.0f
#define SHT_MAX 32767.0f #define SHT_MAX 32767.0f
#define SHT_MINV (1.0f / SHT_MAX) #define SHT_MINV (1.0f / SHT_MAX)
#define DEGTORAD(x) ((x) * (M_PI / 180.0f))
typedef union { typedef union {
f64 d; f64 d;

View File

@ -16,7 +16,6 @@
// TODO: After uintptr_t cast change should have an AVOID_UB target that just toggles the KSEG0 bit in the address rather than add/sub 0x80000000 // TODO: After uintptr_t cast change should have an AVOID_UB target that just toggles the KSEG0 bit in the address rather than add/sub 0x80000000
#define PHYSICAL_TO_VIRTUAL(addr) ((uintptr_t)(addr) + RDRAM_CACHED) #define PHYSICAL_TO_VIRTUAL(addr) ((uintptr_t)(addr) + RDRAM_CACHED)
#define PHYSICAL_TO_VIRTUAL2(addr) ((uintptr_t)(addr) - RDRAM_CACHED)
#define VIRTUAL_TO_PHYSICAL(addr) (uintptr_t)((u8*)(addr) - RDRAM_CACHED) #define VIRTUAL_TO_PHYSICAL(addr) (uintptr_t)((u8*)(addr) - RDRAM_CACHED)
#define SEGMENTED_TO_VIRTUAL(addr) (void*)(PHYSICAL_TO_VIRTUAL(gSegments[SEGMENT_NUMBER(addr)]) + SEGMENT_OFFSET(addr)) #define SEGMENTED_TO_VIRTUAL(addr) (void*)(PHYSICAL_TO_VIRTUAL(gSegments[SEGMENT_NUMBER(addr)]) + SEGMENT_OFFSET(addr))

View File

@ -377,7 +377,7 @@ typedef struct {
typedef struct { typedef struct {
/* 0x0 */ u16 keyFrameLength; /* 0x0 */ u16 keyFrameLength;
/* 0x4 */ void* textureList; /* 0x4 */ TexturePtr* textureList;
/* 0x8 */ u8* textureIndexList; /* 0x8 */ u8* textureIndexList;
} AnimatedMatTexCycleParams; // size = 0xC } AnimatedMatTexCycleParams; // size = 0xC

View File

@ -39,7 +39,7 @@ typedef void (*EnHyActionFunc)(struct EnHy*, PlayState*);
typedef struct EnHy { typedef struct EnHy {
/* 0x000 */ Actor actor; /* 0x000 */ Actor actor;
/* 0x144 */ EnHyActionFunc actionFunc; /* 0x144 */ EnHyActionFunc actionFunc;
/* 0x148 */ EnHyActionFunc tmpActionFunc; /* 0x148 */ EnHyActionFunc prevActionFunc;
/* 0x14C */ SkelAnime skelAnime; /* 0x14C */ SkelAnime skelAnime;
/* 0x190 */ s8 headObjIndex; // Limb 15 /* 0x190 */ s8 headObjIndex; // Limb 15
/* 0x191 */ s8 skelUpperObjIndex; // Limbs 8-14 /* 0x191 */ s8 skelUpperObjIndex; // Limbs 8-14
@ -60,9 +60,9 @@ typedef struct EnHy {
/* 0x2C6 */ Vec3s trackTarget; /* 0x2C6 */ Vec3s trackTarget;
/* 0x2CC */ Vec3s headRot; /* 0x2CC */ Vec3s headRot;
/* 0x2D2 */ Vec3s torsoRot; /* 0x2D2 */ Vec3s torsoRot;
/* 0x2D8 */ Vec3s tmptrackTarget; /* 0x2D8 */ Vec3s prevTrackTarget;
/* 0x2DE */ Vec3s tmpHeadRot; /* 0x2DE */ Vec3s prevHeadRot;
/* 0x2E4 */ Vec3s tmpTorsoRot; /* 0x2E4 */ Vec3s prevTorsoRot;
/* 0x2EA */ s16 limbRotTableY[16]; /* 0x2EA */ s16 limbRotTableY[16];
/* 0x30A */ s16 limbRotTableZ[16]; /* 0x30A */ s16 limbRotTableZ[16];
/* 0x32C */ Vec3f bodyPartsPos[15]; /* 0x32C */ Vec3f bodyPartsPos[15];

View File

@ -29,7 +29,7 @@ const char* sFpuExceptions[] = {
}; };
void Fault_SleepImpl(u32 duration) { void Fault_SleepImpl(u32 duration) {
u64 value = (duration * OS_CPU_COUNTER) / 1000ull; u64 value = (duration * OS_CPU_COUNTER) / 1000ULL;
Sleep_Cycles(value); Sleep_Cycles(value);
} }
@ -702,8 +702,9 @@ void Fault_ResumeThread(OSThread* t) {
osStartThread(t); osStartThread(t);
} }
void Fault_CommitFB() { void Fault_CommitFB(void) {
u16* fb; u16* fb;
osViSetYScale(1.0f); osViSetYScale(1.0f);
osViSetMode(&osViModeNtscLan1); osViSetMode(&osViModeNtscLan1);
osViSetSpecialFeatures(0x42); // gama_disable|dither_fliter_enable_aa_mode3_disable osViSetSpecialFeatures(0x42); // gama_disable|dither_fliter_enable_aa_mode3_disable

View File

@ -277,7 +277,7 @@ void AudioLoad_InitSampleDmaBuffers(s32 numNotes) {
} else { } else {
AudioHeap_WritebackDCache(dma->ramAddr, gAudioContext.sampleDmaBufSize); AudioHeap_WritebackDCache(dma->ramAddr, gAudioContext.sampleDmaBufSize);
dma->size = gAudioContext.sampleDmaBufSize; dma->size = gAudioContext.sampleDmaBufSize;
dma->devAddr = 0U; dma->devAddr = 0;
dma->sizeUnused = 0; dma->sizeUnused = 0;
dma->unused = 0; dma->unused = 0;
dma->ttl = 0; dma->ttl = 0;

View File

@ -192,7 +192,7 @@ void GameState_Realloc(GameState* gameState, size_t size) {
void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* gfxCtx) { void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* gfxCtx) {
gameState->gfxCtx = gfxCtx; gameState->gfxCtx = gfxCtx;
gameState->frames = 0U; gameState->frames = 0;
gameState->main = NULL; gameState->main = NULL;
gameState->destroy = NULL; gameState->destroy = NULL;
gameState->running = 1; gameState->running = 1;
@ -201,7 +201,7 @@ void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* g
gfxCtx->xScale = gViConfigXScale; gfxCtx->xScale = gViConfigXScale;
gfxCtx->yScale = gViConfigYScale; gfxCtx->yScale = gViConfigYScale;
gameState->nextGameStateInit = NULL; gameState->nextGameStateInit = NULL;
gameState->nextGameStateSize = 0U; gameState->nextGameStateSize = 0;
{ {
s32 requiredScopeTemp; s32 requiredScopeTemp;

View File

@ -172,14 +172,14 @@ void ActorShadow_DrawFeet(Actor* actor, Lights* mapper, PlayState* play) {
f32 alphaRatio; f32 alphaRatio;
if ((actor->id == ACTOR_PLAYER) && (((Player*)actor)->stateFlags3 & 0x8000)) { if ((actor->id == ACTOR_PLAYER) && (((Player*)actor)->stateFlags3 & 0x8000)) {
f32 tmpScaleZ = actor->scale.z; f32 prevScaleZ = actor->scale.z;
actor->scale.z += 0.03f * fabsf(Math_CosS(((Player*)actor)->unk_AAA)); actor->scale.z += 0.03f * fabsf(Math_CosS(((Player*)actor)->unk_AAA));
actor->shape.shadowScale *= 0.2f; actor->shape.shadowScale *= 0.2f;
alphaRatio = distToFloor * 0.03f; alphaRatio = distToFloor * 0.03f;
actor->shape.shadowAlpha = actor->shape.shadowAlpha * CLAMP_MAX(alphaRatio, 1.0f); actor->shape.shadowAlpha = actor->shape.shadowAlpha * CLAMP_MAX(alphaRatio, 1.0f);
ActorShadow_Draw(actor, mapper, play, gCircleShadowDL, NULL); ActorShadow_Draw(actor, mapper, play, gCircleShadowDL, NULL);
actor->scale.z = tmpScaleZ; actor->scale.z = prevScaleZ;
} else { } else {
actor->shape.shadowScale *= 0.3f; actor->shape.shadowScale *= 0.3f;
alphaRatio = (distToFloor - 20.0f) * 0.02f; alphaRatio = (distToFloor - 20.0f) * 0.02f;

View File

@ -77,7 +77,7 @@ void EffFootmark_Update(PlayState* play) {
for (footmark = play->footprintInfo, i = 0; i < 100; i++, footmark++) { for (footmark = play->footprintInfo, i = 0; i < 100; i++, footmark++) {
if (footmark->actor != NULL) { if (footmark->actor != NULL) {
if ((footmark->flags & 1) == 1) { if ((footmark->flags & 1) == 1) {
if (footmark->age < 0xFFFFu) { // TODO replace with MAX_U16 or something if ((u32)footmark->age < UINT16_MAX) {
footmark->age++; footmark->age++;
} }

View File

@ -32,7 +32,7 @@
#include "overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.h" #include "overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.h"
#include "overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.h" #include "overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.h"
void EffectSs_DrawGEffect(PlayState* play, EffectSs* this, void* texture) { void EffectSs_DrawGEffect(PlayState* play, EffectSs* this, TexturePtr texture) {
GraphicsContext* gfxCtx = play->state.gfxCtx; GraphicsContext* gfxCtx = play->state.gfxCtx;
f32 scale; f32 scale;
MtxF mfTrans; MtxF mfTrans;

View File

@ -363,10 +363,10 @@ void AnimatedMat_DrawColorNonLinearInterp(PlayState* play, s32 segment, void* pa
*/ */
void AnimatedMat_DrawTexCycle(PlayState* play, s32 segment, void* params) { void AnimatedMat_DrawTexCycle(PlayState* play, s32 segment, void* params) {
AnimatedMatTexCycleParams* texAnimParams = params; AnimatedMatTexCycleParams* texAnimParams = params;
void** texList = Lib_SegmentedToVirtual(texAnimParams->textureList); TexturePtr* texList = Lib_SegmentedToVirtual(texAnimParams->textureList);
u8* texId = Lib_SegmentedToVirtual(texAnimParams->textureIndexList); u8* texId = Lib_SegmentedToVirtual(texAnimParams->textureIndexList);
s32 curFrame = sMatAnimStep % texAnimParams->keyFrameLength; s32 curFrame = sMatAnimStep % texAnimParams->keyFrameLength;
void* tex = Lib_SegmentedToVirtual(texList[texId[curFrame]]); TexturePtr tex = Lib_SegmentedToVirtual(texList[texId[curFrame]]);
OPEN_DISPS(play->state.gfxCtx); OPEN_DISPS(play->state.gfxCtx);

View File

@ -57,7 +57,7 @@ void osInitialize(void) {
osUnmapTLBAll(); osUnmapTLBAll();
osMapTLBRdb(); osMapTLBRdb();
osClockRate = (u64)((osClockRate * 3ll) / 4ull); osClockRate = (u64)((osClockRate * 3LL) / 4ULL);
if (osResetType == COLD_RESET) { if (osResetType == COLD_RESET) {
bzero(osAppNmiBuffer, 64); bzero(osAppNmiBuffer, 64);

View File

@ -66,7 +66,7 @@ static Gfx* sDLists[] = { gClockTowerCeilingCogDL, gClockTowerCenterCogDL, gCloc
void BgCtowerGear_Splash(BgCtowerGear* this, PlayState* play) { void BgCtowerGear_Splash(BgCtowerGear* this, PlayState* play) {
s32 i; s32 i;
s32 flag40 = this->dyna.actor.flags & 0x40; s32 flag40 = this->dyna.actor.flags & ACTOR_FLAG_40;
Vec3f splashSpawnPos; Vec3f splashSpawnPos;
Vec3f splashOffset; Vec3f splashOffset;
s32 pad; s32 pad;

View File

@ -75,7 +75,7 @@ void BgIkanaDharma_SpawnEffects(BgIkanaDharma* this, PlayState* play) {
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
f32 speed = (Rand_ZeroOne() * 5.0f) + 5.0f; f32 speed = (Rand_ZeroOne() * 5.0f) + 5.0f;
s16 angle = ((u32)Rand_Next() >> 0x12) + this->dyna.actor.world.rot.y + 0x6000; s16 angle = (Rand_Next() >> 0x12) + this->dyna.actor.world.rot.y + 0x6000;
f32 dirX = Math_SinS(angle); f32 dirX = Math_SinS(angle);
f32 dirZ = Math_CosS(angle); f32 dirZ = Math_CosS(angle);

View File

@ -132,7 +132,7 @@ void func_80BD599C(BgIkanaShutter* this) {
} }
void func_80BD59C4(BgIkanaShutter* this, PlayState* play) { void func_80BD59C4(BgIkanaShutter* this, PlayState* play) {
if (BgIkanaShutter_AllSwitchesPressed(this, play) == 0) { if (!BgIkanaShutter_AllSwitchesPressed(this, play)) {
func_80BD59F8(this); func_80BD59F8(this);
} }
} }

View File

@ -107,7 +107,7 @@ void func_80C072D0(BgIkninside* this, PlayState* play) {
if ((this->collider.info.acHitInfo != NULL) && (this->collider.info.acHitInfo->toucher.dmgFlags & 0x80000000)) { if ((this->collider.info.acHitInfo != NULL) && (this->collider.info.acHitInfo->toucher.dmgFlags & 0x80000000)) {
for (i = 0; i < 20; i++) { for (i = 0; i < 20; i++) {
altitude = Rand_S16Offset(0x1800, 0x2800); altitude = Rand_S16Offset(0x1800, 0x2800);
azimuth = (u32)Rand_Next() >> 0x10; azimuth = Rand_Next() >> 0x10;
speed = Rand_ZeroFloat(3.0f) + 8.0f; speed = Rand_ZeroFloat(3.0f) + 8.0f;
velocity.x = speed * Math_CosS(altitude) * Math_SinS(azimuth); velocity.x = speed * Math_CosS(altitude) * Math_SinS(azimuth);
velocity.y = speed * Math_SinS(altitude) + Rand_ZeroFloat(5.0f); velocity.y = speed * Math_SinS(altitude) + Rand_ZeroFloat(5.0f);

View File

@ -15,10 +15,10 @@ void BgLadder_Init(Actor* thisx, PlayState* play);
void BgLadder_Destroy(Actor* thisx, PlayState* play); void BgLadder_Destroy(Actor* thisx, PlayState* play);
void BgLadder_Update(Actor* thisx, PlayState* play); void BgLadder_Update(Actor* thisx, PlayState* play);
void BgLadder_Draw(Actor* thisx, PlayState* play); void BgLadder_Draw(Actor* thisx, PlayState* play);
void BgLadder_ActionWait(BgLadder* this, PlayState* play); void BgLadder_Wait(BgLadder* this, PlayState* play);
void BgLadder_ActionStartCutscene(BgLadder* this, PlayState* play); void BgLadder_StartCutscene(BgLadder* this, PlayState* play);
void BgLadder_ActionFadeIn(BgLadder* this, PlayState* play); void BgLadder_FadeIn(BgLadder* this, PlayState* play);
void BgLadder_ActionIdle(BgLadder* this, PlayState* play); void BgLadder_DoNothing(BgLadder* this, PlayState* play);
const ActorInit Bg_Ladder_InitVars = { const ActorInit Bg_Ladder_InitVars = {
ACTOR_BG_LADDER, ACTOR_BG_LADDER,
@ -49,7 +49,6 @@ void BgLadder_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(&this->dyna.actor, sInitChain); Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
// Has to be `thisx` instead of `&this->actor` to match
this->switchFlag = GET_BGLADDER_SWITCHFLAG(thisx); this->switchFlag = GET_BGLADDER_SWITCHFLAG(thisx);
thisx->params = GET_BGLADDER_SIZE(thisx); thisx->params = GET_BGLADDER_SIZE(thisx);
DynaPolyActor_Init(&this->dyna, 0); DynaPolyActor_Init(&this->dyna, 0);
@ -72,13 +71,13 @@ void BgLadder_Init(Actor* thisx, PlayState* play) {
// If the flag is set, then the ladder draws immediately // If the flag is set, then the ladder draws immediately
this->alpha = 255; this->alpha = 255;
this->dyna.actor.flags &= ~ACTOR_FLAG_10; // always update = off this->dyna.actor.flags &= ~ACTOR_FLAG_10; // always update = off
this->action = BgLadder_ActionIdle; this->action = BgLadder_DoNothing;
} else { } else {
// Otherwise, the ladder doesn't draw; wait for the flag to be set // Otherwise, the ladder doesn't draw; wait for the flag to be set
this->alpha = 5; this->alpha = 5;
func_800C62BC(play, &play->colCtx.dyna, this->dyna.bgId); func_800C62BC(play, &play->colCtx.dyna, this->dyna.bgId);
this->dyna.actor.draw = NULL; this->dyna.actor.draw = NULL;
this->action = BgLadder_ActionWait; this->action = BgLadder_Wait;
} }
} }
@ -88,27 +87,27 @@ void BgLadder_Destroy(Actor* thisx, PlayState* play) {
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
} }
void BgLadder_ActionWait(BgLadder* this, PlayState* play) { void BgLadder_Wait(BgLadder* this, PlayState* play) {
// Wait for the flag to be set, then trigger the cutscene // Wait for the flag to be set, then trigger the cutscene
if (Flags_GetSwitch(play, this->switchFlag)) { if (Flags_GetSwitch(play, this->switchFlag)) {
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
this->action = BgLadder_ActionStartCutscene; this->action = BgLadder_StartCutscene;
} }
} }
void BgLadder_ActionStartCutscene(BgLadder* this, PlayState* play) { void BgLadder_StartCutscene(BgLadder* this, PlayState* play) {
// Trigger the cutscene, then make the ladder fade in // Trigger the cutscene, then make the ladder fade in
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
this->dyna.actor.draw = BgLadder_Draw; this->dyna.actor.draw = BgLadder_Draw;
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_SECRET_LADDER_APPEAR); Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_SECRET_LADDER_APPEAR);
this->action = BgLadder_ActionFadeIn; this->action = BgLadder_FadeIn;
} else { } else {
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
} }
} }
void BgLadder_ActionFadeIn(BgLadder* this, PlayState* play) { void BgLadder_FadeIn(BgLadder* this, PlayState* play) {
// Fade in the ladder, then stop the cutscene & go idle // Fade in the ladder, then stop the cutscene & go idle
this->alpha += 5; this->alpha += 5;
if (this->alpha >= 255) { if (this->alpha >= 255) {
@ -116,11 +115,11 @@ void BgLadder_ActionFadeIn(BgLadder* this, PlayState* play) {
ActorCutscene_Stop(this->dyna.actor.cutscene); ActorCutscene_Stop(this->dyna.actor.cutscene);
func_800C6314(play, &play->colCtx.dyna, this->dyna.bgId); func_800C6314(play, &play->colCtx.dyna, this->dyna.bgId);
this->dyna.actor.flags &= ~ACTOR_FLAG_10; // always update = off this->dyna.actor.flags &= ~ACTOR_FLAG_10; // always update = off
this->action = BgLadder_ActionIdle; this->action = BgLadder_DoNothing;
} }
} }
void BgLadder_ActionIdle(BgLadder* this, PlayState* play) { void BgLadder_DoNothing(BgLadder* this, PlayState* play) {
} }
void BgLadder_Update(Actor* thisx, PlayState* play) { void BgLadder_Update(Actor* thisx, PlayState* play) {

View File

@ -1661,7 +1661,7 @@ void func_809DD934(Boss02* this, PlayState* play) {
break; break;
case 1: case 1:
if ((this->unk_1D14 < 80U) && (D_809E0420 != 0) && if ((this->unk_1D14 < 80) && (D_809E0420 != 0) &&
CHECK_BTN_ANY(CONTROLLER1(&play->state)->press.button, CHECK_BTN_ANY(CONTROLLER1(&play->state)->press.button,
BTN_A | BTN_B | BTN_CUP | BTN_CDOWN | BTN_CLEFT | BTN_CRIGHT)) { BTN_A | BTN_B | BTN_CUP | BTN_CDOWN | BTN_CLEFT | BTN_CRIGHT)) {
this->unk_1D18++; this->unk_1D18++;
@ -1669,7 +1669,7 @@ void func_809DD934(Boss02* this, PlayState* play) {
this->unk_1D14 = 0; this->unk_1D14 = 0;
} else { } else {
label1: label1:
if (this->unk_1D14 >= 50U) { if (this->unk_1D14 >= 50) {
if (this->unk_1D14 == (u32)(BREG(43) + 60)) { if (this->unk_1D14 == (u32)(BREG(43) + 60)) {
play_sound(NA_SE_PL_TRANSFORM_GIANT); play_sound(NA_SE_PL_TRANSFORM_GIANT);
} }
@ -1682,17 +1682,17 @@ void func_809DD934(Boss02* this, PlayState* play) {
Math_ApproachF(&this->unk_1D64, 30.0f, 0.1f, 1.0f); Math_ApproachF(&this->unk_1D64, 30.0f, 0.1f, 1.0f);
} }
if (this->unk_1D14 > 50U) { if (this->unk_1D14 > 50) {
Math_ApproachZeroF(&this->unk_1D58, 1.0f, 0.06f); Math_ApproachZeroF(&this->unk_1D58, 1.0f, 0.06f);
} else { } else {
Math_ApproachF(&this->unk_1D58, 0.4f, 1.0f, 0.02f); Math_ApproachF(&this->unk_1D58, 0.4f, 1.0f, 0.02f);
} }
if (this->unk_1D14 == 107U) { if (this->unk_1D14 == 107) {
this->unk_1D78 = 1; this->unk_1D78 = 1;
} }
if (this->unk_1D14 < 121U) { if (this->unk_1D14 < 121) {
break; break;
} }
@ -1703,14 +1703,14 @@ void func_809DD934(Boss02* this, PlayState* play) {
break; break;
case 2: case 2:
if (this->unk_1D14 < 8U) { if (this->unk_1D14 < 8) {
break; break;
} }
sp57 = 1; sp57 = 1;
goto block_38; goto block_38;
case 10: case 10:
if ((this->unk_1D14 < 30U) && (D_809E0421 != 0) && if ((this->unk_1D14 < 30) && (D_809E0421 != 0) &&
CHECK_BTN_ANY(CONTROLLER1(&play->state)->press.button, CHECK_BTN_ANY(CONTROLLER1(&play->state)->press.button,
BTN_A | BTN_B | BTN_CUP | BTN_CDOWN | BTN_CLEFT | BTN_CRIGHT)) { BTN_A | BTN_B | BTN_CUP | BTN_CDOWN | BTN_CLEFT | BTN_CRIGHT)) {
this->unk_1D18++; this->unk_1D18++;
@ -1720,7 +1720,7 @@ void func_809DD934(Boss02* this, PlayState* play) {
} }
label2: label2:
if (this->unk_1D14 != 0U) { if (this->unk_1D14 != 0) {
if (this->unk_1D14 == (u32)(BREG(44) + 10)) { if (this->unk_1D14 == (u32)(BREG(44) + 10)) {
play_sound(NA_SE_PL_TRANSFORM_NORAML); play_sound(NA_SE_PL_TRANSFORM_NORAML);
} }
@ -1731,18 +1731,18 @@ void func_809DD934(Boss02* this, PlayState* play) {
Math_ApproachF(&this->unk_1D5C, 2.0f, 1.0f, 0.01f); Math_ApproachF(&this->unk_1D5C, 2.0f, 1.0f, 0.01f);
} }
if (this->unk_1D14 == 42U) { if (this->unk_1D14 == 42) {
this->unk_1D78 = 1; this->unk_1D78 = 1;
} }
if (this->unk_1D14 > 50U) { if (this->unk_1D14 > 50) {
D_809E0421 = 1; D_809E0421 = 1;
goto block_38; goto block_38;
} }
break; break;
case 11: case 11:
if (this->unk_1D14 < 8U) { if (this->unk_1D14 < 8) {
break; break;
} }

View File

@ -62,9 +62,9 @@ s32 func_80C1C410(DmAn* this, PlayState* play) {
} }
if (objectIndex2 >= 0) { if (objectIndex2 >= 0) {
gSegments[6] = PHYSICAL_TO_VIRTUAL2(play->objectCtx.status[objectIndex2].segment); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex2].segment);
ret = SkelAnime_Update(&this->skelAnime); ret = SkelAnime_Update(&this->skelAnime);
gSegments[6] = PHYSICAL_TO_VIRTUAL2(play->objectCtx.status[objectIndex].segment); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex].segment);
} }
return ret; return ret;
} }
@ -81,10 +81,10 @@ s32 func_80C1C4D8(DmAn* this, PlayState* play, s32 arg2) {
} }
if ((objectIndex2 >= 0) && (arg2 != this->unk_2C8)) { if ((objectIndex2 >= 0) && (arg2 != this->unk_2C8)) {
gSegments[6] = PHYSICAL_TO_VIRTUAL2(play->objectCtx.status[objectIndex2].segment); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex2].segment);
this->unk_2C8 = arg2; this->unk_2C8 = arg2;
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg2); ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg2);
gSegments[6] = PHYSICAL_TO_VIRTUAL2(play->objectCtx.status[objectIndex].segment); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex].segment);
} }
return ret; return ret;
} }

View File

@ -1,7 +1,7 @@
/* /*
* File: z_dm_char03.c * File: z_dm_char03.c
* Overlay: ovl_Dm_Char03 * Overlay: ovl_Dm_Char03
* Description: * Description: Deku Mask (cutscene)
*/ */
#include "z_dm_char03.h" #include "z_dm_char03.h"

View File

@ -62,9 +62,9 @@ s32 func_80C24360(DmGm* this, PlayState* play) {
} }
if (objectIndex2 >= 0) { if (objectIndex2 >= 0) {
gSegments[6] = PHYSICAL_TO_VIRTUAL2(play->objectCtx.status[objectIndex2].segment); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex2].segment);
ret = SkelAnime_Update(&this->skelAnime); ret = SkelAnime_Update(&this->skelAnime);
gSegments[6] = PHYSICAL_TO_VIRTUAL2(play->objectCtx.status[objectIndex].segment); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex].segment);
} }
return ret; return ret;
} }
@ -81,10 +81,10 @@ s32 func_80C24428(DmGm* this, PlayState* play, s32 arg2) {
} }
if ((objectIndex2 >= 0) && (arg2 != this->unk_2C8)) { if ((objectIndex2 >= 0) && (arg2 != this->unk_2C8)) {
gSegments[6] = PHYSICAL_TO_VIRTUAL2(play->objectCtx.status[objectIndex2].segment); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex2].segment);
this->unk_2C8 = arg2; this->unk_2C8 = arg2;
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg2); ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg2);
gSegments[6] = PHYSICAL_TO_VIRTUAL2(play->objectCtx.status[objectIndex].segment); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex].segment);
} }
return ret; return ret;
} }

View File

@ -296,7 +296,7 @@ s32 func_80BED140(PlayState* play) {
} }
s32 func_80BED208(EnAkindonuts* this) { s32 func_80BED208(EnAkindonuts* this) {
if (INV_CONTENT(ITEM_MAGIC_BEANS) != 10U) { if ((u32)INV_CONTENT(ITEM_MAGIC_BEANS) != 10) {
return 0; return 0;
} }

View File

@ -134,10 +134,10 @@ s32 EnBba01_TestIsTalking(EnBba01* this, PlayState* play) {
if (Actor_ProcessTalkRequest(&this->enHy.actor, &play->state)) { if (Actor_ProcessTalkRequest(&this->enHy.actor, &play->state)) {
isTalking = true; isTalking = true;
this->enHy.textId = 0x10B9; // Invalid textId, produces empty textbox this->enHy.textId = 0x10B9; // Invalid textId, produces empty textbox
this->enHy.tmptrackTarget = this->enHy.trackTarget; this->enHy.prevTrackTarget = this->enHy.trackTarget;
this->enHy.tmpHeadRot = this->enHy.headRot; this->enHy.prevHeadRot = this->enHy.headRot;
this->enHy.tmpTorsoRot = this->enHy.torsoRot; this->enHy.prevTorsoRot = this->enHy.torsoRot;
this->enHy.tmpActionFunc = this->enHy.actionFunc; this->enHy.prevActionFunc = this->enHy.actionFunc;
this->enHy.actionFunc = EnBba01_Talk; this->enHy.actionFunc = EnBba01_Talk;
} }
return isTalking; return isTalking;
@ -197,12 +197,12 @@ void EnBba01_Talk(EnHy* this, PlayState* play) {
break; break;
case 2: case 2:
this->actor.textId = 0; this->actor.textId = 0;
this->trackTarget = this->tmptrackTarget; this->trackTarget = this->prevTrackTarget;
this->headRot = this->tmpHeadRot; this->headRot = this->prevHeadRot;
this->torsoRot = this->tmpTorsoRot; this->torsoRot = this->prevTorsoRot;
this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.shape.rot.y = this->actor.world.rot.y;
this->actionFunc = this->tmpActionFunc; this->actionFunc = this->prevActionFunc;
this->tmpActionFunc = NULL; this->prevActionFunc = NULL;
break; break;
} }
} }

View File

@ -374,7 +374,7 @@ void EnBji01_Update(Actor* thisx, PlayState* play) {
s32 pad; s32 pad;
this->actionFunc(this, play); this->actionFunc(this, play);
Actor_UpdateBgCheckInfo(play, (Actor*)this, 0.0f, 0.0f, 0.0f, 4U); Actor_UpdateBgCheckInfo(play, (Actor*)this, 0.0f, 0.0f, 0.0f, 4);
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
if (this->blinkTimer-- <= 0) { if (this->blinkTimer-- <= 0) {

View File

@ -13,7 +13,7 @@
#define THIS ((EnButte*)thisx) #define THIS ((EnButte*)thisx)
void EnButte_Init(Actor* thisx, PlayState* play); void EnButte_Init(Actor* thisx, PlayState* play);
void EnButte_Destroy(Actor* thisx, PlayState* play); void EnButte_Destroy(Actor* thisx, PlayState* play2);
void EnButte_Update(Actor* thisx, PlayState* play); void EnButte_Update(Actor* thisx, PlayState* play);
void EnButte_Draw(Actor* thisx, PlayState* play); void EnButte_Draw(Actor* thisx, PlayState* play);
@ -196,8 +196,11 @@ void EnButte_Init(Actor* thisx, PlayState* play) {
this->unk_250 = 1; this->unk_250 = 1;
} }
void EnButte_Destroy(Actor* thisx, PlayState* play) { void EnButte_Destroy(Actor* thisx, PlayState* play2) {
Collider_DestroyJntSph(play, &THIS->collider); PlayState* play = play2;
EnButte* this = THIS;
Collider_DestroyJntSph(play, &this->collider);
} }
void func_8091C524(EnButte* this) { void func_8091C524(EnButte* this) {

View File

@ -126,10 +126,10 @@ s32 EnCne01_TestIsTalking(EnCne01* this, PlayState* play) {
if (Actor_ProcessTalkRequest(&this->enHy.actor, &play->state)) { if (Actor_ProcessTalkRequest(&this->enHy.actor, &play->state)) {
isTalking = true; isTalking = true;
this->enHy.textId = 0x10B9; // Invalid textId, produces empty textbox this->enHy.textId = 0x10B9; // Invalid textId, produces empty textbox
this->enHy.tmptrackTarget = this->enHy.trackTarget; this->enHy.prevTrackTarget = this->enHy.trackTarget;
this->enHy.tmpHeadRot = this->enHy.headRot; this->enHy.prevHeadRot = this->enHy.headRot;
this->enHy.tmpTorsoRot = this->enHy.torsoRot; this->enHy.prevTorsoRot = this->enHy.torsoRot;
this->enHy.tmpActionFunc = this->enHy.actionFunc; this->enHy.prevActionFunc = this->enHy.actionFunc;
this->enHy.actionFunc = EnCne01_Talk; this->enHy.actionFunc = EnCne01_Talk;
} }
return isTalking; return isTalking;
@ -187,12 +187,12 @@ void EnCne01_Talk(EnHy* this, PlayState* play) {
break; break;
case 2: case 2:
this->actor.textId = 0; this->actor.textId = 0;
this->trackTarget = this->tmptrackTarget; this->trackTarget = this->prevTrackTarget;
this->headRot = this->tmpHeadRot; this->headRot = this->prevHeadRot;
this->torsoRot = this->tmpTorsoRot; this->torsoRot = this->prevTorsoRot;
this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.shape.rot.y = this->actor.world.rot.y;
this->actionFunc = this->tmpActionFunc; this->actionFunc = this->prevActionFunc;
this->tmpActionFunc = NULL; this->prevActionFunc = NULL;
break; break;
} }
} }

View File

@ -283,7 +283,7 @@ void EnEncount2_DrawEffects(EnEncount2* this, PlayState* play) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255);
gDPSetEnvColor(POLY_XLU_DISP++, 250, 180, 255, sPtr->alpha); gDPSetEnvColor(POLY_XLU_DISP++, 250, 180, 255, sPtr->alpha);
Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY); Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY);
Matrix_RotateZF(DEGTORAD(play->state.frames * 20.0f), MTXMODE_APPLY); Matrix_RotateZF(DEGF_TO_RADF(play->state.frames * 20.0f), MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_07AB58); gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_07AB58);
} }

View File

@ -416,7 +416,7 @@ s32 EnFsn_TestEndInteraction(EnFsn* this, PlayState* play, Input* input) {
s32 EnFsn_TestCancelOption(EnFsn* this, PlayState* play, Input* input) { s32 EnFsn_TestCancelOption(EnFsn* this, PlayState* play, Input* input) {
if (CHECK_BTN_ALL(input->press.button, BTN_B)) { if (CHECK_BTN_ALL(input->press.button, BTN_B)) {
this->actionFunc = this->tmpActionFunc; this->actionFunc = this->prevActionFunc;
func_80151938(play, this->items[this->cursorIdx]->actor.textId); func_80151938(play, this->items[this->cursorIdx]->actor.textId);
return true; return true;
} }
@ -467,7 +467,7 @@ s32 EnFsn_HasPlayerSelectedItem(EnFsn* this, PlayState* play, Input* input) {
} }
if (EnFsn_TestItemSelected(play)) { if (EnFsn_TestItemSelected(play)) {
if (!this->items[this->cursorIdx]->isOutOfStock) { if (!this->items[this->cursorIdx]->isOutOfStock) {
this->tmpActionFunc = this->actionFunc; this->prevActionFunc = this->actionFunc;
func_80151938(play, this->items[this->cursorIdx]->choiceTextId); func_80151938(play, this->items[this->cursorIdx]->choiceTextId);
play_sound(NA_SE_SY_DECIDE); play_sound(NA_SE_SY_DECIDE);
this->stickLeftPrompt.isEnabled = false; this->stickLeftPrompt.isEnabled = false;
@ -1217,7 +1217,7 @@ void EnFsn_SelectItem(EnFsn* this, PlayState* play) {
break; break;
case 1: case 1:
func_8019F230(); func_8019F230();
this->actionFunc = this->tmpActionFunc; this->actionFunc = this->prevActionFunc;
func_80151938(play, this->items[this->cursorIdx]->actor.textId); func_80151938(play, this->items[this->cursorIdx]->actor.textId);
} }
} }
@ -1226,7 +1226,7 @@ void EnFsn_SelectItem(EnFsn* this, PlayState* play) {
void EnFsn_PlayerCannotBuy(EnFsn* this, PlayState* play) { void EnFsn_PlayerCannotBuy(EnFsn* this, PlayState* play) {
if (Message_GetState(&play->msgCtx) == 5 && Message_ShouldAdvance(play)) { if (Message_GetState(&play->msgCtx) == 5 && Message_ShouldAdvance(play)) {
this->actionFunc = this->tmpActionFunc; this->actionFunc = this->prevActionFunc;
func_80151938(play, this->items[this->cursorIdx]->actor.textId); func_80151938(play, this->items[this->cursorIdx]->actor.textId);
} }
} }

View File

@ -22,7 +22,7 @@ typedef struct EnFsn {
/* 0x144 */ UNK_TYPE1 pad144[0x4C]; /* 0x144 */ UNK_TYPE1 pad144[0x4C];
/* 0x190 */ SkelAnime skelAnime; /* 0x190 */ SkelAnime skelAnime;
/* 0x1D4 */ EnFsnActionFunc actionFunc; /* 0x1D4 */ EnFsnActionFunc actionFunc;
/* 0x1D8 */ EnFsnActionFunc tmpActionFunc; // Used to return to correct browsing function /* 0x1D8 */ EnFsnActionFunc prevActionFunc; // Used to return to correct browsing function
/* 0x1DC */ ColliderCylinder collider; /* 0x1DC */ ColliderCylinder collider;
/* 0x228 */ s16 limbRotYTable[19]; /* 0x228 */ s16 limbRotYTable[19];
/* 0x24E */ s16 limbRotZTable[19]; /* 0x24E */ s16 limbRotZTable[19];

View File

@ -207,7 +207,7 @@ void EnGakufu_GiveReward(EnGakufu* this, PlayState* play) {
play_sound(NA_SE_SY_CORRECT_CHIME); play_sound(NA_SE_SY_CORRECT_CHIME);
hour = gSaveContext.save.time * (24.0f / 0x10000); hour = gSaveContext.save.time * (24.0f / 0x10000); // TIME_TO_HOURS_F
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
Item_DropCollectible(play, &sRewardDropsSpawnTerminaFieldPos, sRewardDrops[i + sRewardDropsIndex[hour]]); Item_DropCollectible(play, &sRewardDropsSpawnTerminaFieldPos, sRewardDrops[i + sRewardDropsIndex[hour]]);
} }

View File

@ -373,12 +373,12 @@ s32 func_80BB1D64(EnGeg* this, PlayState* play) {
} }
void func_80BB1FCC(EnGeg* this, PlayState* play) { void func_80BB1FCC(EnGeg* this, PlayState* play) {
gSegments[6] = PHYSICAL_TO_VIRTUAL2(play->objectCtx.status[this->unk_248].segment); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->unk_248].segment);
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
} }
void func_80BB2020(EnGeg* this, PlayState* play) { void func_80BB2020(EnGeg* this, PlayState* play) {
gSegments[6] = PHYSICAL_TO_VIRTUAL2(play->objectCtx.status[this->unk_248].segment); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->unk_248].segment);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->unk_4AC); SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->unk_4AC);
} }

View File

@ -502,7 +502,7 @@ void EnGirlA_BuyShieldMirror(PlayState* play, EnGirlA* this) {
func_801159EC(-play->msgCtx.unk1206C); func_801159EC(-play->msgCtx.unk1206C);
} }
// Fanfare is handled by ovl_en_ossan // Fanfare is handled by the shopkeeper
void EnGirlA_BuyFanfare(PlayState* play, EnGirlA* this) { void EnGirlA_BuyFanfare(PlayState* play, EnGirlA* this) {
func_801159EC(-play->msgCtx.unk1206C); func_801159EC(-play->msgCtx.unk1206C);
} }

View File

@ -1159,7 +1159,7 @@ void EnGk_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
} }
} }
void EnGk_TransformDraw(PlayState* play, s32 limbIndex, Actor* thisx) { void EnGk_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx) {
EnGk* this = THIS; EnGk* this = THIS;
s32 phi_v0; s32 phi_v0;
s32 phi_v1; s32 phi_v1;
@ -1257,7 +1257,7 @@ void EnGk_Draw(Actor* thisx, PlayState* play) {
SkelAnime_DrawTransformFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, SkelAnime_DrawTransformFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
this->skelAnime.dListCount, EnGk_OverrideLimbDraw, EnGk_PostLimbDraw, this->skelAnime.dListCount, EnGk_OverrideLimbDraw, EnGk_PostLimbDraw,
EnGk_TransformDraw, &this->actor); EnGk_TransformLimbDraw, &this->actor);
if (ENGK_GET_F(&this->actor) != ENGK_F_2) { if (ENGK_GET_F(&this->actor) != ENGK_F_2) {
func_8012C2DC(play->state.gfxCtx); func_8012C2DC(play->state.gfxCtx);

View File

@ -744,10 +744,10 @@ s32 func_80A12A64(EnGo* this, PlayState* play) {
} }
if (objIdx2 >= 0) { if (objIdx2 >= 0) {
gSegments[6] = PHYSICAL_TO_VIRTUAL2(play->objectCtx.status[objIdx2].segment); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objIdx2].segment);
this->skelAnime.playSpeed = this->unk_398; this->skelAnime.playSpeed = this->unk_398;
ret = SkelAnime_Update(&this->skelAnime); ret = SkelAnime_Update(&this->skelAnime);
gSegments[6] = PHYSICAL_TO_VIRTUAL2(play->objectCtx.status[objIdx].segment); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objIdx].segment);
} }
return ret; return ret;
@ -790,11 +790,11 @@ s32 func_80A12C48(EnGo* this, PlayState* play, s32 arg2) {
} }
if (objIdx2 >= 0) { if (objIdx2 >= 0) {
gSegments[6] = PHYSICAL_TO_VIRTUAL2(play->objectCtx.status[objIdx2].segment); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objIdx2].segment);
this->unk_3DC = arg2; this->unk_3DC = arg2;
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg2); ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg2);
this->unk_398 = this->skelAnime.playSpeed; this->unk_398 = this->skelAnime.playSpeed;
gSegments[6] = PHYSICAL_TO_VIRTUAL2(play->objectCtx.status[objIdx].segment); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objIdx].segment);
} }
return ret; return ret;
@ -1195,19 +1195,19 @@ s32 func_80A13B1C(EnGo* this, PlayState* play) {
this->unk_3C0++; this->unk_3C0++;
if (this->unk_3C0 >= 65) { if (this->unk_3C0 >= 65) {
switch (player->transformation) { switch (player->transformation) {
case 4: case PLAYER_FORM_HUMAN:
gSaveContext.save.weekEventReg[88] |= 0x80; gSaveContext.save.weekEventReg[88] |= 0x80;
break; break;
case 1: case PLAYER_FORM_GORON:
gSaveContext.save.weekEventReg[89] |= 4; gSaveContext.save.weekEventReg[89] |= 4;
break; break;
case 2: case PLAYER_FORM_ZORA:
gSaveContext.save.weekEventReg[89] |= 2; gSaveContext.save.weekEventReg[89] |= 2;
break; break;
case 3: case PLAYER_FORM_DEKU:
gSaveContext.save.weekEventReg[89] |= 1; gSaveContext.save.weekEventReg[89] |= 1;
break; break;
} }

View File

@ -209,7 +209,7 @@ void func_80B221E8(EnHakurock* this, PlayState* play) {
this->actor.shape.rot.y += 0x900; this->actor.shape.rot.y += 0x900;
this->actor.shape.rot.z += 0xB00; this->actor.shape.rot.z += 0xB00;
if (this->collider.base.atFlags & AT_HIT || ((this->counter == 0) && (this->collider.base.ocFlags1 & OC1_HIT)) || if ((this->collider.base.atFlags & AT_HIT) || ((this->counter == 0) && (this->collider.base.ocFlags1 & OC1_HIT)) ||
((this->actor.bgCheckFlags & 1) && (this->actor.velocity.y < 0.0f))) { ((this->actor.bgCheckFlags & 1) && (this->actor.velocity.y < 0.0f))) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ROCK_BROKEN); Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ROCK_BROKEN);
func_80B21EA4(this, 0); func_80B21EA4(this, 0);

View File

@ -96,7 +96,7 @@ static f32 sTranslucencyPlaneDistance = 100.0f;
static f32 sTransparencyPlaneDistance = 50.0f; static f32 sTransparencyPlaneDistance = 50.0f;
void EnHoll_SetupAction(EnHoll* this) { void EnHoll_SetupAction(EnHoll* this) {
this->type = EN_HOLL_GET_TYPE(this); this->type = EN_HOLL_GET_TYPE(&this->actor);
this->actionFunc = sActionFuncs[this->type]; this->actionFunc = sActionFuncs[this->type];
if (EN_HOLL_IS_VISIBLE(this)) { if (EN_HOLL_IS_VISIBLE(this)) {
this->alpha = 255; this->alpha = 255;
@ -128,7 +128,7 @@ void EnHoll_Destroy(Actor* thisx, PlayState* play) {
EnHoll* this = THIS; EnHoll* this = THIS;
if (!EN_HOLL_IS_SCENE_CHANGER(this)) { if (!EN_HOLL_IS_SCENE_CHANGER(this)) {
u32 enHollId = EN_HOLL_GET_ID_CAST(this); u32 enHollId = EN_HOLL_GET_ID(&this->actor);
play->doorCtx.transitionActorList[enHollId].id = -play->doorCtx.transitionActorList[enHollId].id; play->doorCtx.transitionActorList[enHollId].id = -play->doorCtx.transitionActorList[enHollId].id;
if (this == sInstancePlayingSound) { if (this == sInstancePlayingSound) {
@ -152,7 +152,7 @@ void EnHoll_VisibleIdle(EnHoll* this, PlayState* play) {
if (this->type == EN_HOLL_TYPE_DEFAULT) { if (this->type == EN_HOLL_TYPE_DEFAULT) {
u32 actorCtxBitmask = (play->actorCtx.unkC & 0x2AA) >> 1 | (play->actorCtx.unkC & 0x155); u32 actorCtxBitmask = (play->actorCtx.unkC & 0x2AA) >> 1 | (play->actorCtx.unkC & 0x155);
u32 zActorBitmask = D_801AED48[EN_HOLL_GET_Z_ACTOR_BITMASK_INDEX(this)]; u32 zActorBitmask = D_801AED48[EN_HOLL_GET_Z_ACTOR_BITMASK_INDEX(&this->actor)];
if (!(actorCtxBitmask & zActorBitmask)) { if (!(actorCtxBitmask & zActorBitmask)) {
Actor_MarkForDeath(&this->actor); Actor_MarkForDeath(&this->actor);
@ -177,7 +177,7 @@ void EnHoll_VisibleIdle(EnHoll* this, PlayState* play) {
if ((enHollBottom < transformedPlayerPos.y) && (transformedPlayerPos.y < EN_HOLL_TOP_DEFAULT) && if ((enHollBottom < transformedPlayerPos.y) && (transformedPlayerPos.y < EN_HOLL_TOP_DEFAULT) &&
(fabsf(transformedPlayerPos.x) < enHollHalfwidth) && (fabsf(transformedPlayerPos.x) < enHollHalfwidth) &&
(playerDistFromCentralPlane < sActivationPlaneDistance)) { (playerDistFromCentralPlane < sActivationPlaneDistance)) {
u32 enHollId = EN_HOLL_GET_ID_AND(this); u32 enHollId = EN_HOLL_GET_ID(&this->actor);
if (sLoadingPlaneDistance < playerDistFromCentralPlane) { if (sLoadingPlaneDistance < playerDistFromCentralPlane) {
if ((play->roomCtx.prevRoom.num >= 0) && (play->roomCtx.unk31 == 0)) { if ((play->roomCtx.prevRoom.num >= 0) && (play->roomCtx.unk31 == 0)) {
@ -188,7 +188,7 @@ void EnHoll_VisibleIdle(EnHoll* this, PlayState* play) {
func_8012EBF8(play, &play->roomCtx); func_8012EBF8(play, &play->roomCtx);
} }
} else if (this->type == EN_HOLL_TYPE_SCENE_CHANGER) { } else if (this->type == EN_HOLL_TYPE_SCENE_CHANGER) {
play->nextEntranceIndex = play->setupExitList[EN_HOLL_GET_EXIT_LIST_INDEX(this)]; play->nextEntranceIndex = play->setupExitList[EN_HOLL_GET_EXIT_LIST_INDEX(&this->actor)];
gSaveContext.unk_3DBB = 1; gSaveContext.unk_3DBB = 1;
Scene_SetExitFade(play); Scene_SetExitFade(play);
play->sceneLoadFlag = 0x14; play->sceneLoadFlag = 0x14;
@ -232,7 +232,7 @@ void EnHoll_TransparentIdle(EnHoll* this, PlayState* play) {
if (playerDistFromCentralPlane = fabsf(transformedPlayerPos.z), if (playerDistFromCentralPlane = fabsf(transformedPlayerPos.z),
playerDistFromCentralPlane < EN_HOLL_ACTIVATION_PLANE_DISTANCE && playerDistFromCentralPlane < EN_HOLL_ACTIVATION_PLANE_DISTANCE &&
playerDistFromCentralPlane > EN_HOLL_LOADING_PLANE_DISTANCE) { playerDistFromCentralPlane > EN_HOLL_LOADING_PLANE_DISTANCE) {
s32 enHollId = EN_HOLL_GET_ID_CAST(this); s32 enHollId = EN_HOLL_GET_ID(&this->actor);
s32 playerSide = (transformedPlayerPos.z < 0.0f) ? EN_HOLL_BEHIND : EN_HOLL_BEFORE; s32 playerSide = (transformedPlayerPos.z < 0.0f) ? EN_HOLL_BEHIND : EN_HOLL_BEFORE;
TransitionActorEntry* transitionActorEntry = &play->doorCtx.transitionActorList[enHollId]; TransitionActorEntry* transitionActorEntry = &play->doorCtx.transitionActorList[enHollId];
s8 room = transitionActorEntry->sides[playerSide].room; s8 room = transitionActorEntry->sides[playerSide].room;
@ -259,7 +259,7 @@ void EnHoll_VerticalBgCoverIdle(EnHoll* this, PlayState* play) {
play->bgCoverAlpha = EN_HOLL_SCALE_BG_COVER_ALPHA(playerDistFromCentralPlane); play->bgCoverAlpha = EN_HOLL_SCALE_BG_COVER_ALPHA(playerDistFromCentralPlane);
} }
if (playerDistFromCentralPlane > EN_HOLL_LOADING_PLANE_DISTANCE_VERTICAL) { if (playerDistFromCentralPlane > EN_HOLL_LOADING_PLANE_DISTANCE_VERTICAL) {
s32 enHollId = EN_HOLL_GET_ID_CAST(this); s32 enHollId = EN_HOLL_GET_ID(&this->actor);
s32 playerSide = (this->actor.playerHeightRel > 0.0f) ? EN_HOLL_ABOVE : EN_HOLL_BELOW; s32 playerSide = (this->actor.playerHeightRel > 0.0f) ? EN_HOLL_ABOVE : EN_HOLL_BELOW;
this->actor.room = play->doorCtx.transitionActorList[enHollId].sides[playerSide].room; this->actor.room = play->doorCtx.transitionActorList[enHollId].sides[playerSide].room;
@ -283,7 +283,7 @@ void EnHoll_VerticalIdle(EnHoll* this, PlayState* play) {
if (playerDistFromCentralPlane < EN_HOLL_ACTIVATION_PLANE_DISTANCE_VERTICAL && if (playerDistFromCentralPlane < EN_HOLL_ACTIVATION_PLANE_DISTANCE_VERTICAL &&
playerDistFromCentralPlane > EN_HOLL_LOADING_PLANE_DISTANCE_VERTICAL) { playerDistFromCentralPlane > EN_HOLL_LOADING_PLANE_DISTANCE_VERTICAL) {
s32 enHollId = EN_HOLL_GET_ID_CAST(this); s32 enHollId = EN_HOLL_GET_ID(&this->actor);
s32 playerSide = (this->actor.playerHeightRel > 0.0f) ? EN_HOLL_ABOVE : EN_HOLL_BELOW; s32 playerSide = (this->actor.playerHeightRel > 0.0f) ? EN_HOLL_ABOVE : EN_HOLL_BELOW;
this->actor.room = play->doorCtx.transitionActorList[enHollId].sides[playerSide].room; this->actor.room = play->doorCtx.transitionActorList[enHollId].sides[playerSide].room;

View File

@ -60,11 +60,10 @@ typedef struct EnHoll {
#define EN_HOLL_LOADING_PLANE_DISTANCE_VERTICAL 50.0f #define EN_HOLL_LOADING_PLANE_DISTANCE_VERTICAL 50.0f
#define EN_HOLL_GET_ID_AND(this) ((this->actor.params & 0xFFFF) >> 10) #define EN_HOLL_GET_ID(thisx) ((u16)(thisx)->params >> 10)
#define EN_HOLL_GET_ID_CAST(this) ((u16) this->actor.params >> 10) #define EN_HOLL_GET_TYPE(thisx) (((thisx)->params >> 7) & 0x7)
#define EN_HOLL_GET_TYPE(this) ((this->actor.params >> 7) & 0x7) #define EN_HOLL_GET_EXIT_LIST_INDEX(thisx) ((thisx)->params & 0x7F)
#define EN_HOLL_GET_EXIT_LIST_INDEX(this) (this->actor.params & 0x7F) #define EN_HOLL_GET_Z_ACTOR_BITMASK_INDEX(thisx) ((thisx)->params & 0x7)
#define EN_HOLL_GET_Z_ACTOR_BITMASK_INDEX(this) (this->actor.params & 0x7)
#define EN_HOLL_IS_VISIBLE(this) ((this->type == EN_HOLL_TYPE_DEFAULT) || (this->type == EN_HOLL_TYPE_SCENE_CHANGER)) #define EN_HOLL_IS_VISIBLE(this) ((this->type == EN_HOLL_TYPE_DEFAULT) || (this->type == EN_HOLL_TYPE_SCENE_CHANGER))
#define EN_HOLL_IS_SCENE_CHANGER(this) (this->type == EN_HOLL_TYPE_SCENE_CHANGER) #define EN_HOLL_IS_SCENE_CHANGER(this) (this->type == EN_HOLL_TYPE_SCENE_CHANGER)

View File

@ -6,6 +6,7 @@
#include "z_en_horse.h" #include "z_en_horse.h"
#include "z64rumble.h" #include "z64rumble.h"
#include "overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.h"
#include "objects/object_horse_link_child/object_horse_link_child.h" #include "objects/object_horse_link_child/object_horse_link_child.h"
#define FLAGS (ACTOR_FLAG_10) #define FLAGS (ACTOR_FLAG_10)
@ -769,7 +770,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) {
this->stateFlags = 0; this->stateFlags = 0;
} }
if (((play->sceneNum == SCENE_KOEPONARACE) && ((gSaveContext.save.weekEventReg[92] & (1 | 2 | 4)) == 1)) || if (((play->sceneNum == SCENE_KOEPONARACE) && (GET_RACE_FLAGS == 1)) ||
((gSaveContext.save.entranceIndex == 0x6400) && Cutscene_GetSceneSetupIndex(play))) { ((gSaveContext.save.entranceIndex == 0x6400) && Cutscene_GetSceneSetupIndex(play))) {
this->stateFlags |= ENHORSE_FLAG_25; this->stateFlags |= ENHORSE_FLAG_25;
} }
@ -2451,7 +2452,7 @@ void func_808819D8(EnHorse* this, PlayState* play) {
func_8088168C(this); func_8088168C(this);
} }
if ((gSaveContext.save.weekEventReg[92] & (1 | 2 | 4)) == 3) { if (GET_RACE_FLAGS == 3) {
this->rider->unk488 = 7; this->rider->unk488 = 7;
} else { } else {
EnHorse_SetIngoAnimation(this->animationIdx, this->skin.skelAnime.curFrame, this->unk_394 & 1, EnHorse_SetIngoAnimation(this->animationIdx, this->skin.skelAnime.curFrame, this->unk_394 & 1,

View File

@ -458,84 +458,82 @@ u16 func_808F3DD4(PlayState* play, EnIn* this, u32 arg2) {
u16 textId = 0; u16 textId = 0;
if (Player_GetMask(play) == PLAYER_MASK_CIRCUS_LEADER) { if (Player_GetMask(play) == PLAYER_MASK_CIRCUS_LEADER) {
s32 requiredScopeTemp;
if (!(gSaveContext.save.weekEventReg[63] & 0x40)) { if (!(gSaveContext.save.weekEventReg[63] & 0x40)) {
return 0x34A9; textId = 0x34A9;
} else if (this->unk4AC & 8) { } else if (this->unk4AC & 8) {
return 0x34B1; textId = 0x34B1;
} else { } else {
textId = 0x34AF; textId = 0x34AF;
} }
} else { return textId;
switch (arg2) { }
case 0:
if ((gSaveContext.save.playerForm == PLAYER_FORM_ZORA) || switch (arg2) {
(gSaveContext.save.playerForm == PLAYER_FORM_GORON)) { case 0:
textId = 0x345C; if ((gSaveContext.save.playerForm == PLAYER_FORM_ZORA) ||
} else if (gSaveContext.save.playerForm == PLAYER_FORM_DEKU) { (gSaveContext.save.playerForm == PLAYER_FORM_GORON)) {
textId = 0x3460; textId = 0x345C;
} else if (!(gSaveContext.save.weekEventReg[15] & 8)) { } else if (gSaveContext.save.playerForm == PLAYER_FORM_DEKU) {
textId = 0x3458; textId = 0x3460;
} else { } else if (!(gSaveContext.save.weekEventReg[15] & 8)) {
textId = 0x345B; textId = 0x3458;
} } else {
break; textId = 0x345B;
case 1: }
if (!(gSaveContext.save.weekEventReg[15] & 0x10)) { break;
textId = 0x3463; case 1:
} else { if (!(gSaveContext.save.weekEventReg[15] & 0x10)) {
textId = 0x346B; textId = 0x3463;
} } else {
break; textId = 0x346B;
case 3: }
if (gSaveContext.save.playerForm == PLAYER_FORM_DEKU) { break;
textId = 0x3485; case 3:
} else if (gSaveContext.save.playerForm == PLAYER_FORM_ZORA || if (gSaveContext.save.playerForm == PLAYER_FORM_DEKU) {
gSaveContext.save.playerForm == PLAYER_FORM_GORON) { textId = 0x3485;
textId = 0x3484; } else if (gSaveContext.save.playerForm == PLAYER_FORM_ZORA ||
} else if (!(gSaveContext.save.weekEventReg[56] & 4)) { gSaveContext.save.playerForm == PLAYER_FORM_GORON) {
textId = 0x346D; textId = 0x3484;
} else { } else if (!(gSaveContext.save.weekEventReg[56] & 4)) {
textId = 0x3482; textId = 0x346D;
} } else {
break; textId = 0x3482;
case 4: }
if (gSaveContext.save.playerForm == PLAYER_FORM_ZORA || break;
gSaveContext.save.playerForm == PLAYER_FORM_GORON) { case 4:
textId = 0x348A; if (gSaveContext.save.playerForm == PLAYER_FORM_ZORA || gSaveContext.save.playerForm == PLAYER_FORM_GORON) {
} else if (gSaveContext.save.playerForm == PLAYER_FORM_DEKU) { textId = 0x348A;
textId = 0x348B; } else if (gSaveContext.save.playerForm == PLAYER_FORM_DEKU) {
} else if (!(gSaveContext.save.weekEventReg[16] & 1)) { textId = 0x348B;
textId = 0x3486; } else if (!(gSaveContext.save.weekEventReg[16] & 1)) {
} else { textId = 0x3486;
textId = 0x3489; } else {
} textId = 0x3489;
break; }
case 5: break;
if (func_808F33B8()) { case 5:
textId = 0x34B3; if (func_808F33B8()) {
} else if (!(gSaveContext.save.weekEventReg[16] & 2)) { textId = 0x34B3;
textId = 0x348E; } else if (!(gSaveContext.save.weekEventReg[16] & 2)) {
} else { textId = 0x348E;
textId = 0x3493; } else {
} textId = 0x3493;
break; }
case 7: break;
if (gSaveContext.save.playerForm == PLAYER_FORM_DEKU) { case 7:
textId = 0x34A8; if (gSaveContext.save.playerForm == PLAYER_FORM_DEKU) {
} else if (gSaveContext.save.playerForm == PLAYER_FORM_ZORA || textId = 0x34A8;
gSaveContext.save.playerForm == PLAYER_FORM_GORON) { } else if (gSaveContext.save.playerForm == PLAYER_FORM_ZORA ||
textId = 0x34A7; gSaveContext.save.playerForm == PLAYER_FORM_GORON) {
} else if (!(gSaveContext.save.weekEventReg[16] & 4)) { textId = 0x34A7;
textId = 0x3495; } else if (!(gSaveContext.save.weekEventReg[16] & 4)) {
} else { textId = 0x3495;
textId = 0x34A5; } else {
} textId = 0x34A5;
} }
if (textId == 0) { }
textId = 1; if (textId == 0) {
} textId = 1;
} }
return textId; return textId;
} }

View File

@ -12,7 +12,7 @@
#define THIS ((EnInsect*)thisx) #define THIS ((EnInsect*)thisx)
void EnInsect_Init(Actor* thisx, PlayState* play); void EnInsect_Init(Actor* thisx, PlayState* play);
void EnInsect_Destroy(Actor* thisx, PlayState* play); void EnInsect_Destroy(Actor* thisx, PlayState* play2);
void EnInsect_Update(Actor* thisx, PlayState* play); void EnInsect_Update(Actor* thisx, PlayState* play);
void EnInsect_Draw(Actor* thisx, PlayState* play); void EnInsect_Draw(Actor* thisx, PlayState* play);
@ -165,8 +165,11 @@ void EnInsect_Init(Actor* thisx, PlayState* play) {
} }
} }
void EnInsect_Destroy(Actor* thisx, PlayState* play) { void EnInsect_Destroy(Actor* thisx, PlayState* play2) {
Collider_DestroyJntSph(play, &THIS->collider); PlayState* play = play2;
EnInsect* this = THIS;
Collider_DestroyJntSph(play, &this->collider);
} }
void func_8091AC78(EnInsect* this) { void func_8091AC78(EnInsect* this) {

View File

@ -1680,7 +1680,7 @@ void EnInvadepoh_InitAlien(EnInvadepoh* this, PlayState* play) {
ActorShape_Init(&this->actor.shape, 6800.0f, ActorShadow_DrawWhiteCircle, 150.0f); ActorShape_Init(&this->actor.shape, 6800.0f, ActorShadow_DrawWhiteCircle, 150.0f);
this->actor.shape.shadowAlpha = 140; this->actor.shape.shadowAlpha = 140;
this->actor.flags = (ACTOR_FLAG_10 | ACTOR_FLAG_1000 | ACTOR_FLAG_80000000); this->actor.flags = (ACTOR_FLAG_10 | ACTOR_FLAG_1000 | ACTOR_FLAG_80000000);
if (INVADEPOH_TYPE(this) == TYPE_ALIEN_CARRYING_COW) { if (INVADEPOH_TYPE(&this->actor) == TYPE_ALIEN_CARRYING_COW) {
this->actor.update = func_80B4D670; this->actor.update = func_80B4D670;
this->actor.world.pos.y = this->actor.home.pos.y + 150.0f; this->actor.world.pos.y = this->actor.home.pos.y + 150.0f;
} else { } else {
@ -1715,7 +1715,7 @@ void EnInvadepoh_InitChildCow(EnInvadepoh* this, PlayState* play) {
void EnInvadepoh_InitRomani(EnInvadepoh* this, PlayState* play) { void EnInvadepoh_InitRomani(EnInvadepoh* this, PlayState* play) {
s32 pad; s32 pad;
s32 temp = INVADEPOH_TYPE(this); s32 temp = INVADEPOH_TYPE(&this->actor);
Actor_ProcessInitChain(&this->actor, sInitChainRomani); Actor_ProcessInitChain(&this->actor, sInitChainRomani);
@ -1828,7 +1828,7 @@ void EnInvadepoh_InitCremia(EnInvadepoh* this, PlayState* play) {
void EnInvadepoh_Init(Actor* thisx, PlayState* play) { void EnInvadepoh_Init(Actor* thisx, PlayState* play) {
EnInvadepoh* this = THIS; EnInvadepoh* this = THIS;
D_80B4ECB0[INVADEPOH_TYPE(this)](this, play); D_80B4ECB0[INVADEPOH_TYPE(&this->actor)](this, play);
} }
void func_80B46BB0(EnInvadepoh* this, PlayState* play) { void func_80B46BB0(EnInvadepoh* this, PlayState* play) {
@ -1891,7 +1891,7 @@ void func_80B46D28(EnInvadepoh* this, PlayState* play) {
void EnInvadepoh_Destroy(Actor* thisx, PlayState* play) { void EnInvadepoh_Destroy(Actor* thisx, PlayState* play) {
EnInvadepoh* this = THIS; EnInvadepoh* this = THIS;
D_80B4ECE8[INVADEPOH_TYPE(this)](this, play); D_80B4ECE8[INVADEPOH_TYPE(&this->actor)](this, play);
} }
void func_80B46DA8(EnInvadepoh* this) { void func_80B46DA8(EnInvadepoh* this) {
@ -4299,7 +4299,6 @@ void func_80B4D760(Actor* thisx, PlayState* play) {
} }
void func_80B4D7B8(PlayState* play) { void func_80B4D7B8(PlayState* play) {
s32 temp_v0;
u32 temp_s5; u32 temp_s5;
u32 temp_s6; u32 temp_s6;
unkStruct80B50350* phi_s2; unkStruct80B50350* phi_s2;
@ -4309,15 +4308,13 @@ void func_80B4D7B8(PlayState* play) {
func_8012C2DC(play->state.gfxCtx); func_8012C2DC(play->state.gfxCtx);
for (phi_s2 = D_80B50350, i = 0; i < 10; phi_s2++, i++) { for (phi_s2 = D_80B50350, i = 0; i < 10; phi_s2++, i++) {
if (phi_s2->unk1 > 0) { if (phi_s2->unk1 > 0) {
temp_v0 = play->gameplayFrames; temp_s5 = (play->gameplayFrames + ((0x10 * i) & 0xFF)) & 0x7F;
temp_s5 = (temp_v0 + ((0x10 * i) & 0xFFU)) & 0x7F; temp_s6 = (u8)(play->gameplayFrames * -0xF);
temp_s6 = (u8)(temp_v0 * -0xF);
Matrix_Translate(phi_s2->unk4.x, phi_s2->unk4.y, phi_s2->unk4.z, MTXMODE_NEW); Matrix_Translate(phi_s2->unk4.x, phi_s2->unk4.y, phi_s2->unk4.z, MTXMODE_NEW);
Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY); Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY);
gDPPipeSync(POLY_XLU_DISP++); gDPPipeSync(POLY_XLU_DISP++);
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 170, phi_s2->unk2); gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 170, phi_s2->unk2);
gDPSetEnvColor(POLY_XLU_DISP++, 255, 50, 0, 0); gDPSetEnvColor(POLY_XLU_DISP++, 255, 50, 0, 0);
temp_v0 = play->gameplayFrames;
gSPSegment(POLY_XLU_DISP++, 0x08, gSPSegment(POLY_XLU_DISP++, 0x08,
Gfx_TwoTexScroll(play->state.gfxCtx, 0, temp_s5, 0, 0x20, 0x40, 1, 0, temp_s6, 0x20, 0x40)); Gfx_TwoTexScroll(play->state.gfxCtx, 0, temp_s5, 0, 0x20, 0x40, 1, 0, temp_s6, 0x20, 0x40));
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@ -4332,7 +4329,7 @@ void func_80B4D9B4(Actor* thisx, PlayState* play) {
} }
s32 func_80B4D9D8(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx, Gfx** gfx) { s32 func_80B4D9D8(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx, Gfx** gfx) {
return 0; return false;
} }
void func_80B4D9F4(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) { void func_80B4D9F4(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) {
@ -4453,7 +4450,7 @@ s32 func_80B4E120(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s
EnInvadepoh* this = THIS; EnInvadepoh* this = THIS;
rot->x -= this->actor.shape.rot.x; rot->x -= this->actor.shape.rot.x;
} }
return 0; return false;
} }
void func_80B4E158(Actor* thisx, PlayState* play) { void func_80B4E158(Actor* thisx, PlayState* play) {
@ -4485,7 +4482,7 @@ s32 func_80B4E200(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s
rot->x += (s16)(this->behaviorInfo.unk34 * this->behaviorInfo.unk20.y); rot->x += (s16)(this->behaviorInfo.unk34 * this->behaviorInfo.unk20.y);
rot->z += this->behaviorInfo.unk40; rot->z += this->behaviorInfo.unk40;
} }
return 0; return false;
} }
void func_80B4E2AC(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { void func_80B4E2AC(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
@ -4513,7 +4510,8 @@ void func_80B4E324(Actor* thisx, PlayState* play) {
} }
void func_80B4E3F0(Actor* thisx, PlayState* play) { void func_80B4E3F0(Actor* thisx, PlayState* play) {
s32 pad[2]; s32 pad;
EnInvadepoh* this = THIS;
Vec3f sp5C; Vec3f sp5C;
Matrix_Push(); Matrix_Push();
@ -4525,7 +4523,7 @@ void func_80B4E3F0(Actor* thisx, PlayState* play) {
sp5C.z += thisx->world.pos.z; sp5C.z += thisx->world.pos.z;
EnInvadepoh_SetSysMatrix(&sp5C); EnInvadepoh_SetSysMatrix(&sp5C);
Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_ReplaceRotation(&play->billboardMtxF);
Matrix_RotateZS(((EnInvadepoh*)thisx)->unk304, MTXMODE_APPLY); Matrix_RotateZS(this->unk304, MTXMODE_APPLY);
OPEN_DISPS(play->state.gfxCtx); OPEN_DISPS(play->state.gfxCtx);
func_8012C2DC(play->state.gfxCtx); func_8012C2DC(play->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@ -4549,7 +4547,7 @@ s32 func_80B4E5B0(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s
rot->z += this->behaviorInfo.unk20.z; rot->z += this->behaviorInfo.unk20.z;
} }
return 0; return false;
} }
void func_80B4E61C(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { void func_80B4E61C(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
@ -4583,7 +4581,7 @@ s32 func_80B4E6E4(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s
rot->x += (s16)(this->behaviorInfo.unk34 * this->behaviorInfo.unk20.y); rot->x += (s16)(this->behaviorInfo.unk34 * this->behaviorInfo.unk20.y);
} }
return 0; return false;
} }
void func_80B4E784(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { void func_80B4E784(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {

View File

@ -9,7 +9,7 @@ typedef void (*EnInvadepohInitFunc)(struct EnInvadepoh*, PlayState*);
typedef void (*EnInvadepohDestroyFunc)(struct EnInvadepoh*, PlayState*); typedef void (*EnInvadepohDestroyFunc)(struct EnInvadepoh*, PlayState*);
typedef void (*EnInvadepohActionFunc)(struct EnInvadepoh*, PlayState*); typedef void (*EnInvadepohActionFunc)(struct EnInvadepoh*, PlayState*);
#define INVADEPOH_TYPE(x) (x->actor.params >> 4 & 0xF) #define INVADEPOH_TYPE(thisx) (((thisx)->params >> 4) & 0xF)
typedef enum{ typedef enum{
/* 0 */ TYPE_UNK0, /* 0 */ TYPE_UNK0,

View File

@ -109,16 +109,8 @@ void EnJcMato_SetupIdle(EnJcMato* this) {
} }
void EnJcMato_Idle(EnJcMato* this, PlayState* play) { void EnJcMato_Idle(EnJcMato* this, PlayState* play) {
s16 shouldDespawn;
if (this->hitFlag) { if (this->hitFlag) {
if (this->despawnTimer == 0) { if (DECR(this->despawnTimer) == 0) {
shouldDespawn = 0;
} else {
this->despawnTimer--;
shouldDespawn = this->despawnTimer;
}
if (shouldDespawn == 0) {
Actor_MarkForDeath(&this->actor); Actor_MarkForDeath(&this->actor);
} }
} }

View File

@ -148,7 +148,7 @@ void EnKakasi_Init(Actor* thisx, PlayState* play) {
Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &D_80971D80); Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &D_80971D80);
SkelAnime_InitFlex(play, &this->skelanime, &object_ka_Skel_0065B0, &object_ka_Anim_000214, 0, 0, 0); SkelAnime_InitFlex(play, &this->skelanime, &object_ka_Skel_0065B0, &object_ka_Anim_000214, 0, 0, 0);
this->songSummonDist = GET_KAKASI_SUMMON_DISTANCE(this) * 20.0f; this->songSummonDist = GET_KAKASI_SUMMON_DISTANCE(&this->actor) * 20.0f;
if (this->songSummonDist < 40.0f) { if (this->songSummonDist < 40.0f) {
this->songSummonDist = 40.0f; this->songSummonDist = 40.0f;
} }
@ -161,7 +161,7 @@ void EnKakasi_Init(Actor* thisx, PlayState* play) {
} }
this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.shape.rot.y = this->actor.world.rot.y;
this->aboveGroundStatus = GET_KAKASI_ABOVE_GROUND(this); this->aboveGroundStatus = GET_KAKASI_ABOVE_GROUND(&this->actor);
this->actor.world.rot.x = 0; this->actor.world.rot.x = 0;
this->actor.flags |= ACTOR_FLAG_400; this->actor.flags |= ACTOR_FLAG_400;
this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.colChkInfo.mass = MASS_IMMOVABLE;

View File

@ -45,7 +45,7 @@ extern const ActorInit En_Kakasi_InitVars;
#define ENKAKASI_ABOVE_GROUND_TYPE 2 #define ENKAKASI_ABOVE_GROUND_TYPE 2
#define GET_KAKASI_SUMMON_DISTANCE(this) ((this->actor.params >> 0x8) & 0xFF) #define GET_KAKASI_SUMMON_DISTANCE(thisx) (((thisx)->params >> 0x8) & 0xFF)
#define GET_KAKASI_ABOVE_GROUND(this) (this->actor.params & 0x1) #define GET_KAKASI_ABOVE_GROUND(thisx) ((thisx)->params & 0x1)
#endif // Z_EN_KAKASI_H #endif // Z_EN_KAKASI_H

View File

@ -4,8 +4,6 @@
* Description: Blacksmith - Gabora * Description: Blacksmith - Gabora
*/ */
#include "overlays/actors/ovl_En_Kbt/z_en_kbt.h"
#include "overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h"
#include "z_en_kgy.h" #include "z_en_kgy.h"
#include "objects/object_kgy/object_kgy.h" #include "objects/object_kgy/object_kgy.h"
#include "objects/gameplay_keep/gameplay_keep.h" #include "objects/gameplay_keep/gameplay_keep.h"

View File

@ -2,6 +2,8 @@
#define Z_EN_KGY_H #define Z_EN_KGY_H
#include "global.h" #include "global.h"
#include "overlays/actors/ovl_En_Kbt/z_en_kbt.h"
#include "overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h"
struct EnKgy; struct EnKgy;

View File

@ -245,7 +245,7 @@ void EnKusa_DropCollectible(EnKusa* this, PlayState* play) {
s32 collectableParams; s32 collectableParams;
if ((GET_KUSA_TYPE(&this->actor) == ENKUSA_TYPE_GRASS) || (GET_KUSA_TYPE(&this->actor) == ENKUSA_TYPE_BUSH)) { if ((GET_KUSA_TYPE(&this->actor) == ENKUSA_TYPE_GRASS) || (GET_KUSA_TYPE(&this->actor) == ENKUSA_TYPE_BUSH)) {
if (!(KUSA_GET_PARAMS_0C(&this->actor))) { if (!KUSA_GET_PARAMS_0C(&this->actor)) {
Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos,
KUSA_GET_RAND_COLLECTIBLE_ID(&this->actor) * 0x10); KUSA_GET_RAND_COLLECTIBLE_ID(&this->actor) * 0x10);
} }

View File

@ -27,7 +27,7 @@ typedef struct EnKusa {
extern const ActorInit En_Kusa_InitVars; extern const ActorInit En_Kusa_InitVars;
#define KUSA_GET_COLLECTIBLE_ID(thisx) ((((thisx)->params >> 8) & 0x7F)) #define KUSA_GET_COLLECTIBLE_ID(thisx) (((thisx)->params >> 8) & 0x7F)
#define KUSA_GET_RAND_COLLECTIBLE_ID(thisx) (((thisx)->params >> 8) & 0xF) #define KUSA_GET_RAND_COLLECTIBLE_ID(thisx) (((thisx)->params >> 8) & 0xF)
#define KUSA_SHOULD_SPAWN_BUGS(thisx) (((thisx)->params >> 0x4) & 1) #define KUSA_SHOULD_SPAWN_BUGS(thisx) (((thisx)->params >> 0x4) & 1)
#define KUSA_GET_PARAMS_0C(thisx) (((thisx)->params >> 0xC) & 0x1) #define KUSA_GET_PARAMS_0C(thisx) (((thisx)->params >> 0xC) & 0x1)

View File

@ -391,7 +391,7 @@ EnKusa2UnkBssSubStruct* func_80A5C074(EnKusa2UnkBssStruct* arg0) {
EnKusa2UnkBssSubStruct* phi_v1 = &arg0->unk_0000[0]; EnKusa2UnkBssSubStruct* phi_v1 = &arg0->unk_0000[0];
for (i = 1; i < ARRAY_COUNT(D_80A5F1C0.unk_0000); i++) { for (i = 1; i < ARRAY_COUNT(D_80A5F1C0.unk_0000); i++) {
if (!(phi_v1->unk_26 <= arg0->unk_0000[i].unk_26)) { if (phi_v1->unk_26 > arg0->unk_0000[i].unk_26) {
phi_v1 = &arg0->unk_0000[i]; phi_v1 = &arg0->unk_0000[i];
if (phi_v1->unk_26 <= 0) { if (phi_v1->unk_26 <= 0) {
break; break;
@ -407,7 +407,7 @@ EnKusa2UnkBssSubStruct2* func_80A5C0B8(EnKusa2UnkBssStruct* arg0) {
EnKusa2UnkBssSubStruct2* phi_v1 = &arg0->unk_0480[0]; EnKusa2UnkBssSubStruct2* phi_v1 = &arg0->unk_0480[0];
for (i = 1; i < ARRAY_COUNT(D_80A5F1C0.unk_0480); i++) { for (i = 1; i < ARRAY_COUNT(D_80A5F1C0.unk_0480); i++) {
if (!(phi_v1->unk_2C <= arg0->unk_0480[i].unk_2C)) { if (phi_v1->unk_2C > arg0->unk_0480[i].unk_2C) {
phi_v1 = &arg0->unk_0480[i]; phi_v1 = &arg0->unk_0480[i];
if (1) {} if (1) {}
if (phi_v1->unk_2C <= 0) { if (phi_v1->unk_2C <= 0) {

View File

@ -112,7 +112,7 @@ void EnMinifrog_Init(Actor* thisx, PlayState* play) {
this->timer = 0; this->timer = 0;
if (1) {} if (1) {}
if (!EN_MINIFROG_IS_RETURNED(this)) { if (!EN_MINIFROG_IS_RETURNED(&this->actor)) {
if ((this->frogIndex == MINIFROG_YELLOW) || if ((this->frogIndex == MINIFROG_YELLOW) ||
((gSaveContext.save.weekEventReg[isFrogReturnedFlags[this->frogIndex] >> 8] & ((gSaveContext.save.weekEventReg[isFrogReturnedFlags[this->frogIndex] >> 8] &
(u8)isFrogReturnedFlags[this->frogIndex]))) { (u8)isFrogReturnedFlags[this->frogIndex]))) {

View File

@ -7,7 +7,7 @@ struct EnMinifrog;
typedef void (*EnMinifrogActionFunc)(struct EnMinifrog*, PlayState*); typedef void (*EnMinifrogActionFunc)(struct EnMinifrog*, PlayState*);
#define EN_MINIFROG_IS_RETURNED(this) ((((this)->actor.params)&0xF0) >> 4) #define EN_MINIFROG_IS_RETURNED(thisx) ((((thisx)->params) & 0xF0) >> 4)
typedef enum { typedef enum {
/* 0x00 */ MINIFROG_YELLOW, // Mountain Village /* 0x00 */ MINIFROG_YELLOW, // Mountain Village

View File

@ -9,9 +9,9 @@ typedef void (*EnMm2ActionFunc)(struct EnMm2*, PlayState*);
typedef struct EnMm2 { typedef struct EnMm2 {
/* 0x0000 */ Actor actor; /* 0x0000 */ Actor actor;
/* 0x0144 */ char unk_144[0x44]; /* 0x0144 */ UNK_TYPE1 unk_144[0x44];
/* 0x0188 */ EnMm2ActionFunc actionFunc; /* 0x0188 */ EnMm2ActionFunc actionFunc;
/* 0x018C */ char unk_18C[0x128]; /* 0x018C */ UNK_TYPE1 unk_18C[0x128];
} EnMm2; // size = 0x2B4 } EnMm2; // size = 0x2B4
extern const ActorInit En_Mm2_InitVars; extern const ActorInit En_Mm2_InitVars;

View File

@ -234,7 +234,7 @@ s32 EnMttag_UpdateCheckpoints(EnMttag* this, PlayState* play) {
s32 EnMttag_ExitRace(PlayState* play, s32 arg1, s32 nextTransition) { s32 EnMttag_ExitRace(PlayState* play, s32 arg1, s32 nextTransition) {
CUR_FORM_EQUIP(EQUIP_SLOT_B) = ITEM_SWORD_KOKIRI; CUR_FORM_EQUIP(EQUIP_SLOT_B) = ITEM_SWORD_KOKIRI;
play->nextEntranceIndex = 0xD020; play->nextEntranceIndex = 0xD020;
if ((gSaveContext.save.weekEventReg[33] & 0x80)) { if (gSaveContext.save.weekEventReg[33] & 0x80) {
// Spring // Spring
gSaveContext.nextCutsceneIndex = 0xFFF0; gSaveContext.nextCutsceneIndex = 0xFFF0;
} else { } else {

View File

@ -272,7 +272,7 @@ void EnMuto_Update(Actor* thisx, PlayState* play2) {
Math_SmoothStepToS(&this->headRot.x, this->headRotTarget.x, 1, 0x3E8, 0); Math_SmoothStepToS(&this->headRot.x, this->headRotTarget.x, 1, 0x3E8, 0);
Math_SmoothStepToS(&this->waistRot.y, this->waistRotTarget.y, 1, 0xBB8, 0); Math_SmoothStepToS(&this->waistRot.y, this->waistRotTarget.y, 1, 0xBB8, 0);
Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 50.0f, 0x1DU); Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 50.0f, 0x1D);
this->actor.uncullZoneForward = 500.0f; this->actor.uncullZoneForward = 500.0f;

View File

@ -77,7 +77,7 @@ void func_80C08828(EnNnh* this) {
void func_80C0883C(EnNnh* this, PlayState* play) { void func_80C0883C(EnNnh* this, PlayState* play) {
if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) {
Message_StartTextbox(play, 0x228U, &this->actor); Message_StartTextbox(play, 0x228, &this->actor);
func_80C088A4(this); func_80C088A4(this);
return; return;
} }

View File

@ -29,19 +29,31 @@ const ActorInit En_Osn_InitVars = {
}; };
static AnimationInfo sAnimations[] = { static AnimationInfo sAnimations[] = {
{ &object_osn_Anim_0201BC, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_osn_Anim_002F74, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_osn_Anim_0201BC, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
{ &object_osn_Anim_0037C4, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_osn_Anim_004320, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_osn_Anim_002F74, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
{ &object_osn_Anim_004C8C, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_osn_Anim_0094E4, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_osn_Anim_0037C4, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
{ &object_osn_Anim_009BB8, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_osn_Anim_00AC60, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_osn_Anim_004320, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
{ &object_osn_Anim_001614, 1.0f, 1.0f, 39.0f, 0, 0.0f }, { &object_osn_Anim_001034, 1.0f, 1.0f, 70.0f, 0, 0.0f }, { &object_osn_Anim_004C8C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
{ &object_osn_Anim_00AE9C, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_osn_Anim_003A1C, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_osn_Anim_0094E4, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
{ &object_osn_Anim_0055F8, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_osn_Anim_007220, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_osn_Anim_009BB8, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
{ &object_osn_Anim_00A444, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_osn_Anim_0000C4, 0.0f, 0.0f, 0.0f, 2, 0.0f }, { &object_osn_Anim_00AC60, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
{ &object_osn_Anim_0000C4, 0.0f, 1.0f, 1.0f, 2, 0.0f }, { &object_osn_Anim_006D48, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_osn_Anim_001614, 1.0f, 1.0f, 39.0f, ANIMMODE_LOOP, 0.0f },
{ &object_osn_Anim_001D6C, 1.0f, 0.0f, 0.0f, 2, 0.0f }, { &object_osn_Anim_002634, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_osn_Anim_001034, 1.0f, 1.0f, 70.0f, ANIMMODE_LOOP, 0.0f },
{ &object_osn_Anim_008D80, 1.0f, 0.0f, 0.0f, 2, 0.0f }, { &object_osn_Anim_005D78, 1.0f, 0.0f, 0.0f, 2, 0.0f }, { &object_osn_Anim_00AE9C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
{ &object_osn_Anim_006564, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_osn_Anim_00A444, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_osn_Anim_003A1C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
{ &object_osn_Anim_008D80, 0.0f, 77.0f, 0.0f, 2, 0.0f }, { &object_osn_Anim_0055F8, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
{ &object_osn_Anim_007220, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
{ &object_osn_Anim_00A444, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
{ &object_osn_Anim_0000C4, 0.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f },
{ &object_osn_Anim_0000C4, 0.0f, 1.0f, 1.0f, ANIMMODE_ONCE, 0.0f },
{ &object_osn_Anim_006D48, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
{ &object_osn_Anim_001D6C, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f },
{ &object_osn_Anim_002634, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
{ &object_osn_Anim_008D80, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f },
{ &object_osn_Anim_005D78, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f },
{ &object_osn_Anim_006564, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
{ &object_osn_Anim_00A444, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
{ &object_osn_Anim_008D80, 0.0f, 77.0f, 0.0f, ANIMMODE_ONCE, 0.0f },
}; };
static ColliderCylinderInit sCylinderInit = { static ColliderCylinderInit sCylinderInit = {
@ -770,7 +782,7 @@ void EnOsn_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(&this->actor, sInitChain); Actor_ProcessInitChain(&this->actor, sInitChain);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f);
SkelAnime_InitFlex(play, &this->skelAnime, &object_osn_Skel_0202F0, &object_osn_Anim_0201BC, 0, 0, 0); SkelAnime_InitFlex(play, &this->skelAnime, &object_osn_Skel_0202F0, &object_osn_Anim_0201BC, NULL, NULL, 0);
Collider_InitCylinder(play, &this->collider); Collider_InitCylinder(play, &this->collider);
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
@ -836,7 +848,7 @@ void EnOsn_Update(Actor* thisx, PlayState* play) {
this->actionFunc(this, play); this->actionFunc(this, play);
Actor_MoveWithGravity(&this->actor); Actor_MoveWithGravity(&this->actor);
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
if (!(ENOSN_GET_3(&this->actor))) { if (!ENOSN_GET_3(&this->actor)) {
if (sp34 != 0) { if (sp34 != 0) {
this->actor.flags |= ACTOR_FLAG_1; this->actor.flags |= ACTOR_FLAG_1;
func_80AD0830(this, play); func_80AD0830(this, play);

View File

@ -10,7 +10,7 @@ typedef void (*EnOsnActionFunc)(struct EnOsn*, PlayState*);
typedef struct EnOsn { typedef struct EnOsn {
/* 0x0000 */ Actor actor; /* 0x0000 */ Actor actor;
/* 0x0144 */ ColliderCylinder collider; /* 0x0144 */ ColliderCylinder collider;
/* 0X0190 */ SkelAnime skelAnime; /* 0x0190 */ SkelAnime skelAnime;
/* 0x01D4 */ EnOsnActionFunc actionFunc; /* 0x01D4 */ EnOsnActionFunc actionFunc;
/* 0x01D8 */ Vec3s unk_1D8; /* 0x01D8 */ Vec3s unk_1D8;
/* 0x01DE */ Vec3s unk_1DE; /* 0x01DE */ Vec3s unk_1DE;

View File

@ -19,13 +19,13 @@ void EnOssan_Destroy(Actor* thisx, PlayState* play);
void EnOssan_Update(Actor* thisx, PlayState* play); void EnOssan_Update(Actor* thisx, PlayState* play);
void EnOssan_CuriosityShopMan_Draw(Actor* thisx, PlayState* play); void EnOssan_CuriosityShopMan_Draw(Actor* thisx, PlayState* play);
void EnOssan_PartTimeWorker_Draw(Actor* thisx, PlayState* play); void EnOssan_PartTimer_Draw(Actor* thisx, PlayState* play);
void EnOssan_CuriosityShopMan_Init(EnOssan* this, PlayState* play); void EnOssan_CuriosityShopMan_Init(EnOssan* this, PlayState* play);
u16 EnOssan_CuriosityShopMan_GetWelcome(EnOssan* this, PlayState* play); u16 EnOssan_CuriosityShopMan_GetWelcome(EnOssan* this, PlayState* play);
void EnOssan_PartTimeWorker_Init(EnOssan* this, PlayState* play); void EnOssan_PartTimer_Init(EnOssan* this, PlayState* play);
u16 EnOssan_PartTimerWorker_GetWelcome(EnOssan* this, PlayState* play); u16 EnOssan_PartTimer_GetWelcome(EnOssan* this, PlayState* play);
void EnOssan_InitShop(EnOssan* this, PlayState* play); void EnOssan_InitShop(EnOssan* this, PlayState* play);
void EnOssan_Idle(EnOssan* this, PlayState* play); void EnOssan_Idle(EnOssan* this, PlayState* play);
@ -104,7 +104,7 @@ const ActorInit En_Ossan_InitVars = {
(ActorFunc)NULL, (ActorFunc)NULL,
}; };
static AnimationInfoS sAnimationsCuriosityShopMan[] = { static AnimationInfoS sCuriosityShopManAnimations[] = {
{ &gFsnIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &gFsnIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &gFsnScratchBackAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &gFsnScratchBackAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &gFsnTurnAroundAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, { &gFsnTurnAroundAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
@ -120,7 +120,7 @@ static AnimationInfoS sAnimationsCuriosityShopMan[] = {
{ &gFsnMakeOfferAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, { &gFsnMakeOfferAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
}; };
static AnimationInfoS sAnimationsPartTimeWorker[] = { static AnimationInfoS sPartTimerAnimations[] = {
{ &gAniStandingNormalAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 }, { &gAniStandingNormalAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 },
{ &gAniStandingNormalAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 }, { &gAniStandingNormalAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 },
{ &gAniStandingNormalAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, { &gAniStandingNormalAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
@ -137,7 +137,7 @@ static AnimationInfoS sAnimationsPartTimeWorker[] = {
static s16 sObjectIds[] = { OBJECT_FSN, OBJECT_ANI }; static s16 sObjectIds[] = { OBJECT_FSN, OBJECT_ANI };
static AnimationInfoS* sAnimations[] = { sAnimationsCuriosityShopMan, sAnimationsPartTimeWorker }; static AnimationInfoS* sAnimations[] = { sCuriosityShopManAnimations, sPartTimerAnimations };
static f32 sActorScales[] = { 0.01f, 0.01f }; static f32 sActorScales[] = { 0.01f, 0.01f };
@ -161,31 +161,31 @@ static ShopItem sShops[][8] = {
{ SI_POTION_RED_3, { -80, 92, -195 } } }, { SI_POTION_RED_3, { -80, 92, -195 } } },
}; };
static u16 sWelcomeHumanTextIds[] = { 0X06A4, 0X06C1 }; static u16 sWelcomeHumanTextIds[] = { 0x06A4, 0x06C1 };
static u16 sTalkOptionTextIds[] = { 0X06AB, 0X06C8 }; static u16 sTalkOptionTextIds[] = { 0x06AB, 0x06C8 };
static u16 sWelcomeGoronFirstTimeTextIds[] = { 0X06A5, 0X06C2 }; static u16 sWelcomeGoronFirstTimeTextIds[] = { 0x06A5, 0x06C2 };
static u16 sWelcomeZoraFirstTimeTextIds[] = { 0X06A7, 0X06C4 }; static u16 sWelcomeZoraFirstTimeTextIds[] = { 0x06A7, 0x06C4 };
static u16 sWelcomeDekuFirstTimeTextIds[] = { 0X06A9, 0X06C6 }; static u16 sWelcomeDekuFirstTimeTextIds[] = { 0x06A9, 0x06C6 };
static u16 sWelcomeGoronTextIds[] = { 0X06A6, 0X06C3 }; static u16 sWelcomeGoronTextIds[] = { 0x06A6, 0x06C3 };
static u16 sWelcomeZoraTextIds[] = { 0X06A8, 0X06C5 }; static u16 sWelcomeZoraTextIds[] = { 0x06A8, 0x06C5 };
static u16 sWelcomeDekuTextIds[] = { 0X06AA, 0X06C7 }; static u16 sWelcomeDekuTextIds[] = { 0x06AA, 0x06C7 };
static u16 sNeedEmptyBottleTextIds[] = { 0X06BC, 0X06D9 }; static u16 sNeedEmptyBottleTextIds[] = { 0x06BC, 0x06D9 };
static u16 sNeedRupeesTextIds[] = { 0X06BD, 0X06DA }; static u16 sNeedRupeesTextIds[] = { 0x06BD, 0x06DA };
static u16 sNoRoomTextIds[] = { 0X06BE, 0X06DB }; static u16 sNoRoomTextIds[] = { 0x06BE, 0x06DB };
static u16 sBuySuccessTextIds[] = { 0X06BF, 0X06DC }; static u16 sBuySuccessTextIds[] = { 0x06BF, 0x06DC };
static u16 sCannotGetNowTextIds[] = { 0X06C0, 0X06DD }; static u16 sCannotGetNowTextIds[] = { 0x06C0, 0x06DD };
static InitChainEntry sInitChain[] = { static InitChainEntry sInitChain[] = {
ICHAIN_F32(targetArrowOffset, 500, ICHAIN_STOP), ICHAIN_F32(targetArrowOffset, 500, ICHAIN_STOP),
@ -236,12 +236,12 @@ void EnOssan_RotateHead(EnOssan* this, PlayState* play) {
if (this->actor.params == ENOSSAN_PART_TIME_WORKER) { if (this->actor.params == ENOSSAN_PART_TIME_WORKER) {
if (player->transformation == PLAYER_FORM_ZORA) { if (player->transformation == PLAYER_FORM_ZORA) {
Math_SmoothStepToS(&this->headRotPartTimeWorker.y, this->headRot.y, 3, 2000, 0); Math_SmoothStepToS(&this->partTimerHeadRot.y, this->headRot.y, 3, 2000, 0);
} else if (this->flags & LOOKED_AT_PLAYER) { } else if (this->flags & LOOKED_AT_PLAYER) {
Math_SmoothStepToS(&this->headRotPartTimeWorker.y, 8000, 3, 2000, 0); Math_SmoothStepToS(&this->partTimerHeadRot.y, 8000, 3, 2000, 0);
} else { } else {
Math_SmoothStepToS(&this->headRotPartTimeWorker.y, this->headRot.y, 3, 2000, 0); Math_SmoothStepToS(&this->partTimerHeadRot.y, this->headRot.y, 3, 2000, 0);
if (ABS_ALT(this->headRotPartTimeWorker.y - this->headRot.y) < 16) { if (ABS_ALT(this->partTimerHeadRot.y - this->headRot.y) < 16) {
this->flags |= LOOKED_AT_PLAYER; this->flags |= LOOKED_AT_PLAYER;
} }
} }
@ -331,7 +331,7 @@ s32 EnOssan_TestEndInteraction(EnOssan* this, PlayState* play, Input* input) {
s32 EnOssan_TestCancelOption(EnOssan* this, PlayState* play, Input* input) { s32 EnOssan_TestCancelOption(EnOssan* this, PlayState* play, Input* input) {
if (CHECK_BTN_ALL(input->press.button, BTN_B)) { if (CHECK_BTN_ALL(input->press.button, BTN_B)) {
this->actionFunc = this->tmpActionFunc; this->actionFunc = this->prevActionFunc;
func_80151938(play, this->items[this->cursorIdx]->actor.textId); func_80151938(play, this->items[this->cursorIdx]->actor.textId);
return true; return true;
} }
@ -383,7 +383,7 @@ void EnOssan_Idle(EnOssan* this, PlayState* play) {
func_800B8614(&this->actor, play, 100.0f); func_800B8614(&this->actor, play, 100.0f);
} }
if (this->actor.params == ENOSSAN_PART_TIME_WORKER) { if (this->actor.params == ENOSSAN_PART_TIME_WORKER) {
Math_SmoothStepToS(&this->headRotPartTimeWorker.y, 8000, 3, 2000, 0); Math_SmoothStepToS(&this->partTimerHeadRot.y, 8000, 3, 2000, 0);
} }
} }
} }
@ -446,7 +446,7 @@ void EnOssan_BeginInteraction(EnOssan* this, PlayState* play) {
} }
} else { } else {
EnOssan_SetHaveMet(this); EnOssan_SetHaveMet(this);
this->textId = EnOssan_PartTimerWorker_GetWelcome(this, play); this->textId = EnOssan_PartTimer_GetWelcome(this, play);
Message_StartTextbox(play, this->textId, &this->actor); Message_StartTextbox(play, this->textId, &this->actor);
EnOssan_SetupStartShopping(play, this, false); EnOssan_SetupStartShopping(play, this, false);
} }
@ -657,7 +657,7 @@ void EnOssan_FaceShopkeeper(EnOssan* this, PlayState* play) {
} }
} }
if (this->actor.params == ENOSSAN_PART_TIME_WORKER && player->transformation != PLAYER_FORM_ZORA) { if (this->actor.params == ENOSSAN_PART_TIME_WORKER && player->transformation != PLAYER_FORM_ZORA) {
Math_SmoothStepToS(&this->headRotPartTimeWorker.y, 8000, 3, 2000, 0); Math_SmoothStepToS(&this->partTimerHeadRot.y, 8000, 3, 2000, 0);
} }
} }
} }
@ -823,7 +823,7 @@ s32 EnOssan_HasPlayerSelectedItem(PlayState* play, EnOssan* this, Input* input)
} }
if (EnOssan_TestItemSelected(play)) { if (EnOssan_TestItemSelected(play)) {
if (!item->isOutOfStock) { if (!item->isOutOfStock) {
this->tmpActionFunc = this->actionFunc; this->prevActionFunc = this->actionFunc;
func_80151938(play, this->items[this->cursorIdx]->choiceTextId); func_80151938(play, this->items[this->cursorIdx]->choiceTextId);
this->stickLeftPrompt.isEnabled = false; this->stickLeftPrompt.isEnabled = false;
this->stickRightPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = false;
@ -1060,7 +1060,7 @@ void EnOssan_SelectItem(EnOssan* this, PlayState* play) {
break; break;
case 1: case 1:
func_8019F230(); func_8019F230();
this->actionFunc = this->tmpActionFunc; this->actionFunc = this->prevActionFunc;
func_80151938(play, this->items[this->cursorIdx]->actor.textId); func_80151938(play, this->items[this->cursorIdx]->actor.textId);
break; break;
} }
@ -1070,7 +1070,7 @@ void EnOssan_SelectItem(EnOssan* this, PlayState* play) {
void EnOssan_CannotBuy(EnOssan* this, PlayState* play) { void EnOssan_CannotBuy(EnOssan* this, PlayState* play) {
if (Message_GetState(&play->msgCtx) == 5 && Message_ShouldAdvance(play)) { if (Message_GetState(&play->msgCtx) == 5 && Message_ShouldAdvance(play)) {
this->actionFunc = this->tmpActionFunc; this->actionFunc = this->prevActionFunc;
func_80151938(play, this->items[this->cursorIdx]->actor.textId); func_80151938(play, this->items[this->cursorIdx]->actor.textId);
} }
} }
@ -1083,7 +1083,7 @@ void EnOssan_CanBuy(EnOssan* this, PlayState* play) {
EnOssan_ResetItemPosition(this); EnOssan_ResetItemPosition(this);
item = this->items[this->cursorIdx]; item = this->items[this->cursorIdx];
item->restockFunc(play, item); item->restockFunc(play, item);
this->actionFunc = this->tmpActionFunc; this->actionFunc = this->prevActionFunc;
func_80151938(play, this->items[this->cursorIdx]->actor.textId); func_80151938(play, this->items[this->cursorIdx]->actor.textId);
} }
} }
@ -1368,10 +1368,10 @@ void EnOssan_CuriosityShopMan_Init(EnOssan* this, PlayState* play) {
this->actor.draw = EnOssan_CuriosityShopMan_Draw; this->actor.draw = EnOssan_CuriosityShopMan_Draw;
} }
void EnOssan_PartTimeWorker_Init(EnOssan* this, PlayState* play) { void EnOssan_PartTimer_Init(EnOssan* this, PlayState* play) {
SkelAnime_InitFlex(play, &this->skelAnime, &gAniSkeleton, &gAniStandingNormalAnim, this->jointTable, SkelAnime_InitFlex(play, &this->skelAnime, &gAniSkeleton, &gAniStandingNormalAnim, this->jointTable,
this->morphTable, 16); this->morphTable, 16);
this->actor.draw = EnOssan_PartTimeWorker_Draw; this->actor.draw = EnOssan_PartTimer_Draw;
} }
u16 EnOssan_CuriosityShopMan_GetWelcome(EnOssan* this, PlayState* play) { u16 EnOssan_CuriosityShopMan_GetWelcome(EnOssan* this, PlayState* play) {
@ -1407,7 +1407,7 @@ u16 EnOssan_CuriosityShopMan_GetWelcome(EnOssan* this, PlayState* play) {
return sWelcomeHumanTextIds[ENOSSAN_CURIOSITY_SHOP_MAN]; return sWelcomeHumanTextIds[ENOSSAN_CURIOSITY_SHOP_MAN];
} }
u16 EnOssan_PartTimerWorker_GetWelcome(EnOssan* this, PlayState* play) { u16 EnOssan_PartTimer_GetWelcome(EnOssan* this, PlayState* play) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
u16 textId = Text_GetFaceReaction(play, 0x36); u16 textId = Text_GetFaceReaction(play, 0x36);
@ -1459,7 +1459,7 @@ void EnOssan_SetHaveMet(EnOssan* this) {
} }
void EnOssan_InitShop(EnOssan* this, PlayState* play) { void EnOssan_InitShop(EnOssan* this, PlayState* play) {
static EnOssanActionFunc sInitFuncs[] = { EnOssan_CuriosityShopMan_Init, EnOssan_PartTimeWorker_Init }; static EnOssanActionFunc sInitFuncs[] = { EnOssan_CuriosityShopMan_Init, EnOssan_PartTimer_Init };
ShopItem* shopItems; ShopItem* shopItems;
if (Object_IsLoaded(&play->objectCtx, this->objIndex)) { if (Object_IsLoaded(&play->objectCtx, this->objIndex)) {
@ -1678,13 +1678,13 @@ s32 EnOssan_CuriosityShopMan_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gf
return false; return false;
} }
s32 EnOssan_PartTimeWorker_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, s32 EnOssan_PartTimer_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
Actor* thisx) { Actor* thisx) {
EnOssan* this = THIS; EnOssan* this = THIS;
if (limbIndex == ANI_LIMB_HEAD) { if (limbIndex == ANI_LIMB_HEAD) {
Matrix_RotateXS(this->headRotPartTimeWorker.y, MTXMODE_APPLY); Matrix_RotateXS(this->partTimerHeadRot.y, MTXMODE_APPLY);
Matrix_RotateZS(this->headRotPartTimeWorker.x, MTXMODE_APPLY); Matrix_RotateZS(this->partTimerHeadRot.x, MTXMODE_APPLY);
} }
return false; return false;
} }
@ -1698,12 +1698,12 @@ void EnOssan_CuriosityShopMan_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx**
} }
} }
void EnOssan_PartTimeWorker_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { void EnOssan_PartTimer_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
static Vec3f sPartTimeWorkerFocusOffset = { 800.0f, 500.0f, 0.0f }; static Vec3f sFocusOffset = { 800.0f, 500.0f, 0.0f };
EnOssan* this = THIS; EnOssan* this = THIS;
if (limbIndex == ANI_LIMB_HEAD) { if (limbIndex == ANI_LIMB_HEAD) {
Matrix_MultVec3f(&sPartTimeWorkerFocusOffset, &this->actor.focus.pos); Matrix_MultVec3f(&sFocusOffset, &this->actor.focus.pos);
} }
} }
@ -1723,7 +1723,7 @@ void EnOssan_CuriosityShopMan_Draw(Actor* thisx, PlayState* play) {
CLOSE_DISPS(play->state.gfxCtx); CLOSE_DISPS(play->state.gfxCtx);
} }
void EnOssan_PartTimeWorker_Draw(Actor* thisx, PlayState* play) { void EnOssan_PartTimer_Draw(Actor* thisx, PlayState* play) {
static TexturePtr sEyeTextures[] = { gAniOpenEyeTex, gAniClosingEyeTex, gAniClosedEyeTex }; static TexturePtr sEyeTextures[] = { gAniOpenEyeTex, gAniClosingEyeTex, gAniClosedEyeTex };
s32 pad; s32 pad;
EnOssan* this = THIS; EnOssan* this = THIS;
@ -1732,7 +1732,7 @@ void EnOssan_PartTimeWorker_Draw(Actor* thisx, PlayState* play) {
func_8012C28C(play->state.gfxCtx); func_8012C28C(play->state.gfxCtx);
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeTextures[this->eyeTexIndex])); gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeTextures[this->eyeTexIndex]));
SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
EnOssan_PartTimeWorker_OverrideLimbDraw, EnOssan_PartTimeWorker_PostLimbDraw, &this->actor); EnOssan_PartTimer_OverrideLimbDraw, EnOssan_PartTimer_PostLimbDraw, &this->actor);
EnOssan_DrawCursor(play, this, this->cursorPos.x, this->cursorPos.y, this->cursorPos.z, this->drawCursor); EnOssan_DrawCursor(play, this, this->cursorPos.x, this->cursorPos.y, this->cursorPos.z, this->drawCursor);
EnOssan_DrawStickDirectionPrompts(play, this); EnOssan_DrawStickDirectionPrompts(play, this);
CLOSE_DISPS(play->state.gfxCtx); CLOSE_DISPS(play->state.gfxCtx);

View File

@ -18,7 +18,7 @@ typedef struct EnOssan {
/* 0x000 */ Actor actor; /* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime; /* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ EnOssanActionFunc actionFunc; /* 0x188 */ EnOssanActionFunc actionFunc;
/* 0x18C */ EnOssanActionFunc tmpActionFunc; // Used to restore back to correct browsing function /* 0x18C */ EnOssanActionFunc prevActionFunc; // Used to restore back to correct browsing function
/* 0x190 */ ColliderCylinder collider; /* 0x190 */ ColliderCylinder collider;
/* 0x1DC */ s16 delayTimer; /* 0x1DC */ s16 delayTimer;
/* 0x1DE */ s8 objIndex; /* 0x1DE */ s8 objIndex;
@ -57,7 +57,7 @@ typedef struct EnOssan {
/* 0x31E */ Vec3s jointTable[ENOSSAN_LIMB_MAX]; /* 0x31E */ Vec3s jointTable[ENOSSAN_LIMB_MAX];
/* 0x390 */ Vec3s morphTable[ENOSSAN_LIMB_MAX]; /* 0x390 */ Vec3s morphTable[ENOSSAN_LIMB_MAX];
/* 0x402 */ s16 animationIndex; /* 0x402 */ s16 animationIndex;
/* 0x404 */ Vec3s headRotPartTimeWorker; /* 0x404 */ Vec3s partTimerHeadRot;
/* 0x40A */ u16 flags; /* 0x40A */ u16 flags;
} EnOssan; // size = 0x40C } EnOssan; // size = 0x40C

View File

@ -12,9 +12,6 @@
#define THIS ((EnPoFusen*)thisx) #define THIS ((EnPoFusen*)thisx)
#define GET_FUSE_LEN_PARAM(this) (((Actor*)(this))->params & 0x3FF)
#define GET_IS_FUSE_TYPE_PARAM(this) (((Actor*)(this))->params & 0x8000)
void EnPoFusen_Init(Actor* thisx, PlayState* play); void EnPoFusen_Init(Actor* thisx, PlayState* play);
void EnPoFusen_Destroy(Actor* thisx, PlayState* play); void EnPoFusen_Destroy(Actor* thisx, PlayState* play);
void EnPoFusen_Update(Actor* thisx, PlayState* play); void EnPoFusen_Update(Actor* thisx, PlayState* play);
@ -113,7 +110,7 @@ void EnPoFusen_Init(Actor* thisx, PlayState* play) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f);
Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, 0x4); Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, 0x4);
if (EnPoFusen_CheckParent(this, play) == 0) { if (!EnPoFusen_CheckParent(this, play)) {
Actor_MarkForDeath(&this->actor); Actor_MarkForDeath(&this->actor);
} }
@ -122,9 +119,9 @@ void EnPoFusen_Init(Actor* thisx, PlayState* play) {
this->actor.home.pos.y = heightTemp; this->actor.home.pos.y = heightTemp;
} }
this->randScaleChange = ((Rand_Next() % 0xFFFEU) - 0x7FFF); this->randScaleChange = (Rand_Next() % 0xFFFE) - 0x7FFF;
this->randYRotChange = ((Rand_Next() % 0x4B0U) - 0x258); this->randYRotChange = (Rand_Next() % 0x4B0) - 0x258;
this->avgBaseRotation = 0x1555; this->avgBaseRotation = 0x10000 / 12;
this->limb3Rot = 0; this->limb3Rot = 0;
this->limb46Rot = 0; this->limb46Rot = 0;
this->limb57Rot = 0; this->limb57Rot = 0;
@ -132,7 +129,7 @@ void EnPoFusen_Init(Actor* thisx, PlayState* play) {
this->limb9Rot = 0x71C; this->limb9Rot = 0x71C;
this->randBaseRotChange = 0; this->randBaseRotChange = 0;
if (GET_IS_FUSE_TYPE_PARAM(this)) { if (GET_IS_FUSE_TYPE_PARAM(&this->actor)) {
EnPoFusen_InitFuse(this); EnPoFusen_InitFuse(this);
return; return;
} }
@ -142,6 +139,7 @@ void EnPoFusen_Init(Actor* thisx, PlayState* play) {
void EnPoFusen_Destroy(Actor* thisx, PlayState* play) { void EnPoFusen_Destroy(Actor* thisx, PlayState* play) {
EnPoFusen* this = THIS; EnPoFusen* this = THIS;
Collider_DestroySphere(play, &this->collider); Collider_DestroySphere(play, &this->collider);
} }
@ -149,26 +147,24 @@ u16 EnPoFusen_CheckParent(EnPoFusen* this, PlayState* play) {
Actor* actorPtr; Actor* actorPtr;
actorPtr = play->actorCtx.actorLists[ACTORCAT_NPC].first; actorPtr = play->actorCtx.actorLists[ACTORCAT_NPC].first;
if (GET_IS_FUSE_TYPE_PARAM(this)) { if (GET_IS_FUSE_TYPE_PARAM(&this->actor)) {
return 1; return true;
} }
if (actorPtr != 0) { while (actorPtr != NULL) {
do { if (actorPtr->id == ACTOR_EN_MA4) {
if (actorPtr->id == ACTOR_EN_MA4) { this->actor.parent = actorPtr;
this->actor.parent = actorPtr; return true;
return 1; }
} actorPtr = actorPtr->next;
actorPtr = actorPtr->next;
} while (actorPtr != 0);
} }
return 0; return false;
} }
u16 EnPoFusen_CheckCollision(EnPoFusen* this, PlayState* play) { u16 EnPoFusen_CheckCollision(EnPoFusen* this, PlayState* play) {
if (this->actionFunc == EnPoFusen_IdleFuse) { if (this->actionFunc == EnPoFusen_IdleFuse) {
return 0; return false;
} }
this->collider.dim.worldSphere.center.x = this->actor.world.pos.x; this->collider.dim.worldSphere.center.x = this->actor.world.pos.x;
@ -177,13 +173,13 @@ u16 EnPoFusen_CheckCollision(EnPoFusen* this, PlayState* play) {
if ((this->collider.base.acFlags & AC_HIT) && (this->actor.colChkInfo.damageEffect == 0xF)) { if ((this->collider.base.acFlags & AC_HIT) && (this->actor.colChkInfo.damageEffect == 0xF)) {
this->collider.base.acFlags &= ~AC_HIT; this->collider.base.acFlags &= ~AC_HIT;
return 1; return true;
} }
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
return 0; return false;
} }
void EnPoFusen_InitNoFuse(EnPoFusen* this) { void EnPoFusen_InitNoFuse(EnPoFusen* this) {
@ -247,9 +243,9 @@ void EnPoFusen_Pop(EnPoFusen* this, PlayState* play) {
void EnPoFusen_InitFuse(EnPoFusen* this) { void EnPoFusen_InitFuse(EnPoFusen* this) {
s16 rotZ = this->actor.shape.rot.z; s16 rotZ = this->actor.shape.rot.z;
this->fuse = GET_FUSE_LEN_PARAM(this); this->fuse = GET_FUSE_LEN_PARAM(&this->actor);
this->actor.shape.rot.z = 0; this->actor.shape.rot.z = 0;
this->randScaleChange = rotZ & 0xFFFFu; this->randScaleChange = rotZ & 0xFFFF;
this->actionFunc = EnPoFusen_IdleFuse; this->actionFunc = EnPoFusen_IdleFuse;
} }
@ -263,7 +259,7 @@ void EnPoFusen_IdleFuse(EnPoFusen* this, PlayState* play) {
void EnPoFusen_Update(Actor* thisx, PlayState* play) { void EnPoFusen_Update(Actor* thisx, PlayState* play) {
EnPoFusen* this = THIS; EnPoFusen* this = THIS;
this->actionFunc(this, play); this->actionFunc(this, play);
if (EnPoFusen_CheckCollision(this, play) != 0) { if (EnPoFusen_CheckCollision(this, play)) {
EnPoFusen_IncrementRomaniPop(this); EnPoFusen_IncrementRomaniPop(this);
} }
} }

View File

@ -5,6 +5,9 @@
struct EnPoFusen; struct EnPoFusen;
#define GET_FUSE_LEN_PARAM(thisx) ((thisx)->params & 0x3FF)
#define GET_IS_FUSE_TYPE_PARAM(thisx) ((thisx)->params & 0x8000)
typedef void (*EnPoFusenActionFunc)(struct EnPoFusen*, PlayState*); typedef void (*EnPoFusenActionFunc)(struct EnPoFusen*, PlayState*);
typedef struct EnPoFusen { typedef struct EnPoFusen {

View File

@ -41,7 +41,7 @@ static InitChainEntry sInitChain[] = {
ICHAIN_F32(targetArrowOffset, 1000, ICHAIN_STOP), ICHAIN_F32(targetArrowOffset, 1000, ICHAIN_STOP),
}; };
static s32 texturesDesegmented = false; static s32 sTexturesDesegmented = false;
void EnRecepgirl_Init(Actor* thisx, PlayState* play) { void EnRecepgirl_Init(Actor* thisx, PlayState* play) {
EnRecepgirl* this = THIS; EnRecepgirl* this = THIS;
@ -52,11 +52,11 @@ void EnRecepgirl_Init(Actor* thisx, PlayState* play) {
SkelAnime_InitFlex(play, &this->skelAnime, &object_bg_Skel_011B60, &object_bg_Anim_009890, this->jointTable, SkelAnime_InitFlex(play, &this->skelAnime, &object_bg_Skel_011B60, &object_bg_Anim_009890, this->jointTable,
this->morphTable, 24); this->morphTable, 24);
if (!texturesDesegmented) { if (!sTexturesDesegmented) {
for (i = 0; i < ARRAY_COUNT(sEyeTextures); i++) { for (i = 0; i < ARRAY_COUNT(sEyeTextures); i++) {
sEyeTextures[i] = Lib_SegmentedToVirtual(sEyeTextures[i]); sEyeTextures[i] = Lib_SegmentedToVirtual(sEyeTextures[i]);
} }
texturesDesegmented = true; sTexturesDesegmented = true;
} }
this->eyeTexIndex = 2; this->eyeTexIndex = 2;

View File

@ -543,7 +543,7 @@ void EnRuppecrow_FlyWhileDroppingRupees(EnRuppecrow* this, PlayState* play) {
// Finished spawning rupees; fly up and then despawn // Finished spawning rupees; fly up and then despawn
this->speedModifier = 6.0f; this->speedModifier = 6.0f;
// Source of the "Termina Field Guay Glitch"; guay will no longer fall if killed after this point //! @bug: Source of the "Termina Field Guay Glitch"; guay will no longer fall if killed after this point
this->actor.gravity = 0.0f; this->actor.gravity = 0.0f;
Math_ApproachF(&this->actor.speedXZ, 6.0f, 0.2f, 0.5f); Math_ApproachF(&this->actor.speedXZ, 6.0f, 0.2f, 0.5f);

View File

@ -390,7 +390,7 @@ void EnSb_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
s8 phi_a2; s8 phi_a2;
EnSb* this = THIS; EnSb* this = THIS;
if (this->isDrawn != false) { if (this->isDrawn) {
if (limbIndex < 7) { if (limbIndex < 7) {
phi_a2 = (this->actor.depthInWater > 0) ? 4 : 1; phi_a2 = (this->actor.depthInWater > 0) ? 4 : 1;
Actor_SpawnBodyParts(thisx, play, phi_a2, dList); Actor_SpawnBodyParts(thisx, play, phi_a2, dList);

View File

@ -798,7 +798,7 @@ void func_80996474(EnSkb* this) {
} }
void func_809964A0(EnSkb* this, PlayState* play) { void func_809964A0(EnSkb* this, PlayState* play) {
if ((this->unk_3D0++ < 19) ^ 1) { if (this->unk_3D0++ >= 19) {
Actor_MarkForDeath(&this->actor); Actor_MarkForDeath(&this->actor);
} }
} }

View File

@ -466,7 +466,7 @@ s32 EnSob1_TestEndInteraction(EnSob1* this, PlayState* play, Input* input) {
s32 EnSob1_TestCancelOption(EnSob1* this, PlayState* play, Input* input) { s32 EnSob1_TestCancelOption(EnSob1* this, PlayState* play, Input* input) {
if (CHECK_BTN_ALL(input->press.button, BTN_B)) { if (CHECK_BTN_ALL(input->press.button, BTN_B)) {
this->actionFunc = this->tmpActionFunc; this->actionFunc = this->prevActionFunc;
func_80151938(play, this->items[this->cursorIndex]->actor.textId); func_80151938(play, this->items[this->cursorIndex]->actor.textId);
return true; return true;
} }
@ -882,7 +882,7 @@ s32 EnSob1_HasPlayerSelectedItem(PlayState* play, EnSob1* this, Input* input) {
} }
if (EnSob1_TestItemSelected(play)) { if (EnSob1_TestItemSelected(play)) {
if (!item->isOutOfStock) { if (!item->isOutOfStock) {
this->tmpActionFunc = this->actionFunc; this->prevActionFunc = this->actionFunc;
func_80151938(play, this->items[this->cursorIndex]->choiceTextId); func_80151938(play, this->items[this->cursorIndex]->choiceTextId);
play_sound(NA_SE_SY_DECIDE); play_sound(NA_SE_SY_DECIDE);
this->stickLeftPrompt.isEnabled = false; this->stickLeftPrompt.isEnabled = false;
@ -1028,7 +1028,7 @@ void EnSob1_SelectItem(EnSob1* this, PlayState* play) {
break; break;
case 1: case 1:
func_8019F230(); func_8019F230();
this->actionFunc = this->tmpActionFunc; this->actionFunc = this->prevActionFunc;
func_80151938(play, this->items[this->cursorIndex]->actor.textId); func_80151938(play, this->items[this->cursorIndex]->actor.textId);
break; break;
} }
@ -1039,7 +1039,7 @@ void EnSob1_SelectItem(EnSob1* this, PlayState* play) {
void EnSob1_CannotBuy(EnSob1* this, PlayState* play) { void EnSob1_CannotBuy(EnSob1* this, PlayState* play) {
if (Message_GetState(&play->msgCtx) == 5) { if (Message_GetState(&play->msgCtx) == 5) {
if (Message_ShouldAdvance(play)) { if (Message_ShouldAdvance(play)) {
this->actionFunc = this->tmpActionFunc; this->actionFunc = this->prevActionFunc;
func_80151938(play, this->items[this->cursorIndex]->actor.textId); func_80151938(play, this->items[this->cursorIndex]->actor.textId);
} }
} }
@ -1053,7 +1053,7 @@ void EnSob1_CanBuy(EnSob1* this, PlayState* play) {
EnSob1_ResetItemPosition(this); EnSob1_ResetItemPosition(this);
item = this->items[this->cursorIndex]; item = this->items[this->cursorIndex];
item->restockFunc(play, item); item->restockFunc(play, item);
this->actionFunc = this->tmpActionFunc; this->actionFunc = this->prevActionFunc;
func_80151938(play, this->items[this->cursorIndex]->actor.textId); func_80151938(play, this->items[this->cursorIndex]->actor.textId);
} }
} }

View File

@ -28,7 +28,7 @@ typedef struct EnSob1 {
/* 0x000 */ Actor actor; /* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime; /* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ EnSob1ActionFunc actionFunc; /* 0x188 */ EnSob1ActionFunc actionFunc;
/* 0x18C */ EnSob1ActionFunc tmpActionFunc; // Used to restore back to correct browsing function /* 0x18C */ EnSob1ActionFunc prevActionFunc; // Used to restore back to correct browsing function
/* 0x190 */ EnSob1ActionFunc changeObjectFunc; /* 0x190 */ EnSob1ActionFunc changeObjectFunc;
/* 0x194 */ ColliderCylinder collider; /* 0x194 */ ColliderCylinder collider;
/* 0x1E0 */ Path* path; /* 0x1E0 */ Path* path;
@ -88,8 +88,6 @@ typedef enum {
/* 2 */ ENSOB1_CUTSCENESTATE_PLAYING /* 2 */ ENSOB1_CUTSCENESTATE_PLAYING
} EnSob1CutsceneState; } EnSob1CutsceneState;
//! @TODO: Add enum for objIndices index based on what the object is for
extern const ActorInit En_Sob1_InitVars; extern const ActorInit En_Sob1_InitVars;
#endif // Z_EN_SOB1_H #endif // Z_EN_SOB1_H

View File

@ -242,7 +242,7 @@ void func_808A54B0(EnSt* this, PlayState* play) {
if ((this->unk_18C & 1) && (this->actor.colChkInfo.health != 0)) { if ((this->unk_18C & 1) && (this->actor.colChkInfo.health != 0)) {
OPEN_DISPS(play->state.gfxCtx); OPEN_DISPS(play->state.gfxCtx);
gSegments[6] = PHYSICAL_TO_VIRTUAL2(play->objectCtx.status[this->unk_2C0].segment); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->unk_2C0].segment);
gSPSegment(POLY_XLU_DISP++, 0x06, play->objectCtx.status[this->unk_2C0].segment); gSPSegment(POLY_XLU_DISP++, 0x06, play->objectCtx.status[this->unk_2C0].segment);

View File

@ -581,7 +581,7 @@ void EnTab_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
} }
} }
void EnTab_TransformDraw(PlayState* play, s32 limbIndex, Actor* thisx) { void EnTab_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx) {
EnTab* this = THIS; EnTab* this = THIS;
s32 rotStep; s32 rotStep;
s32 overrideStep; s32 overrideStep;
@ -624,7 +624,7 @@ void EnTab_Draw(Actor* thisx, PlayState* play) {
SkelAnime_DrawTransformFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, SkelAnime_DrawTransformFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
this->skelAnime.dListCount, EnTab_OverrideLimbDraw, EnTab_PostLimbDraw, this->skelAnime.dListCount, EnTab_OverrideLimbDraw, EnTab_PostLimbDraw,
EnTab_TransformDraw, &this->actor); EnTab_TransformLimbDraw, &this->actor);
CLOSE_DISPS(play->state.gfxCtx); CLOSE_DISPS(play->state.gfxCtx);
} }

View File

@ -49,7 +49,7 @@ const ActorInit En_Tag_Obj_InitVars = {
void EnTagObj_Init(Actor* thisx, PlayState* play) { void EnTagObj_Init(Actor* thisx, PlayState* play) {
EnTagObj* this = THIS; EnTagObj* this = THIS;
this->hasSpawnedSeahorse = 0; this->hasSpawnedSeahorse = false;
} }
void EnTagObj_Destroy(Actor* thisx, PlayState* play) { void EnTagObj_Destroy(Actor* thisx, PlayState* play) {
@ -61,6 +61,6 @@ void EnTagObj_Update(Actor* thisx, PlayState* play) {
if (!this->hasSpawnedSeahorse) { if (!this->hasSpawnedSeahorse) {
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_OT, this->actor.world.pos.x, this->actor.world.pos.y, Actor_Spawn(&play->actorCtx, play, ACTOR_EN_OT, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, 0, 0, 0, 0); this->actor.world.pos.z, 0, 0, 0, 0);
this->hasSpawnedSeahorse = 1; this->hasSpawnedSeahorse = true;
} }
} }

View File

@ -139,7 +139,7 @@ static EnTotoText D_80BA50BC[] = {
}; };
static EnTotoUnkStruct2 D_80BA50DC[] = { static EnTotoUnkStruct2 D_80BA50DC[] = {
{ 0x2B2F, 0x2B30, 0X2B31, { 0xFF96, 0x0016, 0xFE16 } }, { 0x2B2F, 0x2B30, 0x2B31, { 0xFF96, 0x0016, 0xFE16 } },
{ 0x2B26, 0x2B27, 0x2B28, { 0x0072, 0x0016, 0xFE3C } }, { 0x2B26, 0x2B27, 0x2B28, { 0x0072, 0x0016, 0xFE3C } },
{ 0x2B29, 0x2B2A, 0x2B2B, { 0xFF67, 0x0016, 0xFE6E } }, { 0x2B29, 0x2B2A, 0x2B2B, { 0xFF67, 0x0016, 0xFE6E } },
{ 0x2B2C, 0x2B2D, 0x2B2E, { 0xFFF1, 0x0016, 0xFE74 } }, { 0x2B2C, 0x2B2D, 0x2B2E, { 0xFFF1, 0x0016, 0xFE74 } },

View File

@ -232,7 +232,7 @@ s32 EnTrt_TestEndInteraction(EnTrt* this, PlayState* play, Input* input) {
s32 EnTrt_TestCancelOption(EnTrt* this, PlayState* play, Input* input) { s32 EnTrt_TestCancelOption(EnTrt* this, PlayState* play, Input* input) {
if (CHECK_BTN_ALL(input->press.button, BTN_B)) { if (CHECK_BTN_ALL(input->press.button, BTN_B)) {
this->actionFunc = this->tmpActionFunc; this->actionFunc = this->prevActionFunc;
func_80151938(play, EnTrt_GetItemTextId(this)); func_80151938(play, EnTrt_GetItemTextId(this));
return true; return true;
} }
@ -396,7 +396,7 @@ void EnTrt_SetupTryToGiveRedPotion(EnTrt* this, PlayState* play) {
play->msgCtx.unk12023 = 4; play->msgCtx.unk12023 = 4;
this->actionFunc = EnTrt_GiveRedPotionForKoume; this->actionFunc = EnTrt_GiveRedPotionForKoume;
} else { } else {
this->tmpTextId = this->textId; this->prevTextId = this->textId;
this->textId = 0x88E; this->textId = 0x88E;
gSaveContext.save.weekEventReg[85] |= 8; gSaveContext.save.weekEventReg[85] |= 8;
Message_StartTextbox(play, this->textId, &this->actor); Message_StartTextbox(play, this->textId, &this->actor);
@ -591,7 +591,7 @@ s32 EnTrt_HasPlayerSelectedItem(PlayState* play, EnTrt* this, Input* input) {
} }
if (EnTrt_TestItemSelected(play)) { if (EnTrt_TestItemSelected(play)) {
if (item->actor.params != SI_POTION_BLUE || (this->flags & ENTRT_GIVEN_MUSHROOM)) { if (item->actor.params != SI_POTION_BLUE || (this->flags & ENTRT_GIVEN_MUSHROOM)) {
this->tmpActionFunc = this->actionFunc; this->prevActionFunc = this->actionFunc;
func_80151938(play, EnTrt_GetItemChoiceTextId(this)); func_80151938(play, EnTrt_GetItemChoiceTextId(this));
play_sound(NA_SE_SY_DECIDE); play_sound(NA_SE_SY_DECIDE);
this->stickLeftPrompt.isEnabled = false; this->stickLeftPrompt.isEnabled = false;
@ -714,7 +714,7 @@ void EnTrt_SelectItem(EnTrt* this, PlayState* play) {
break; break;
case 1: case 1:
func_8019F230(); func_8019F230();
this->actionFunc = this->tmpActionFunc; this->actionFunc = this->prevActionFunc;
func_80151938(play, EnTrt_GetItemTextId(this)); func_80151938(play, EnTrt_GetItemTextId(this));
break; break;
} }
@ -755,7 +755,7 @@ void EnTrt_IdleSleeping(EnTrt* this, PlayState* play) {
} else { } else {
this->talkOptionTextId = 0x885; this->talkOptionTextId = 0x885;
} }
this->tmpTextId = this->textId; this->prevTextId = this->textId;
if (player->transformation == PLAYER_FORM_GORON || player->transformation == PLAYER_FORM_ZORA || if (player->transformation == PLAYER_FORM_GORON || player->transformation == PLAYER_FORM_ZORA ||
player->transformation == PLAYER_FORM_DEKU) { player->transformation == PLAYER_FORM_DEKU) {
@ -803,7 +803,7 @@ void EnTrt_IdleAwake(EnTrt* this, PlayState* play) {
if (Player_GetMask(play) == PLAYER_MASK_SCENTS) { if (Player_GetMask(play) == PLAYER_MASK_SCENTS) {
this->textId = 0x890; this->textId = 0x890;
} else { } else {
this->textId = this->tmpTextId; this->textId = this->prevTextId;
} }
} else { } else {
this->textId = 0x850; this->textId = 0x850;
@ -938,7 +938,7 @@ void EnTrt_TryToGiveRedPotionAfterSurprised(EnTrt* this, PlayState* play) {
} }
this->actionFunc = EnTrt_GiveRedPotionForKoume; this->actionFunc = EnTrt_GiveRedPotionForKoume;
} else { } else {
this->tmpTextId = this->textId; this->prevTextId = this->textId;
this->textId = 0x88E; this->textId = 0x88E;
gSaveContext.save.weekEventReg[85] |= 8; gSaveContext.save.weekEventReg[85] |= 8;
Message_StartTextbox(play, this->textId, &this->actor); Message_StartTextbox(play, this->textId, &this->actor);
@ -959,7 +959,7 @@ void EnTrt_TryToGiveRedPotion(EnTrt* this, PlayState* play) {
play->msgCtx.unk12023 = 4; play->msgCtx.unk12023 = 4;
this->actionFunc = EnTrt_GiveRedPotionForKoume; this->actionFunc = EnTrt_GiveRedPotionForKoume;
} else { } else {
this->tmpTextId = this->textId; this->prevTextId = this->textId;
this->textId = 0x88E; this->textId = 0x88E;
gSaveContext.save.weekEventReg[85] |= 8; gSaveContext.save.weekEventReg[85] |= 8;
Message_StartTextbox(play, this->textId, &this->actor); Message_StartTextbox(play, this->textId, &this->actor);
@ -1046,7 +1046,7 @@ void EnTrt_ShopkeeperGone(EnTrt* this, PlayState* play) {
void EnTrt_CannotBuy(EnTrt* this, PlayState* play) { void EnTrt_CannotBuy(EnTrt* this, PlayState* play) {
if (Message_GetState(&play->msgCtx) == 5 && Message_ShouldAdvance(play)) { if (Message_GetState(&play->msgCtx) == 5 && Message_ShouldAdvance(play)) {
this->actionFunc = this->tmpActionFunc; this->actionFunc = this->prevActionFunc;
func_80151938(play, EnTrt_GetItemTextId(this)); func_80151938(play, EnTrt_GetItemTextId(this));
} }
} }
@ -1059,7 +1059,7 @@ void EnTrt_CanBuy(EnTrt* this, PlayState* play) {
EnTrt_ResetItemPosition(this); EnTrt_ResetItemPosition(this);
item = this->items[this->cursorIdx]; item = this->items[this->cursorIdx];
item->restockFunc(play, item); item->restockFunc(play, item);
this->actionFunc = this->tmpActionFunc; this->actionFunc = this->prevActionFunc;
func_80151938(play, EnTrt_GetItemTextId(this)); func_80151938(play, EnTrt_GetItemTextId(this));
} }
} }

View File

@ -12,7 +12,7 @@ typedef void (*EnTrtBlinkFunc)(struct EnTrt*);
typedef struct EnTrt { typedef struct EnTrt {
/* 0x000 */ Actor actor; /* 0x000 */ Actor actor;
/* 0x144 */ EnTrtActionFunc actionFunc; /* 0x144 */ EnTrtActionFunc actionFunc;
/* 0x148 */ EnTrtActionFunc tmpActionFunc; /* 0x148 */ EnTrtActionFunc prevActionFunc;
/* 0x14C */ SkelAnime skelAnime; /* 0x14C */ SkelAnime skelAnime;
/* 0x190 */ ColliderCylinder collider; /* 0x190 */ ColliderCylinder collider;
/* 0x1DC */ UNK_TYPE1 pad1DC[0x154]; /* 0x1DC */ UNK_TYPE1 pad1DC[0x154];
@ -43,7 +43,7 @@ typedef struct EnTrt {
/* 0x402 */ s16 timer; /* 0x402 */ s16 timer;
/* 0x404 */ s16 animationIndex; /* 0x404 */ s16 animationIndex;
/* 0x406 */ u16 textId; /* 0x406 */ u16 textId;
/* 0x408 */ u16 tmpTextId; /* 0x408 */ u16 prevTextId;
/* 0x40A */ u16 talkOptionTextId; /* 0x40A */ u16 talkOptionTextId;
/* 0x40C */ s16 lookForwardCutscene; /* 0x40C */ s16 lookForwardCutscene;
/* 0x40E */ s16 lookToShelfCutscene; /* 0x40E */ s16 lookToShelfCutscene;

View File

@ -629,7 +629,7 @@ void EnWallmas_Update(Actor* thisx, PlayState* play) {
} }
if (this->actionFunc != EnWallmas_Drop) { if (this->actionFunc != EnWallmas_Drop) {
Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 25.0f, 0.0f, 0x1DU); Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 25.0f, 0.0f, 0x1D);
} }
if ((this->actionFunc != EnWallmas_Die) && (this->actionFunc != EnWallmas_Drop)) { if ((this->actionFunc != EnWallmas_Die) && (this->actionFunc != EnWallmas_Drop)) {

View File

@ -463,23 +463,21 @@ void EnWood02_Update(Actor* thisx, PlayState* play2) {
} }
void EnWood02_Draw(Actor* thisx, PlayState* play) { void EnWood02_Draw(Actor* thisx, PlayState* play) {
EnWood02* this = THIS;
GraphicsContext* gfxCtx = play->state.gfxCtx; GraphicsContext* gfxCtx = play->state.gfxCtx;
s16 type;
s16 pad;
u8 red; u8 red;
u8 green; u8 green;
u8 blue; u8 blue;
OPEN_DISPS(gfxCtx); OPEN_DISPS(gfxCtx);
type = thisx->params;
if ((type == WOOD_TREE_OVAL_GREEN_SPAWNER) || (type == WOOD_TREE_OVAL_GREEN_SPAWNED) || if ((thisx->params == WOOD_TREE_OVAL_GREEN_SPAWNER) || (thisx->params == WOOD_TREE_OVAL_GREEN_SPAWNED) ||
(type == WOOD_TREE_OVAL_GREEN) || (type == WOOD_LEAF_GREEN)) { (thisx->params == WOOD_TREE_OVAL_GREEN) || (thisx->params == WOOD_LEAF_GREEN)) {
red = 50; red = 50;
green = 170; green = 170;
blue = 70; blue = 70;
} else if ((type == WOOD_TREE_OVAL_YELLOW_SPAWNER) || (type == WOOD_TREE_OVAL_YELLOW_SPAWNED) || } else if ((thisx->params == WOOD_TREE_OVAL_YELLOW_SPAWNER) || (thisx->params == WOOD_TREE_OVAL_YELLOW_SPAWNED) ||
(type == WOOD_LEAF_YELLOW)) { (thisx->params == WOOD_LEAF_YELLOW)) {
red = 180; red = 180;
green = 155; green = 155;
blue = 0; blue = 0;
@ -495,17 +493,17 @@ void EnWood02_Draw(Actor* thisx, PlayState* play) {
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, red, green, blue, 127); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, red, green, blue, 127);
Gfx_DrawDListOpa(play, object_wood02_DL_000700); Gfx_DrawDListOpa(play, object_wood02_DL_000700);
} else if (D_808C4D70[THIS->drawType & 0xF] != NULL) { } else if (D_808C4D70[this->drawType & 0xF] != NULL) {
Gfx_DrawDListOpa(play, D_808C4D54[THIS->drawType & 0xF]); Gfx_DrawDListOpa(play, D_808C4D54[this->drawType & 0xF]);
gDPSetEnvColor(POLY_XLU_DISP++, red, green, blue, 0); gDPSetEnvColor(POLY_XLU_DISP++, red, green, blue, 0);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, D_808C4D70[THIS->drawType & 0xF]); gSPDisplayList(POLY_XLU_DISP++, D_808C4D70[this->drawType & 0xF]);
} else { } else {
func_8012C2DC(gfxCtx); func_8012C2DC(gfxCtx);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, D_808C4D54[THIS->drawType & 0xF]); gSPDisplayList(POLY_XLU_DISP++, D_808C4D54[this->drawType & 0xF]);
} }
CLOSE_DISPS(gfxCtx); CLOSE_DISPS(gfxCtx);

View File

@ -755,8 +755,7 @@ void func_80B97E0C(EnZot* this, PlayState* play) {
} }
void func_80B97E4C(EnZot* this, PlayState* play) { void func_80B97E4C(EnZot* this, PlayState* play) {
if (1) { if (1) {}
do { } while (0); }
if (this->unk_2F2 & 0x40) { if (this->unk_2F2 & 0x40) {
func_80B96BEC(this, 0, 0); func_80B96BEC(this, 0, 0);

View File

@ -12,7 +12,7 @@
#define THIS ((ObjBombiwa*)thisx) #define THIS ((ObjBombiwa*)thisx)
void ObjBombiwa_Init(Actor* thisx, PlayState* play); void ObjBombiwa_Init(Actor* thisx, PlayState* play);
void ObjBombiwa_Destroy(Actor* thisx, PlayState* play); void ObjBombiwa_Destroy(Actor* thisx, PlayState* play2);
void ObjBombiwa_Update(Actor* thisx, PlayState* play); void ObjBombiwa_Update(Actor* thisx, PlayState* play);
s32 func_809393B0(Actor* thisx); s32 func_809393B0(Actor* thisx);
@ -206,8 +206,11 @@ void ObjBombiwa_Init(Actor* thisx, PlayState* play) {
func_80939EE0(this); func_80939EE0(this);
} }
void ObjBombiwa_Destroy(Actor* thisx, PlayState* play) { void ObjBombiwa_Destroy(Actor* thisx, PlayState* play2) {
Collider_DestroyCylinder(play, &THIS->collider); PlayState* play = play2;
ObjBombiwa* this = THIS;
Collider_DestroyCylinder(play, &this->collider);
} }
void func_80939794(ObjBombiwa* this, PlayState* play) { void func_80939794(ObjBombiwa* this, PlayState* play) {

View File

@ -426,7 +426,7 @@ void ObjChan_DrawFire(ObjChan* this, PlayState* play) {
dl = func_8012C2B4(POLY_XLU_DISP); dl = func_8012C2B4(POLY_XLU_DISP);
gSPMatrix(&dl[0], Matrix_NewMtx(play->state.gfxCtx), G_MTX_LOAD); gSPMatrix(&dl[0], Matrix_NewMtx(play->state.gfxCtx), G_MTX_LOAD);
gMoveWd(&dl[1], 6, 32, Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0U, -sp4C * 20, 32, 128)); gSPSegment(&dl[1], 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, -sp4C * 20, 32, 128));
gDPSetPrimColor(&dl[2], 128, 128, 255, 255, 0, 255); gDPSetPrimColor(&dl[2], 128, 128, 255, 255, 0, 255);
gDPSetEnvColor(&dl[3], 255, 0, 0, 0); gDPSetEnvColor(&dl[3], 255, 0, 0, 0);
gSPDisplayList(&dl[4], &gGameplayKeepDrawFlameDL); gSPDisplayList(&dl[4], &gGameplayKeepDrawFlameDL);

View File

@ -12,7 +12,7 @@
#define THIS ((ObjComb*)thisx) #define THIS ((ObjComb*)thisx)
void ObjComb_Init(Actor* thisx, PlayState* play); void ObjComb_Init(Actor* thisx, PlayState* play);
void ObjComb_Destroy(Actor* thisx, PlayState* play); void ObjComb_Destroy(Actor* thisx, PlayState* play2);
void ObjComb_Update(Actor* thisx, PlayState* play); void ObjComb_Update(Actor* thisx, PlayState* play);
void ObjComb_Draw(Actor* thisx, PlayState* play); void ObjComb_Draw(Actor* thisx, PlayState* play);
@ -352,8 +352,11 @@ void ObjComb_Init(Actor* thisx, PlayState* play) {
func_8098DC44(this); func_8098DC44(this);
} }
void ObjComb_Destroy(Actor* thisx, PlayState* play) { void ObjComb_Destroy(Actor* thisx, PlayState* play2) {
Collider_DestroyJntSph(play, &THIS->collider); PlayState* play = play2;
ObjComb* this = THIS;
Collider_DestroyJntSph(play, &this->collider);
} }
void func_8098DC44(ObjComb* this) { void func_8098DC44(ObjComb* this) {

View File

@ -177,8 +177,8 @@ void func_80A1B3D0(void) {
void func_80A1B840(MtxF* matrix) { void func_80A1B840(MtxF* matrix) {
MtxF* temp = Matrix_GetCurrent(); MtxF* temp = Matrix_GetCurrent();
f32* tmp = (f32*)&temp->mf[0]; f32* tmp = &temp->xx;
f32* tmp2 = (f32*)&matrix->mf[0]; f32* tmp2 = &matrix->xx;
s32 i; s32 i;
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {

View File

@ -12,7 +12,7 @@
#define THIS ((ObjHamishi*)thisx) #define THIS ((ObjHamishi*)thisx)
void ObjHamishi_Init(Actor* thisx, PlayState* play); void ObjHamishi_Init(Actor* thisx, PlayState* play);
void ObjHamishi_Destroy(Actor* thisx, PlayState* play); void ObjHamishi_Destroy(Actor* thisx, PlayState* play2);
void ObjHamishi_Update(Actor* thisx, PlayState* play); void ObjHamishi_Update(Actor* thisx, PlayState* play);
void ObjHamishi_Draw(Actor* thisx, PlayState* play); void ObjHamishi_Draw(Actor* thisx, PlayState* play);
@ -192,8 +192,11 @@ void ObjHamishi_Init(Actor* thisx, PlayState* play) {
} }
} }
void ObjHamishi_Destroy(Actor* thisx, PlayState* play) { void ObjHamishi_Destroy(Actor* thisx, PlayState* play2) {
Collider_DestroyCylinder(play, &THIS->collider); PlayState* play = play2;
ObjHamishi* this = THIS;
Collider_DestroyCylinder(play, &this->collider);
} }
void ObjHamishi_Update(Actor* thisx, PlayState* play) { void ObjHamishi_Update(Actor* thisx, PlayState* play) {

View File

@ -100,9 +100,9 @@ void ObjLightswitch_UpdateSwitchFlags(ObjLightswitch* this, PlayState* play, s32
if (this) {} if (this) {}
if (set) { if (set) {
Flags_SetSwitch(play, GET_LIGHTSWITCH_SWITCHFLAG(this)); Flags_SetSwitch(play, GET_LIGHTSWITCH_SWITCHFLAG(&this->actor));
} else { } else {
Flags_UnsetSwitch(play, GET_LIGHTSWITCH_SWITCHFLAG(this)); Flags_UnsetSwitch(play, GET_LIGHTSWITCH_SWITCHFLAG(&this->actor));
} }
} }
@ -150,13 +150,13 @@ void ObjLightswitch_Init(Actor* thisx, PlayState* play) {
u32 isSwitchActivated; u32 isSwitchActivated;
s32 isTriggered; s32 isTriggered;
isSwitchActivated = Flags_GetSwitch(play, GET_LIGHTSWITCH_SWITCHFLAG(this)); isSwitchActivated = Flags_GetSwitch(play, GET_LIGHTSWITCH_SWITCHFLAG(&this->actor));
isTriggered = false; isTriggered = false;
Actor_ProcessInitChain(&this->actor, sInitChain); Actor_ProcessInitChain(&this->actor, sInitChain);
Actor_SetFocus(&this->actor, 0.0f); Actor_SetFocus(&this->actor, 0.0f);
if (isSwitchActivated) { if (isSwitchActivated) {
if (GET_LIGHTSWITCH_TYPE(this) == LIGHTSWITCH_TYPE_FAKE) { if (GET_LIGHTSWITCH_TYPE(&this->actor) == LIGHTSWITCH_TYPE_FAKE) {
isTriggered = true; isTriggered = true;
} else { } else {
ObjLightSwitch_SetupEnabled(this); ObjLightSwitch_SetupEnabled(this);
@ -167,7 +167,7 @@ void ObjLightswitch_Init(Actor* thisx, PlayState* play) {
ObjLightswitch_InitCollider(this, play); ObjLightswitch_InitCollider(this, play);
if (GET_LIGHTSWITCH_INVISIBLE(this)) { if (GET_LIGHTSWITCH_INVISIBLE(&this->actor)) {
// the stone tower exterior switch is part of the scene mesh, the actor is invisble on top // the stone tower exterior switch is part of the scene mesh, the actor is invisble on top
this->actor.draw = NULL; this->actor.draw = NULL;
} }
@ -209,7 +209,7 @@ void ObjLightswitch_SetupIdle(ObjLightswitch* this) {
} }
void ObjLightswitch_Idle(ObjLightswitch* this, PlayState* play) { void ObjLightswitch_Idle(ObjLightswitch* this, PlayState* play) {
s32 actorType = GET_LIGHTSWITCH_TYPE(this); s32 actorType = GET_LIGHTSWITCH_TYPE(&this->actor);
if (this->hitState >= 10) { if (this->hitState >= 10) {
if (actorType == LIGHTSWITCH_TYPE_FAKE) { if (actorType == LIGHTSWITCH_TYPE_FAKE) {
@ -260,11 +260,11 @@ void ObjLightSwitch_SetupEnabled(ObjLightswitch* this) {
} }
void ObjLightSwitch_Enabled(ObjLightswitch* this, PlayState* play) { void ObjLightSwitch_Enabled(ObjLightswitch* this, PlayState* play) {
s32 actorType = GET_LIGHTSWITCH_TYPE(this); s32 actorType = GET_LIGHTSWITCH_TYPE(&this->actor);
if (actorType == LIGHTSWITCH_TYPE_REGULAR) { if (actorType == LIGHTSWITCH_TYPE_REGULAR) {
// switch can be disabled outside of this actor by flag // switch can be disabled outside of this actor by flag
if (!Flags_GetSwitch(play, GET_LIGHTSWITCH_SWITCHFLAG(this))) { if (!Flags_GetSwitch(play, GET_LIGHTSWITCH_SWITCHFLAG(&this->actor))) {
ObjLightSwitch_SetupDisabled(this); ObjLightSwitch_SetupDisabled(this);
} }
} else if (actorType == LIGHTSWITCH_TYPE_FLIP) { } else if (actorType == LIGHTSWITCH_TYPE_FLIP) {
@ -329,7 +329,7 @@ void ObjLightswitch_Update(Actor* thisx, PlayState* play) {
// dmgFlags enum doesn't exist yet, 0x2000 is light arrows // dmgFlags enum doesn't exist yet, 0x2000 is light arrows
if ((this->collider.elements->info.acHitInfo->toucher.dmgFlags & 0x2000) != 0) { if ((this->collider.elements->info.acHitInfo->toucher.dmgFlags & 0x2000) != 0) {
this->hitState = 10; this->hitState = 10;
} else if (GET_LIGHTSWITCH_TYPE(this) == LIGHTSWITCH_TYPE_FLIP) { } else if (GET_LIGHTSWITCH_TYPE(&this->actor) == LIGHTSWITCH_TYPE_FLIP) {
if (this->hitState == 0) { if (this->hitState == 0) {
if ((this->previousACFlags & AC_HIT) == 0) { if ((this->previousACFlags & AC_HIT) == 0) {
this->hitState = 1; this->hitState = 1;
@ -438,7 +438,7 @@ void ObjLightswitch_Draw(Actor* thisx, PlayState* play) {
ObjLightswitch* this = THIS; ObjLightswitch* this = THIS;
s32 alpha = (u8)(this->colorAlpha >> 6); s32 alpha = (u8)(this->colorAlpha >> 6);
if ((GET_LIGHTSWITCH_TYPE(this) == LIGHTSWITCH_TYPE_FAKE) && (alpha > 0) && (alpha < 255)) { if ((GET_LIGHTSWITCH_TYPE(&this->actor) == LIGHTSWITCH_TYPE_FAKE) && (alpha > 0) && (alpha < 255)) {
ObjLightSwitch_DrawXlu(this, play); ObjLightSwitch_DrawXlu(this, play);
} else { } else {
ObjLightSwitch_DrawOpa(this, play); ObjLightSwitch_DrawOpa(this, play);

View File

@ -40,8 +40,8 @@ extern const ActorInit Obj_Lightswitch_InitVars;
#define LIGHTSWITCH_TYPE_UNK2 2 #define LIGHTSWITCH_TYPE_UNK2 2
#define LIGHTSWITCH_TYPE_FAKE 3 #define LIGHTSWITCH_TYPE_FAKE 3
#define GET_LIGHTSWITCH_TYPE(this) (((this)->actor.params >> 4) & 0x3) #define GET_LIGHTSWITCH_TYPE(thisx) (((thisx)->params >> 4) & 0x3)
#define GET_LIGHTSWITCH_INVISIBLE(this) (((this)->actor.params >> 3) & 1) #define GET_LIGHTSWITCH_INVISIBLE(thisx) (((thisx)->params >> 3) & 1)
#define GET_LIGHTSWITCH_SWITCHFLAG(this) (((this)->actor.params >> 8) & 0x7F) #define GET_LIGHTSWITCH_SWITCHFLAG(thisx) (((thisx)->params >> 8) & 0x7F)
#endif // Z_OBJ_LIGHTSWITCH_H #endif // Z_OBJ_LIGHTSWITCH_H

View File

@ -75,7 +75,7 @@ void func_80C06640(ObjMoonStone* this, PlayState* play) {
sp1A -= player->actor.shape.rot.y; sp1A -= player->actor.shape.rot.y;
if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) {
this->actor.colChkInfo.health = 1; this->actor.colChkInfo.health = 1;
Message_StartTextbox(play, 0x5E3U, &this->actor); Message_StartTextbox(play, 0x5E3, &this->actor);
func_80C066F8(this); func_80C066F8(this);
} else { } else {
s32 phi_v0 = ABS_ALT(sp1A); s32 phi_v0 = ABS_ALT(sp1A);

View File

@ -45,7 +45,7 @@ void ObjMuPict_Init(Actor* thisx, PlayState* play) {
} }
func_80C06D90(this, play); func_80C06D90(this, play);
this->unk14A = UNK_ACTOR_PARAM; this->unk14A = OBJMUPICT_GET_F000(&this->actor);
this->actor.targetMode = 6; this->actor.targetMode = 6;
this->actor.focus.pos = this->actor.world.pos; this->actor.focus.pos = this->actor.world.pos;
this->actor.focus.pos.y += 30.0f; this->actor.focus.pos.y += 30.0f;

View File

@ -5,7 +5,7 @@
struct ObjMuPict; struct ObjMuPict;
#define UNK_ACTOR_PARAM ((this->actor.params & 0xF000) >> 0xC) #define OBJMUPICT_GET_F000(thisx) (((thisx)->params & 0xF000) >> 0xC)
typedef void (*ObjMuPictActionFunc)(struct ObjMuPict*, PlayState*); typedef void (*ObjMuPictActionFunc)(struct ObjMuPict*, PlayState*);

View File

@ -595,7 +595,7 @@ void ObjSwitch_FloorSwitchDown(ObjSwitch* this, PlayState* play) {
case OBJSWITCH_SUBTYPE_RESET: case OBJSWITCH_SUBTYPE_RESET:
case OBJSWITCH_SUBTYPE_RESET_INVERTED: case OBJSWITCH_SUBTYPE_RESET_INVERTED:
if (!DynaPolyActor_IsInSwitchPressedState(&this->dyna) && if (!DynaPolyActor_IsInSwitchPressedState(&this->dyna) &&
(Player_InCsMode(&play->state) == 0 || play->sceneNum == SCENE_SECOM)) { (!Player_InCsMode(&play->state) || play->sceneNum == SCENE_SECOM)) {
if (this->floorSwitchReleaseTimer <= 0) { if (this->floorSwitchReleaseTimer <= 0) {
if (subType == OBJSWITCH_SUBTYPE_RESET) { if (subType == OBJSWITCH_SUBTYPE_RESET) {
ObjSwitch_SetSwitchFlagState(this, play, false); ObjSwitch_SetSwitchFlagState(this, play, false);

View File

@ -19,7 +19,7 @@ typedef struct ObjTokeiStepPanel {
typedef struct ObjTokeiStep { typedef struct ObjTokeiStep {
/* 0x000 */ DynaPolyActor dyna; /* 0x000 */ DynaPolyActor dyna;
/* 0x15c */ ObjTokeiStepFunc actionFunc; /* 0x15C */ ObjTokeiStepFunc actionFunc;
/* 0x160 */ ObjTokeiStepPanel panels[7]; /* 0x160 */ ObjTokeiStepPanel panels[7];
} ObjTokeiStep; // size = 0x1EC } ObjTokeiStep; // size = 0x1EC

View File

@ -16,9 +16,9 @@ void ObjTree_Destroy(Actor* thisx, PlayState* play);
void ObjTree_Update(Actor* thisx, PlayState* play); void ObjTree_Update(Actor* thisx, PlayState* play);
void ObjTree_Draw(Actor* thisx, PlayState* play); void ObjTree_Draw(Actor* thisx, PlayState* play);
void ObTree_DoNothing(ObjTree* this, PlayState* play); void ObjTree_DoNothing(ObjTree* this, PlayState* play);
void ObTree_SetupDoNothing(ObjTree* this); void ObjTree_SetupDoNothing(ObjTree* this);
void ObTree_Sway(ObjTree* this, PlayState* play); void ObjTree_Sway(ObjTree* this, PlayState* play);
const ActorInit Obj_Tree_InitVars = { const ActorInit Obj_Tree_InitVars = {
ACTOR_OBJ_TREE, ACTOR_OBJ_TREE,
@ -115,7 +115,7 @@ void ObjTree_Init(Actor* thisx, PlayState* play) {
this->swayAmplitude = 0.0f; this->swayAmplitude = 0.0f;
this->swayAngle = 0; this->swayAngle = 0;
this->swayVelocity = 0; this->swayVelocity = 0;
ObTree_SetupDoNothing(this); ObjTree_SetupDoNothing(this);
} }
void ObjTree_Destroy(Actor* thisx, PlayState* play) { void ObjTree_Destroy(Actor* thisx, PlayState* play) {
@ -130,24 +130,24 @@ void ObjTree_Destroy(Actor* thisx, PlayState* play) {
Collider_DestroyCylinder(play, &this->collider); Collider_DestroyCylinder(play, &this->collider);
} }
void ObTree_SetupDoNothing(ObjTree* this) { void ObjTree_SetupDoNothing(ObjTree* this) {
this->actionFunc = ObTree_DoNothing; this->actionFunc = ObjTree_DoNothing;
} }
void ObTree_DoNothing(ObjTree* this, PlayState* play) { void ObjTree_DoNothing(ObjTree* this, PlayState* play) {
} }
void ObTree_SetupSway(ObjTree* this) { void ObjTree_SetupSway(ObjTree* this) {
this->timer = 0; this->timer = 0;
this->swayAmplitude = 546.0f; this->swayAmplitude = 546.0f;
this->swayVelocity = 35 * 0x10000 / 360; this->swayVelocity = 35 * 0x10000 / 360;
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_TREE_SWING); Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_TREE_SWING);
this->actionFunc = ObTree_Sway; this->actionFunc = ObjTree_Sway;
} }
void ObTree_Sway(ObjTree* this, PlayState* play) { void ObjTree_Sway(ObjTree* this, PlayState* play) {
if (this->timer > 80) { if (this->timer > 80) {
ObTree_SetupDoNothing(this); ObjTree_SetupDoNothing(this);
return; return;
} }
@ -159,7 +159,7 @@ void ObTree_Sway(ObjTree* this, PlayState* play) {
this->timer++; this->timer++;
} }
void ObTree_UpdateCollision(ObjTree* this, PlayState* play) { void ObjTree_UpdateCollision(ObjTree* this, PlayState* play) {
Collider_UpdateCylinder(&this->dyna.actor, &this->collider); Collider_UpdateCylinder(&this->dyna.actor, &this->collider);
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
@ -167,7 +167,7 @@ void ObTree_UpdateCollision(ObjTree* this, PlayState* play) {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
if (this->dyna.actor.home.rot.y == 1) { if (this->dyna.actor.home.rot.y == 1) {
this->dyna.actor.home.rot.y = 0; this->dyna.actor.home.rot.y = 0;
ObTree_SetupSway(this); ObjTree_SetupSway(this);
} }
} }
} }
@ -176,7 +176,7 @@ void ObjTree_Update(Actor* thisx, PlayState* play) {
ObjTree* this = THIS; ObjTree* this = THIS;
this->actionFunc(this, play); this->actionFunc(this, play);
ObTree_UpdateCollision(this, play); ObjTree_UpdateCollision(this, play);
} }
void ObjTree_Draw(Actor* thisx, PlayState* play) { void ObjTree_Draw(Actor* thisx, PlayState* play) {

View File

@ -144,7 +144,7 @@ void ObjTsubo_SpawnGoldSkulltula(ObjTsubo* this, PlayState* play, s32 arg2) {
if (func_809275C0(this, play)) { if (func_809275C0(this, play)) {
params = (OBJ_TSUBO_P001F(&this->actor) << 2) | 0xFF01; params = (OBJ_TSUBO_P001F(&this->actor) << 2) | 0xFF01;
child = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_SW, this->actor.world.pos.x, this->actor.world.pos.y, child = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_SW, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, 0, (u32)Rand_Next() >> 0x10, 0, params); this->actor.world.pos.z, 0, Rand_Next() >> 0x10, 0, params);
if (child != NULL) { if (child != NULL) {
child->parent = &this->actor; child->parent = &this->actor;
child->velocity.y = 0.0f; child->velocity.y = 0.0f;

View File

@ -71,7 +71,7 @@ void ObjWarpstone_Init(Actor* thisx, PlayState* play) {
Collider_InitAndSetCylinder(play, &this->collider, &this->dyna.actor, &sCylinderInit); Collider_InitAndSetCylinder(play, &this->collider, &this->dyna.actor, &sCylinderInit);
Actor_SetFocus(&this->dyna.actor, 40.0f); Actor_SetFocus(&this->dyna.actor, 40.0f);
if (!OBJ_WARPSTONE_IS_ACTIVATED(OBJ_WARPSTONE_GET_ID(this))) { if (!OBJ_WARPSTONE_IS_ACTIVATED(OBJ_WARPSTONE_GET_ID(&this->dyna.actor))) {
ObjWarpstone_SetupAction(this, ObjWarpstone_ClosedIdle); ObjWarpstone_SetupAction(this, ObjWarpstone_ClosedIdle);
} else { } else {
ObjWarpstone_SetupAction(this, ObjWarpstone_OpenedIdle); ObjWarpstone_SetupAction(this, ObjWarpstone_OpenedIdle);
@ -110,7 +110,7 @@ s32 ObjWarpstone_BeginOpeningCutscene(ObjWarpstone* this, PlayState* play) {
s32 ObjWarpstone_PlayOpeningCutscene(ObjWarpstone* this, PlayState* play) { s32 ObjWarpstone_PlayOpeningCutscene(ObjWarpstone* this, PlayState* play) {
if (this->openingCSTimer++ >= OBJ_WARPSTONE_TIMER_ACTIVATE_THRESHOLD) { if (this->openingCSTimer++ >= OBJ_WARPSTONE_TIMER_ACTIVATE_THRESHOLD) {
ActorCutscene_Stop(this->dyna.actor.cutscene); ActorCutscene_Stop(this->dyna.actor.cutscene);
Sram_ActivateOwl(OBJ_WARPSTONE_GET_ID(this)); Sram_ActivateOwl(OBJ_WARPSTONE_GET_ID(&this->dyna.actor));
ObjWarpstone_SetupAction(this, ObjWarpstone_OpenedIdle); ObjWarpstone_SetupAction(this, ObjWarpstone_OpenedIdle);
} else if (this->openingCSTimer < OBJ_WARPSTONE_TIMER_OPEN_THRESHOLD) { } else if (this->openingCSTimer < OBJ_WARPSTONE_TIMER_OPEN_THRESHOLD) {
Math_StepToF(&this->dyna.actor.velocity.x, 0.01f, 0.001f); Math_StepToF(&this->dyna.actor.velocity.x, 0.01f, 0.001f);
@ -144,7 +144,7 @@ void ObjWarpstone_Update(Actor* thisx, PlayState* play) {
play->msgCtx.msgMode = 0x4D; play->msgCtx.msgMode = 0x4D;
play->msgCtx.unk120D6 = 0; play->msgCtx.unk120D6 = 0;
play->msgCtx.unk120D4 = 0; play->msgCtx.unk120D4 = 0;
gSaveContext.save.owlSaveLocation = OBJ_WARPSTONE_GET_ID(this); gSaveContext.save.owlSaveLocation = OBJ_WARPSTONE_GET_ID(&this->dyna.actor);
} else { } else {
func_801477B4(play); func_801477B4(play);
} }

View File

@ -28,7 +28,7 @@ typedef struct ObjWarpstone {
extern const ActorInit Obj_Warpstone_InitVars; extern const ActorInit Obj_Warpstone_InitVars;
#define OBJ_WARPSTONE_GET_ID(this) ((u16)(this->dyna.actor.params & 0xF)) #define OBJ_WARPSTONE_GET_ID(thisx) ((u16)((thisx)->params & 0xF))
#define OBJ_WARPSTONE_IS_ACTIVATED(owlId) (((void)0, gSaveContext.save.playerData.owlActivationFlags) & (u16)gBitFlags[owlId]) #define OBJ_WARPSTONE_IS_ACTIVATED(owlId) (((void)0, gSaveContext.save.playerData.owlActivationFlags) & (u16)gBitFlags[(owlId)])
#endif // Z_OBJ_WARPSTONE_H #endif // Z_OBJ_WARPSTONE_H

View File

@ -644,7 +644,7 @@ f32 func_808DDE74(void) {
} }
#ifdef NON_MATCHING #ifdef NON_MATCHING
// play->envCtx.unk_F2[1] needs to be laoded into s0 and then copied to s7 // play->envCtx.unk_F2[1] needs to be loaded into s0 and then copied to s7
void func_808DDE9C(Actor* thisx, PlayState* play2) { void func_808DDE9C(Actor* thisx, PlayState* play2) {
PlayState* play = play2; PlayState* play = play2;
ObjectKankyo* this = THIS; ObjectKankyo* this = THIS;

View File

@ -45,7 +45,7 @@ void TGSw_ActionDecider(TGSw* this, PlayState* play) {
} }
unk1F4 = play->actorCtx.unk1F4; unk1F4 = play->actorCtx.unk1F4;
if (unk1F4 == 2 || unk1F4 == 0) { if (unk1F4 == 2 || unk1F4 == 0) {
this->actionFunc = &TGSw_ActionExecuteOneShot; this->actionFunc = TGSw_ActionExecuteOneShot;
} }
} }
} }
@ -89,16 +89,17 @@ void TGSw_ActionExecuteOneShot(TGSw* this, PlayState* play) {
void TGSw_Init(Actor* thisx, PlayState* play) { void TGSw_Init(Actor* thisx, PlayState* play) {
TGSw* this = THIS; TGSw* this = THIS;
this->actor.cutscene = this->actor.world.rot.z; this->actor.cutscene = this->actor.world.rot.z;
this->actionFunc = &TGSw_ActionDecider; this->actionFunc = TGSw_ActionDecider;
} }
void TGSw_Destroy(Actor* thisx, PlayState* play) { void TGSw_Destroy(Actor* thisx, PlayState* play) {
;
} }
void TGSw_Update(Actor* thisx, PlayState* play) { void TGSw_Update(Actor* thisx, PlayState* play) {
TGSw* this = THIS; TGSw* this = THIS;
this->actionFunc(this, play); this->actionFunc(this, play);
} }

View File

@ -5803,9 +5803,9 @@
0x808AACE0:("EnOssan_WaitForBlink",), 0x808AACE0:("EnOssan_WaitForBlink",),
0x808AAD14:("EnOssan_Blink",), 0x808AAD14:("EnOssan_Blink",),
0x808AADB4:("EnOssan_CuriosityShopMan_Init",), 0x808AADB4:("EnOssan_CuriosityShopMan_Init",),
0x808AAE1C:("EnOssan_PartTimeWorker_Init",), 0x808AAE1C:("EnOssan_PartTimer_Init",),
0x808AAE84:("EnOssan_CuriosityShopMan_GetWelcome",), 0x808AAE84:("EnOssan_CuriosityShopMan_GetWelcome",),
0x808AAFB0:("EnOssan_PartTimerWorker_GetWelcome",), 0x808AAFB0:("EnOssan_PartTimer_GetWelcome",),
0x808AB0B0:("EnOssan_SetHaveMet",), 0x808AB0B0:("EnOssan_SetHaveMet",),
0x808AB16C:("EnOssan_InitShop",), 0x808AB16C:("EnOssan_InitShop",),
0x808AB404:("EnOssan_GetCutscenes",), 0x808AB404:("EnOssan_GetCutscenes",),
@ -5814,11 +5814,11 @@
0x808AB78C:("EnOssan_DrawTextRec",), 0x808AB78C:("EnOssan_DrawTextRec",),
0x808AB928:("EnOssan_DrawStickDirectionPrompts",), 0x808AB928:("EnOssan_DrawStickDirectionPrompts",),
0x808ABCD0:("EnOssan_CuriosityShopMan_OverrideLimbDraw",), 0x808ABCD0:("EnOssan_CuriosityShopMan_OverrideLimbDraw",),
0x808ABD10:("EnOssan_PartTimeWorker_OverrideLimbDraw",), 0x808ABD10:("EnOssan_PartTimer_OverrideLimbDraw",),
0x808ABD60:("EnOssan_CuriosityShopMan_PostLimbDraw",), 0x808ABD60:("EnOssan_CuriosityShopMan_PostLimbDraw",),
0x808ABE18:("EnOssan_PartTimeWorker_PostLimbDraw",), 0x808ABE18:("EnOssan_PartTimer_PostLimbDraw",),
0x808ABE58:("EnOssan_CuriosityShopMan_Draw",), 0x808ABE58:("EnOssan_CuriosityShopMan_Draw",),
0x808ABF30:("EnOssan_PartTimeWorker_Draw",), 0x808ABF30:("EnOssan_PartTimer_Draw",),
0x808AC920:("EnFamos_Init",), 0x808AC920:("EnFamos_Init",),
0x808ACB08:("EnFamos_Destroy",), 0x808ACB08:("EnFamos_Destroy",),
0x808ACB58:("EnFamos_SetupAttackDebris",), 0x808ACB58:("EnFamos_SetupAttackDebris",),
@ -10515,10 +10515,10 @@
0x80A4D6A4:("ObjFireshield_Draw",), 0x80A4D6A4:("ObjFireshield_Draw",),
0x80A4D9F0:("BgLadder_Init",), 0x80A4D9F0:("BgLadder_Init",),
0x80A4DB54:("BgLadder_Destroy",), 0x80A4DB54:("BgLadder_Destroy",),
0x80A4DB88:("BgLadder_ActionWait",), 0x80A4DB88:("BgLadder_Wait",),
0x80A4DBD8:("BgLadder_ActionStartCutscene",), 0x80A4DBD8:("BgLadder_StartCutscene",),
0x80A4DC48:("BgLadder_ActionFadeIn",), 0x80A4DC48:("BgLadder_FadeIn",),
0x80A4DCCC:("BgLadder_ActionIdle",), 0x80A4DCCC:("BgLadder_DoNothing",),
0x80A4DCDC:("BgLadder_Update",), 0x80A4DCDC:("BgLadder_Update",),
0x80A4DD00:("BgLadder_Draw",), 0x80A4DD00:("BgLadder_Draw",),
0x80A4DED0:("EnMkk_Init",), 0x80A4DED0:("EnMkk_Init",),
@ -14005,7 +14005,7 @@
0x80B529E4:("EnGk_Update",), 0x80B529E4:("EnGk_Update",),
0x80B52AD4:("EnGk_OverrideLimbDraw",), 0x80B52AD4:("EnGk_OverrideLimbDraw",),
0x80B52AF0:("EnGk_PostLimbDraw",), 0x80B52AF0:("EnGk_PostLimbDraw",),
0x80B52D8C:("EnGk_TransformDraw",), 0x80B52D8C:("EnGk_TransformLimbDraw",),
0x80B52F74:("EnGk_Draw",), 0x80B52F74:("EnGk_Draw",),
0x80B53840:("func_80B53840",), 0x80B53840:("func_80B53840",),
0x80B539CC:("func_80B539CC",), 0x80B539CC:("func_80B539CC",),
@ -16059,7 +16059,7 @@
0x80BE1550:("EnTab_Update",), 0x80BE1550:("EnTab_Update",),
0x80BE1648:("EnTab_OverrideLimbDraw",), 0x80BE1648:("EnTab_OverrideLimbDraw",),
0x80BE16B4:("EnTab_PostLimbDraw",), 0x80BE16B4:("EnTab_PostLimbDraw",),
0x80BE1704:("EnTab_TransformDraw",), 0x80BE1704:("EnTab_TransformLimbDraw",),
0x80BE1810:("EnTab_Draw",), 0x80BE1810:("EnTab_Draw",),
0x80BE1C80:("func_80BE1C80",), 0x80BE1C80:("func_80BE1C80",),
0x80BE1CEC:("EnNimotsu_Init",), 0x80BE1CEC:("EnNimotsu_Init",),

View File

@ -6407,7 +6407,7 @@
0x808A8060:("D_808A8060","UNK_TYPE1","",0x1), 0x808A8060:("D_808A8060","UNK_TYPE1","",0x1),
0x808AC010:("En_Ossan_InitVars","UNK_TYPE1","",0x1), 0x808AC010:("En_Ossan_InitVars","UNK_TYPE1","",0x1),
0x808AC030:("sAnimationsCuriosityShopMan","UNK_TYPE1","",0x1), 0x808AC030:("sAnimationsCuriosityShopMan","UNK_TYPE1","",0x1),
0x808AC100:("sAnimationsPartTimeWorker","UNK_TYPE1","",0x1), 0x808AC100:("sAnimationsPartTimer","UNK_TYPE1","",0x1),
0x808AC1C0:("sObjectIds","UNK_TYPE1","",0x1), 0x808AC1C0:("sObjectIds","UNK_TYPE1","",0x1),
0x808AC1C4:("sAnimations","UNK_TYPE1","",0x1), 0x808AC1C4:("sAnimations","UNK_TYPE1","",0x1),
0x808AC1CC:("sShops","UNK_TYPE1","",0x1), 0x808AC1CC:("sShops","UNK_TYPE1","",0x1),
@ -6427,9 +6427,9 @@
0x808AC288:("sInitChain","UNK_TYPE1","",0x1), 0x808AC288:("sInitChain","UNK_TYPE1","",0x1),
0x808AC28C:("sSelectedItemPosition","UNK_TYPE4","",0x4), 0x808AC28C:("sSelectedItemPosition","UNK_TYPE4","",0x4),
0x808AC2A4:("sInitFuncs","UNK_TYPE1","",0x1), 0x808AC2A4:("sInitFuncs","UNK_TYPE1","",0x1),
0x808AC2AC:("sPartTimeWorkerFocusOffset","UNK_TYPE1","",0x1), 0x808AC2AC:("sPartTimerFocusOffset","UNK_TYPE1","",0x1),
0x808AC2B8:("sCuriosityShopManEyeTextures","UNK_TYPE1","",0x1), 0x808AC2B8:("sCuriosityShopManEyeTextures","UNK_TYPE1","",0x1),
0x808AC2C4:("sPartTimeWorkerEyeTextures","UNK_TYPE1","",0x1), 0x808AC2C4:("sPartTimerEyeTextures","UNK_TYPE1","",0x1),
0x808AC2D0:("filename1","char","[]",0x1), 0x808AC2D0:("filename1","char","[]",0x1),
0x808AC2E0:("filename2","char","[]",0x1), 0x808AC2E0:("filename2","char","[]",0x1),
0x808AC2F0:("filename3","char","[]",0x1), 0x808AC2F0:("filename3","char","[]",0x1),