Skip to content

Commit

Permalink
Merge 'New cutscene speedup : Defeat Morpha' (#2270)
Browse files Browse the repository at this point in the history
# Conflicts:
#	Cutscenes.py
  • Loading branch information
fenhl committed Oct 9, 2024
2 parents 5016b88 + 5fd31b9 commit 99dd143
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 59 deletions.
69 changes: 11 additions & 58 deletions Cutscenes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
from Rom import Rom
from Settings import Settings

# The following helpers can be used when the cutscene is written in the form of CutsceneData instructions.
# This is the case for all cutscenes defined directly in their scenes, and some specific ones in their actor file.
# However some cutscenes like all the ones tied to bosses are done "manually" in their actor files in a completely different format.

def delete_cutscene(rom: Rom, address: int) -> None:
# Address is the start of the cutscene commands.
# Insert the CS END command at the start of the file.
Expand Down Expand Up @@ -71,16 +75,6 @@ def patch_cutscene_misc_command(rom: Rom, address: int, start_frame:int, end_fra
rom.write_int16(address + 4, end_frame)

def patch_cutscenes(rom: Rom, songs_as_items: bool, settings: Settings) -> None:
# Speed scene after Deku Tree
# Deku Tree talking to Link.
# Cut to 1 frame and redirect destination to the get Emerald cutscene (0x07).
patch_cutscene_destination_and_length(rom, 0x2077E20, 1, 0x07)
# Recieve the Emerald cutscene.
patch_cutscene_destination_and_length(rom, 0x2078A10, 31)
# Display the 0x0080 textbox (You got the Kokiri's Emerald!) between 0 and 30 frames.
patch_textbox_during_cutscene(rom, 0x2079570, 0x0080, 0, 30)
# Display no text between 30 and 40 frames.
patch_textbox_during_cutscene(rom, 0x207957C, 0, 30, 40)

# Speed obtaining Fairy Ocarina
patch_cutscene_destination_and_length(rom, 0x2151230, 60)
Expand Down Expand Up @@ -173,11 +167,6 @@ def patch_cutscenes(rom: Rom, songs_as_items: bool, settings: Settings) -> None:
# Play Sarias Song to Darunia
delete_cutscene(rom, 0x22769E0)

# Speed scene after Dodongo's Cavern
patch_cutscene_destination_and_length(rom, 0x2221E88, 59)
# Display the 0x0081 textbox (You got the Goron's Ruby!) between 0 and 58 frames.
patch_textbox_during_cutscene(rom, 0x2223308, 0x0081, 0, 58)

# Speed up Death Mountain Trail Owl Flight
patch_cutscene_destination_and_length(rom, 0x223B6B0, 1)

Expand All @@ -190,11 +179,6 @@ def patch_cutscenes(rom: Rom, songs_as_items: bool, settings: Settings) -> None:
# Speed scene after Jabu Jabu's Belly
# Cut Ruto talking to Link when entering the blue warp.
rom.write_int32(0xCA3530, 0x00000000)
patch_cutscene_destination_and_length(rom, 0x2113340, 59)
# Display the 0x0081 textbox (You got the Zora's Sapphire!) between 0 and 58 frames.
patch_textbox_during_cutscene(rom, 0x2113C18, 0x0082, 0, 58)
# Ensure the initial white screen will stay on screen for 59 frames and not switch briefly to the next cutscene.
patch_cutscene_scene_transition(rom, 0x21131D0, 1, 0, 59)

# Speed up Lake Hylia Owl Flight
patch_cutscene_destination_and_length(rom, 0x20E60D0, 1)
Expand Down Expand Up @@ -276,15 +260,6 @@ def patch_cutscenes(rom: Rom, songs_as_items: bool, settings: Settings) -> None:
# Last part is 250 frames.
rom.write_int32(0xC94594, 0x00000000)

# Speed scene after Forest Temple
# Saria becomes a Sage cutscene.
# Cut to 59 frames and redirect to the third part of the Deku Sprout cutscene (0x45).
patch_cutscene_destination_and_length(rom, 0xD4ED68, 59, 0x45)
# Display the 0x003E textbox (You received the Forest Medallion!) between 0 and 58 frames.
patch_textbox_during_cutscene(rom, 0xD4ED78, 0x003E, 0, 58)
# Deku Sprout cutscene number 3.
delete_cutscene(rom, 0x207B9D0)

# Speed learning Prelude of Light
if songs_as_items:
delete_cutscene(rom, 0x0252FD20)
Expand Down Expand Up @@ -318,14 +293,6 @@ def patch_cutscenes(rom: Rom, songs_as_items: bool, settings: Settings) -> None:
rom.write_int16(0x0224B828, 0x0000)
rom.write_int16(0x0224B858, 0x0000)

# Speed scene after Fire Temple
# Crater volcano erupting from Kakariko.
patch_cutscene_destination_and_length(rom, 0x2001848, 1)
# Darunia becomes a Sage cutscene.
patch_cutscene_destination_and_length(rom, 0xD100B4, 59)
# Display the 0x003C textbox (You received the Fire Medallion!) between 0 and 58 frames.
patch_textbox_during_cutscene(rom, 0xD10134, 0x003C, 0, 58)

# Speed learning Serenade of Water
if songs_as_items:
delete_cutscene(rom, 0x02BEB250)
Expand All @@ -348,15 +315,13 @@ def patch_cutscenes(rom: Rom, songs_as_items: bool, settings: Settings) -> None:
# Restart Ice cavern music on frame 33.
rom.write_int16s(0x02BEC852, [0x0021, 0x0022])

# Speed scene after Water Temple
# Ruto becomes a Sage cutscene.
patch_cutscene_destination_and_length(rom, 0xD5A458, 59)
# Display the 0x003D textbox (You received the Water Medallion!) between 0 and 58 frames.
patch_textbox_during_cutscene(rom, 0xD5A3A8, 0x003D, 0, 58)
# Set the "Restored Lake Hylia water" flag at the first frame.
patch_cutscene_misc_command(rom, 0x20D0B68, 1, 2)
# Lake Hylia restored water cutscene.
patch_cutscene_destination_and_length(rom, 0x20D0D20, 2)
# Speed Morpha defeat cutscene
rom.write_int16(0xD3FDA6, 0x43AF) # make the cam look at the ceiling after core burst
rom.write_int16(0xD3FDBA, 0x0068) # jump some cutscene states, go directly to MO_DEATH_DROPLET instead of MO_DEATH_DRAIN_WATER_1
rom.write_int16(0xD3FE1E, 0x0020) # change the timer for current state to 32 because the MO_DEATH_DROPLET state starts at timer 30
rom.write_int16(0xD3FE46, 0xC396) # make the water level down instantly
rom.write_int32(0xD4021C, 0x00000000) # prevent cam to do a 90 degree rotation
rom.write_int16(0xD40392, 0x003C) # stop the NA_SE_EN_MOFER_APPEAR sfx after 2sec

# Speed learning Nocturne of Shadow
# Burning Kak cutscene
Expand Down Expand Up @@ -399,12 +364,6 @@ def patch_cutscenes(rom: Rom, songs_as_items: bool, settings: Settings) -> None:
# New value : { 0.0f, 0.0f, 0.0f }, { 50.0f, 30.0f, -200.0f}
rom.write_int32s(0xB69804, [0x00000000, 0x00000000, 0x00000000, 0x42480000, 0x42480000, 0xC3480000])

# Speed scene after Shadow Temple
# Impa becomes a Sage cutscene.
patch_cutscene_destination_and_length(rom, 0xD13EC8, 59)
# Display the 0x0041 textbox (You received the Shadow Medallion!) between 0 and 58 frames.
patch_textbox_during_cutscene(rom, 0xD13E18, 0x0041, 0, 58)

# Speed learning Requiem of Spirit
if songs_as_items:
patch_cutscene_destination_and_length(rom, 0x0218B480, 1)
Expand Down Expand Up @@ -452,12 +411,6 @@ def patch_cutscenes(rom: Rom, songs_as_items: bool, settings: Settings) -> None:
# Replaces a if (msgId2 != 0) check by if (0 != 0) to prevent textboxes from starting.
rom.write_bytes(0xD67BA4, [0x10, 0x00])

# Speed scene after Spirit Temple
# Nabooru becomes a Sage cutscene.
patch_cutscene_destination_and_length(rom, 0xD3A0A8, 59)
# Display the 0x003F textbox (You received the Spirit Medallion!) between 0 and 58 frames.
patch_textbox_during_cutscene(rom, 0xD39FF0, 0x003F, 0, 58)

# Cutscene for all medallions never triggers when leaving shadow or spirit temples
rom.write_byte(0xACA409, 0xAD)
rom.write_byte(0xACA49D, 0xCE)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ issue. You should always Hard Reset to avoid this issue entirely.
* New hidden `plandomized_locations` setting to allow presets to place specific items at specific locations.
* New setting to speed up the boat ride in the Shadow Temple.
* New `Require Lens of Truth for Treasure Chest Game` setting.
* The cutscene that plays when Morpha is defeated has been shortened from around 30 seconds to around 5 seconds.

#### Bug fixes

Expand Down
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '8.2.16'
__version__ = '8.2.17'

# This is a supplemental version number for branches based off of main dev.
supplementary_version = 0
Expand Down

0 comments on commit 99dd143

Please sign in to comment.