Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Crain-32 committed Feb 22, 2022
2 parents 12de823 + 3f2fac0 commit 6cc270a
Show file tree
Hide file tree
Showing 29 changed files with 284 additions and 89 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Add seed key
run: echo "${{ secrets.SEED_KEY }}" > keys/seed_key.py
run: echo "$env:SEED_KEY" > keys/seed_key.py
env:
SEED_KEY: ${{ secrets.SEED_KEY }}
- name: Add release key
run: echo ${{ secrets.RELEASE_KEY }} > keys/build_key.txt
run: echo "$env:RELEASE_KEY" > keys/build_key.txt
env:
RELEASE_KEY: ${{ secrets.RELEASE_KEY }}
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
Expand Down Expand Up @@ -60,18 +64,23 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Add seed key
run: echo "${{ secrets.SEED_KEY }}" > keys/seed_key.py
run: echo "$SEED_KEY" > keys/seed_key.py
env:
SEED_KEY: ${{ secrets.SEED_KEY }}
- name: Add release key
run: echo ${{ secrets.RELEASE_KEY }} > keys/build_key.txt
run: echo "$RELEASE_KEY" > keys/build_key.txt
env:
RELEASE_KEY: ${{ secrets.RELEASE_KEY }}
- name: Set up Miniconda with Python 3.9
uses: goanpeca/setup-miniconda@v1
with:
python-version: 3.9
architecture: ${{ matrix.architecture }}
miniconda-version: latest
auto-update-conda: true
- run: |
conda create -qyf -n py38 python=3.9 wheel -c anaconda
conda activate py38
conda create -qyf -n py39 python=3.9 wheel -c anaconda
conda activate py39
shell: bash -l {0}
- name: Install dependencies
run: |
Expand Down Expand Up @@ -107,9 +116,13 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Add seed key
run: echo "${{ secrets.SEED_KEY }}" > keys/seed_key.py
run: echo "$SEED_KEY" > keys/seed_key.py
env:
SEED_KEY: ${{ secrets.SEED_KEY }}
- name: Add release key
run: echo ${{ secrets.RELEASE_KEY }} > keys/build_key.txt
run: echo "$RELEASE_KEY" > keys/build_key.txt
env:
RELEASE_KEY: ${{ secrets.RELEASE_KEY }}
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
Expand Down
10 changes: 8 additions & 2 deletions asm/assemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,18 @@ def try_apply_local_relocation(bin_name, elf_relocation, elf_symbol):
if line[0] == ";":
# Comment
continue
raise Exception("Found code when no file was open")
if line == ".section \".text\"":
# Ignore the failsafe section reset after an include
continue
raise Exception("Found code when no file was open:\n%s" % line)
if most_recent_org_offset is None:
if line[0] == ";":
# Comment
continue
raise Exception("Found code before any .org directive")
if line == ".section \".text\"":
# Ignore the failsafe section reset after an include
continue
raise Exception("Found code before any .org directive:\n%s" % line)

code_chunks[patch_name][most_recent_file_path][most_recent_org_offset] += line + "\n"

Expand Down
13 changes: 9 additions & 4 deletions asm/custom_symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ sys/main.dol:
ballad_of_gales_warp_table: 0x803FCFB0
ballad_of_gales_warp_float_bank: 0x803FCFF8
custom_DynamicNameTable: 0x803FD050
custom_l_objectName: 0x803FD066
custom_DMC: 0x803FD072
custom_l_objectName_end: 0x803FD072
custom_l_objectName: 0x803FD068
custom_DMC: 0x803FD074
custom_l_objectName_end: 0x803FD074
init_save_with_tweaks: 0x803FD850
init_starting_gear: 0x803FDBD4
num_triforce_shards_to_start_with: 0x803FDC1C
Expand Down Expand Up @@ -96,8 +96,13 @@ sys/main.dol:
test_room_room_index: 0x800531E7
test_room_override_layer_num: 0x800531EB
files/rels/d_a_rd.rel:
redead_check_spawn_switch: 0x61E4
redead_check_disable_spawn_switch: 0x61E4
redead_set_death_switch: 0x621C
files/rels/d_a_ph.rel:
peahat_check_disable_spawn_switch: 0x7F70
peahat_set_death_switch: 0x7FB8
peahat_check_enable_spawn_switch: 0x7FE4
peahat_check_enable_spawn_switch_for_draw: 0x803C
files/rels/d_a_npc_bs1.rel:
set_shop_item_in_bait_bag_slot_sold_out: 0x61F0
check_shop_item_in_bait_bag_slot_sold_out: 0x6220
Expand Down
1 change: 0 additions & 1 deletion asm/disassemble.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

