mirror of
https://github.com/zeldaret/mm.git
synced 2026-06-08 12:17:05 -04:00
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:
+26
-27
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
@@ -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, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user