Skip to content

Commit

Permalink
Merge branch 'Dev' into dev-fenhl
Browse files Browse the repository at this point in the history
# Conflicts:
#	ASM/build/asm_symbols.txt
#	ASM/build/bundle.o
#	ASM/build/c_symbols.txt
#	data/generated/rom_patch.txt
#	data/generated/symbols.json
  • Loading branch information
fenhl committed Jun 8, 2024
2 parents 986e4f8 + 1695851 commit c35ef38
Show file tree
Hide file tree
Showing 22 changed files with 7,601 additions and 7,576 deletions.
578 changes: 289 additions & 289 deletions ASM/build/asm_symbols.txt

Large diffs are not rendered by default.

Binary file modified ASM/build/bundle.o
Binary file not shown.
596 changes: 298 additions & 298 deletions ASM/build/c_symbols.txt

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions ASM/c/dpad.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ extern uint8_t CFG_DPAD_ON_THE_LEFT;
extern uint16_t CFG_ADULT_TRADE_SHUFFLE;
extern uint16_t CFG_CHILD_TRADE_SHUFFLE;

#define CAN_DRAW_TRADE_DPAD (z64_game.pause_ctxt.state == 6 && \
#define CAN_DRAW_TRADE_DPAD (z64_game.pause_ctxt.state == PAUSE_STATE_MAIN && \
z64_game.pause_ctxt.screen_idx == 0 && \
(!z64_game.pause_ctxt.changing || z64_game.pause_ctxt.changing == 3) && \
((z64_game.pause_ctxt.cursor_point[PAUSE_ITEM] == Z64_SLOT_ADULT_TRADE && CFG_ADULT_TRADE_SHUFFLE) || \
(z64_game.pause_ctxt.cursor_point[PAUSE_ITEM] == Z64_SLOT_CHILD_TRADE && CFG_CHILD_TRADE_SHUFFLE)))

#define CAN_DRAW_OCARINA_BUTTONS (z64_game.pause_ctxt.state == 6 && \
#define CAN_DRAW_OCARINA_BUTTONS (z64_game.pause_ctxt.state == PAUSE_STATE_MAIN && \
z64_game.pause_ctxt.screen_idx == 0 && \
(!z64_game.pause_ctxt.changing || z64_game.pause_ctxt.changing == 3) && \
(z64_game.pause_ctxt.cursor_point[PAUSE_ITEM] == Z64_SLOT_OCARINA && SHUFFLE_OCARINA_BUTTONS))
Expand All @@ -66,15 +66,15 @@ extern uint16_t CFG_CHILD_TRADE_SHUFFLE;
// Not getting pulled by hookshot
// Not playing Bombchu bowling
// Not playing Shooting Gallery
#define CAN_USE_OCARINA (z64_game.pause_ctxt.state == 0 && \
#define CAN_USE_OCARINA (z64_game.pause_ctxt.state == PAUSE_STATE_OFF && \
(z64_file.items[Z64_SLOT_OCARINA] == Z64_ITEM_FAIRY_OCARINA || z64_file.items[Z64_SLOT_OCARINA] == Z64_ITEM_OCARINA_OF_TIME) && \
!z64_game.restriction_flags.ocarina && \
((z64_link.state_flags_1 & BLOCK_ITEMS) == 0) && \
(!(z64_link.state_flags_3 & (1 << 7))) && \
z64_game.bombchuBowlingStatus == 0 && \
z64_game.shootingGalleryStatus == 0)

