Fix byte indexes.

And standardize on lower-case hexadecimal.
This commit is contained in:
Lyle Mantooth 2022-06-04 14:39:11 -04:00
parent fed38efcc4
commit 4972986fee
Signed by: IslandUsurper
GPG key ID: 6DB52EAE123A5789

View file

@ -25,8 +25,8 @@ pub const RANDOM_SPRITE_FLAG: usize = 0x03;
pub const AGAHNIM_BOUNCE_BALLS_FLAG: usize = 0x04;
pub const ENABLE_MIMIC_OVERRIDE_FLAG: usize = 0x05;
pub const ENABLE_TERRORPIN_AI_FIX_FLAG: usize = 0x06;
pub const CHECKSUM_COMPLIMENT_ADDRESS: usize = 0x7FDC;
pub const CHECKSUM_ADDRESS: usize = 0x7FDE;
pub const CHECKSUM_COMPLIMENT_ADDRESS: usize = 0x7fdc;
pub const CHECKSUM_ADDRESS: usize = 0x7fde;
pub const RANDOMIZER_MODE_FLAG: usize = 0x180032;
pub struct RomData {
@ -53,7 +53,7 @@ impl RomData {
DUNGEON_HEADER_POINTER_TABLE..(DUNGEON_HEADER_POINTER_TABLE + 640);
self.rom_data[dungeon_header_range].copy_from_slice(&ORIGINAL_ROOM_POINTERS);
let room_range = 0x5B97..(0x5B97 + 576);
let room_range = 0x5b97..(0x5b97 + 576);
self.rom_data[room_range].copy_from_slice(&ORIGINAL_ROOM_BLOCKS);
let ow_gfx_range = OVERWORLD_AREA_GRAPHICS_BLOCK..(OVERWORLD_AREA_GRAPHICS_BLOCK + 272);
@ -117,15 +117,15 @@ impl RomData {
acceptable
.iter()
.any(|abbr| &abbr[..] == &self.rom_data[0x7FC0..0x7Fc1])
.any(|abbr| &abbr[..] == &self.rom_data[0x7fc0..0x7fc2])
|| (self.rom_data.len() >= 0x20_0000
&& &self.rom_data[0x7FC0..0x7FCE] == b"ZELDANODENSETSU")
&& &self.rom_data[0x7fc0..0x7fcf] == b"ZELDANODENSETSU")
}
pub fn is_race(&self) -> bool {
self.is_randomizer()
&& (&self.rom_data[0x180213..0x180214] == &[1, 0]
|| &self.rom_data[0x7FC0..0x7FC9] == b"VT TOURNEY")
|| &self.rom_data[0x7fc0..0x7fca] == b"VT TOURNEY")
}
fn assert_rom_length(&self) {
@ -169,8 +169,8 @@ impl RomData {
pub fn expand_rom(&mut self) {
self.rom_data.resize(0x40_0000, 0);
// Update header length.
self.rom_data[0x7FD7] = 0x0C;
self.set_patch_bytes(0x7FD7..0x7FD8);
self.rom_data[0x7fd7] = 0x0c;
self.set_patch_bytes(0x7fd7..0x7fd8);
self.set_enemizer_version("6.0.32".to_owned());
}
@ -261,7 +261,7 @@ impl RomData {
let table_base = DUNGEON_HEADER_POINTER_TABLE;
let header_base = self.asar_symbols["room_header_table"];
// Change room header bank (at 0xB5E7) to 0x04.
// Change room header bank (at 0xb5e7) to 0x04.
let new_room_bank =
self.rom_data[self.asar_symbols["moved_room_header_bank_value_address"]];
self.rom_data[ROOM_HEADER_BANK_LOCATION] = new_room_bank;