from subprocess import call
from subprocess import DEVNULL
import tempfile
import os
import re
from io import BytesIO
Expand Down
49 changes: 48 additions & 1 deletion asm/patch_diffs/add_new_enemy_rando_params_diff.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,54 @@ files/rels/d_a_rd.rel:
Offset: 0x1C, Type: R_PPC_REL24}]
0x4874:
Data: [0x48, 0x00, 0x00, 0x00]
Relocations: [{SymbolName: redead_check_spawn_switch, Offset: 0x00, Type: R_PPC_REL24}]
Relocations: [{SymbolName: redead_check_disable_spawn_switch, Offset: 0x00, Type: R_PPC_REL24}]
0x1FBC:
Data: [0x48, 0x00, 0x00, 0x00]
Relocations: [{SymbolName: redead_set_death_switch, Offset: 0x00, Type: R_PPC_REL24}]
files/rels/d_a_ph.rel:
0x7F70:
Data: [0xA8, 0x9D, 0x02, 0x0C, 0x54, 0x84, 0x06, 0x3E, 0x38, 0x00, 0x00, 0x00,
0xB0, 0x1D, 0x02, 0x0C, 0x28, 0x04, 0x00, 0xFF, 0x41, 0x82, 0x00, 0x2C, 0x28,
0x04, 0x00, 0x00, 0x41, 0x82, 0x00, 0x24, 0x98, 0x9D, 0x0B, 0x49, 0x3C, 0x60,
0x00, 0x00, 0x38, 0x63, 0x00, 0x00, 0x88, 0xBD, 0x02, 0x0A, 0x48, 0x00, 0x00,
0x01, 0x2C, 0x03, 0x00, 0x00, 0x41, 0x82, 0x00, 0x08, 0x4B, 0xFF, 0xE9, 0x20,
0x7F, 0xA3, 0xEB, 0x78, 0x4B, 0xFF, 0xE9, 0x00]
Relocations: [{SymbolName: g_dComIfG_gameInfo, Offset: 0x26, Type: R_PPC_ADDR16_HA},
{SymbolName: g_dComIfG_gameInfo, Offset: 0x2A, Type: R_PPC_ADDR16_LO}, {SymbolName: isSwitch__10dSv_info_cFii,
Offset: 0x30, Type: R_PPC_REL24}]
0x7FB8:
Data: [0x88, 0x9E, 0x0B, 0x49, 0x28, 0x04, 0x00, 0xFF, 0x41, 0x82, 0x00, 0x1C,
0x28, 0x04, 0x00, 0x00, 0x41, 0x82, 0x00, 0x14, 0x3C, 0x60, 0x00, 0x00, 0x38,
0x63, 0x00, 0x00, 0x88, 0xBE, 0x02, 0x0A, 0x48, 0x00, 0x00, 0x01, 0x7F, 0xC3,
0xF3, 0x78, 0x4B, 0xFF, 0xC1, 0x3C]
Relocations: [{SymbolName: g_dComIfG_gameInfo, Offset: 0x16, Type: R_PPC_ADDR16_HA},
{SymbolName: g_dComIfG_gameInfo, Offset: 0x1A, Type: R_PPC_ADDR16_LO}, {SymbolName: onSwitch__10dSv_info_cFii,
Offset: 0x20, Type: R_PPC_REL24}]
0x7FE4:
Data: [0x80, 0x9E, 0x00, 0xB0, 0x54, 0x84, 0x46, 0x3E, 0x28, 0x04, 0x00, 0xFF,
0x41, 0x82, 0x00, 0x30, 0x28, 0x04, 0x00, 0x00, 0x41, 0x82, 0x00, 0x28, 0x3C,
0x60, 0x00, 0x00, 0x38, 0x63, 0x00, 0x00, 0x88, 0xBE, 0x02, 0x0A, 0x48, 0x00,
0x00, 0x01, 0x2C, 0x03, 0x00, 0x00, 0x40, 0x82, 0x00, 0x10, 0x38, 0x00, 0x00,
0x00, 0x90, 0x1E, 0x02, 0x80, 0x4B, 0xFF, 0xE2, 0x40, 0x38, 0x00, 0x00, 0x04,
0x90, 0x1E, 0x02, 0x80, 0x80, 0x9E, 0x00, 0xB0, 0x64, 0x84, 0xFF, 0x00, 0x90,
0x9E, 0x00, 0xB0, 0xC0, 0x1E, 0x02, 0xC0, 0x4B, 0xFF, 0xDA, 0xF8]
Relocations: [{SymbolName: g_dComIfG_gameInfo, Offset: 0x1A, Type: R_PPC_ADDR16_HA},
{SymbolName: g_dComIfG_gameInfo, Offset: 0x1E, Type: R_PPC_ADDR16_LO}, {SymbolName: isSwitch__10dSv_info_cFii,
Offset: 0x24, Type: R_PPC_REL24}]
0x803C:
Data: [0x80, 0x9F, 0x00, 0xB0, 0x54, 0x84, 0x46, 0x3E, 0x28, 0x04, 0x00, 0xFF,
0x41, 0x82, 0x00, 0x10, 0x28, 0x04, 0x00, 0x00, 0x41, 0x82, 0x00, 0x08, 0x4B,
0xFF, 0x84, 0x68, 0x80, 0x7F, 0x02, 0xBC, 0x4B, 0xFF, 0x83, 0x00]
0x68B0:
Data: [0x48, 0x00, 0x00, 0x00]
Relocations: [{SymbolName: peahat_check_disable_spawn_switch, Offset: 0x00, Type: R_PPC_REL24}]
0x4118:
Data: [0x48, 0x00, 0x00, 0x00]
Relocations: [{SymbolName: peahat_set_death_switch, Offset: 0x00, Type: R_PPC_REL24}]
0x5B2C:
Data: [0x48, 0x00, 0x00, 0x00]
Relocations: [{SymbolName: peahat_check_enable_spawn_switch, Offset: 0x00, Type: R_PPC_REL24}]
0x358:
Data: [0x48, 0x00, 0x00, 0x00]
Relocations: [{SymbolName: peahat_check_enable_spawn_switch_for_draw, Offset: 0x00,
Type: R_PPC_REL24}]
4 changes: 2 additions & 2 deletions asm/patch_diffs/custom_data_diff.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ sys/main.dol:
0x00, 0x00, 0x43, 0x11, 0x00, 0x00, 0xC2, 0xA0, 0x00, 0x00, 0x42, 0xAC, 0x00,
0x00, 0xC3, 0x41, 0x00, 0x00, 0x3F, 0xCC, 0xCC, 0xCD, 0x3F, 0x40, 0x00, 0x00,
0x01, 0xF6, 0x00, 0x00, 0x80, 0x3F, 0xD0, 0x58, 0x64, 0x5F, 0x61, 0x5F, 0x73,
0x77, 0x69, 0x74, 0x63, 0x68, 0x5F, 0x6F, 0x70, 0x00, 0x53, 0x77, 0x4F, 0x70,
0x00, 0x00, 0x00, 0x00, 0x01, 0xF6, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x77, 0x69, 0x74, 0x63, 0x68, 0x5F, 0x6F, 0x70, 0x00, 0x00, 0x00, 0x53, 0x77,
0x4F, 0x70, 0x00, 0x00, 0x00, 0x00, 0x01, 0xF6, 0xFF, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
Expand Down
24 changes: 12 additions & 12 deletions asm/patch_diffs/misc_rando_features_diff.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ sys/main.dol:
0x803FEBB4:
Data: [0x28, 0x1E, 0x03, 0x39, 0x41, 0x82, 0x00, 0x10, 0x28, 0x1C, 0x03, 0x3A,
0x40, 0x80, 0x00, 0x14, 0x41, 0x80, 0x00, 0x0C, 0x3F, 0xE0, 0x80, 0x40, 0x3B,
0xFF, 0xD0, 0x66, 0x4B, 0xC4, 0x29, 0x9C, 0x38, 0x60, 0x00, 0x00, 0x4B, 0xC4,
0xFF, 0xD0, 0x68, 0x4B, 0xC4, 0x29, 0x9C, 0x38, 0x60, 0x00, 0x00, 0x4B, 0xC4,
0x29, 0xC4]
0x803FEBDC:
Data: [0x3C, 0xE0, 0x80, 0x40, 0x38, 0xE7, 0xD0, 0x72, 0x7C, 0x06, 0x38, 0x00,
0x41, 0x82, 0x00, 0x18, 0x3C, 0xC0, 0x80, 0x40, 0x38, 0xC6, 0xD0, 0x66, 0x38,
Data: [0x3C, 0xE0, 0x80, 0x40, 0x38, 0xE7, 0xD0, 0x74, 0x7C, 0x06, 0x38, 0x00,
0x41, 0x82, 0x00, 0x18, 0x3C, 0xC0, 0x80, 0x40, 0x38, 0xC6, 0xD0, 0x68, 0x38,
0x00, 0x00, 0x01, 0x7C, 0x09, 0x03, 0xA6, 0x4B, 0xC4, 0x29, 0xD4, 0x3C, 0x60,
0x80, 0x35, 0x4B, 0xC4, 0x29, 0xFC]
0x803FEC08:
Expand Down Expand Up @@ -132,23 +132,23 @@ sys/main.dol:
0x800415FC:
Data: [0x48, 0x3B, 0xD5, 0xE0]
0x80022818:
Data: [0x3C, 0x60, 0x80, 0x40, 0x38, 0x63, 0xD0, 0x72]
Data: [0x3C, 0x60, 0x80, 0x40, 0x38, 0x63, 0xD0, 0x74]
0x80022898:
Data: [0x3C, 0x60, 0x80, 0x40, 0x38, 0x63, 0xD0, 0x72]
Data: [0x3C, 0x60, 0x80, 0x40, 0x38, 0x63, 0xD0, 0x74]
0x800228EC:
Data: [0x3C, 0x60, 0x80, 0x40, 0x3B, 0x03, 0xD0, 0x72]
Data: [0x3C, 0x60, 0x80, 0x40, 0x3B, 0x03, 0xD0, 0x74]
0x80022930:
Data: [0x3C, 0x60, 0x80, 0x40, 0x38, 0x63, 0xD0, 0x72]
Data: [0x3C, 0x60, 0x80, 0x40, 0x38, 0x63, 0xD0, 0x74]
0x80022958:
Data: [0x3C, 0x60, 0x80, 0x40, 0x38, 0x63, 0xD0, 0x72]
Data: [0x3C, 0x60, 0x80, 0x40, 0x38, 0x63, 0xD0, 0x74]
0x80022990:
Data: [0x3C, 0x60, 0x80, 0x40, 0x38, 0x63, 0xD0, 0x72]
Data: [0x3C, 0x60, 0x80, 0x40, 0x38, 0x63, 0xD0, 0x74]
0x80022A40:
Data: [0x3C, 0x60, 0x80, 0x40, 0x38, 0x63, 0xD0, 0x72]
Data: [0x3C, 0x60, 0x80, 0x40, 0x38, 0x63, 0xD0, 0x74]
0x80022B24:
Data: [0x3C, 0x60, 0x80, 0x40, 0x38, 0x63, 0xD0, 0x72]
Data: [0x3C, 0x60, 0x80, 0x40, 0x38, 0x63, 0xD0, 0x74]
0x80022C30:
Data: [0x3C, 0x60, 0x80, 0x40, 0x38, 0x63, 0xD0, 0x72]
Data: [0x3C, 0x60, 0x80, 0x40, 0x38, 0x63, 0xD0, 0x74]
0x80022850:
Data: [0x28, 0x00, 0x01, 0xF7]
0x80022944:
Expand Down
8 changes: 4 additions & 4 deletions asm/patcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from fs_helpers import *
from wwrando_paths import ASM_PATH
from wwlib.rel import REL, RELSection, RELRelocation, RELRelocationType
from wwlib.rel import RELRelocation, RELRelocationType

ORIGINAL_FREE_SPACE_RAM_ADDRESS = 0x803FCFA8
ORIGINAL_DOL_SIZE = 0x3A52C0
Expand Down Expand Up @@ -199,11 +199,11 @@ def add_relocations_to_rel(self, file_path, rel_section_index, offset_into_secti

rel_relocation.section_num_to_relocate_against = other_rel_section_index
rel_relocation.symbol_address = relative_offset
elif ":" in symbol_name:
elif "$$" in symbol_name:
# Vanilla symbol located in a REL.
# We use a colon to signify rel_name:symbol_name.
# We use double dollar signs to denote rel_name$$symbol_name.
# (This is because we don't necessarily know for sure that the REL is calling a function inside of itself, it's possible to call a function in another REL.)
rel_name, symbol_name = symbol_name.split(":", 1)
rel_name, symbol_name = symbol_name.split("$$", 1)
other_rel = self.get_rel("files/rels/%s.rel" % rel_name)
other_rel_symbols = self.get_symbol_map("files/maps/%s.map" % rel_name)

Expand Down
Loading

0 comments on commit 6cc270a

Please sign in to comment.