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

VC crash screen + load progress #2153

Merged
merged 6 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,47 @@ def generate_wad(wad_file: str, rom_file: str, output_file: str, channel_title:
if not os.path.isfile(wad_file):
raise Exception("Cannot open base WAD file.")

try:
with open(wad_file, 'rb') as wad_stream:
wad_buffer = bytearray(wad_stream.read(0xFC0))
except FileNotFoundError as ex:
raise FileNotFoundError(f'Invalid path to Base WAD: "{input_file}"')

wad_app1_sha1_usa = [
[0x76, 0x3D, 0x4D, 0x3D, 0x07, 0x13, 0xE4, 0xD1, 0x0E, 0x44, 0x54, 0x0C, 0xCF, 0xA3, 0x25, 0x5E, 0x19, 0xF2, 0x8A, 0xF7], # US Wad App1
]

wad_app1_sha1_jpn = [
[0x47, 0x54, 0x6E, 0x48, 0x46, 0x7A, 0xE1, 0x4D, 0x71, 0x2B, 0x8C, 0x20, 0x7E, 0x91, 0x18, 0x21, 0x58, 0x6D, 0x10, 0x43], # JP Wad App1
]

wad_app5_sha1_usa = [
[0x7C, 0x94, 0x77, 0x69, 0x68, 0xA7, 0xE1, 0xF5, 0xFD, 0x5D, 0xC5, 0xE2, 0xB6, 0xF8, 0x32, 0xEE, 0xF4, 0x55, 0x35, 0xA0], # US Wad App5
]

wad_app5_sha1_jpn = [
[0xD1, 0x4D, 0xEF, 0x1E, 0xCE, 0xB0, 0x6D, 0xE2, 0x05, 0xA3, 0x53, 0xC4, 0xB5, 0x66, 0xFD, 0x55, 0x9C, 0x25, 0x4F, 0x1F], # JP Wad App5
]

wad_patch_name = ""
wad_app1_sha1 = list(wad_buffer[0xF18:0xF2C])
wad_app5_sha1 = list(wad_buffer[0xFA8:0xFBC])

if wad_app1_sha1 in wad_app1_sha1_usa:
if wad_app5_sha1 in wad_app5_sha1_usa:
wad_patch_name = "ootr_usa.gzi"
else:
raise Exception('Base WAD file is not a valid OoT USA or JPN wad.')
elif wad_app1_sha1 in wad_app1_sha1_jpn:
if wad_app5_sha1 in wad_app5_sha1_jpn:
wad_patch_name = "ootr_jpn.gzi"
else:
raise Exception('Base WAD file is not a valid OoT USA or JPN wad.')
else:
raise Exception('Base WAD file is not a valid OoT USA or JPN wad.')
fenhl marked this conversation as resolved.
Show resolved Hide resolved

gzinject_path = "./" if is_bundled() else "bin/gzinject/"
gzinject_patch_path = gzinject_path + "ootr.gzi"
gzinject_patch_path = gzinject_path + wad_patch_name
if platform.system() == 'Windows':
if platform.machine() == 'AMD64':
gzinject_path += "gzinject.exe"
Expand Down
4 changes: 2 additions & 2 deletions bin/gzinject/ootr.gzi → bin/gzinject/ootr_jpn.gzi
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# ootr remapping for NACE and NACJ
# ootr remapping for NACJ
0000 00000000 00000001
# use 8MB memory
0304 00002EB0 60000000
# apply d-pad remappings
0302 0016BAF4 00000400
0302 0016BAF8 00000200
0302 0016BAFC 00000100
0302 0016BAFC 00000100
Loading
Loading