1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-24 07:51:48 +00:00

Decompile z_kankyo (#956)

* working

* start color switch

* progress

* progress

* progress on bgm func

* progress

* game over matched (except the rodata meme)

* start update

* progress

* lightning docs done

* progress

* progress

* progress

* progress

* progress

* can compile at least

* suns state, progress on kankyo_update

* some new names

* progress

* progress

* progress

* new functions

* cleanup

* more matches

* another match

* now functional

* format

* better match

* hugely improved update

* cleanup/review

* remove old changes

* review2

* review3

* missed one

* review4

* change asm filenames

* update doorwarp1

* review5

* Kankyo_ -> Environment_

* format

* merge master and format functions.h

Co-authored-by: Jacob Young <jacobly0@users.noreply.github.com>
Co-authored-by: fig <fig02srl@gmail.com>
Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
This commit is contained in:
petrie911 2021-09-20 11:51:35 -05:00 committed by GitHub
parent 50095d427c
commit e51f50f0ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
139 changed files with 3478 additions and 6277 deletions

View file

@ -508,33 +508,33 @@ void BossVa_Tumor(GlobalContext* globalCtx, BossVa* this, s32 count, s16 scale,
}
void BossVa_SetSparkEnv(GlobalContext* globalCtx) {
globalCtx->envCtx.unk_8C[0][0] = 0xA;
globalCtx->envCtx.unk_8C[0][1] = 0xA;
globalCtx->envCtx.unk_8C[0][2] = 0xA;
globalCtx->envCtx.unk_8C[1][0] = 0x73;
globalCtx->envCtx.unk_8C[1][1] = 0x41;
globalCtx->envCtx.unk_8C[1][2] = 0x64;
globalCtx->envCtx.unk_8C[2][0] = 0x78;
globalCtx->envCtx.unk_8C[2][1] = 0x78;
globalCtx->envCtx.unk_8C[2][2] = 0x46;
globalCtx->envCtx.adjAmbientColor[0] = 0xA;
globalCtx->envCtx.adjAmbientColor[1] = 0xA;
globalCtx->envCtx.adjAmbientColor[2] = 0xA;
globalCtx->envCtx.adjLight1Color[0] = 0x73;
globalCtx->envCtx.adjLight1Color[1] = 0x41;
globalCtx->envCtx.adjLight1Color[2] = 0x64;
globalCtx->envCtx.adjFogColor[0] = 0x78;
globalCtx->envCtx.adjFogColor[1] = 0x78;
globalCtx->envCtx.adjFogColor[2] = 0x46;
}
void BossVa_SetDeathEnv(GlobalContext* globalCtx) {
globalCtx->envCtx.unk_8C[2][0] = 0xDC;
globalCtx->envCtx.unk_8C[2][1] = 0xDC;
globalCtx->envCtx.unk_8C[2][2] = 0x96;
globalCtx->envCtx.unk_9E = -0x3E8;
globalCtx->envCtx.unk_A0 = -0x384;
globalCtx->envCtx.unk_8C[0][0] = 0xC8;
globalCtx->envCtx.unk_8C[0][1] = 0xC8;
globalCtx->envCtx.unk_8C[0][2] = 0xC8;
globalCtx->envCtx.unk_8C[1][0] = 0xD7;
globalCtx->envCtx.unk_8C[1][1] = 0xA5;
globalCtx->envCtx.unk_8C[1][2] = 0xC8;
globalCtx->envCtx.unk_E2[0] = 0xDC;
globalCtx->envCtx.unk_E2[1] = 0xDC;
globalCtx->envCtx.unk_E2[2] = 0x96;
globalCtx->envCtx.unk_E2[3] = 0x64;
globalCtx->envCtx.adjFogColor[0] = 0xDC;
globalCtx->envCtx.adjFogColor[1] = 0xDC;
globalCtx->envCtx.adjFogColor[2] = 0x96;
globalCtx->envCtx.adjFogNear = -0x3E8;
globalCtx->envCtx.adjFogFar = -0x384;
globalCtx->envCtx.adjAmbientColor[0] = 0xC8;
globalCtx->envCtx.adjAmbientColor[1] = 0xC8;
globalCtx->envCtx.adjAmbientColor[2] = 0xC8;
globalCtx->envCtx.adjLight1Color[0] = 0xD7;
globalCtx->envCtx.adjLight1Color[1] = 0xA5;
globalCtx->envCtx.adjLight1Color[2] = 0xC8;
globalCtx->envCtx.screenFillColor[0] = 0xDC;
globalCtx->envCtx.screenFillColor[1] = 0xDC;
globalCtx->envCtx.screenFillColor[2] = 0x96;
globalCtx->envCtx.screenFillColor[3] = 0x64;
}
EnBoom* BossVa_FindBoomerang(GlobalContext* globalCtx) {
@ -630,7 +630,8 @@ void BossVa_Init(Actor* thisx, GlobalContext* globalCtx2) {
warpId = ACTOR_DOOR_WARP1;
}
Actor_Spawn(&globalCtx->actorCtx, globalCtx, warpId, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, 0, 0, 0, 0); //! params could be WARP_DUNGEON_CHILD however this can also spawn Ru1
this->actor.world.pos.z, 0, 0, 0,
0); //! params could be WARP_DUNGEON_CHILD however this can also spawn Ru1
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_ITEM_B_HEART, this->actor.world.pos.x + 160.0f,
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0);
sDoorState = 100;
@ -642,10 +643,10 @@ void BossVa_Init(Actor* thisx, GlobalContext* globalCtx2) {
sCsState = INTRO_CALL_BARI;
sDoorState = 100;
func_8002DF54(globalCtx, &this->actor, 1);
globalCtx->envCtx.unk_E2[0] = 0xDC;
globalCtx->envCtx.unk_E2[1] = 0xDC;
globalCtx->envCtx.unk_E2[2] = 0xBE;
globalCtx->envCtx.unk_E2[3] = 0xD2;
globalCtx->envCtx.screenFillColor[0] = 0xDC;
globalCtx->envCtx.screenFillColor[1] = 0xDC;
globalCtx->envCtx.screenFillColor[2] = 0xBE;
globalCtx->envCtx.screenFillColor[3] = 0xD2;
func_80064520(globalCtx, &globalCtx->csCtx);
sCsCamera = Gameplay_CreateSubCamera(globalCtx);
Gameplay_ChangeCameraStatus(globalCtx, MAIN_CAM, CAM_STAT_WAIT);
@ -778,10 +779,10 @@ void BossVa_BodyIntro(BossVa* this, GlobalContext* globalCtx) {
}
break;
case INTRO_START:
globalCtx->envCtx.unk_E2[0] = 0xDC;
globalCtx->envCtx.unk_E2[1] = 0xDC;
globalCtx->envCtx.unk_E2[2] = 0xBE;
globalCtx->envCtx.unk_E2[3] = 0xD2;
globalCtx->envCtx.screenFillColor[0] = 0xDC;
globalCtx->envCtx.screenFillColor[1] = 0xDC;
globalCtx->envCtx.screenFillColor[2] = 0xBE;
globalCtx->envCtx.screenFillColor[3] = 0xD2;
func_8002DF54(globalCtx, &this->actor, 8);
player->actor.world.rot.y = player->actor.shape.rot.y = 0x7FFF;
sCsState++;
@ -1552,9 +1553,10 @@ void BossVa_BodyDeath(BossVa* this, GlobalContext* globalCtx) {
this->unk_1AC = Math_Vec3f_Yaw(&sCameraEye, &sCameraNextAt) - 0x100;
this->unk_1B0 = 15;
globalCtx->envCtx.unk_E2[0] = globalCtx->envCtx.unk_E2[1] = globalCtx->envCtx.unk_E2[2] = 0xFF;
globalCtx->envCtx.unk_E2[3] = 0;
globalCtx->envCtx.unk_E1 = 1;
globalCtx->envCtx.screenFillColor[0] = globalCtx->envCtx.screenFillColor[1] =
globalCtx->envCtx.screenFillColor[2] = 0xFF;
globalCtx->envCtx.screenFillColor[3] = 0;
globalCtx->envCtx.fillScreen = true;
sCsState++;
case DEATH_BODY_TUMORS:
this->unk_1AC += 0x100;
@ -1652,7 +1654,7 @@ void BossVa_BodyDeath(BossVa* this, GlobalContext* globalCtx) {
}
case DEATH_FINISH:
Rand_CenteredFloat(0.5f);
globalCtx->envCtx.unk_E1 = 0;
globalCtx->envCtx.fillScreen = false;
break;
}
@ -1671,8 +1673,8 @@ void BossVa_BodyDeath(BossVa* this, GlobalContext* globalCtx) {
Math_SmoothStepToS(&this->vaBodySpinRate, 0, 1, 0xC8, 0);
Math_SmoothStepToS(&this->vaCamRotMod, 0, 1, 0xC8, 0);
Math_SmoothStepToS(&this->bodyGlow, 200, 1, 10, 0);
if (globalCtx->envCtx.unk_E2[3] != 0) {
globalCtx->envCtx.unk_E2[3] -= 50;
if (globalCtx->envCtx.screenFillColor[3] != 0) {
globalCtx->envCtx.screenFillColor[3] -= 50;
}
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f);
@ -2818,22 +2820,22 @@ void BossVa_Update(Actor* thisx, GlobalContext* globalCtx2) {
BossVa_UpdateEffects(globalCtx);
for (i = 2; i >= 0; i--) {
if ((globalCtx->envCtx.unk_8C[0][i] - 1) > 0) {
globalCtx->envCtx.unk_8C[0][i] -= 1;
if ((globalCtx->envCtx.adjAmbientColor[i] - 1) > 0) {
globalCtx->envCtx.adjAmbientColor[i] -= 1;
} else {
globalCtx->envCtx.unk_8C[0][i] = 0;
globalCtx->envCtx.adjAmbientColor[i] = 0;
}
if ((globalCtx->envCtx.unk_8C[1][i] - 10) > 0) {
globalCtx->envCtx.unk_8C[1][i] -= 10;
if ((globalCtx->envCtx.adjLight1Color[i] - 10) > 0) {
globalCtx->envCtx.adjLight1Color[i] -= 10;
} else {
globalCtx->envCtx.unk_8C[1][i] = 0;
globalCtx->envCtx.adjLight1Color[i] = 0;
}
if ((globalCtx->envCtx.unk_8C[2][i] - 10) > 0) {
globalCtx->envCtx.unk_8C[2][i] -= 10;
if ((globalCtx->envCtx.adjFogColor[i] - 10) > 0) {
globalCtx->envCtx.adjFogColor[i] -= 10;
} else {
globalCtx->envCtx.unk_8C[2][i] = 0;
globalCtx->envCtx.adjFogColor[i] = 0;
}
}
@ -3187,17 +3189,17 @@ void BossVa_Draw(Actor* thisx, GlobalContext* globalCtx) {
switch (this->actor.params) {
case BOSSVA_BODY:
if (globalCtx->envCtx.unk_9E != 0) {
globalCtx->envCtx.unk_9E += 0x15E;
if (globalCtx->envCtx.unk_9E > 0) {
globalCtx->envCtx.unk_9E = 0;
if (globalCtx->envCtx.adjFogNear != 0) {
globalCtx->envCtx.adjFogNear += 0x15E;
if (globalCtx->envCtx.adjFogNear > 0) {
globalCtx->envCtx.adjFogNear = 0;
}
}
if (globalCtx->envCtx.unk_A0 != 0) {
globalCtx->envCtx.unk_A0 += 0x15E;
if (globalCtx->envCtx.unk_A0 > 0) {
globalCtx->envCtx.unk_A0 = 0;
if (globalCtx->envCtx.adjFogFar != 0) {
globalCtx->envCtx.adjFogFar += 0x15E;
if (globalCtx->envCtx.adjFogFar > 0) {
globalCtx->envCtx.adjFogFar = 0;
}
}