Skip to content

Commit 22a4b1f

Browse files
committed
Merge branch 'Dev' into dev-fenhl-next
# Conflicts: # ASM/build/asm_symbols.txt # ASM/build/bundle.o # ASM/build/c_symbols.txt # ASM/c/door_of_time.c # ASM/c/door_of_time.h # ASM/c/z64.h # World.py # data/LogicHelpers.json # data/generated/patch_symbols.json # data/generated/rom_patch.txt # data/generated/symbols.json # tests/entrance-warps.sav # tests/entrance2.sav # tests/entrance3.sav # tests/glitched-entrances.sav # tests/glitched-standard.sav # tests/plando/one-hint-per-goal-dungeons.json # tests/plando/one-hint-per-goal-hearts.json # tests/plando/one-hint-per-goal-medallions.json # tests/plando/one-hint-per-goal-skulls.json # tests/plando/one-hint-per-goal-stones.json # tests/plando/one-hint-per-goal-triforce-hunt.json # tests/plando/plando-adult-trade-in-list.json # tests/plando/plando-adult-trade-item-group-in-list.json # tests/plando/plando-bottle-item-group-in-list.json # tests/plando/plando-bottles-in-list.json # tests/plando/plando-fix-broken-drops-bad.json # tests/plando/plando-fix-broken-drops-good.json # tests/plando/plando-list-case-sensitivity.json # tests/plando/plando-list.json # tests/plando/plando-weird-egg-in-list.json # tests/triforce-multiworld.sav # tests/triforce-startingitems.sav # tests/triforce.sav
2 parents 54accaf + 50eac08 commit 22a4b1f

18 files changed

+34842
-34705
lines changed

ASM/build/asm_symbols.txt

Lines changed: 737 additions & 733 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ASM/build/bundle.o

484 Bytes
Binary file not shown.

ASM/build/c_symbols.txt

Lines changed: 705 additions & 700 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ASM/c/door_of_time.c

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,27 @@ extern uint8_t DOT_CONDITION;
66
int32_t DemoKankyo_CutsceneFlags_Get_Hook(void* play, int16_t flag) {
77
switch (DOT_CONDITION) {
88
case 0: // open
9-
return 1;
9+
case 3: // stones
10+
return has_items_for_door_of_time();
11+
case 1: // sot
12+
case 2: // oot_sot
13+
case 4: // stones_sot
14+
case 5: // stones_oot_sot
15+
return has_items_for_door_of_time() && CutsceneFlags_Get(play, flag);
16+
}
17+
}
18+
19+
bool has_items_for_door_of_time() {
20+
switch (DOT_CONDITION) {
21+
case 0: // open
1022
case 1: // sot
11-
return CutsceneFlags_Get(play, flag);
23+
return true;
1224
case 2: // oot_sot
13-
return z64_file.items[Z64_SLOT_OCARINA] == 0x08 && CutsceneFlags_Get(play, flag);
25+
return z64_file.items[Z64_SLOT_OCARINA] == 0x08;
1426
case 3: // stones
15-
return (z64_file.quest_items & 0x1C0000) == 0x1C0000;
1627
case 4: // stones_sot
17-
return (z64_file.quest_items & 0x1C0000) == 0x1C0000 && CutsceneFlags_Get(play, flag);
28+
return (z64_file.quest_items & 0x1C0000) == 0x1C0000;
1829
case 5: // stones_oot_sot
19-
return (z64_file.quest_items & 0x1C0000) == 0x1C0000 && z64_file.items[Z64_SLOT_OCARINA] == 0x08 && CutsceneFlags_Get(play, flag);
30+
return (z64_file.quest_items & 0x1C0000) == 0x1C0000 && z64_file.items[Z64_SLOT_OCARINA] == 0x08;
2031
}
2132
}

ASM/c/door_of_time.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include <stdbool.h>
12
#include <stdint.h>
23

34
int32_t DemoKankyo_CutsceneFlags_Get_Hook(void* play, int16_t flag);
5+
bool has_items_for_door_of_time();

ASM/c/en_okarina_tag.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include "z64.h"
2+
#include "door_of_time.h"
3+
#include "en_okarina_tag.h"
4+
#include "util.h"
5+
6+
extern EnOkarinaTagActionFunc OVL_EnOkarinaTag_Action1;
7+
extern EnOkarinaTagActionFunc OVL_EnOkarinaTag_Action2;
8+
9+
void EnOkarinaTag_ActionHook(EnOkarinaTag* this, z64_game_t* play) {
10+
if (play->msgContext.ocarinaMode == 3 && this->type == 4 && !has_items_for_door_of_time()) {
11+
play->msgContext.ocarinaMode = 4;
12+
this->actionFunc = resolve_overlay_addr(&OVL_EnOkarinaTag_Action1, this->actor.actor_id);
13+
return;
14+
}
15+
EnOkarinaTagActionFunc EnOkarinaTag_Action = resolve_overlay_addr(&OVL_EnOkarinaTag_Action2, this->actor.actor_id);
16+
EnOkarinaTag_Action(this, play);
17+
}

ASM/c/en_okarina_tag.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#ifndef Z_EN_OKARINA_TAG_H
2+
#define Z_EN_OKARINA_TAG_H
3+
4+
#include "z64.h"
5+
6+
struct EnOkarinaTag;
7+
8+
typedef void (*EnOkarinaTagActionFunc)(struct EnOkarinaTag*, z64_game_t*);
9+
10+
typedef struct EnOkarinaTag {
11+
/* 0x0000 */ z64_actor_t actor;
12+
/* 0x014C */ EnOkarinaTagActionFunc actionFunc;
13+
/* 0x0150 */ int16_t type;
14+
/* 0x0152 */ int16_t ocarinaSong;
15+
/* 0x0154 */ int16_t switchFlag;
16+
/* 0x0156 */ char unk_156[0x2];
17+
/* 0x0158 */ int16_t unk_158;
18+
/* 0x015A */ int16_t unk_15A;
19+
/* 0x015C */ float interactRange;
20+
} EnOkarinaTag; // size = 0x0160
21+
22+
#endif

ASM/c/z64.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2472,5 +2472,6 @@ typedef void(*z64_Play_SetupRespawnPoint_proc)(z64_game_t *game, int32_t respawn
24722472
extern void Fault_AddHungupAndCrashImpl(const char* msg1, const char* msg2);
24732473
extern int32_t sprintf(char* dst, char* fmt, ...);
24742474
extern int32_t CutsceneFlags_Get(void* play, int16_t flag);
2475+
extern int32_t DemoKankyo_CutsceneFlags_Get_Hook(void* play, int16_t flag);
24752476

24762477
#endif

ASM/ootSymbols.ld

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,5 @@ z64_sEquipMoveTimer = 0x8039EAB8;
4040
gActorOverlayTable = 0x800E8530;
4141
Message_CloseTextbox = 0x800d6218;
4242
sSetupDL = 0x800f7d50;
43+
OVL_EnOkarinaTag_Action2 = 0x80a872d0;
44+
OVL_EnOkarinaTag_Action1 = 0x80a87088;

ASM/src/hacks.asm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4237,3 +4237,4 @@ DemoEffect_DrawJewel_AfterHook:
42374237
.include "hacks/z_file_choose.asm"
42384238
.include "hacks/ovl_en_changer.asm"
42394239
.include "hacks/ovl_en_ssh.asm"
4240+
.include "hacks/ovl_en_okarina_tag.asm"

0 commit comments

Comments
 (0)