#define CAN_USE_CHILD_TRADE (z64_game.pause_ctxt.state == 0 && z64_file.items[Z64_SLOT_CHILD_TRADE] >= Z64_ITEM_WEIRD_EGG && z64_file.items[Z64_SLOT_CHILD_TRADE] <= Z64_ITEM_MASK_OF_TRUTH && !z64_game.restriction_flags.trade_items && ((z64_link.state_flags_1 & BLOCK_ITEMS) == 0))
#define CAN_USE_CHILD_TRADE (z64_game.pause_ctxt.state == PAUSE_STATE_OFF && z64_file.items[Z64_SLOT_CHILD_TRADE] >= Z64_ITEM_WEIRD_EGG && z64_file.items[Z64_SLOT_CHILD_TRADE] <= Z64_ITEM_MASK_OF_TRUTH && !z64_game.restriction_flags.trade_items && ((z64_link.state_flags_1 & BLOCK_ITEMS) == 0))

void handle_dpad();
void draw_dpad_and_menu_utilities();
Expand Down
2 changes: 1 addition & 1 deletion ASM/c/dungeon_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ extern uint8_t CFG_DPAD_DUNGEON_INFO_ENABLE;
static int show_dungeon_info = 0;

#define CAN_DRAW_DUNGEON_INFO (CFG_DUNGEON_INFO_ENABLE != 0 && \
z64_game.pause_ctxt.state == 6 && \
z64_game.pause_ctxt.state == PAUSE_STATE_MAIN && \
z64_game.pause_ctxt.screen_idx == 0 && \
(!z64_game.pause_ctxt.changing || \
z64_game.pause_ctxt.changing == 3))
Expand Down
2 changes: 1 addition & 1 deletion ASM/c/get_items.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ void after_item_received() {
inline uint32_t link_is_ready() {
if ((z64_logo_state != 0x802C5880) &&
(z64_logo_state != 0) &&
(z64_file.game_mode == 0) &&
(z64_file.game_mode == PAUSE_STATE_OFF) &&
(z64_game.pause_ctxt.state == 0) &&
// don't receive items in shops to avoid a softlock when buying an item at the same time as receiving one
((z64_game.scene_index < 0x002C || z64_game.scene_index > 0x0033) && z64_game.scene_index != 0x0042 && z64_game.scene_index != 0x004B) &&
Expand Down
37 changes: 0 additions & 37 deletions ASM/c/kaleido_item.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,43 +10,6 @@
#define PAUSE_CURSOR_PAGE_LEFT 10
#define PAUSE_CURSOR_PAGE_RIGHT 11

typedef enum {
/* 0 */ PAUSE_STATE_OFF,
/* 1 */ PAUSE_STATE_WAIT_LETTERBOX, // Request no letterboxing and wait for it.
/* 2 */ PAUSE_STATE_WAIT_BG_PRERENDER, // Wait for the pause background prerender to be done.
/* 3 */ PAUSE_STATE_INIT, // Load data and initialize/setup various things.
/* 4 */ PAUSE_STATE_OPENING_1, // Animate the pause menu coming together with rotations and other animations.
/* 5 */ PAUSE_STATE_OPENING_2, // Finish some animations for opening the menu.
/* 6 */ PAUSE_STATE_MAIN, // Pause menu ready for player inputs.
/* 7 */ PAUSE_STATE_SAVE_PROMPT, // Save prompt in the pause menu
/* 8 */ PAUSE_STATE_8,
/* 9 */ PAUSE_STATE_9,
/* 10 */ PAUSE_STATE_10,
/* 11 */ PAUSE_STATE_11,
/* 12 */ PAUSE_STATE_12,
/* 13 */ PAUSE_STATE_13,
/* 14 */ PAUSE_STATE_14,
/* 15 */ PAUSE_STATE_15,
/* 16 */ PAUSE_STATE_16,
/* 17 */ PAUSE_STATE_17,
/* 18 */ PAUSE_STATE_CLOSING, // Animate the pause menu closing
/* 19 */ PAUSE_STATE_RESUME_GAMEPLAY // Handles returning to normal gameplay once the pause menu is visually closed
} PauseState;

// Sub-states of PAUSE_STATE_MAIN
typedef enum {
/* 0 */ PAUSE_MAIN_STATE_IDLE,
/* 1 */ PAUSE_MAIN_STATE_1,
/* 2 */ PAUSE_MAIN_STATE_2,
/* 3 */ PAUSE_MAIN_STATE_3,
/* 4 */ PAUSE_MAIN_STATE_4,
/* 5 */ PAUSE_MAIN_STATE_5,
/* 6 */ PAUSE_MAIN_STATE_6,
/* 7 */ PAUSE_MAIN_STATE_7,
/* 8 */ PAUSE_MAIN_STATE_8,
/* 9 */ PAUSE_MAIN_STATE_9
} PauseMainState;

extern uint8_t z64_AmmoItems[16];
extern void* z64_EquippedItemOutlineTex[0x400];

Expand Down
2 changes: 1 addition & 1 deletion ASM/c/model_text.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const int text_height = 10;
void draw_illegal_model_text(z64_disp_buf_t* db) {

// Only draw when paused
if (!(illegal_model && z64_game.pause_ctxt.state == 6)) {
if (!(illegal_model && z64_game.pause_ctxt.state == PAUSE_STATE_MAIN)) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions ASM/c/music.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void display_song_name(z64_disp_buf_t* db) {
alpha = 255;
frames = 0;
}
if (!(display_song_name_flag == 1 || z64_game.pause_ctxt.state == 6)) {
if (!(display_song_name_flag == 1 || z64_game.pause_ctxt.state == PAUSE_STATE_MAIN)) {
return;
}

Expand All @@ -96,7 +96,7 @@ void display_song_name(z64_disp_buf_t* db) {
return;
}

if (z64_game.pause_ctxt.state == 6) {
if (z64_game.pause_ctxt.state == PAUSE_STATE_MAIN) {
alpha = 255;
frames = 0;
}
Expand Down
4 changes: 2 additions & 2 deletions ASM/c/triforce.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ void set_triforce_render() {
void draw_triforce_count(z64_disp_buf_t* db) {

// Must be triforce hunt and triforce should be drawable, and we should either be on the pause screen or the render triforce flag should be set
if (!(TRIFORCE_HUNT_ENABLED && CAN_DRAW_TRIFORCE && (render_triforce_flag == 1 || z64_game.pause_ctxt.state == 6))) {
if (!(TRIFORCE_HUNT_ENABLED && CAN_DRAW_TRIFORCE && (render_triforce_flag == 1 || z64_game.pause_ctxt.state == PAUSE_STATE_MAIN))) {
return;
}

uint8_t alpha;
// In the pause screen always draw
if (z64_game.pause_ctxt.state == 6) {
if (z64_game.pause_ctxt.state == PAUSE_STATE_MAIN) {
alpha = 255;
frames = frames % (TRIFORCE_SPRITE_FRAMES * FRAMES_PER_CYCLE);
} else {
Expand Down
4 changes: 4 additions & 0 deletions ASM/c/uninvertYaxis.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ void manage_uninvert_yaxis() {
if (z64_MessageGetState(((uint8_t*)(&z64_game)) + 0x20D8) == 4) {
return;
}
// Also never in pause menu.
if (z64_game.pause_ctxt.state == PAUSE_STATE_MAIN) {
return;
}
if (z64_game.camera_mode == CAM_MODE_FIRST_PERSON ||
z64_game.camera_mode == CAM_MODE_AIM_ADULT ||
z64_game.camera_mode == CAM_MODE_AIM_BOOMERANG ||
Expand Down
37 changes: 37 additions & 0 deletions ASM/c/z64.h
Original file line number Diff line number Diff line change
Expand Up @@ -1844,6 +1844,43 @@ typedef struct EnGSwitch
/* 0x01C8 */ uint8_t effects[0x1130]; // EnGSwitchEffect[100]
} EnGSwitch; // size = 0x12F8

typedef enum {
/* 0 */ PAUSE_STATE_OFF,
/* 1 */ PAUSE_STATE_WAIT_LETTERBOX, // Request no letterboxing and wait for it.
/* 2 */ PAUSE_STATE_WAIT_BG_PRERENDER, // Wait for the pause background prerender to be done.
/* 3 */ PAUSE_STATE_INIT, // Load data and initialize/setup various things.
/* 4 */ PAUSE_STATE_OPENING_1, // Animate the pause menu coming together with rotations and other animations.
/* 5 */ PAUSE_STATE_OPENING_2, // Finish some animations for opening the menu.
/* 6 */ PAUSE_STATE_MAIN, // Pause menu ready for player inputs.
/* 7 */ PAUSE_STATE_SAVE_PROMPT, // Save prompt in the pause menu
/* 8 */ PAUSE_STATE_8,
/* 9 */ PAUSE_STATE_9,
/* 10 */ PAUSE_STATE_10,
/* 11 */ PAUSE_STATE_11,
/* 12 */ PAUSE_STATE_12,
/* 13 */ PAUSE_STATE_13,
/* 14 */ PAUSE_STATE_14,
/* 15 */ PAUSE_STATE_15,
/* 16 */ PAUSE_STATE_16,
/* 17 */ PAUSE_STATE_17,
/* 18 */ PAUSE_STATE_CLOSING, // Animate the pause menu closing
/* 19 */ PAUSE_STATE_RESUME_GAMEPLAY // Handles returning to normal gameplay once the pause menu is visually closed
} PauseState;

// Sub-states of PAUSE_STATE_MAIN
typedef enum {
/* 0 */ PAUSE_MAIN_STATE_IDLE,
/* 1 */ PAUSE_MAIN_STATE_1,
/* 2 */ PAUSE_MAIN_STATE_2,
/* 3 */ PAUSE_MAIN_STATE_3,
/* 4 */ PAUSE_MAIN_STATE_4,
/* 5 */ PAUSE_MAIN_STATE_5,
/* 6 */ PAUSE_MAIN_STATE_6,
/* 7 */ PAUSE_MAIN_STATE_7,
/* 8 */ PAUSE_MAIN_STATE_8,
/* 9 */ PAUSE_MAIN_STATE_9
} PauseMainState;

typedef enum {
/* 0 */ PAUSE_BG_PRERENDER_OFF, // Inactive, do nothing.
/* 1 */ PAUSE_BG_PRERENDER_SETUP, // The current frame is only drawn for the purpose of serving as the pause background.
Expand Down
6 changes: 0 additions & 6 deletions ASM/src/hacks.asm
Original file line number Diff line number Diff line change
Expand Up @@ -4249,12 +4249,6 @@ DemoEffect_DrawJewel_AfterHook:
jal volvagia_flying_hitbox
nop

; Replaces lh t6, 0x01D0(a1)
; addiu $at, $zero, 0x0003
.orga 0xE56B38
jal kz_no_timer
addiu $at, $zero, 0x0003

.include "hacks/z_parameter.asm"
.include "hacks/ovl_en_kz.asm"
.include "hacks/ovl_en_dns.asm"
Expand Down
7 changes: 7 additions & 0 deletions Patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -1599,6 +1599,13 @@ def calculate_traded_flags(world):
if world.dungeon_mq['Spirit Temple']: # Patch Spirit MQ Lobby front right chest to use permanent switch flag 0x1F
rom.write_byte(0x2b08ce4 + 13, 0x1F)

if not world.dungeon_mq['Bottom of the Well']:
# Collecting the final BotW basement silver rupee and activating the cutscene of the door unlocking while on the ladder causes a softlock.
# Move slightly the X coordinate of this actor so that it cannot be collected while climbing.
# This is a vanilla bug tracked at https://github.com/OoTRandomizer/OoT-Randomizer/issues/2004
# If and when that bug is fixed in rando, this displacement can be removed.
rom.write_int16(0x32E92C6, 0xFD78)

# Write flag table data
#collectible_flag_table, alt_list = get_collectible_flag_table(world)
xflags_tables, alt_list = build_xflags_from_world(world)
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ issue. You should always Hard Reset to avoid this issue entirely.
* Fix castle courtyard exiting to incorrect area in Ganon's Castle Dungeon ER.
* Fix heart piece count getting zeroed out incorrectly in certain circumstances.
* Business scrubs now take their payment before giving the item.
* The softlock which occurs when collecting a shuffled silver rupee on the ladder in the Bottom of the Well is now fixed by moving the item location so it can't be collected from the ladder instead of disallowing silver rupees on this location.
* Fix inverted cursor in the pause menu when pausing while in first person with the `Uninvert Y-Axis in First Person Camera` cosmetic setting enabled.

#### New Speedups
* Meg will now take less time before respawning after getting hurt.
Expand Down
7 changes: 0 additions & 7 deletions Rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,6 @@ def set_rules(world: World) -> None:
else:
add_item_rule(location, lambda location, item: item.type != 'Shop')

if world.shuffle_silver_rupees and location.name == 'Bottom of the Well Basement Silver Rupee Ladders Middle':
# Collecting the final BotW basement silver rupee and activating the cutscene of the door unlocking while on the ladder causes a softlock.
# This is a vanilla bug tracked at https://github.com/OoTRandomizer/OoT-Randomizer/issues/2004
# If and when that bug is fixed in rando, this item restriction can be removed.
forbid_item(location, 'Silver Rupee (Bottom of the Well Basement)')
forbid_item(location, 'Silver Rupee Pouch (Bottom of the Well Basement)')

if world.skip_child_zelda and location.name == 'Song from Impa':
if world.settings.triforce_hunt and world.total_starting_triforce_count >= world.triforce_goal - world.settings.world_count:
# We have enough starting Triforce pieces that putting a piece on every world's Song from Impa would hit the goal count
Expand Down
8 changes: 6 additions & 2 deletions assets/pre-commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
new_version_py = f.read()

for old_line, new_line in zip(old_version_py.splitlines(), new_version_py.splitlines()):
if old_line.startswith("__version__ = '"):
same_primary = old_line == new_line
if old_line.startswith('supplementary_version = '):
if old_line == new_line:
sys.exit('Missing version bump')
same_supplementary = old_line == new_line

if same_primary and same_supplementary:
sys.exit('Missing version bump')
44 changes: 30 additions & 14 deletions data/Hints/weekly.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
{
"name": "weekly",
"gui_name": "Weekly",
"description": "Hint distribution for weekly races. 5 Goal hints, 3 Barren hints, 6 Entrance/Sometimes hints, 6 Always hints (including Skull Mask and Sheik in Kakariko).",
"description": "Hint distribution for the weekly races. 6 Goal hints, 3 Barren hints, 6 Sometimes hints, 1 Dual hint, 4 Always hints.",
"add_locations": [
{ "location": "Deku Theater Skull Mask", "types": ["always"] },
{ "location": "Sheik in Kakariko", "types": ["always"] },
{ "location": "DMC Deku Scrub", "types": ["always"] }
{ "location": "Deku Theater Skull Mask", "types": ["always"] }
],
"remove_locations": [
{ "location": "Ganons Castle Shadow Trial Golden Gauntlets Chest", "types": ["sometimes"] },
{ "location": "Song from Royal Familys Tomb", "types": ["sometimes"] },
{ "location": "Sheik in Forest", "types": ["sometimes"] },
{ "location": "Sheik at Temple", "types": ["sometimes"] },
{ "location": "Sheik in Crater", "types": ["sometimes"] },
{ "location": "Sheik in Ice Cavern", "types": ["sometimes"] },
{ "location": "Sheik at Colossus", "types": ["sometimes"] },
{ "location": "Song from Royal Familys Tomb", "types": ["sometimes"] }
{ "location": "GF HBA 1500 Points", "types": ["sometimes"] },
{ "location": "GC Maze Left Chest", "types": ["sometimes"] },
{ "location": "GV Chest", "types": ["sometimes"] },
{ "location": "HC Great Fairy Reward", "types": ["sometimes"] },
{ "location": "OGC Great Fairy Reward", "types": ["sometimes"] },
{ "location": "Gerudo Training Ground Maze Path Final Chest", "types": ["sometimes"] },
{ "location": "Ice Cavern Iron Boots Chest", "types": ["sometimes"] },
{ "location": "Ganons Castle Shadow Trial Golden Gauntlets Chest", "types": ["sometimes"] },
{ "location": "Graveyard Dampe Race Rewards", "types": ["dual"] },
{ "location": "Graveyard Royal Family Tomb Contents", "types": ["dual"] },
{ "location": "Fire Temple Lower Loop", "types": ["dual"] },
{ "location": "Water Temple River Loop Chests", "types": ["dual"] },
{ "location": "Spirit Temple Colossus Hands", "types": ["dual"] },
{ "location": "Spirit Temple Child Lower", "types": ["dual"] },
{ "location": "Spirit Temple Adult Lower", "types": ["dual"] },
{ "location": "Shadow Temple Invisible Blades Chests", "types": ["dual"] },
{ "location": "Shadow Temple Spike Walls Room", "types": ["dual"] },
{ "location": "Ganons Castle Spirit Trial Chests", "types": ["dual"] }
],
"add_items": [],
"remove_items": [
Expand All @@ -27,20 +43,20 @@
"trial": {"order": 1, "weight": 0.0, "fixed": 0, "copies": 2},
"entrance_always": {"order": 2, "weight": 0.0, "fixed": 0, "copies": 2},
"always": {"order": 3, "weight": 0.0, "fixed": 0, "copies": 2},
"goal": {"order": 4, "weight": 0.0, "fixed": 5, "copies": 2},
"goal": {"order": 4, "weight": 0.0, "fixed": 6, "copies": 2},
"barren": {"order": 5, "weight": 0.0, "fixed": 3, "copies": 2},
"entrance": {"order": 6, "weight": 9.0, "fixed": 0, "copies": 2},
"sometimes": {"order": 7, "weight": 9.0, "fixed": 0, "copies": 2},
"random": {"order": 8, "weight": 0.0, "fixed": 0, "copies": 2},
"named-item": {"order": 9, "weight": 0.0, "fixed": 0, "copies": 2},
"entrance": {"order": 6, "weight": 0.0, "fixed": 0, "copies": 2},
"dual": {"order": 7, "weight": 0.0, "fixed": 1, "copies": 2},
"sometimes": {"order": 8, "weight": 1.0, "fixed": 0, "copies": 2},
"random": {"order": 0, "weight": 0.0, "fixed": 0, "copies": 2},
"item": {"order": 0, "weight": 0.0, "fixed": 0, "copies": 2},
"song": {"order": 0, "weight": 0.0, "fixed": 0, "copies": 2},
"overworld": {"order": 0, "weight": 0.0, "fixed": 0, "copies": 2},
"dungeon": {"order": 0, "weight": 0.0, "fixed": 0, "copies": 2},
"junk": {"order": 0, "weight": 0.0, "fixed": 0, "copies": 2},
"named-item": {"order": 0, "weight": 0.0, "fixed": 0, "copies": 2},
"woth": {"order": 0, "weight": 0.0, "fixed": 0, "copies": 2},
"dual_always": {"order": 0, "weight": 0.0, "fixed": 0, "copies": 0},
"dual": {"order": 0, "weight": 0.0, "fixed": 0, "copies": 0},
"important_check": {"order": 0, "weight": 0.0, "fixed": 0, "copies": 0}
"dual_always": {"order": 0, "weight": 0.0, "fixed": 0, "copies": 2},
"important_check": {"order": 0, "weight": 0.0, "fixed": 0, "copies": 2}
}
}
Loading

0 comments on commit c35ef38

Please sign in to comment.