Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time independent skulltulas #2332

Draft
wants to merge 13 commits into
base: Dev
Choose a base branch
from
263 changes: 263 additions & 0 deletions Cutscenes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Optional
from enum import IntEnum

from Rom import Rom
from Settings import Settings
Expand Down Expand Up @@ -503,3 +504,265 @@ def patch_wondertalk2(rom: Rom, settings: Settings) -> None:
# And move the hint spot down the log so that it doesn't pop every time a song is played, and let some room to do ocarina item glitch.
rom.write_int16s(0x2059412, [0x03C0, 0x00E2, 0xFAA6]) # Move coordinates. Original value : 1000, 205, -1202. New value : 960, 226, -1370.
rom.write_byte(0x205941F, 0xBF) # Never set the flag.


# Gaps in IDs are intentional
# https://github.com/zeldaret/oot/blob/7235af2249843fb68740111b70089bad827a4730/include/z64cutscene.h#L35-L165
class CutsceneCommandID(IntEnum):
CS_CMD_CAM_EYE_SPLINE = 0x0001
CS_CMD_CAM_AT_SPLINE = 0x0002
CS_CMD_MISC = 0x0003
CS_CMD_LIGHT_SETTING = 0x0004
CS_CMD_CAM_EYE_SPLINE_REL_TO_PLAYER = 0x0005
CS_CMD_CAM_AT_SPLINE_REL_TO_PLAYER = 0x0006
CS_CMD_CAM_EYE = 0x0007
CS_CMD_CAM_AT = 0x0008
CS_CMD_RUMBLE_CONTROLLER = 0x0009
CS_CMD_PLAYER_CUE = 0x000A
CS_CMD_UNIMPLEMENTED_B = 0x000B
CS_CMD_UNIMPLEMENTED_D = 0x000D
CS_CMD_ACTOR_CUE_1_0 = 0x000E
CS_CMD_ACTOR_CUE_0_0 = 0x000F
CS_CMD_ACTOR_CUE_1_1 = 0x0010
CS_CMD_ACTOR_CUE_0_1 = 0x0011
CS_CMD_ACTOR_CUE_0_2 = 0x0012
CS_CMD_TEXT = 0x0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x006C
CS_CMD_UNIMPLEMENTED_6D = 0x006D
CS_CMD_ACTOR_CUE_0_12 = 0x006E
CS_CMD_ACTOR_CUE_7_3 = 0x006F
CS_CMD_UNIMPLEMENTED_70 = 0x0070
CS_CMD_UNIMPLEMENTED_71 = 0x0071
CS_CMD_ACTOR_CUE_7_4 = 0x0072
CS_CMD_ACTOR_CUE_6_5 = 0x0073
CS_CMD_ACTOR_CUE_1_12 = 0x0074
CS_CMD_ACTOR_CUE_2_10 = 0x0075
CS_CMD_ACTOR_CUE_1_13 = 0x0076
CS_CMD_ACTOR_CUE_0_13 = 0x0077
CS_CMD_ACTOR_CUE_1_14 = 0x0078
CS_CMD_ACTOR_CUE_2_11 = 0x0079
CS_CMD_ACTOR_CUE_0_14 = 0x007B
CS_CMD_FADE_OUT_SEQ = 0x007C
CS_CMD_ACTOR_CUE_1_15 = 0x007D
CS_CMD_ACTOR_CUE_2_12 = 0x007E
CS_CMD_ACTOR_CUE_3_11 = 0x007F
CS_CMD_ACTOR_CUE_4_7 = 0x0080
CS_CMD_ACTOR_CUE_5_5 = 0x0081
CS_CMD_ACTOR_CUE_6_6 = 0x0082
CS_CMD_ACTOR_CUE_1_16 = 0x0083
CS_CMD_ACTOR_CUE_2_13 = 0x0084
CS_CMD_ACTOR_CUE_3_12 = 0x0085
CS_CMD_ACTOR_CUE_7_5 = 0x0086
CS_CMD_ACTOR_CUE_4_8 = 0x0087
CS_CMD_ACTOR_CUE_5_6 = 0x0088
CS_CMD_ACTOR_CUE_6_7 = 0x0089
CS_CMD_ACTOR_CUE_0_15 = 0x008A
CS_CMD_ACTOR_CUE_0_16 = 0x008B
CS_CMD_TIME = 0x008C
CS_CMD_ACTOR_CUE_1_17 = 0x008D
CS_CMD_ACTOR_CUE_7_6 = 0x008E
CS_CMD_ACTOR_CUE_9_0 = 0x008F
CS_CMD_ACTOR_CUE_0_17 = 0x0090
CS_CMD_DESTINATION = 0x03E8
CS_CMD_END = 0xFFFFFFFF


