Skip to content

Commit

Permalink
Merge 'Repeatable time-of-day changes from blue warps' (#2287)
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 Sep 8, 2024
2 parents a93636d + 36c50d3 commit bb31ce7
Show file tree
Hide file tree
Showing 8 changed files with 32,887 additions and 32,901 deletions.
1,310 changes: 655 additions & 655 deletions ASM/build/asm_symbols.txt

Large diffs are not rendered by default.

Binary file modified ASM/build/bundle.o
Binary file not shown.
1,312 changes: 656 additions & 656 deletions ASM/build/c_symbols.txt

Large diffs are not rendered by default.

32 changes: 21 additions & 11 deletions ASM/c/blue_warp.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

#define TEXT_STATE_CLOSING 2

#define SCENE_VOLVAGIA_BOSS_ROOM 0x0015
#define SCENE_MORPHA_BOSS_ROOM 0x0016

extern uint8_t PLAYER_ID;
extern uint8_t PLAYER_NAME_ID;
extern bool REWARDS_AS_ITEMS;
Expand Down Expand Up @@ -42,6 +45,16 @@ int32_t DoorWarp1_PlayerInRange_Overwrite(z64_actor_t* actor, z64_game_t* game)
}
extended_savectx.collected_dungeon_rewards[boss_idx] = true;
}
// set time of day each time the blue warp is taken to reduce nonrepeatable access
if (game->scene_index == SCENE_MORPHA_BOSS_ROOM) {
z64_file.skybox_time = z64_file.day_time = 0x4800; // CLOCK_TIME(6, 45)
} else {
z64_file.skybox_time = z64_file.day_time = 0x8000; // CLOCK_TIME(12, 00)
}
// reset heat timer after Volvagia
if (game->scene_index == SCENE_VOLVAGIA_BOSS_ROOM) {
z64_file.timer_1_state = 0;
}
// immediately activate the blue warp. Queued item will be given after the warp
return true;
}
Expand All @@ -57,38 +70,35 @@ int32_t DoorWarp1_IsShadowRewardObtained(void) {
}

void DoorWarp1_KokiriEmerald_Overwrite(void) {
z64_file.skybox_time = z64_file.day_time = 0x8000; // CLOCK_TIME(12, 00)
// code to run the first time the Queen Gohma blue warp is taken
}

void DoorWarp1_GoronRuby_Overwrite(void) {
z64_file.skybox_time = z64_file.day_time = 0x8000; // CLOCK_TIME(12, 00)
// code to run the first time the King Dodongo blue warp is taken
}

void DoorWarp1_ZoraSapphire_Overwrite(void) {
z64_file.skybox_time = z64_file.day_time = 0x8000; // CLOCK_TIME(12, 00)
// code to run the first time the Barinade blue warp is taken
}

void DoorWarp1_ForestMedallion_Overwrite(void) {
z64_file.skybox_time = z64_file.day_time = 0x8000; // CLOCK_TIME(12, 00)
// code to run the first time the Phantom Ganon blue warp is taken
}

void DoorWarp1_FireMedallion_Overwrite(void) {
z64_file.skybox_time = z64_file.day_time = 0x8000; // CLOCK_TIME(12, 00)
// code to run the first time the Volvagia blue warp is taken
z64_file.event_chk_inf[2] |= 1 << 15; // DMT cloud circle no longer fire
z64_file.timer_1_state = 0; // reset heat timer
}

void DoorWarp1_WaterMedallion_Overwrite(void) {
z64_file.skybox_time = z64_file.day_time = 0x4800; // CLOCK_TIME(6, 45)
// code to run the first time the Morpha blue warp is taken
z64_file.event_chk_inf[6] |= 1 << 9; // Lake Hylia water raised
}

void DoorWarp1_SpiritMedallion_Overwrite(void) {
extended_savectx.collected_dungeon_rewards[6] = true;
z64_file.skybox_time = z64_file.day_time = 0x8000; // CLOCK_TIME(12, 00)
// code to run the first time the Twinrova blue warp is taken
}

void DoorWarp1_ShadowMedallion_Overwrite(void) {
extended_savectx.collected_dungeon_rewards[7] = true;
z64_file.skybox_time = z64_file.day_time = 0x8000; // CLOCK_TIME(12, 00)
// code to run the first time the Bongo Bongo blue warp is taken
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ issue. You should always Hard Reset to avoid this issue entirely.
* Major items from pots, crates, etc now display above Link's head while the text box is open.
* Gameplay is no longer interrupted if you receive a junk item from another player in multiworld.
* Removed the potentially confusing Master Sword icon from the Rainbow Bridge page of the adult Temple of Time altar text.
* Blue warps now set time of day each time they're taken, fixing a potential softlock.

### 8.1

Expand Down
Loading

0 comments on commit bb31ce7

Please sign in to comment.