Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion src/mars_patcher/constants/reserved_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ReservedConstants:
PATCHER_FREE_SPACE_ADDR = 0x7D0000
PATCHER_FREE_SPACE_END = PATCHER_FREE_SPACE_ADDR + 0x20000
MINOR_LOCS_TABLE_ADDR = 0x7FF000
MAJOR_LOCS_ADDR = 0x7FF01C
MAJOR_LOCS_POINTER_ADDR = 0x7FF01C
TANK_INC_ADDR = 0x7FF046
TOTAL_METROID_COUNT_ADDR = 0x7FF04C
REQUIRED_METROID_COUNT_ADDR = 0x7FF04D
Expand Down
6 changes: 4 additions & 2 deletions src/mars_patcher/item_patcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
MINOR_LOCS_TABLE_ADDR = ReservedConstants.MINOR_LOCS_TABLE_ADDR
MINOR_LOCS_ARRAY_ADDR = ReservedConstants.MINOR_LOCS_ARRAY_ADDR
MINOR_LOC_SIZE = 0x8
MAJOR_LOCS_ADDR = ReservedConstants.MAJOR_LOCS_ADDR
MAJOR_LOCS_POINTER_ADDR = ReservedConstants.MAJOR_LOCS_POINTER_ADDR
MAJOR_LOC_SIZE = 0x2
TANK_INC_ADDR = ReservedConstants.TANK_INC_ADDR
REQUIRED_METROID_COUNT_ADDR = ReservedConstants.REQUIRED_METROID_COUNT_ADDR
Expand Down Expand Up @@ -163,7 +163,9 @@ def write_items(self) -> None:
if maj_loc.new_item != ItemType.UNDEFINED:
if maj_loc.new_item == ItemType.INFANT_METROID:
total_metroids += 1
addr = MAJOR_LOCS_ADDR + (maj_loc.major_src.value * MAJOR_LOC_SIZE)
addr = rom.read_ptr(MAJOR_LOCS_POINTER_ADDR) + (
maj_loc.major_src.value * MAJOR_LOC_SIZE
)
rom.write_8(addr, maj_loc.new_item.value)
# Handle item messages
if maj_loc.item_messages is not None:
Expand Down