ACTOR_CUE_COMMANDS = [
CutsceneCommandID.CS_CMD_PLAYER_CUE,
CutsceneCommandID.CS_CMD_ACTOR_CUE_1_0,
CutsceneCommandID.CS_CMD_ACTOR_CUE_0_0,
CutsceneCommandID.CS_CMD_ACTOR_CUE_1_1,
CutsceneCommandID.CS_CMD_ACTOR_CUE_0_1,
CutsceneCommandID.CS_CMD_ACTOR_CUE_0_2,
CutsceneCommandID.CS_CMD_ACTOR_CUE_0_3,
CutsceneCommandID.CS_CMD_ACTOR_CUE_1_2,
CutsceneCommandID.CS_CMD_ACTOR_CUE_2_0,
CutsceneCommandID.CS_CMD_ACTOR_CUE_3_0,
CutsceneCommandID.CS_CMD_ACTOR_CUE_4_0,
CutsceneCommandID.CS_CMD_ACTOR_CUE_6_0,
CutsceneCommandID.CS_CMD_ACTOR_CUE_0_4,
CutsceneCommandID.CS_CMD_ACTOR_CUE_1_3,
CutsceneCommandID.CS_CMD_ACTOR_CUE_2_1,
CutsceneCommandID.CS_CMD_ACTOR_CUE_3_1,
CutsceneCommandID.CS_CMD_ACTOR_CUE_4_1,
CutsceneCommandID.CS_CMD_ACTOR_CUE_0_5,
CutsceneCommandID.CS_CMD_ACTOR_CUE_1_4,
CutsceneCommandID.CS_CMD_ACTOR_CUE_2_2,
CutsceneCommandID.CS_CMD_ACTOR_CUE_3_2,
CutsceneCommandID.CS_CMD_ACTOR_CUE_4_2,
CutsceneCommandID.CS_CMD_ACTOR_CUE_5_0,
CutsceneCommandID.CS_CMD_ACTOR_CUE_0_6,
CutsceneCommandID.CS_CMD_ACTOR_CUE_4_3,
CutsceneCommandID.CS_CMD_ACTOR_CUE_1_5,
CutsceneCommandID.CS_CMD_ACTOR_CUE_7_0,
CutsceneCommandID.CS_CMD_ACTOR_CUE_2_3,
CutsceneCommandID.CS_CMD_ACTOR_CUE_3_3,
CutsceneCommandID.CS_CMD_ACTOR_CUE_6_1,
CutsceneCommandID.CS_CMD_ACTOR_CUE_3_4,
CutsceneCommandID.CS_CMD_ACTOR_CUE_4_4,
CutsceneCommandID.CS_CMD_ACTOR_CUE_5_1,
CutsceneCommandID.CS_CMD_ACTOR_CUE_6_2,
CutsceneCommandID.CS_CMD_ACTOR_CUE_6_3,
CutsceneCommandID.CS_CMD_ACTOR_CUE_7_1,
CutsceneCommandID.CS_CMD_ACTOR_CUE_8_0,
CutsceneCommandID.CS_CMD_ACTOR_CUE_3_5,
CutsceneCommandID.CS_CMD_ACTOR_CUE_1_6,
CutsceneCommandID.CS_CMD_ACTOR_CUE_3_6,
CutsceneCommandID.CS_CMD_ACTOR_CUE_3_7,
CutsceneCommandID.CS_CMD_ACTOR_CUE_2_4,
CutsceneCommandID.CS_CMD_ACTOR_CUE_1_7,
CutsceneCommandID.CS_CMD_ACTOR_CUE_2_5,
CutsceneCommandID.CS_CMD_ACTOR_CUE_1_8,
CutsceneCommandID.CS_CMD_ACTOR_CUE_2_6,
CutsceneCommandID.CS_CMD_ACTOR_CUE_2_7,
CutsceneCommandID.CS_CMD_ACTOR_CUE_3_8,
CutsceneCommandID.CS_CMD_ACTOR_CUE_0_7,
CutsceneCommandID.CS_CMD_ACTOR_CUE_5_2,
CutsceneCommandID.CS_CMD_ACTOR_CUE_1_9,
CutsceneCommandID.CS_CMD_ACTOR_CUE_4_5,
CutsceneCommandID.CS_CMD_ACTOR_CUE_1_10,
CutsceneCommandID.CS_CMD_ACTOR_CUE_2_8,
CutsceneCommandID.CS_CMD_ACTOR_CUE_3_9,
CutsceneCommandID.CS_CMD_ACTOR_CUE_4_6,
CutsceneCommandID.CS_CMD_ACTOR_CUE_5_3,
CutsceneCommandID.CS_CMD_ACTOR_CUE_0_8,
CutsceneCommandID.CS_CMD_ACTOR_CUE_6_4,
CutsceneCommandID.CS_CMD_ACTOR_CUE_7_2,
CutsceneCommandID.CS_CMD_ACTOR_CUE_5_4,
CutsceneCommandID.CS_CMD_ACTOR_CUE_0_9,
CutsceneCommandID.CS_CMD_ACTOR_CUE_1_11,
CutsceneCommandID.CS_CMD_ACTOR_CUE_0_10,
CutsceneCommandID.CS_CMD_ACTOR_CUE_2_9,
CutsceneCommandID.CS_CMD_ACTOR_CUE_0_11,
CutsceneCommandID.CS_CMD_ACTOR_CUE_3_10,
CutsceneCommandID.CS_CMD_ACTOR_CUE_0_12,
CutsceneCommandID.CS_CMD_ACTOR_CUE_7_3,
CutsceneCommandID.CS_CMD_ACTOR_CUE_7_4,
CutsceneCommandID.CS_CMD_ACTOR_CUE_6_5,
CutsceneCommandID.CS_CMD_ACTOR_CUE_1_12,
CutsceneCommandID.CS_CMD_ACTOR_CUE_2_10,
CutsceneCommandID.CS_CMD_ACTOR_CUE_1_13,
CutsceneCommandID.CS_CMD_ACTOR_CUE_0_13,
CutsceneCommandID.CS_CMD_ACTOR_CUE_1_14,
CutsceneCommandID.CS_CMD_ACTOR_CUE_2_11,
CutsceneCommandID.CS_CMD_ACTOR_CUE_0_14,
CutsceneCommandID.CS_CMD_ACTOR_CUE_1_15,
CutsceneCommandID.CS_CMD_ACTOR_CUE_2_12,
CutsceneCommandID.CS_CMD_ACTOR_CUE_3_11,
CutsceneCommandID.CS_CMD_ACTOR_CUE_4_7,
CutsceneCommandID.CS_CMD_ACTOR_CUE_5_5,
CutsceneCommandID.CS_CMD_ACTOR_CUE_6_6,
CutsceneCommandID.CS_CMD_ACTOR_CUE_1_16,
CutsceneCommandID.CS_CMD_ACTOR_CUE_2_13,
CutsceneCommandID.CS_CMD_ACTOR_CUE_3_12,
CutsceneCommandID.CS_CMD_ACTOR_CUE_7_5,
CutsceneCommandID.CS_CMD_ACTOR_CUE_4_8,
CutsceneCommandID.CS_CMD_ACTOR_CUE_5_6,
CutsceneCommandID.CS_CMD_ACTOR_CUE_6_7,
CutsceneCommandID.CS_CMD_ACTOR_CUE_0_15,
CutsceneCommandID.CS_CMD_ACTOR_CUE_0_16,
CutsceneCommandID.CS_CMD_ACTOR_CUE_1_17,
CutsceneCommandID.CS_CMD_ACTOR_CUE_7_6,
CutsceneCommandID.CS_CMD_ACTOR_CUE_9_0,
CutsceneCommandID.CS_CMD_ACTOR_CUE_0_17,
]

GENERIC_COMMANDS = [
CutsceneCommandID.CS_CMD_MISC,
CutsceneCommandID.CS_CMD_LIGHT_SETTING,
CutsceneCommandID.CS_CMD_START_SEQ,
CutsceneCommandID.CS_CMD_STOP_SEQ,
CutsceneCommandID.CS_CMD_FADE_OUT_SEQ,
]

CAMERA_COMMANDS = [
CutsceneCommandID.CS_CMD_CAM_EYE_SPLINE,
CutsceneCommandID.CS_CMD_CAM_AT_SPLINE,
CutsceneCommandID.CS_CMD_CAM_EYE_SPLINE_REL_TO_PLAYER,
CutsceneCommandID.CS_CMD_CAM_AT_SPLINE_REL_TO_PLAYER,
]

NULL_COMMANDS = [
CutsceneCommandID.CS_CMD_CAM_EYE,
CutsceneCommandID.CS_CMD_CAM_AT,
]

# z_demo tables
ENTRANCE_CUTSCENE_TABLE_ADDRESS = 0xB65C64
UNKNOWN_LIST_CUTSCENES = 0xB65D74 # does not include NULL first entry

# z_demo_kekkai list
SAGE_CUTSCENES = 0xECF8EC
Loading