mirror of
https://github.com/pret/pmd-sky.git
synced 2026-03-21 17:25:15 -05:00
Fixed sync-to-pmdsky-debug inserting in wrong place
This commit is contained in:
parent
fbd9e668a5
commit
6564a51336
|
|
@ -8926,7 +8926,7 @@ DUNGEON_MAIN_MENU_ITEMS:
|
|||
.byte 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF
|
||||
.global DUNGEON_MENU_SWITCH_STR1
|
||||
DUNGEON_MENU_SWITCH_STR1:
|
||||
.byte 0x5B, 0x64, 0x75, 0x6E, 0x67, 0x65, 0x6F, 0x6E, 0x3A, 0x30, 0x5D, 0x00
|
||||
.string "[dungeon:0]"
|
||||
.global OVERLAY31_UNKNOWN_STRING_IDS
|
||||
OVERLAY31_UNKNOWN_STRING_IDS:
|
||||
.hword 0x8C7 + OV31_DATA_OFFSET
|
||||
|
|
|
|||
|
|
@ -157,13 +157,13 @@ def sync_xmap_symbol(address: int, symbol: SymbolDetails, language: str, section
|
|||
# Keep track of the symbol directly before the target symbol.
|
||||
# This will be used as an anchor when appending to the header file.
|
||||
symbol_header_line = find_symbol_in_header(symbol_entry['name'], symbol.is_data, header_contents)
|
||||
if symbol_header_line is not None:
|
||||
if symbol_header_line is not None and insert_index is None:
|
||||
target_header_line = symbol_header_line
|
||||
if language_key in symbol_entry['address']:
|
||||
current_symbol_address: int | List[int] = symbol_entry['address'][language_key]
|
||||
if isinstance(current_symbol_address, list):
|
||||
current_symbol_address = current_symbol_address[0]
|
||||
if current_symbol_address > address and insert_index is not None:
|
||||
if current_symbol_address > address and insert_index is None:
|
||||
insert_index = i
|
||||
if not matching_symbol_entry:
|
||||
matching_symbol_entry = {
|
||||
|
|
@ -273,7 +273,7 @@ def sync_xmap_symbol(address: int, symbol: SymbolDetails, language: str, section
|
|||
else:
|
||||
symbol_header = f'void {base_symbol_name}(void);\n'
|
||||
|
||||
header_contents[target_header_line - 1] += symbol_header
|
||||
header_contents[target_header_line] += symbol_header
|
||||
|
||||
with open(header_path, 'w') as header_file:
|
||||
header_file.writelines(header_contents)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user