From 4972986feec372235db62ac2546ad1d55a976179 Mon Sep 17 00:00:00 2001 From: Lyle Mantooth Date: Sat, 4 Jun 2022 14:39:11 -0400 Subject: [PATCH] Fix byte indexes. And standardize on lower-case hexadecimal. --- enemize/src/rom.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/enemize/src/rom.rs b/enemize/src/rom.rs index 2ae8d66..fe22d41 100644 --- a/enemize/src/rom.rs +++ b/enemize/src/rom.rs @@ -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;