diff --git a/enemize/src/rom.rs b/enemize/src/rom.rs index 8b7a2e0..95b1fb6 100644 --- a/enemize/src/rom.rs +++ b/enemize/src/rom.rs @@ -69,6 +69,29 @@ impl RomData { && self.rom_data[self.asar_symbols["enemizer_info_table"] + ENEMIZER_INFO_SEED_OFFSET + 1] == b'N' } + pub fn is_randomizer(&self) -> bool { + let acceptable = [ + // item rando + b"VT", + // entrance rando + b"ER", + // door rando + b"DR", + // Berserker's multiworld + b"BM", + // Berserker's multiworld doors + b"BD", + // Archipelago + b"AP", + // Archipelago with door rando + b"AD", + ]; + + acceptable.iter().any(|abbr| &abbr[..] == &self.rom_data[0x7FC0..0x7Fc1]) || + (self.rom_data.len() >= 0x20_0000 && + &self.rom_data[0x7FC0..0x7FCE] == b"ZELDANODENSETSU") + } + fn assert_rom_length(&self) { assert!(self.rom_data.len() >= ENEMIZER_FILE_LENGTH, "You need to expand the rom before you can use Enemizer features."); }