Document most of global context (#198)

* doesn't build for some reason..?

* some formatting fixes

* windows calculator is trash

* fix!

* fix2

* most of global context documented

* interfacectx

* hopefully fix interface

* document restrictions

* envCtx done

* revert accidental change

* fix

* pause ctx done

* fixxxxxxxxxxxxxxx

* remove unintended zapd change

* fix..?

* format files

* Update include/z64.h

Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>

* ocarinstaff

* Update include/z64.h

Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>

* Update include/z64.h

Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>

* suggestions

* fix mistake in pausectx

* typo

* door context

* renames

* all nb removed

* Update include/z64.h

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update include/functions.h

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* fix kanfont, new docs

* format files, merge master

* fix typo in linker script

* extract asm properly

* door context rename

* fixes in door context

Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
This commit is contained in:
Zelllll
2021-07-05 18:14:27 -07:00
committed by GitHub
parent 0e51bf35a1
commit 6db3fc7b32
65 changed files with 870 additions and 739 deletions
+26 -27
View File
@@ -2,9 +2,9 @@
#include <global.h>
/**
* Assigns the "save" values in PreRenderContext
* Assigns the "save" values in PreRender
*/
void PreRender_SetValuesSave(PreRenderContext* this, u32 width, u32 height, void* fbuf, void* zbuf, void* cvg) {
void PreRender_SetValuesSave(PreRender* this, u32 width, u32 height, void* fbuf, void* zbuf, void* cvg) {
this->widthSave = width;
this->heightSave = height;
this->fbufSave = fbuf;
@@ -16,15 +16,15 @@ void PreRender_SetValuesSave(PreRenderContext* this, u32 width, u32 height, void
this->lrySave = height - 1;
}
void PreRender_Init(PreRenderContext* this) {
bzero(this, sizeof(PreRenderContext));
void PreRender_Init(PreRender* this) {
bzero(this, sizeof(PreRender));
func_80174AA0(&this->alloc);
}
/**
* Assigns the current values in PreRenderContext
* Assigns the current values in PreRender
*/
void PreRender_SetValues(PreRenderContext* this, u32 width, u32 height, void* fbuf, void* zbuf) {
void PreRender_SetValues(PreRender* this, u32 width, u32 height, void* fbuf, void* zbuf) {
this->width = width;
this->height = height;
this->fbuf = fbuf;
@@ -35,11 +35,11 @@ void PreRender_SetValues(PreRenderContext* this, u32 width, u32 height, void* fb
this->lry = height - 1;
}
void PreRender_Destroy(PreRenderContext* this) {
void PreRender_Destroy(PreRender* this) {
func_80174BA0(&this->alloc);
}
void func_8016FDB8(PreRenderContext* this, Gfx** gfxp, void* buf, void* bufSave, u32 arg4) {
void func_8016FDB8(PreRender* this, Gfx** gfxp, void* buf, void* bufSave, u32 arg4) {
Gfx* gfx = *gfxp;
u32 flags;
@@ -60,12 +60,11 @@ void func_8016FDB8(PreRenderContext* this, Gfx** gfxp, void* buf, void* bufSave,
*gfxp = gfx;
}
void func_8016FF70(PreRenderContext* this, Gfx** gfxp, void* buf, void* bufSave) {
void func_8016FF70(PreRender* this, Gfx** gfxp, void* buf, void* bufSave) {
func_8016FDB8(this, gfxp, buf, bufSave, false);
}
void func_8016FF90(PreRenderContext* this, Gfx** gfxp, void* buf, void* bufSave, s32 envR, s32 envG, s32 envB,
s32 envA) {
void func_8016FF90(PreRender* this, Gfx** gfxp, void* buf, void* bufSave, s32 envR, s32 envG, s32 envB, s32 envA) {
Gfx* gfx = *gfxp;
gDPPipeSync(gfx++);
@@ -97,13 +96,13 @@ void func_8016FF90(PreRenderContext* this, Gfx** gfxp, void* buf, void* bufSave,
*gfxp = gfx;
}
void func_80170200(PreRenderContext* this, Gfx** gfxp, void* buf, void* bufSave) {
void func_80170200(PreRender* this, Gfx** gfxp, void* buf, void* bufSave) {
func_8016FF90(this, gfxp, buf, bufSave, 255, 255, 255, 255);
}
#ifdef NON_MATCHING
// just regalloc
void func_8017023C(PreRenderContext* this, Gfx** gfxp, void* buf, void* bufSave) {
void func_8017023C(PreRender* this, Gfx** gfxp, void* buf, void* bufSave) {
Gfx* gfx = *gfxp;
s32 x;
s32 x2;
@@ -152,19 +151,19 @@ void func_8017023C(PreRenderContext* this, Gfx** gfxp, void* buf, void* bufSave)
#pragma GLOBAL_ASM("./asm/non_matchings/code/PreRender/func_8017023C.asm")
#endif
void func_8017057C(PreRenderContext* this, Gfx** gfxp) {
void func_8017057C(PreRender* this, Gfx** gfxp) {
if ((this->zbufSave != NULL) && (this->zbuf != NULL)) {
func_8016FF70(this, gfxp, this->zbuf, this->zbufSave);
}
}
void func_801705B4(PreRenderContext* this, Gfx** gfxp) {
void func_801705B4(PreRender* this, Gfx** gfxp) {
if ((this->fbufSave != NULL) && (this->fbuf != NULL)) {
func_80170200(this, gfxp, this->fbuf, this->fbufSave);
}
}
void func_801705EC(PreRenderContext* this, Gfx** gfxp) {
void func_801705EC(PreRender* this, Gfx** gfxp) {
Gfx* gfx = *gfxp;
gDPPipeSync(gfx++);
@@ -181,7 +180,7 @@ void func_801705EC(PreRenderContext* this, Gfx** gfxp) {
*gfxp = gfx;
}
void func_80170730(PreRenderContext* this, Gfx** gfxp) {
void func_80170730(PreRender* this, Gfx** gfxp) {
func_801705EC(this, gfxp);
if (this->cvgSave != NULL) {
@@ -189,13 +188,13 @@ void func_80170730(PreRenderContext* this, Gfx** gfxp) {
}
}
void func_80170774(PreRenderContext* this, Gfx** gfxp) {
void func_80170774(PreRender* this, Gfx** gfxp) {
func_8016FF70(this, gfxp, this->zbufSave, this->zbuf);
}
#ifdef NON_MATCHING
// just regalloc
void func_80170798(PreRenderContext* this, Gfx** gfxp) {
void func_80170798(PreRender* this, Gfx** gfxp) {
Gfx* gfx;
s32 y;
s32 y2;
@@ -253,11 +252,11 @@ void func_80170798(PreRenderContext* this, Gfx** gfxp) {
#pragma GLOBAL_ASM("./asm/non_matchings/code/PreRender/func_80170798.asm")
#endif
void func_80170AE0(PreRenderContext* this, Gfx** gfxp, s32 alpha) {
void func_80170AE0(PreRender* this, Gfx** gfxp, s32 alpha) {
func_8016FF90(this, gfxp, this->fbufSave, this->fbuf, 255, 255, 255, alpha);
}
void func_80170B28(PreRenderContext* this, Gfx** gfxp) {
void func_80170B28(PreRender* this, Gfx** gfxp) {
func_8016FF70(this, gfxp, this->fbufSave, this->fbuf);
}
@@ -269,7 +268,7 @@ void func_80170B28(PreRenderContext* this, Gfx** gfxp) {
* | A B C D E |
* ‾ ‾ ‾ ‾ ‾
*/
void PreRender_AntiAliasAlgorithm(PreRenderContext* this, s32 x, s32 y) {
void PreRender_AntiAliasAlgorithm(PreRender* this, s32 x, s32 y) {
s32 i;
s32 j;
s32 buffA[3 * 5];
@@ -380,7 +379,7 @@ void PreRender_AntiAliasAlgorithm(PreRenderContext* this, s32 x, s32 y) {
/**
* Applies an anti-alias filter to the current prerender
*/
void PreRender_ApplyAntiAliasingFilter(PreRenderContext* this) {
void PreRender_ApplyAntiAliasingFilter(PreRender* this) {
s32 x;
s32 y;
s32 cvg;
@@ -405,7 +404,7 @@ void PreRender_ApplyAntiAliasingFilter(PreRenderContext* this) {
/**
* Applies filters to the framebuffer prerender to make it look smoother
*/
void PreRender_ApplyFilters(PreRenderContext* this) {
void PreRender_ApplyFilters(PreRender* this) {
if (this->cvgSave == NULL || this->fbufSave == NULL) {
this->unk_4D = 0;
} else {
@@ -419,7 +418,7 @@ void PreRender_ApplyFilters(PreRenderContext* this) {
/**
* Initializes `PreRender_ApplyFilters` onto a new "slowly" thread
*/
void PreRender_ApplyFiltersSlowlyInit(PreRenderContext* this) {
void PreRender_ApplyFiltersSlowlyInit(PreRender* this) {
if ((this->cvgSave != NULL) && (this->fbufSave != NULL)) {
if (D_801F6FC0) {
StackCheck_Cleanup(&slowlyStackEntry);
@@ -436,7 +435,7 @@ void PreRender_ApplyFiltersSlowlyInit(PreRenderContext* this) {
/**
* Destroys the "slowly" thread
*/
void PreRender_ApplyFiltersSlowlyDestroy(PreRenderContext* this) {
void PreRender_ApplyFiltersSlowlyDestroy(PreRender* this) {
if (D_801F6FC0) {
StackCheck_Cleanup(&slowlyStackEntry);
Slowly_Stop(&D_801F6E00);
@@ -445,7 +444,7 @@ void PreRender_ApplyFiltersSlowlyDestroy(PreRenderContext* this) {
}
// Unused, likely since `PreRender_ApplyFilters` already handles NULL checks
void func_801720C4(PreRenderContext* this) {
void func_801720C4(PreRender* this) {
if ((this->cvgSave != NULL) && (this->fbufSave != NULL)) {
PreRender_ApplyFilters(this);
}
+1 -1
View File
@@ -43,7 +43,7 @@ void EnAObj_Update2(ActorEnAObj* this, GlobalContext* globalCtx) {
void EnAObj_Update(ActorEnAObj* this, GlobalContext* globalCtx) {
(this->update)((Actor*)this, (GlobalContext*)globalCtx);
Actor_SetHeight((Actor*)this, 45.0f);
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, (Collider*)&this->collision);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, (Collider*)&this->collision);
}
void EnAObj_Draw(ActorEnAObj* this, GlobalContext* globalCtx) {
+1 -1
View File
@@ -736,7 +736,7 @@ void Actor_DrawAllSetup(GlobalContext* globalCtx) {
void Actor_FreeOverlay(ActorOverlay* entry) {
void* ramAddr;
if (entry->nbLoaded == 0) {
if (entry->numLoaded == 0) {
ramAddr = entry->loadedRamAddr;
if (ramAddr != NULL) {
// Bit 1 - always loaded
+1 -1
View File
@@ -726,7 +726,7 @@ void ActorOverlayTable_FaultPrint(void* arg0, void* arg1) {
overlaySize = (u32)overlayEntry->vramEnd - (u32)overlayEntry->vramStart;
if (overlayEntry->loadedRamAddr != NULL) {
FaultDrawer_Printf("%3d %08x-%08x %3d %s\n", i, overlayEntry->loadedRamAddr,
(u32)overlayEntry->loadedRamAddr + overlaySize, overlayEntry->nbLoaded, "");
(u32)overlayEntry->loadedRamAddr + overlaySize, overlayEntry->numLoaded, "");
}
}
}
+4 -4
View File
@@ -5,7 +5,7 @@ void EffFootmark_Init(GlobalContext* globalCtx) {
EffFootmark* footmark;
s32 i;
for (footmark = globalCtx->footmarks, i = 0; i < 100; i++, footmark++) {
for (footmark = globalCtx->footprintInfo, i = 0; i < 100; i++, footmark++) {
footmark->actor = NULL;
footmark->location.x = 0;
footmark->location.y = 0;
@@ -25,7 +25,7 @@ void EffFootmark_Add(GlobalContext* globalCtx, MtxF* displayMatrix, Actor* actor
EffFootmark* oldest = NULL;
s32 isNew = 1;
for (footmark = globalCtx->footmarks, i = 0; i < 100; i++, footmark++) {
for (footmark = globalCtx->footprintInfo, i = 0; i < 100; i++, footmark++) {
if (((actor == footmark->actor) && (footmark->id == id)) && ((footmark->flags & 1) == 0)) {
if (fabsf((footmark->location).x - location->x) <= 1) {
if (fabsf((footmark->location).z - location->z) <= 1) {
@@ -75,7 +75,7 @@ void EffFootmark_Update(GlobalContext* globalCtx) {
EffFootmark* footmark;
s32 i;
for (footmark = globalCtx->footmarks, i = 0; i < 100; i++, footmark++) {
for (footmark = globalCtx->footprintInfo, i = 0; i < 100; i++, footmark++) {
if (footmark->actor != NULL) {
if ((footmark->flags & 1) == 1) {
if (footmark->age < 0xFFFFu) { // TODO replace with MAX_U16 or something
@@ -105,7 +105,7 @@ void EffFootmark_Draw(GlobalContext* globalCtx) {
gSPDisplayList(gfxCtx->polyXlu.p++, D_801BC240);
for (footmark = globalCtx->footmarks, i = 0; i < 100; i++, footmark++) {
for (footmark = globalCtx->footprintInfo, i = 0; i < 100; i++, footmark++) {
if (footmark->actor != NULL) {
SysMatrix_SetCurrentState(&footmark->displayMatrix);
Matrix_Scale(footmark->size * 0.00390625f * 0.7f, 1, footmark->size * 0.00390625f, 1);
+1 -1
View File
@@ -17,7 +17,7 @@ void EffectSs_DrawGEffect(GlobalContext* globalCtx, EffectSs* this, void* textur
scale = this->rgScale * D_801DC100;
SkinMatrix_SetTranslate(&mfTrans, this->pos.x, this->pos.y, this->pos.z);
SkinMatrix_SetScale(&mfScale, scale, scale, scale);
SkinMatrix_MtxFMtxFMult(&mfTrans, &globalCtx->unk187FC, &mfTrans11DA0);
SkinMatrix_MtxFMtxFMult(&mfTrans, &globalCtx->mf_187FC, &mfTrans11DA0);
SkinMatrix_MtxFMtxFMult(&mfTrans11DA0, &mfScale, &mfResult);
gSegments[6] = PHYSICAL_TO_VIRTUAL(object);
gSPSegment(POLY_XLU_DISP++, 0x06, object);
+2 -2
View File
@@ -470,7 +470,7 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
}
Collision_CylinderMoveToActor(&this->actor, &this->collider);
Collision_AddAC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
Collision_AddAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
if ((this->actor.params == ITEM00_SHIELD_HERO) || (this->actor.params == ITEM00_MAP) ||
(this->actor.params == ITEM00_COMPASS)) {
@@ -490,7 +490,7 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
}
}
if (globalCtx->unk17000 != 0) {
if (globalCtx->gameOverCtx.state != 0) {
return;
}
+25 -15
View File
@@ -1,34 +1,44 @@
#include <ultra64.h>
#include <global.h>
void Kanfont_Nop800F4F40(GlobalContext* globalCtx, UNK_TYPE param_2, UNK_TYPE param_3) {
// stubbed in NTSC-U
void Font_LoadChar(GlobalContext* globalCtx, u16 codePointIndex, s32 offset) {
}
void Kanfont_LoadAsciiChar(GlobalContext* globalCtx, u8 character, s32 iParm3) {
// UB to convert pointer to u32
DmaMgr_SendRequest0((void*)((u32)&globalCtx->msgCtx.font.unk0[(globalCtx->msgCtx).unk11EF0] + iParm3),
(u32)_nes_font_staticSegmentRomStart + character * 0x80 - 0x1000, 0x80);
void Font_LoadCharNES(GlobalContext* globalCtx, u8 codePointIndex, s32 offset) {
MessageContext* msgCtx = &globalCtx->msgCtx;
Font* font = &msgCtx->font;
DmaMgr_SendRequest0(&font->charBuf[font->unk_11D88][offset],
&_nes_font_staticSegmentRomStart[(codePointIndex - ' ') * FONT_CHAR_TEX_SIZE],
FONT_CHAR_TEX_SIZE);
}
void Kanfont_LoadMessageBoxEnd(Font* font, u16 type) {
// UB to convert pointer to u32
DmaMgr_SendRequest0(&font->unk7800[0][0], type * 0x80 + (u32)_message_staticSegmentRomStart + 0x5000, 0x80);
void Font_LoadMessageBoxEndIcon(Font* font, u16 icon) {
DmaMgr_SendRequest0(&font->iconBuf, &_message_staticSegmentRomStart[5 * 0x1000 + icon * FONT_CHAR_TEX_SIZE],
FONT_CHAR_TEX_SIZE);
}
void Kanfont_LoadOrderedFont(Font* font) {
static char sFontOrdering[] = "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19"
"!\"#$%&\'()*+,-./0123456789:ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"\x00\x0D\x0E\x1A"
"afjmosvwxyz{|}~"
"\x7F\x80\x81\x84\x86\x87\x88\x89\x8A\x8B\x8C";
void Font_LoadOrderedFont(Font* font) {
u32 loadOffset;
s32 codePointIndex = 0;
void* writeLocation;
u8* writeLocation;
while (1) {
writeLocation = &font->unk7800[codePointIndex + 1];
loadOffset = kanfontOrdering[codePointIndex] * 128;
if (kanfontOrdering[codePointIndex] == 0) {
writeLocation = &font->fontBuf[codePointIndex * FONT_CHAR_TEX_SIZE];
loadOffset = sFontOrdering[codePointIndex] * FONT_CHAR_TEX_SIZE;
if (sFontOrdering[codePointIndex] == 0) {
loadOffset = 0;
}
// UB to convert pointer to u32
DmaMgr_SendRequest0(writeLocation, (u32)_nes_font_staticSegmentRomStart + loadOffset, 0x80);
if (kanfontOrdering[codePointIndex] == 140) {
DmaMgr_SendRequest0(writeLocation, (u32)_nes_font_staticSegmentRomStart + loadOffset, FONT_CHAR_TEX_SIZE);
if (sFontOrdering[codePointIndex] == 0x8C) {
break;
}
codePointIndex++;
+1 -1
View File
@@ -132,7 +132,7 @@ void Lights_BindPoint(Lights* lights, LightParams* params, GlobalContext* global
posF.x = params->point.x;
posF.y = params->point.y;
posF.z = params->point.z;
SkinMatrix_Vec3fMtxFMultXYZ(&globalCtx->unk187B0, &posF, &adjustedPos);
SkinMatrix_Vec3fMtxFMultXYZ(&globalCtx->projectionMatrix, &posF, &adjustedPos);
if ((adjustedPos.z > -radiusF) && (600 + radiusF > adjustedPos.z) && (400 > fabsf(adjustedPos.x) - radiusF) &&
(400 > fabsf(adjustedPos.y) - radiusF)) {
light = Lights_FindSlot(lights);
+3 -3
View File
@@ -120,8 +120,8 @@ s32 Room_HandleLoadCallbacks(GlobalContext* globalCtx, RoomContext* roomCtx) {
if (((globalCtx->sceneNum != SCENE_IKANA) || (roomCtx->currRoom.num != 1)) &&
(globalCtx->sceneNum != SCENE_IKNINSIDE)) {
globalCtx->kankyoContext.unkC3 = 0xff;
globalCtx->kankyoContext.unkE0 = 0;
globalCtx->envCtx.unk_C3 = 0xff;
globalCtx->envCtx.unk_E0 = 0;
}
func_800FEAB0();
if (!func_800FE4B8(globalCtx)) {
@@ -153,5 +153,5 @@ void func_8012EBF8(GlobalContext* globalCtx, RoomContext* roomCtx) {
func_8010A33C(globalCtx, roomCtx->currRoom.num);
func_8010A2DC(globalCtx);
}
func_801A3CD8(globalCtx->roomContext.currRoom.echo);
func_801A3CD8(globalCtx->roomCtx.currRoom.echo);
}
+72 -72
View File
@@ -142,7 +142,7 @@ void* func_8012F73C(ObjectContext* objectCtx, s32 iParm2, s16 id) {
return (void*)addr;
}
// Scene Header Command 0x00: Spawn List
// SceneTableEntry Header Command 0x00: Spawn List
void Scene_HeaderCmdSpawnList(GlobalContext* globalCtx, SceneCmd* cmd) {
GlobalContext* globalCtx2 = globalCtx;
s32 loadedCount;
@@ -171,19 +171,19 @@ void Scene_HeaderCmdSpawnList(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->objectCtx.status[globalCtx->objectCtx.num].segment = nextObject;
}
// Scene Header Command 0x01: Actor List
// SceneTableEntry Header Command 0x01: Actor List
void Scene_HeaderCmdActorList(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->sceneNumActorsToLoad = (u16)cmd->actorList.num;
globalCtx->numSetupActors = (u16)cmd->actorList.num;
globalCtx->setupActorList = (ActorEntry*)Lib_SegmentedToVirtual(cmd->actorList.segment);
globalCtx->actorCtx.unkC = (u16)0;
}
// Scene Header Command 0x02: List of cameras for actor cutscenes
// SceneTableEntry Header Command 0x02: List of cameras for actor cutscenes
void Scene_HeaderCmdActorCutsceneCamList(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->unk18858 = (UNK_PTR)Lib_SegmentedToVirtual(cmd->csCameraList.segment);
globalCtx->unk_18858 = (UNK_PTR)Lib_SegmentedToVirtual(cmd->csCameraList.segment);
}
// Scene Header Command 0x03: Collision Header
// SceneTableEntry Header Command 0x03: Collision Header
void Scene_HeaderCmdColHeader(GlobalContext* globalCtx, SceneCmd* cmd) {
CollisionHeader* colHeaderTemp;
CollisionHeader* colHeader;
@@ -208,18 +208,18 @@ void Scene_HeaderCmdColHeader(GlobalContext* globalCtx, SceneCmd* cmd) {
BgCheck_Init(&globalCtx->colCtx, globalCtx, colHeader);
}
// Scene Header Command 0x04: Room List
// SceneTableEntry Header Command 0x04: Room List
void Scene_HeaderCmdRoomList(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->numRooms = cmd->roomList.num;
globalCtx->roomList = (RomFile*)Lib_SegmentedToVirtual(cmd->roomList.segment);
}
// Scene Header Command 0x06: Entrance List
// SceneTableEntry Header Command 0x06: Entrance List
void Scene_HeaderCmdEntranceList(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->setupEntranceList = (EntranceEntry*)Lib_SegmentedToVirtual(cmd->entranceList.segment);
}
// Scene Header Command 0x07: Special Files
// SceneTableEntry Header Command 0x07: Special Files
void Scene_HeaderCmdSpecialFiles(GlobalContext* globalCtx, SceneCmd* cmd) {
static RomFile tatlMessageFiles[2] = {
{ (u32)_elf_message_fieldSegmentRomStart, (u32)_elf_message_fieldSegmentRomEnd },
@@ -233,26 +233,26 @@ void Scene_HeaderCmdSpecialFiles(GlobalContext* globalCtx, SceneCmd* cmd) {
}
if (cmd->specialFiles.cUpElfMsgNum != 0) {
globalCtx->unk18868 = Play_LoadScene(globalCtx, &tatlMessageFiles[cmd->specialFiles.cUpElfMsgNum - 1]);
globalCtx->unk_18868 = Play_LoadScene(globalCtx, &tatlMessageFiles[cmd->specialFiles.cUpElfMsgNum - 1]);
}
}
// Scene Header Command 0x08: Room Behavior
// SceneTableEntry Header Command 0x08: Room Behavior
void Scene_HeaderCmdRoomBehavior(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->roomContext.currRoom.unk3 = cmd->roomBehavior.gpFlag1;
globalCtx->roomContext.currRoom.unk2 = cmd->roomBehavior.gpFlag2 & 0xFF;
globalCtx->roomContext.currRoom.unk5 = (cmd->roomBehavior.gpFlag2 >> 8) & 1;
globalCtx->roomCtx.currRoom.unk3 = cmd->roomBehavior.gpFlag1;
globalCtx->roomCtx.currRoom.unk2 = cmd->roomBehavior.gpFlag2 & 0xFF;
globalCtx->roomCtx.currRoom.unk5 = (cmd->roomBehavior.gpFlag2 >> 8) & 1;
globalCtx->msgCtx.unk12044 = (cmd->roomBehavior.gpFlag2 >> 0xa) & 1;
globalCtx->roomContext.currRoom.enablePosLights = (cmd->roomBehavior.gpFlag2 >> 0xb) & 1;
globalCtx->kankyoContext.unkE2 = (cmd->roomBehavior.gpFlag2 >> 0xc) & 1;
globalCtx->roomCtx.currRoom.enablePosLights = (cmd->roomBehavior.gpFlag2 >> 0xb) & 1;
globalCtx->envCtx.unk_E2 = (cmd->roomBehavior.gpFlag2 >> 0xc) & 1;
}
// Scene Header Command 0x0A: Mesh Header
// SceneTableEntry Header Command 0x0A: Mesh Header
void Scene_HeaderCmdMesh(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->roomContext.currRoom.mesh = (RoomMesh*)Lib_SegmentedToVirtual(cmd->mesh.segment);
globalCtx->roomCtx.currRoom.mesh = (RoomMesh*)Lib_SegmentedToVirtual(cmd->mesh.segment);
}
// Scene Header Command 0x0B: Object List
// SceneTableEntry Header Command 0x0B: Object List
void Scene_HeaderCmdObjectList(GlobalContext* globalCtx, SceneCmd* cmd) {
s32 i, j, k;
ObjectStatus* firstObject;
@@ -303,7 +303,7 @@ void Scene_HeaderCmdObjectList(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->objectCtx.num = i;
}
// Scene Header Command 0x0C: Light List
// SceneTableEntry Header Command 0x0C: Light List
void Scene_HeaderCmdLightList(GlobalContext* globalCtx, SceneCmd* cmd) {
s32 i;
LightInfo* lightInfo = (LightInfo*)Lib_SegmentedToVirtual(cmd->lightList.segment);
@@ -314,28 +314,28 @@ void Scene_HeaderCmdLightList(GlobalContext* globalCtx, SceneCmd* cmd) {
}
}
// Scene Header Command 0x0D: Path List
// SceneTableEntry Header Command 0x0D: Path List
void Scene_HeaderCmdPathList(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->setupPathList = (void*)Lib_SegmentedToVirtual(cmd->pathList.segment);
}
// Scene Header Command 0x0E: Transition Actor List
// SceneTableEntry Header Command 0x0E: Transition Actor List
void Scene_HeaderCmdTransiActorList(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->transitionCtx.nbTransitionActors = cmd->transiActorList.num;
globalCtx->transitionCtx.transitionActorList =
globalCtx->doorCtx.numTransitionActors = cmd->transiActorList.num;
globalCtx->doorCtx.transitionActorList =
(TransitionActorEntry*)Lib_SegmentedToVirtual((void*)cmd->transiActorList.segment);
func_80105818(globalCtx, globalCtx->transitionCtx.nbTransitionActors, globalCtx->transitionCtx.transitionActorList);
func_80105818(globalCtx, globalCtx->doorCtx.numTransitionActors, globalCtx->doorCtx.transitionActorList);
}
// Init function for the transition system.
void Transition_Init(GameState* gamestate, TransitionContext* transitionCtx) {
transitionCtx->nbTransitionActors = 0;
void Door_InitContext(GameState* state, DoorContext* doorCtx) {
doorCtx->numTransitionActors = 0;
}
// Scene Header Command 0x0F: Environment Light Settings List
// SceneTableEntry Header Command 0x0F: Environment Light Settings List
void Scene_HeaderCmdEnvLightSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->kankyoContext.environmentSettingsCount = cmd->lightSettingList.num;
globalCtx->kankyoContext.environmentSettingsList = (void*)Lib_SegmentedToVirtual(cmd->lightSettingList.segment);
globalCtx->envCtx.numLightSettings = cmd->lightSettingList.num;
globalCtx->envCtx.lightSettingsList = (void*)Lib_SegmentedToVirtual(cmd->lightSettingList.segment);
}
/**
@@ -358,28 +358,28 @@ s32 Scene_LoadAreaTextures(GlobalContext* globalCtx, s32 fileIndex) {
u32 size = sceneTextureFiles[fileIndex].vromEnd - vromStart;
if (size != 0) {
globalCtx->roomContext.unk74 = THA_AllocEndAlign16(&globalCtx->state.heap, size);
return DmaMgr_SendRequest0(globalCtx->roomContext.unk74, vromStart, size);
globalCtx->roomCtx.unk74 = THA_AllocEndAlign16(&globalCtx->state.heap, size);
return DmaMgr_SendRequest0(globalCtx->roomCtx.unk74, vromStart, size);
}
// UB: Undefined behaviour to not have a return statement here, but it breaks matching to add one.
}
// Scene Header Command 0x11: Skybox Settings
// SceneTableEntry Header Command 0x11: Skybox Settings
void Scene_HeaderCmdSkyboxSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->unk18874 = cmd->skyboxSettings.skyboxId & 3;
globalCtx->kankyoContext.unk17 = globalCtx->kankyoContext.unk18 = cmd->skyboxSettings.unk5;
globalCtx->kankyoContext.unk1E = cmd->skyboxSettings.unk6;
globalCtx->skyboxId = cmd->skyboxSettings.skyboxId & 3;
globalCtx->envCtx.unk_17 = globalCtx->envCtx.unk_18 = cmd->skyboxSettings.unk5;
globalCtx->envCtx.unk_1E = cmd->skyboxSettings.unk6;
Scene_LoadAreaTextures(globalCtx, cmd->skyboxSettings.data1);
}
// Scene Header Command 0x12: Skybox Disables
// SceneTableEntry Header Command 0x12: Skybox Disables
void Scene_HeaderCmdSkyboxDisables(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->kankyoContext.unk15 = cmd->skyboxDisables.unk4;
globalCtx->kankyoContext.unk16 = cmd->skyboxDisables.unk5;
globalCtx->envCtx.unk_15 = cmd->skyboxDisables.unk4;
globalCtx->envCtx.unk_16 = cmd->skyboxDisables.unk5;
}
// Scene Header Command 0x10: Time Settings
// SceneTableEntry Header Command 0x10: Time Settings
void Scene_HeaderCmdTimeSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
u32 dayTime;
@@ -389,27 +389,27 @@ void Scene_HeaderCmdTimeSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
}
if (cmd->timeSettings.unk6 != 0xFF) {
globalCtx->kankyoContext.unk2 = cmd->timeSettings.unk6;
globalCtx->envCtx.unk_2 = cmd->timeSettings.unk6;
} else {
globalCtx->kankyoContext.unk2 = 0;
globalCtx->envCtx.unk_2 = 0;
}
if ((gSaveContext.inventory.items[0] == 0xFF) && (globalCtx->kankyoContext.unk2 != 0)) {
globalCtx->kankyoContext.unk2 = 5;
if ((gSaveContext.inventory.items[0] == 0xFF) && (globalCtx->envCtx.unk_2 != 0)) {
globalCtx->envCtx.unk_2 = 5;
}
if (gSaveContext.unk_3F58 == 0) {
REG(15) = globalCtx->kankyoContext.unk2;
REG(15) = globalCtx->envCtx.unk_2;
}
dayTime = gSaveContext.time;
globalCtx->kankyoContext.unk4 = -(Math_SinS(dayTime - 0x8000) * 120.0f) * 25.0f;
globalCtx->envCtx.unk_4 = -(Math_SinS(dayTime - 0x8000) * 120.0f) * 25.0f;
dayTime = gSaveContext.time;
globalCtx->kankyoContext.unk8 = (Math_CosS(dayTime - 0x8000) * 120.0f) * 25.0f;
globalCtx->envCtx.unk_8 = (Math_CosS(dayTime - 0x8000) * 120.0f) * 25.0f;
dayTime = gSaveContext.time;
globalCtx->kankyoContext.unkC = (Math_CosS(dayTime - 0x8000) * 20.0f) * 25.0f;
globalCtx->envCtx.unk_C = (Math_CosS(dayTime - 0x8000) * 20.0f) * 25.0f;
if (globalCtx->kankyoContext.unk2 == 0 && gSaveContext.cutscene < 0xFFF0) {
if (globalCtx->envCtx.unk_2 == 0 && gSaveContext.cutscene < 0xFFF0) {
gSaveContext.environmentTime = gSaveContext.time;
if (gSaveContext.environmentTime >= 0x2AAA && gSaveContext.environmentTime < 0x4555) {
@@ -424,43 +424,43 @@ void Scene_HeaderCmdTimeSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
}
}
// Scene Header Command 0x05: Wind Settings
// SceneTableEntry Header Command 0x05: Wind Settings
void Scene_HeaderCmdWindSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
s8 temp1 = cmd->windSettings.west;
s8 temp2 = cmd->windSettings.vertical;
s8 temp3 = cmd->windSettings.south;
globalCtx->kankyoContext.windWest = temp1;
globalCtx->kankyoContext.windVertical = temp2;
globalCtx->kankyoContext.windSouth = temp3;
globalCtx->kankyoContext.windClothIntensity = cmd->windSettings.clothIntensity;
globalCtx->envCtx.windDir.x = temp1;
globalCtx->envCtx.windDir.y = temp2;
globalCtx->envCtx.windDir.z = temp3;
globalCtx->envCtx.windSpeed = cmd->windSettings.clothIntensity;
}
// Scene Header Command 0x13: Exit List
// SceneTableEntry Header Command 0x13: Exit List
void Scene_HeaderCmdExitList(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->setupExitList = (u16*)Lib_SegmentedToVirtual(cmd->exitList.segment);
}
// Scene Header Command 0x09: Undefined
// SceneTableEntry Header Command 0x09: Undefined
void Scene_HeaderCmd09(GlobalContext* globalCtx, SceneCmd* cmd) {
}
// Scene Header Command 0x15: Sound Settings=
// SceneTableEntry Header Command 0x15: Sound Settings=
void Scene_HeaderCmdSoundSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->unk814 = cmd->soundSettings.musicSeq;
globalCtx->unk815 = cmd->soundSettings.nighttimeSFX;
globalCtx->soundCtx.seqIndex = cmd->soundSettings.musicSeq;
globalCtx->soundCtx.nightSeqIndex = cmd->soundSettings.nighttimeSFX;
if (gSaveContext.seqIndex == 0xFF || func_801A8A50(0) == 0x57) {
audio_setBGM(cmd->soundSettings.bgmId);
}
}
// Scene Header Command 0x16: Echo Setting
// SceneTableEntry Header Command 0x16: Echo Setting
void Scene_HeaderCmdEchoSetting(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->roomContext.currRoom.echo = cmd->echoSettings.echo;
globalCtx->roomCtx.currRoom.echo = cmd->echoSettings.echo;
}
// Scene Header Command 0x18: Alternate Header List=
// SceneTableEntry Header Command 0x18: Alternate Header List=
void Scene_HeaderCmdAltHeaderList(GlobalContext* globalCtx, SceneCmd* cmd) {
SceneCmd** altHeaderList;
SceneCmd* altHeader;
@@ -476,34 +476,34 @@ void Scene_HeaderCmdAltHeaderList(GlobalContext* globalCtx, SceneCmd* cmd) {
}
}
// Scene Header Command 0x17: Cutscene List
// SceneTableEntry Header Command 0x17: Cutscene List
void Scene_HeaderCmdCutsceneList(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->csCtx.cutsceneCount = (u8)cmd->base.data1;
globalCtx->cutsceneList = (CutsceneEntry*)Lib_SegmentedToVirtual((void*)cmd->base.data2);
globalCtx->csCtx.sceneCsCount = (u8)cmd->base.data1;
globalCtx->csCtx.sceneCsList = (CutsceneEntry*)Lib_SegmentedToVirtual((void*)cmd->base.data2);
}
// Scene Header Command 0x1B: Actor Cutscene List
// SceneTableEntry Header Command 0x1B: Actor Cutscene List
void Scene_HeaderCmdActorCutsceneList(GlobalContext* globalCtx, SceneCmd* cmd) {
ActorCutscene_Init(globalCtx, (ActorCutscene*)Lib_SegmentedToVirtual(cmd->cutsceneActorList.segment),
cmd->cutsceneActorList.num);
}
// Scene Header Command 0x1C: Mini Maps
// SceneTableEntry Header Command 0x1C: Mini Maps
void Scene_HeaderCmdMiniMap(GlobalContext* globalCtx, SceneCmd* cmd) {
func_80104CF4(globalCtx);
func_8010549C(globalCtx, cmd->minimapSettings.segment);
}
// Scene Header Command 0x1D: Undefined
// SceneTableEntry Header Command 0x1D: Undefined
void Scene_HeaderCmd1D(GlobalContext* globalCtx, SceneCmd* cmd) {
}
// Scene Header Command 0x1E: Minimap Compass Icon Info
// SceneTableEntry Header Command 0x1E: Minimap Compass Icon Info
void Scene_HeaderCmdMiniMapCompassInfo(GlobalContext* globalCtx, SceneCmd* cmd) {
func_8010565C(globalCtx, cmd->minimapChests.num, cmd->minimapChests.segment);
}
// Scene Header Command 0x1A: Sets Area Visited Flag
// SceneTableEntry Header Command 0x1A: Sets Area Visited Flag
void Scene_HeaderCmdSetAreaVisitedFlag(GlobalContext* globalCtx, SceneCmd* cmd) {
s16 j = 0;
s16 i = 0;
@@ -530,7 +530,7 @@ void Scene_HeaderCmdSetAreaVisitedFlag(GlobalContext* globalCtx, SceneCmd* cmd)
}
}
// Scene Header Command 0x1A: Material Animations
// SceneTableEntry Header Command 0x1A: Material Animations
void Scene_HeaderCmdAnimatedMaterials(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->sceneMaterialAnims = (AnimatedMaterial*)Lib_SegmentedToVirtual(cmd->textureAnimations.segment);
}
@@ -539,7 +539,7 @@ void Scene_HeaderCmdAnimatedMaterials(GlobalContext* globalCtx, SceneCmd* cmd) {
* Sets the exit fade from the next entrance index.
*/
void Scene_SetExitFade(GlobalContext* globalCtx) {
globalCtx->unk1887F = Entrance_GetTransitionFlags(globalCtx->nextEntranceIndex) & 0x7F;
globalCtx->unk_1887F = Entrance_GetTransitionFlags(globalCtx->nextEntranceIndex) & 0x7F;
}
/**
+13 -13
View File
@@ -40,7 +40,7 @@ void Scene_ExecuteDrawConfig(GlobalContext* globalCtx) {
}
/**
* Scene Draw Config 0:
* SceneTableEntry Draw Config 0:
* Default scene draw config function. This just executes `sSceneDrawDefaultDL`.
*/
void Scene_DrawConfigDefault(GlobalContext* globalCtx) {
@@ -501,7 +501,7 @@ void AnimatedMat_DrawAlphaStepXlu(GlobalContext* globalCtx, AnimatedMaterial* ma
}
/**
* Scene Draw Config 1:
* SceneTableEntry Draw Config 1:
* Allows the usage of the animated material system in scenes.
*/
void Scene_DrawConfigMatAnim(GlobalContext* globalCtx) {
@@ -509,7 +509,7 @@ void Scene_DrawConfigMatAnim(GlobalContext* globalCtx) {
}
/**
* Scene Draw Config 3:
* SceneTableEntry Draw Config 3:
* This config is unused, although it is identical to the grotto scene config from Ocarina of Time.
*/
void Scene_DrawConfig3(GlobalContext* globalCtx) {
@@ -547,7 +547,7 @@ void Scene_DrawConfig3(GlobalContext* globalCtx) {
}
/**
* Scene Draw Config 4:
* SceneTableEntry Draw Config 4:
* This config is unused and just has a single TwoTexScroll intended for two 32x32 textures (likely two water textures).
* It is identical to the Castle Courtyard and Sacred Forest Meadow scene config from Ocarina of Time.
*/
@@ -572,7 +572,7 @@ void Scene_DrawConfig4(GlobalContext* globalCtx) {
}
/**
* Scene Draw Config 2:
* SceneTableEntry Draw Config 2:
* Has no effect, and is only used in SPOT00 (cutscene scene).
*/
void Scene_DrawConfigDoNothing(GlobalContext* globalCtx) {
@@ -666,27 +666,27 @@ void Scene_SetCullFlag(GlobalContext* globalCtx, s32 index, u32 flags) {
}
/**
* Scene Draw Config 5:
* SceneTableEntry Draw Config 5:
* This config is unused, and its purpose is unknown.
*/
void Scene_DrawConfig5(GlobalContext* globalCtx) {
u32 dListIndex;
u32 alpha;
if (globalCtx->roomContext.unk7A[0] != 0) {
if (globalCtx->roomCtx.unk7A[0] != 0) {
dListIndex = 1;
alpha = globalCtx->roomContext.unk7A[1];
alpha = globalCtx->roomCtx.unk7A[1];
} else {
dListIndex = 0;
alpha = 255;
}
if (alpha == 0) {
globalCtx->roomContext.unk78 = 0;
globalCtx->roomCtx.unk78 = 0;
} else {
OPEN_DISPS(globalCtx->state.gfxCtx);
globalCtx->roomContext.unk78 = 1;
globalCtx->roomCtx.unk78 = 1;
AnimatedMat_Draw(globalCtx, globalCtx->sceneMaterialAnims);
Scene_SetRenderModeXlu(globalCtx, dListIndex, 3);
gDPSetEnvColor(POLY_OPA_DISP++, 255, 255, 255, alpha);
@@ -697,16 +697,16 @@ void Scene_DrawConfig5(GlobalContext* globalCtx) {
}
/**
* Scene Draw Config 7:
* SceneTableEntry Draw Config 7:
* This is a special draw config for Sakon's Hideout, as well as the Music Box House. Its step value is set manually
* rather than always animating like `Scene_DrawConfigMatAnim`.
*/
void Scene_DrawConfigMatAnimManualStep(GlobalContext* globalCtx) {
AnimatedMat_DrawStep(globalCtx, globalCtx->sceneMaterialAnims, globalCtx->roomContext.unk7A[0]);
AnimatedMat_DrawStep(globalCtx, globalCtx->sceneMaterialAnims, globalCtx->roomCtx.unk7A[0]);
}
/**
* Scene Draw Config 6:
* SceneTableEntry Draw Config 6:
* This is a special draw config for Great Bay Temple, which handles both material animations as well as setting the lod
* fraction to a certain value when certain flags are set, which are likely used for the pipes whenever they are
* activated.
+1 -1
View File
@@ -150,7 +150,7 @@ s32 func_8013A530(GlobalContext* globalCtx, Actor* actor, s32 flag, Vec3f* pos,
actors[0] = actor;
actors[1] = &PLAYER->actor;
if (CollisionCheck_LineOCCheck(globalCtx, &globalCtx->colCheckCtx, pos, &camera->eye, actors, 2) != 0) {
if (CollisionCheck_LineOCCheck(globalCtx, &globalCtx->colChkCtx, pos, &camera->eye, actors, 2) != 0) {
func_8013A41C(0x3b);
ret |= 0x3b;
}
+2 -2
View File
@@ -95,7 +95,7 @@ void func_80143324(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skyTy
if (skyType == 1) {
osCreateMesgQueue(&skyboxCtx->loadQueue, &skyboxCtx->loadMsg, 1);
if (globalCtx->kankyoContext.unk10 == 0) {
if (globalCtx->envCtx.unk_10 == 0) {
// Send a DMA request for the clear sky texture
size = (u32)_d2_fine_staticSegmentRomEnd - (u32)_d2_fine_staticSegmentRomStart;
@@ -112,7 +112,7 @@ void func_80143324(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skyTy
osRecvMesg(&skyboxCtx->loadQueue, NULL, 1);
osCreateMesgQueue(&skyboxCtx->loadQueue, &skyboxCtx->loadMsg, 1);
if (globalCtx->kankyoContext.unk11 == 0) {
if (globalCtx->envCtx.unk_11 == 0) {
// Send a DMA request for the clear sky texture
size = (u32)_d2_fine_staticSegmentRomEnd - (u32)_d2_fine_staticSegmentRomStart;
@@ -188,7 +188,7 @@ void BgCtowerGear_UpdateOrgan(Actor* thisx, GlobalContext* globalCtx) {
BgCtowerGear* this = THIS;
if (func_800EE29C(globalCtx, 0x68)) {
switch (globalCtx->csCtx.actorActions[func_800EE200(globalCtx, 0x68)]->unk0) {
switch (globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x68)]->unk0) {
case 1:
this->dyna.actor.draw = NULL;
func_800C62BC(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
@@ -122,7 +122,7 @@ void BgHakaCurtain_Update(Actor* thisx, GlobalContext* globalCtx) {
CsCmdActorAction* actorAction;
if (func_800EE29C(globalCtx, 0x1D5)) {
actorAction = globalCtx->csCtx.actorActions[func_800EE200(globalCtx, 0x1D5)];
actorAction = globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x1D5)];
if (actorAction->startFrame == globalCtx->csCtx.frames && actorAction->unk0 == 2) {
func_80B6DD80(this);
}
@@ -151,7 +151,7 @@ void BgIcicle_Shiver(BgIcicle* this, GlobalContext* globalCtx) {
this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x;
this->dyna.actor.world.pos.z = this->dyna.actor.home.pos.z;
CollisionCheck_SetAT(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
func_800C62BC(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
this->actionFunc = BgIcicle_Fall;
} else {
@@ -188,7 +188,7 @@ void BgIcicle_Fall(BgIcicle* this, GlobalContext* globalCtx) {
this->dyna.actor.world.pos.y += 40.0f;
Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 4);
this->dyna.actor.world.pos.y -= 40.0f;
CollisionCheck_SetAT(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
@@ -240,7 +240,7 @@ void BgIcicle_Update(Actor* thisx, GlobalContext* globalCtx) {
if (this->actionFunc != BgIcicle_Regrow) {
Collider_UpdateCylinder(&this->dyna.actor, &this->collider);
CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
@@ -97,7 +97,7 @@ void BgIkanaRay_SetActivated(BgIkanaRay* this) {
}
void BgIkanaRay_UpdateActivated(BgIkanaRay* this, GlobalContext* globalCtx) {
CollisionCheck_SetAT(globalCtx, &globalCtx->colCheckCtx, &this->collision.base);
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collision.base);
}
void BgIkanaRay_Update(Actor* thisx, GlobalContext* globalCtx) {
@@ -130,7 +130,7 @@ void BgIknvObj_UpdateWaterwheel(BgIknvObj* this, GlobalContext* globalCtx) {
func_800B9010(&this->dyna.actor, NA_SE_EV_WOOD_WATER_WHEEL - SFX_FLAG);
}
if ((globalCtx->csCtx.state != 0) && (gSaveContext.sceneSetupIndex == 1) && (globalCtx->csCtx.unk12 == 4) &&
if ((globalCtx->csCtx.state != 0) && (gSaveContext.sceneSetupIndex == 1) && (globalCtx->csCtx.unk_12 == 4) &&
(globalCtx->csCtx.frames == 0x5D7)) {
func_8019F128(NA_SE_EV_DOOR_UNLOCK);
}
@@ -138,7 +138,7 @@ void BgIknvObj_UpdateWaterwheel(BgIknvObj* this, GlobalContext* globalCtx) {
s32 func_80BD7E0C(BgIknvObj* this, s16 targetRotation, GlobalContext* globalCtx) {
this->dyna.actor.shape.yOffset = 0.0f;
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
if (targetRotation != this->dyna.actor.shape.rot.y) {
Math_SmoothStepToS(&this->dyna.actor.shape.rot.y, targetRotation, 2, 100, 100);
this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y;
@@ -157,7 +157,7 @@ void func_80BD7ED8(BgIknvObj* this, GlobalContext* globalCtx) {
this->actionFunc = BgIknvObj_UpdateSakonDoor;
gSaveContext.weekEventReg[51] &= (u8)~0x10;
}
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
void func_80BD7F4C(BgIknvObj* this, GlobalContext* globalCtx) {
@@ -168,7 +168,7 @@ void func_80BD7F4C(BgIknvObj* this, GlobalContext* globalCtx) {
ActorCutscene_Stop(this->dyna.actor.cutscene);
this->dyna.actor.home.rot.x = 0;
}
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
void func_80BD7FDC(BgIknvObj* this, GlobalContext* globalCtx) {
@@ -183,7 +183,7 @@ void func_80BD8040(BgIknvObj* this, GlobalContext* globalCtx) {
if (func_80BD7CEC(this)) {
this->actionFunc = func_80BD7FDC;
}
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
void BgIknvObj_UpdateSakonDoor(BgIknvObj* this, GlobalContext* globalCtx) {
@@ -191,7 +191,7 @@ void BgIknvObj_UpdateSakonDoor(BgIknvObj* this, GlobalContext* globalCtx) {
this->actionFunc = func_80BD8040;
gSaveContext.weekEventReg[89] |= 0x80;
}
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
void BgIknvObj_UpdateRaisedDoor(BgIknvObj* this, GlobalContext* globalCtx) {
@@ -209,7 +209,7 @@ void BgKin2Fence_HandleMaskCode(BgKin2Fence* this, GlobalContext* globalCtx) {
this->cooldownTimer -= 1;
return;
}
CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
@@ -8,15 +8,9 @@ void BgMarketStep_Init(Actor* thisx, GlobalContext* globalCtx);
void BgMarketStep_Draw(Actor* thisx, GlobalContext* globalCtx);
const ActorInit Bg_Market_Step_InitVars = {
ACTOR_BG_MARKET_STEP,
ACTORCAT_BG,
FLAGS,
OBJECT_MARKET_OBJ,
sizeof(BgMarketStep),
(ActorFunc)BgMarketStep_Init,
(ActorFunc)Actor_Noop,
(ActorFunc)Actor_Noop,
(ActorFunc)BgMarketStep_Draw,
ACTOR_BG_MARKET_STEP, ACTORCAT_BG, FLAGS,
OBJECT_MARKET_OBJ, sizeof(BgMarketStep), (ActorFunc)BgMarketStep_Init,
(ActorFunc)Actor_Noop, (ActorFunc)Actor_Noop, (ActorFunc)BgMarketStep_Draw,
};
static InitChainEntry sInitChain[] = {
+1 -1
View File
@@ -57,7 +57,7 @@ void func_80C1DF18(DmNb* this, GlobalContext* globalCtx) {
}
if (func_800EE29C(globalCtx, 0x232)) {
actionIndex = func_800EE200(globalCtx, 0x232);
actionUnk0 = globalCtx->csCtx.actorActions[actionIndex]->unk0;
actionUnk0 = globalCtx->csCtx.npcActions[actionIndex]->unk0;
if (this->unk1EC != (actionUnk0 & 0xFF)) {
this->unk1EC = actionUnk0;
func_80C1DED0(this, sp2C[actionUnk0]);
@@ -37,8 +37,8 @@ void DmRavine_Init(Actor* thisx, GlobalContext* globalCtx) {
}
this->isActive = false;
globalCtx->roomContext.unk7A[0] = 1;
globalCtx->roomContext.unk7A[1] = 0;
globalCtx->roomCtx.unk7A[0] = 1;
globalCtx->roomCtx.unk7A[1] = 0;
this->state = 0;
Actor_SetScale(&this->actor, 1.0f);
this->actionFunc = DmRavine_DoNothing;
@@ -59,12 +59,12 @@ void DmRavine_Update(Actor* thisx, GlobalContext* globalCtx) {
return;
case DM_RAVINE_STATE_ACTIVE:
this->isActive = true;
globalCtx->roomContext.unk7A[1]++;
if (globalCtx->roomContext.unk7A[1] > 254) {
globalCtx->roomContext.unk7A[1] = 254;
globalCtx->roomCtx.unk7A[1]++;
if (globalCtx->roomCtx.unk7A[1] > 254) {
globalCtx->roomCtx.unk7A[1] = 254;
if (globalCtx->csCtx.frames > 700) {
globalCtx->roomContext.unk7A[1] = 255;
globalCtx->roomContext.unk7A[0] = 0;
globalCtx->roomCtx.unk7A[1] = 255;
globalCtx->roomCtx.unk7A[0] = 0;
this->state++; // -> DM_RAVINE_STATE_PENDING_DEATH
}
}
@@ -104,7 +104,7 @@ void DoorAna_WaitClosed(DoorAna* this, GlobalContext* globalCtx) {
} else {
Collider_UpdateCylinder(&this->actor, &this->bombCollider);
CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->bombCollider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->bombCollider.base);
}
}
@@ -125,7 +125,7 @@ void DoorAna_WaitOpen(DoorAna* this, GlobalContext* globalCtx) {
f32 yDist;
if (Math_StepToF(&this->actor.scale.x, 0.01f, 0.001f) != 0) {
if ((this->actor.targetMode != 0) && (globalCtx->unk18875 == 0) && (globalCtx->unk18B4A == 0) &&
if ((this->actor.targetMode != 0) && (globalCtx->sceneLoadFlag == 0) && (globalCtx->unk_18B4A == 0) &&
(player->stateFlags1 & 0x80000000) && (player->unk_AE7 == 0)) {
if (dooranaType == DOORANA_TYPE_ADJACENT) {
@@ -119,7 +119,7 @@ s32 DoorSpiral_SetSpiralType(DoorSpiral* this, GlobalContext* globalCtx) {
this->spiralType = doorObjectInfo->spiralType;
if ((this->spiralType == SPIRAL_DAMPES_HOUSE) ||
((this->spiralType == SPIRAL_WOODFALL_TEMPLE) && globalCtx->roomContext.currRoom.enablePosLights)) {
((this->spiralType == SPIRAL_WOODFALL_TEMPLE) && globalCtx->roomCtx.currRoom.enablePosLights)) {
if (this->spiralType == SPIRAL_WOODFALL_TEMPLE) {
this->spiralType = SPIRAL_WOODFALL_TEMPLE_ALT;
}
@@ -181,7 +181,7 @@ void DoorSpiral_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 transition = GET_TRANSITION_ID_PARAM(thisx);
s8 objBankId;
if (this->actor.room != globalCtx->transitionCtx.transitionActorList[transition].sides[0].room) {
if (this->actor.room != globalCtx->doorCtx.transitionActorList[transition].sides[0].room) {
Actor_MarkForDeath(&this->actor);
return;
}
@@ -205,7 +205,7 @@ void DoorSpiral_Init(Actor* thisx, GlobalContext* globalCtx) {
void DoorSpiral_Destroy(Actor* thisx, GlobalContext* globalCtx) {
s32 transition = GET_TRANSITION_ID_PARAM(thisx);
globalCtx->transitionCtx.transitionActorList[transition].id *= -1;
globalCtx->doorCtx.transitionActorList[transition].id *= -1;
}
/**
@@ -283,7 +283,7 @@ void DoorSpiral_Wait(DoorSpiral* this, GlobalContext* globalCtx) {
player->doorDirection = this->orientation;
player->doorActor = &this->actor;
transition = GET_TRANSITION_ID_PARAM(this);
player->doorNext = ((u16)globalCtx->transitionCtx.transitionActorList[transition].params) >> 10;
player->doorNext = ((u16)globalCtx->doorCtx.transitionActorList[transition].params) >> 10;
func_80122F28(player, globalCtx, &this->actor);
}
@@ -290,7 +290,7 @@ void func_80919768(Actor* thisx, GlobalContext* globalCtx2) {
initialPositions->z * ((this->dz * aux) + (1.0f - this->dz)), MTXMODE_APPLY);
Matrix_Scale(this->scalingFactor, this->scalingFactor, this->scalingFactor, 1);
SysMatrix_NormalizeXYZ(&globalCtx->unk187FC);
SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@@ -347,7 +347,7 @@ void func_809199FC(Actor* thisx, GlobalContext* globalCtx2) {
Matrix_Scale(*distanceTraveled * this->scalingFactor, *distanceTraveled * this->scalingFactor,
*distanceTraveled * this->scalingFactor, MTXMODE_APPLY);
SysMatrix_NormalizeXYZ(&globalCtx->unk187FC);
SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPClearGeometryMode(POLY_XLU_DISP++, G_FOG | G_LIGHTING);
+2 -2
View File
@@ -107,10 +107,10 @@ void EnCha_Update(Actor* thisx, GlobalContext* globalCtx) {
EnCha* this = THIS;
GlobalContext* globalCtx2 = globalCtx;
CollisionCheck_SetOC(globalCtx, &globalCtx2->colCheckCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx2->colChkCtx, &this->collider.base);
this->actionFunc(this, globalCtx);
if ((this->actor.shape.rot.z >= -0x1F3F) && (this->actor.shape.rot.z < 0x1F40)) {
CollisionCheck_SetAC(globalCtx, &globalCtx2->colCheckCtx, &this->collider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx2->colChkCtx, &this->collider.base);
}
}
@@ -161,8 +161,8 @@ void EnEncount2_Update(Actor* thisx, GlobalContext* globalCtx) {
if (!this->isPopped) {
Collider_UpdateSpheresElement(&this->collider, 0, &this->dyna.actor);
CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
+4 -4
View File
@@ -109,8 +109,8 @@ void func_80A2D348(EnFg* this, GlobalContext* globalCtx) {
this->collider.dim.pos.x = this->actor.world.pos.x;
this->collider.dim.pos.y = this->actor.world.pos.y;
this->collider.dim.pos.z = this->actor.world.pos.z;
CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
@@ -361,7 +361,7 @@ void EnFg_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec
if ((limbIndex == 7) || (limbIndex == 8)) {
OPEN_DISPS(globalCtx->state.gfxCtx);
SysMatrix_StatePush();
SysMatrix_NormalizeXYZ(&globalCtx->unk187FC);
SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, *dList);
SysMatrix_StatePop();
@@ -455,7 +455,7 @@ void EnFg_DrawDust(GlobalContext* globalCtx, EnFgEffectDust* dustEffect) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, alpha);
gDPPipeSync(POLY_XLU_DISP++);
SysMatrix_InsertTranslation(dustEffect->pos.x, dustEffect->pos.y, dustEffect->pos.z, MTXMODE_NEW);
SysMatrix_NormalizeXYZ(&globalCtx->unk187FC);
SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC);
Matrix_Scale(dustEffect->xyScale, dustEffect->xyScale, 1.0f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@@ -667,11 +667,11 @@ void EnFirefly_Update(Actor* thisx, GlobalContext* globalCtx2) {
this->collider.dim.worldSphere.center.z = this->actor.world.pos.z;
if ((this->actionFunc == EnFirefly_DiveAttack) || (this->actionFunc == EnFirefly_DisturbDiveAttack)) {
CollisionCheck_SetAT(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
if (this->actor.colChkInfo.health != 0) {
CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
this->actor.world.rot.y = this->actor.shape.rot.y;
if (func_801378B8(&this->skelAnime, 5.0f)) {
@@ -679,7 +679,7 @@ void EnFirefly_Update(Actor* thisx, GlobalContext* globalCtx2) {
}
}
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
if (this->unk_2E8.x > 0.0f) {
if (this->unk_18F != 0xA) {
+5 -5
View File
@@ -211,7 +211,7 @@ void func_808F32A0(EnIn* this, GlobalContext* globalCtx) {
this->colliderCylinder.dim.pos.y = this->actor.world.pos.y;
this->colliderCylinder.dim.pos.z = this->actor.world.pos.z;
if (this->unk23D == 0) {
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->colliderCylinder.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderCylinder.base);
}
}
@@ -831,8 +831,8 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
SET_FLAGS_START_RACE;
func_800FD750(0x40);
globalCtx->nextEntranceIndex = 0xCE50;
globalCtx->unk1887F = 5;
globalCtx->unk18875 = 0x14;
globalCtx->unk_1887F = 5;
globalCtx->sceneLoadFlag = 0x14;
gSaveContext.weekEventReg[57] |= 1;
break;
case 0x3478:
@@ -1078,8 +1078,8 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
SET_FLAGS_START_RACE;
func_800FD750(0x40);
globalCtx->nextEntranceIndex = 0xCE50;
globalCtx->unk1887F = 5;
globalCtx->unk18875 = 0x14;
globalCtx->unk_1887F = 5;
globalCtx->sceneLoadFlag = 0x14;
gSaveContext.weekEventReg[57] |= 1;
break;
case 0x349D:
@@ -63,12 +63,12 @@ s32 EnJcMato_CheckForHit(EnJcMato* this, GlobalContext* globalCtx) {
if ((this->collider.base.acFlags & AC_HIT) && !this->hitFlag && (this->actor.colChkInfo.damageEffect == 0xF)) {
this->collider.base.acFlags &= ~AC_HIT;
Audio_PlayActorSound2(&this->actor, NA_SE_SY_TRE_BOX_APPEAR);
globalCtx->interfaceCtx.unk25C = 1;
globalCtx->interfaceCtx.unk_25C = 1;
this->hitFlag = 1;
return 1;
} else {
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
return 0;
}
}
@@ -65,6 +65,6 @@ void EnMFire1_Update(Actor* thisx, GlobalContext* globalCtx) {
Actor_MarkForDeath(&this->actor);
} else {
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetAT(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
@@ -404,11 +404,11 @@ void EnMaYts_EndCreditsHandler(EnMaYts* this, GlobalContext* globalCtx) {
if (func_800EE29C(globalCtx, 0x78) != 0) {
actionIndex = func_800EE200(globalCtx, 0x78);
if (globalCtx->csCtx.frames == globalCtx->csCtx.actorActions[actionIndex]->startFrame) {
if (globalCtx->csCtx.actorActions[actionIndex]->unk0 != D_80B8E32C) {
D_80B8E32C = globalCtx->csCtx.actorActions[actionIndex]->unk0;
if (globalCtx->csCtx.frames == globalCtx->csCtx.npcActions[actionIndex]->startFrame) {
if (globalCtx->csCtx.npcActions[actionIndex]->unk0 != D_80B8E32C) {
D_80B8E32C = globalCtx->csCtx.npcActions[actionIndex]->unk0;
this->endCreditsFlag = 0;
switch (globalCtx->csCtx.actorActions[actionIndex]->unk0) {
switch (globalCtx->csCtx.npcActions[actionIndex]->unk0) {
case 1:
this->hasBow = true;
EnMaYts_ChangeAnim(this, 0);
@@ -515,7 +515,7 @@ void EnMaYts_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc(this, globalCtx);
collider = &this->collider;
Collider_UpdateCylinder(&this->actor, collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &collider->base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &collider->base);
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
EnMaYts_UpdateEyes(this);
func_80B8D12C(this, globalCtx);
@@ -416,7 +416,7 @@ void EnMinifrog_NextFrogReturned(EnMinifrog* this, GlobalContext* globalCtx) {
this->actionFunc = EnMinifrog_ContinueChoirCutscene;
this->flags &= ~(0x2 << MINIFROG_YELLOW | 0x2 << MINIFROG_CYAN | 0x2 << MINIFROG_PINK | 0x2 << MINIFROG_BLUE |
0x2 << MINIFROG_WHITE);
globalCtx->func_18798(globalCtx, &D_0400DEA8, 0);
globalCtx->setPlayerTalkAnim(globalCtx, &D_0400DEA8, 0);
}
}
@@ -447,7 +447,7 @@ void EnMinifrog_SetupNextFrogChoir(EnMinifrog* this, GlobalContext* globalCtx) {
this->flags &= ~0x100;
this->flags &= ~(0x2 << MINIFROG_YELLOW | 0x2 << MINIFROG_CYAN | 0x2 << MINIFROG_PINK | 0x2 << MINIFROG_BLUE |
0x2 << MINIFROG_WHITE);
globalCtx->func_18798(globalCtx, &D_0400DEA8, 0);
globalCtx->setPlayerTalkAnim(globalCtx, &D_0400DEA8, 0);
} else if (this->timer <= 0) {
this->actionFunc = EnMinifrog_NextFrogReturned;
this->timer = 30;
@@ -467,7 +467,7 @@ void EnMinifrog_BeginChoirCutscene(EnMinifrog* this, GlobalContext* globalCtx) {
this->timer = 5;
func_801A1F00(3, 0x5A);
this->flags |= 0x100;
globalCtx->func_18798(globalCtx, &D_0400E2A8, 0);
globalCtx->setPlayerTalkAnim(globalCtx, &D_0400E2A8, 0);
} else {
ActorCutscene_SetIntentToPlay(this->actor.cutscene);
}
@@ -593,7 +593,7 @@ void EnMinifrog_Update(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor);
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 25.0f, 12.0f, 0.0f, 0x1D);
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
this->actor.focus.rot.y = this->actor.shape.rot.y;
}
@@ -625,7 +625,7 @@ void EnMinifrog_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLis
if ((limbIndex == 7) || (limbIndex == 8)) {
OPEN_DISPS(globalCtx->state.gfxCtx);
SysMatrix_NormalizeXYZ(&globalCtx->unk187FC);
SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, *dList);
CLOSE_DISPS(globalCtx->state.gfxCtx);
+10 -8
View File
@@ -1,8 +1,8 @@
/*
* File: z_en_niw.c
/*
* File: z_en_niw.c
* Overlay: ovl_En_Niw
* Description: Cucco (Chicken) (Japanese: Niwatori)
*/
*/
#include "z_en_niw.h"
@@ -451,7 +451,8 @@ void EnNiw_Held(EnNiw* this, GlobalContext* globalCtx) {
this->actor.shape.rot.y = rotZ;
this->actor.shape.rot.x = rotZ;
}
} else if (this->unk2BC.z != 0.0f) { this->actor.shape.rot.z = 0;
} else if (this->unk2BC.z != 0.0f) {
this->actor.shape.rot.z = 0;
rotZ = this->actor.shape.rot.z;
this->actor.velocity.y = 8.0f;
this->actor.speedXZ = 4.0f;
@@ -915,12 +916,12 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx) {
if (!this->isStormActive) {
if (this->niwType == ENNIW_TYPE_REGULAR) {
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
if (globalCtx) {}
if ((this->unknownState28E != 4) && (this->unknownState28E != 5)) {
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
}
@@ -1038,8 +1039,9 @@ void func_808932B0(EnNiw* this, GlobalContext* globalCtx) {
flag++;
}
SysMatrix_InsertTranslation(this->feathers[i].pos.x, this->feathers[i].pos.y, this->feathers[i].pos.z, MTXMODE_NEW);
SysMatrix_NormalizeXYZ(&globalCtx->unk187FC);
SysMatrix_InsertTranslation(this->feathers[i].pos.x, this->feathers[i].pos.y, this->feathers[i].pos.z,
MTXMODE_NEW);
SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC);
Matrix_Scale(this->feathers[i].scale, this->feathers[i].scale, 1.0f, MTXMODE_APPLY);
SysMatrix_InsertZRotation_f(this->feathers[i].zRot, MTXMODE_APPLY);
SysMatrix_InsertTranslation(0.0f, -1000.0f, 0.0f, MTXMODE_APPLY);
+1 -1
View File
@@ -95,7 +95,7 @@ void EnNnh_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc(this, globalCtx);
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
void EnNnh_Draw(Actor* thisx, GlobalContext* globalCtx) {
@@ -150,11 +150,11 @@ void EnNutsball_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actor.flags |= 0x1000000;
CollisionCheck_SetAT(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
if (this->timer < this->timerThreshold) {
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
}
@@ -164,7 +164,7 @@ void EnNutsball_Draw(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx)
func_8012C28C(globalCtx->state.gfxCtx);
SysMatrix_InsertMatrix(&globalCtx->unk187FC, 1);
SysMatrix_InsertMatrix(&globalCtx->mf_187FC, 1);
SysMatrix_InsertZRotation_s(this->actor.home.rot.z, 1);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, D_04058BA0);
@@ -34,7 +34,7 @@ void EnOkarinaEffect_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void EnOkarinaEffect_Init(Actor* thisx, GlobalContext* globalCtx) {
EnOkarinaEffect* this = THIS;
if (globalCtx->kankyoContext.unkF2[1]) {
if (globalCtx->envCtx.unk_F2[1]) {
Actor_MarkForDeath(&this->actor);
}
EnOkarinaEffect_SetupAction(this, func_8096B104);
@@ -42,26 +42,26 @@ void EnOkarinaEffect_Init(Actor* thisx, GlobalContext* globalCtx) {
void func_8096B104(EnOkarinaEffect* this, GlobalContext* globalCtx) {
this->unk144 = 0x50;
globalCtx->kankyoContext.unkF2[4] = 0x3C;
globalCtx->envCtx.unk_F2[4] = 0x3C;
D_801F4E70 = 501.0f;
globalCtx->kankyoContext.unkE3 = 2;
globalCtx->envCtx.unk_E3 = 2;
func_800FD78C(globalCtx);
EnOkarinaEffect_SetupAction(this, func_8096B174);
}
void func_8096B174(EnOkarinaEffect* this, GlobalContext* globalCtx) {
DECR(this->unk144);
if (!globalCtx->pauseCtx.unk1EC && !globalCtx->unk17000 && !globalCtx->msgCtx.unk11F10 &&
if (!globalCtx->pauseCtx.state && !globalCtx->gameOverCtx.state && !globalCtx->msgCtx.unk11F10 &&
!FrameAdvance_IsEnabled(globalCtx) && this->unk144 == 0) {
EnOkarinaEffect_SetupAction(this, func_8096B1FC);
}
}
void func_8096B1FC(EnOkarinaEffect* this, GlobalContext* globalCtx) {
if (globalCtx->kankyoContext.unkF2[4]) {
if (globalCtx->envCtx.unk_F2[4]) {
if ((globalCtx->state.frames & 3) == 0) {
--globalCtx->kankyoContext.unkF2[4];
if (globalCtx->kankyoContext.unkF2[4] == 8) {
--globalCtx->envCtx.unk_F2[4];
if (globalCtx->envCtx.unk_F2[4] == 8) {
func_800FD858(globalCtx);
}
}
@@ -171,7 +171,7 @@ void EnPametfrog_Init(Actor* thisx, GlobalContext* globalCtx) {
this->transitionDrawTable, 24);
Collider_InitAndSetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colElement);
this->params = CLAMP(this->actor.params, 1, 4);
if (Actor_GetRoomCleared(globalCtx, globalCtx->roomContext.currRoom.num)) {
if (Actor_GetRoomCleared(globalCtx, globalCtx->roomCtx.currRoom.num)) {
Actor_MarkForDeath(&this->actor);
if (!(gSaveContext.weekEventReg[isFrogReturnedFlags[this->actor.params - 1] >> 8] &
(u8)isFrogReturnedFlags[this->actor.params - 1])) {
@@ -944,7 +944,7 @@ void EnPametfrog_SetupSpawnFrog(EnPametfrog* this, GlobalContext* globalCtx) {
this->collider.base.ocFlags1 &= ~OC1_ON;
func_800B0DE0(globalCtx, &vec1, &D_801D15B0, &D_801D15B0, &primColor, &envColor, 800, 50);
func_800F0568(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_NPC_APPEAR);
Actor_SetRoomClearedTemp(globalCtx, globalCtx->roomContext.currRoom.num);
Actor_SetRoomClearedTemp(globalCtx, globalCtx->roomCtx.currRoom.num);
for (i = 0; i < 25; i++) {
vel.x = randPlusMinusPoint5Scaled(5.0f);
@@ -1324,15 +1324,15 @@ void EnPametfrog_Update(Actor* thisx, GlobalContext* globalCtx) {
}
if (this->collider.base.atFlags & AT_ON) {
CollisionCheck_SetAT(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
if (this->collider.base.acFlags & AC_ON) {
CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
if (this->collider.base.ocFlags1 & OC1_ON) {
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
if (this->unk_2C4 > 0.0f) {
@@ -146,8 +146,8 @@ u16 EnPoFusen_CheckCollision(EnPoFusen* this, GlobalContext* globalCtx) {
return 1;
}
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
return 0;
}
+2 -2
View File
@@ -350,9 +350,9 @@ void EnSb_Update(Actor* thisx, GlobalContext* globalCtx) {
if (player->stateFlags1 & 0x8000000) {
Collider_UpdateCylinder(&this->actor, &this->collider);
if (this->vulnerableTimer == 0) {
CollisionCheck_SetAT(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
}
@@ -120,7 +120,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx) {
} else {
// Once the player has moved away, update collision and become opaque
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
targetAlpha = 255;
}
Math_StepToS(&this->alpha, targetAlpha, 8);
+3 -3
View File
@@ -705,7 +705,7 @@ s32 func_80BA4C44(EnToto* this, GlobalContext* globalCtx) {
void func_80BA4CB4(EnToto* this, GlobalContext* globalCtx) {
CsCmdActorAction* action;
action = globalCtx->csCtx.actorActions[func_800EE200(globalCtx, 0x20D)];
action = globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x20D)];
if (this->unk2B5 != action->unk0) {
this->unk2B5 = action->unk0;
if (this->unk2B5 != 4) {
@@ -743,8 +743,8 @@ void EnToto_Update(Actor* thisx, GlobalContext* globalCtx) {
Collider_ResetCylinderAC(globalCtx, &this->collider.base);
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
Actor_SetHeight(&this->actor, 40.0f);
}
@@ -326,8 +326,8 @@ void EnTuboTrap_Update(Actor* thisx, GlobalContext* globalCtx) {
}
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAT(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
void EnTuboTrap_Draw(Actor* thisx, GlobalContext* globalCtx) {
@@ -129,7 +129,7 @@ void EnWarpUzu_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actor.uncullZoneForward = 1000.0f;
this->actionFunc(this, globalCtx);
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
void EnWarpUzu_Draw(Actor* thisx, GlobalContext* globalCtx) {
@@ -89,9 +89,9 @@ void EnWeatherTag_Init(Actor* thisx, GlobalContext* globalCtx) {
break;
case WEATHERTAG_TYPE_UNK5:
func_800BC154(globalCtx, &globalCtx->actorCtx, &this->actor, 7);
globalCtx->unk18874 = 3;
globalCtx->kankyoContext.unk1F = 5;
globalCtx->kankyoContext.unk20 = 5;
globalCtx->skyboxId = 3;
globalCtx->envCtx.unk_1F = 5;
globalCtx->envCtx.unk_20 = 5;
D_801F4E74 = 1.0f;
EnWeatherTag_SetupAction(this, func_80966BF4);
break;
@@ -115,20 +115,20 @@ u8 func_80966608(EnWeatherTag* this, GlobalContext* globalCtx, UNK_TYPE a3, UNK_
u8 returnVal = 0;
if (WEATHER_TAG_RANGE100(this) > Actor_XZDistanceBetweenActors(&player->actor, &this->actor)) {
if (globalCtx->kankyoContext.unk1F == globalCtx->kankyoContext.unk20) {
if (globalCtx->envCtx.unk_1F == globalCtx->envCtx.unk_20) {
D_801BDBB8 = 1;
if (!(globalCtx->kankyoContext.unk1E == 0) ||
((globalCtx->kankyoContext.unk1F != 1) && (globalCtx->kankyoContext.unk21 == 0))) {
if (!(globalCtx->envCtx.unk_1E == 0) ||
((globalCtx->envCtx.unk_1F != 1) && (globalCtx->envCtx.unk_21 == 0))) {
D_801BDBB8 = 0;
if (D_801BDBB0 != weatherMode) {
D_801BDBB0 = weatherMode;
globalCtx->kankyoContext.unk21 = 1;
globalCtx->kankyoContext.unk1F = new1F;
globalCtx->kankyoContext.unk20 = new20;
globalCtx->envCtx.unk_21 = 1;
globalCtx->envCtx.unk_1F = new1F;
globalCtx->envCtx.unk_20 = new20;
D_801BDBB4 = new20;
globalCtx->kankyoContext.unk24 = new24;
globalCtx->kankyoContext.unk22 = globalCtx->kankyoContext.unk24;
globalCtx->envCtx.unk_24 = new24;
globalCtx->envCtx.unk_22 = globalCtx->envCtx.unk_24;
}
returnVal = 1;
}
@@ -145,19 +145,19 @@ u8 func_80966758(EnWeatherTag* this, GlobalContext* globalCtx, UNK_TYPE a3, UNK_
u8 returnVal = 0;
if (WEATHER_TAG_RANGE100(this) < Actor_XZDistanceBetweenActors(&player->actor, &this->actor)) {
if (globalCtx->kankyoContext.unk1F == globalCtx->kankyoContext.unk20) {
if (globalCtx->envCtx.unk_1F == globalCtx->envCtx.unk_20) {
D_801BDBB8 = 1;
if (!(globalCtx->kankyoContext.unk1E == 0) ||
((globalCtx->kankyoContext.unk1F != 1) && (globalCtx->kankyoContext.unk21 == 0))) {
if (!(globalCtx->envCtx.unk_1E == 0) ||
((globalCtx->envCtx.unk_1F != 1) && (globalCtx->envCtx.unk_21 == 0))) {
D_801BDBB8 = 0;
D_801BDBB0 = 0;
globalCtx->kankyoContext.unk21 = 1;
globalCtx->kankyoContext.unk1F = new1F;
globalCtx->kankyoContext.unk20 = new20;
globalCtx->envCtx.unk_21 = 1;
globalCtx->envCtx.unk_1F = new1F;
globalCtx->envCtx.unk_20 = new20;
D_801BDBB4 = new20;
globalCtx->kankyoContext.unk24 = new24;
globalCtx->kankyoContext.unk22 = globalCtx->kankyoContext.unk24;
globalCtx->envCtx.unk_24 = new24;
globalCtx->envCtx.unk_22 = globalCtx->envCtx.unk_24;
returnVal = 1;
}
}
@@ -184,13 +184,13 @@ void func_8096689C(EnWeatherTag* this, GlobalContext* globalCtx) {
partialResult = (1.0f - (distance / this->fadeDistance)); // strength based on distance?
partialResult = (this->unk154 / 32768.0f) * partialResult; // another scale applied
globalCtx->kankyoContext.windClothIntensity = (this->actor.world.rot.z * partialResult) + 30.0f;
globalCtx->envCtx.windSpeed = (this->actor.world.rot.z * partialResult) + 30.0f;
if (partialResult > 0.01f) {
globalCtx->kankyoContext.unkEA = 8;
globalCtx->envCtx.unk_EA = 8;
D_801F4E30 = 0x9B;
} else if (globalCtx->kankyoContext.unkEA == 8) {
} else if (globalCtx->envCtx.unk_EA == 8) {
D_801F4E30 = 0;
globalCtx->kankyoContext.unkEA = 9;
globalCtx->envCtx.unk_EA = 9;
}
}
@@ -228,11 +228,11 @@ void EnWeatherTag_Die(EnWeatherTag* this, GlobalContext* globalCtx) {
// poisoned swamp: placed behind the water fall from ikana
// this tag stops spawning after STT cleared?
void func_80966B08(EnWeatherTag* this, GlobalContext* globalCtx) {
if (func_80966608(this, globalCtx, 0, 0, globalCtx->kankyoContext.unk1F, 5, 100, 2) || D_801BDBB0 == 2) {
globalCtx->unk18874 = 3;
if (func_80966608(this, globalCtx, 0, 0, globalCtx->envCtx.unk_1F, 5, 100, 2) || D_801BDBB0 == 2) {
globalCtx->skyboxId = 3;
EnWeatherTag_SetupAction(this, func_80966D20);
} else if (D_801F4E74 <= 0.01f) {
globalCtx->unk18874 = 1;
globalCtx->skyboxId = 1;
} else {
Math_SmoothStepToF(&D_801F4E74, 0.0f, 0.2f, 0.02f, 0.001f);
}
@@ -245,7 +245,7 @@ void func_80966BF4(EnWeatherTag* this, GlobalContext* globalCtx) {
CsCmdActorAction* tmpAction;
if (func_800EE29C(globalCtx, 0x237) != 0) {
tmpAction = globalCtx->csCtx.actorActions[func_800EE200(globalCtx, 0x237)];
tmpAction = globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x237)];
if ((globalCtx->csCtx.frames >= tmpAction->startFrame) && (tmpAction->unk0 >= 2)) {
switch (gSaveContext.day) {
case 0:
@@ -263,11 +263,11 @@ void func_80966BF4(EnWeatherTag* this, GlobalContext* globalCtx) {
Math_SmoothStepToF(&D_801F4E74, 0.0f, 0.2f, 0.02f, 0.001f);
if (globalCtx->kankyoContext.unk20 != newUnk20) {
globalCtx->kankyoContext.unk21 = 1;
globalCtx->kankyoContext.unk20 = newUnk20;
globalCtx->kankyoContext.unk24 = 100;
globalCtx->kankyoContext.unk22 = globalCtx->kankyoContext.unk24;
if (globalCtx->envCtx.unk_20 != newUnk20) {
globalCtx->envCtx.unk_21 = 1;
globalCtx->envCtx.unk_20 = newUnk20;
globalCtx->envCtx.unk_24 = 100;
globalCtx->envCtx.unk_22 = globalCtx->envCtx.unk_24;
}
}
}
@@ -306,7 +306,7 @@ void func_80966D20(EnWeatherTag* this, GlobalContext* globalCtx) {
// path to goron village winter, winter mountain village
void func_80966E0C(EnWeatherTag* this, GlobalContext* globalCtx) {
if (func_80966608(this, globalCtx, 0, 1, 0, 2, 60, 3)) {
globalCtx->kankyoContext.unkF2[3] = 0x80;
globalCtx->envCtx.unk_F2[3] = 0x80;
EnWeatherTag_SetupAction(this, func_80966E84);
}
}
@@ -314,7 +314,7 @@ void func_80966E0C(EnWeatherTag* this, GlobalContext* globalCtx) {
// WEATHERTAG_TYPE_WINTERFOG 2
void func_80966E84(EnWeatherTag* this, GlobalContext* globalCtx) {
if (func_80966758(this, globalCtx, 1, 0, 2, 0, 60)) {
globalCtx->kankyoContext.unkF2[3] = 0;
globalCtx->envCtx.unk_F2[3] = 0;
EnWeatherTag_SetupAction(this, func_80966E0C);
}
}
@@ -325,7 +325,7 @@ void func_80966E84(EnWeatherTag* this, GlobalContext* globalCtx) {
void func_80966EF0(EnWeatherTag* this, GlobalContext* globalCtx) {
if (func_80966608(this, globalCtx, 0, 1, 0, 2, 100, 4)) {
func_800FD78C(globalCtx);
globalCtx->kankyoContext.unkF2[0] = 60;
globalCtx->envCtx.unk_F2[0] = 60;
EnWeatherTag_SetupAction(this, func_80966F74);
}
}
@@ -334,7 +334,7 @@ void func_80966EF0(EnWeatherTag* this, GlobalContext* globalCtx) {
void func_80966F74(EnWeatherTag* this, GlobalContext* globalCtx) {
if (func_80966758(this, globalCtx, 1, 0, 2, 0, 100)) {
func_800FD858(globalCtx);
globalCtx->kankyoContext.unkF2[0] = 0;
globalCtx->envCtx.unk_F2[0] = 0;
EnWeatherTag_SetupAction(this, func_80966EF0);
}
}
@@ -399,8 +399,8 @@ void EnWeatherTag_DoNothing(EnWeatherTag* this, GlobalContext* globalCtx) {
void EnWeatherTag_Unused_809671B8(EnWeatherTag* this, GlobalContext* globalCtx) {
if (func_80966608(this, globalCtx, 0, 1, 0, 4, 100, 5)) {
func_800FD78C(globalCtx);
globalCtx->kankyoContext.unkE3 = 1;
globalCtx->kankyoContext.unkF2[0] = 60;
globalCtx->envCtx.unk_E3 = 1;
globalCtx->envCtx.unk_F2[0] = 60;
EnWeatherTag_SetupAction(this, EnWeatherTag_Unused_80967250);
}
}
@@ -409,8 +409,8 @@ void EnWeatherTag_Unused_809671B8(EnWeatherTag* this, GlobalContext* globalCtx)
void EnWeatherTag_Unused_80967250(EnWeatherTag* this, GlobalContext* globalCtx) {
if (func_80966758(this, globalCtx, 1, 0, 4, 0, 100)) {
func_800FD858(globalCtx);
globalCtx->kankyoContext.unkE3 = 2;
globalCtx->kankyoContext.unkF2[0] = 0;
globalCtx->envCtx.unk_E3 = 2;
globalCtx->envCtx.unk_F2[0] = 0;
EnWeatherTag_SetupAction(this, EnWeatherTag_Unused_809671B8);
}
}
@@ -437,20 +437,20 @@ void func_809672DC(EnWeatherTag* this, GlobalContext* globalCtx) {
range = WEATHER_TAG_RANGE100(this);
if (distance < range) {
globalCtx->kankyoContext.unkEA = 6;
globalCtx->envCtx.unk_EA = 6;
strength = 1.0f - (distance / range);
if (0.8f < strength) {
strength = 1.0f;
}
D_801F4E30 = (200.0f * strength);
} else {
if (globalCtx->kankyoContext.unkEA == 6) {
if (globalCtx->envCtx.unk_EA == 6) {
D_801F4E30 = 0;
globalCtx->kankyoContext.unkEA = 7;
globalCtx->envCtx.unk_EA = 7;
}
}
Math_SmoothStepToS(&globalCtx->kankyoContext.unkA4, (s16)(-40.0f * strength), 1, 1, 1);
Math_SmoothStepToS(&globalCtx->envCtx.unk_8C.fogNear, (s16)(-40.0f * strength), 1, 1, 1);
}
#else
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Weather_Tag_0x80966410/func_809672DC.asm")
@@ -463,19 +463,18 @@ void func_809674C8(EnWeatherTag* this, GlobalContext* globalCtx) {
if (Actor_XZDistanceBetweenActors(&player->actor, &this->actor) < WEATHER_TAG_RANGE100(this)) {
if (CURRENT_DAY == 2) {
if ((gSaveContext.time >= 0x4AAA) && (gSaveContext.time < 0xBAAA) &&
(globalCtx->kankyoContext.unkF2[2] == 0)) {
if ((gSaveContext.time >= 0x4AAA) && (gSaveContext.time < 0xBAAA) && (globalCtx->envCtx.unk_F2[2] == 0)) {
D_801BDBB0 = 1;
func_800FD78C(globalCtx);
globalCtx->kankyoContext.unkF2[4] = 0x20;
globalCtx->envCtx.unk_F2[4] = 0x20;
EnWeatherTag_SetupAction(this, func_80967608);
}
}
} else {
if ((globalCtx->kankyoContext.unkF2[4] != 0) && !(globalCtx->state.frames & 3)) {
globalCtx->kankyoContext.unkF2[4]--;
if ((globalCtx->kankyoContext.unkF2[4]) == 8) {
if ((globalCtx->envCtx.unk_F2[4] != 0) && !(globalCtx->state.frames & 3)) {
globalCtx->envCtx.unk_F2[4]--;
if ((globalCtx->envCtx.unk_F2[4]) == 8) {
func_800FD858(globalCtx);
}
}
@@ -496,8 +495,8 @@ void EnWeatherTag_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc(this, globalCtx);
if ((globalCtx->actorCtx.unk5 & 2) && (globalCtx->msgCtx.unk11F22 != 0) && (globalCtx->msgCtx.unk11F04 == 0x5E6) &&
(!FrameAdvance_IsEnabled(globalCtx)) && (globalCtx->unk18875 == 0) && (ActorCutscene_GetCurrentIndex() == -1) &&
(globalCtx->csCtx.state == 0)) {
(!FrameAdvance_IsEnabled(globalCtx)) && (globalCtx->sceneLoadFlag == 0) &&
(ActorCutscene_GetCurrentIndex() == -1) && (globalCtx->csCtx.state == 0)) {
oldTime = gSaveContext.time;
gSaveContext.time = (u16)REG(0xF) + oldTime; // cast req
@@ -187,9 +187,9 @@ void func_80A358FC(ObjBell* this, GlobalContext* globalCtx) {
this->collider1.dim.worldSphere.radius = (this->collider1.dim.modelSphere.radius * this->collider1.dim.scale);
this->collider2.dim.worldSphere.radius = (this->collider2.dim.modelSphere.radius * this->collider2.dim.scale);
if (DECR(this->unk_20E) == 0) {
CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider2.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider2.base);
}
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider1.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider1.base);
}
void func_80A359B4(Actor* thisx, GlobalContext* globalCtx) {
@@ -171,10 +171,10 @@ void ObjBoyo_Update(Actor* thisx, GlobalContext* globalCtx2) {
this->collider.base.ocFlags1 &= ~OC1_HIT;
this->collider.base.ocFlags2 &= ~OC2_HIT_PLAYER;
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
if (thisx->xzDistToPlayer < 2000.0f) {
CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
@@ -8,15 +8,9 @@ void ObjFunen_Init(Actor* thisx, GlobalContext* globalCtx);
void ObjFunen_Draw(Actor* thisx, GlobalContext* globalCtx);
const ActorInit Obj_Funen_InitVars = {
ACTOR_OBJ_FUNEN,
ACTORCAT_PROP,
FLAGS,
OBJECT_FUNEN,
sizeof(ObjFunen),
(ActorFunc)ObjFunen_Init,
(ActorFunc)Actor_Noop,
(ActorFunc)Actor_Noop,
(ActorFunc)ObjFunen_Draw,
ACTOR_OBJ_FUNEN, ACTORCAT_PROP, FLAGS,
OBJECT_FUNEN, sizeof(ObjFunen), (ActorFunc)ObjFunen_Init,
(ActorFunc)Actor_Noop, (ActorFunc)Actor_Noop, (ActorFunc)ObjFunen_Draw,
};
extern Gfx D_060000D0[];
@@ -132,9 +132,9 @@ void func_80BD4358(ObjHgdoor* this, GlobalContext* globalCtx) {
if (func_800EE29C(globalCtx, 0x1E3)) {
actionIndex = func_800EE200(globalCtx, 0x1E3);
if (this->unk166 != globalCtx->csCtx.actorActions[actionIndex]->unk0) {
this->unk166 = globalCtx->csCtx.actorActions[actionIndex]->unk0;
switch (globalCtx->csCtx.actorActions[actionIndex]->unk0) {
if (this->unk166 != globalCtx->csCtx.npcActions[actionIndex]->unk0) {
this->unk166 = globalCtx->csCtx.npcActions[actionIndex]->unk0;
switch (globalCtx->csCtx.npcActions[actionIndex]->unk0) {
case 1:
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_WOOD_DOOR_OPEN_SPEEDY);
if ((this->dyna.actor.parent != NULL) && (this->dyna.actor.parent->id == ACTOR_EN_HG)) {
@@ -118,7 +118,7 @@ void func_80926318(ObjKibako* this, GlobalContext* globalCtx) {
}
void func_80926394(ObjKibako* this, GlobalContext* globalCtx) {
if ((this->isDropCollected == 0) && (globalCtx->roomContext.currRoom.num != this->unk199)) {
if ((this->isDropCollected == 0) && (globalCtx->roomCtx.currRoom.num != this->unk199)) {
this->isDropCollected = 1;
}
}
@@ -282,7 +282,7 @@ void ObjKibako_Idle(ObjKibako* this, GlobalContext* globalCtx) {
Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor);
func_809262BC(this);
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 18.0f, 15.0f, 0.0f, 0x45);
if (!(this->collider.base.ocFlags1 & OC1_TYPE_PLAYER) && (this->actor.xzDistToPlayer > 28.0f)) {
this->collider.base.ocFlags1 |= OC1_TYPE_PLAYER;
}
@@ -296,19 +296,19 @@ void ObjKibako_Idle(ObjKibako* this, GlobalContext* globalCtx) {
if ((this->actor.params >> 7) & 1) {
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
if (this->actor.xzDistToPlayer < 800.0f) {
CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
func_80926318(this, globalCtx);
}
} else {
if (this->actor.xzDistToPlayer < 800.0f) {
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
if (this->actor.xzDistToPlayer < 180.0f) {
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
func_80926318(this, globalCtx);
}
}
@@ -327,7 +327,7 @@ void ObjKibako_Held(ObjKibako* this, GlobalContext* globalCtx) {
func_80926394(this, globalCtx);
if (Actor_HasNoParent(&this->actor, globalCtx)) {
this->actor.room = globalCtx->roomContext.currRoom.num;
this->actor.room = globalCtx->roomCtx.currRoom.num;
if (fabsf(this->actor.speedXZ) < 0.1f) {
ObjKibako_SetupIdle(this);
this->collider.base.ocFlags1 &= ~OC1_TYPE_PLAYER;
@@ -394,8 +394,8 @@ void ObjKibako_Thrown(ObjKibako* this, GlobalContext* globalCtx) {
this->actor.shape.rot.y = (s16)(this->actor.shape.rot.y + D_8092738C);
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 18.0f, 15.0f, 0.0f, 0x45);
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAT(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
}
@@ -391,8 +391,8 @@ void ObjLightswitch_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc(this, globalCtx);
if (this->actor.update != 0) {
this->previousACFlags = this->collider.base.acFlags;
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
@@ -91,8 +91,8 @@ void ObjMilkBin_Update(Actor* thisx, GlobalContext* globalCtx2) {
}
if (!(this->disableDraw & 1)) {
CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
@@ -156,7 +156,7 @@ void ObjMoonStone_Draw(Actor* thisx, GlobalContext* globalCtx) {
AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_06001C60));
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, D_06000D78);
SysMatrix_NormalizeXYZ(&globalCtx->unk187FC);
SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, D_06000C80);
CLOSE_DISPS(globalCtx->state.gfxCtx);
@@ -197,7 +197,7 @@ void ObjTokeiStep_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
BcCheck3_BgActorInit(&this->dyna, 0);
if ((globalCtx->sceneNum == 0x6F) && (gSaveContext.sceneSetupIndex == 2) && (globalCtx->csCtx.unk12 == 0)) {
if ((globalCtx->sceneNum == 0x6F) && (gSaveContext.sceneSetupIndex == 2) && (globalCtx->csCtx.unk_12 == 0)) {
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000968);
ObjTokeiStep_InitSteps(this);
ObjTokeiStep_SetupBeginOpen(this);
@@ -226,7 +226,7 @@ void ObjTokeiStep_BeginOpen(ObjTokeiStep* this, GlobalContext* globalCtx) {
CsCmdActorAction* action;
if (func_800EE29C(globalCtx, 0x86)) {
action = globalCtx->csCtx.actorActions[func_800EE200(globalCtx, 0x86)];
action = globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x86)];
if ((globalCtx->csCtx.frames == (*action).startFrame) && action->unk0) {
this->dyna.actor.draw = ObjTokeiStep_DrawOpen;
ObjTokeiStep_SetupOpen(this);