1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-13 11:24:40 +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

@ -3789,7 +3789,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
void Interface_Update(GlobalContext* globalCtx) {
static u8 D_80125B60 = 0;
static s16 D_80125B64 = 0;
static s16 sPrevTimeIncrement = 0;
MessageContext* msgCtx = &globalCtx->msgCtx;
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
Player* player = GET_PLAYER(globalCtx);
@ -4098,30 +4098,32 @@ void Interface_Update(GlobalContext* globalCtx) {
}
}
if (gSaveContext.unk_1422 != 0) {
if ((msgCtx->unk_E3F0 != 0x31) && (gSaveContext.unk_1422 == 1)) {
if (gSaveContext.sunsSongState != SUNSSONG_INACTIVE) {
// exit out of ocarina mode after suns song finishes playing
if ((msgCtx->unk_E3F0 != 0x31) && (gSaveContext.sunsSongState == SUNSSONG_START)) {
globalCtx->msgCtx.unk_E3EE = 4;
}
if (globalCtx->envCtx.unk_02 != 0) {
if (gSaveContext.unk_1422 != 2) {
// handle suns song in areas where time moves
if (globalCtx->envCtx.timeIncrement != 0) {
if (gSaveContext.sunsSongState != SUNSSONG_SPEED_TIME) {
D_80125B60 = 0;
if ((gSaveContext.dayTime >= 0x4555) && (gSaveContext.dayTime <= 0xC001)) {
D_80125B60 = 1;
}
gSaveContext.unk_1422 = 2;
D_80125B64 = D_8011FB40;
D_8011FB40 = 400;
gSaveContext.sunsSongState = SUNSSONG_SPEED_TIME;
sPrevTimeIncrement = gTimeIncrement;
gTimeIncrement = 400;
} else if (D_80125B60 == 0) {
if ((gSaveContext.dayTime >= 0x4555) && (gSaveContext.dayTime <= 0xC001)) {
gSaveContext.unk_1422 = 0;
D_8011FB40 = D_80125B64;
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
gTimeIncrement = sPrevTimeIncrement;
globalCtx->msgCtx.unk_E3EE = 4;
}
} else if (gSaveContext.dayTime > 0xC001) {
gSaveContext.unk_1422 = 0;
D_8011FB40 = D_80125B64;
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
gTimeIncrement = sPrevTimeIncrement;
globalCtx->msgCtx.unk_E3EE = 4;
}
} else if ((globalCtx->roomCtx.curRoom.unk_03 != 1) && (interfaceCtx->restrictions.sunsSong != 3)) {
@ -4145,12 +4147,12 @@ void Interface_Update(GlobalContext* globalCtx) {
gSaveContext.respawnFlag = -2;
globalCtx->nextEntranceIndex = gSaveContext.entranceIndex;
globalCtx->sceneLoadFlag = 0x14;
gSaveContext.unk_1422 = 0;
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
func_800F6964(30);
gSaveContext.seqIndex = 0xFF;
gSaveContext.nightSeqIndex = 0xFF;
} else {
gSaveContext.unk_1422 = 3;
gSaveContext.sunsSongState = SUNSSONG_SPECIAL;
}
}
}