mirror of
https://github.com/pret/pokemon-reverse-engineering-tools.git
synced 2026-08-23 10:44:09 -05:00
move is_valid_address into addresses.py
This commit is contained in:
14
pokemontools/addresses.py
Normal file
14
pokemontools/addresses.py
Normal file
@@ -0,0 +1,14 @@
|
||||
"""
|
||||
Common methods used against addresses.
|
||||
"""
|
||||
|
||||
def is_valid_address(address):
|
||||
"""is_valid_rom_address"""
|
||||
if address == None:
|
||||
return False
|
||||
if type(address) == str:
|
||||
address = int(address, 16)
|
||||
if 0 <= address <= 2097152:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
@@ -61,6 +61,9 @@ import item_constants
|
||||
import wram
|
||||
import exceptions
|
||||
|
||||
import addresses
|
||||
is_valid_address = addresses.is_valid_address
|
||||
|
||||
from map_names import map_names
|
||||
|
||||
# ---- script_parse_table explanation ----
|
||||
@@ -142,17 +145,6 @@ def load_asm2(filename="../main.asm"):
|
||||
new_asm = Asm(filename=filename)
|
||||
return new_asm
|
||||
|
||||
def is_valid_address(address):
|
||||
"""is_valid_rom_address"""
|
||||
if address == None:
|
||||
return False
|
||||
if type(address) == str:
|
||||
address = int(address, 16)
|
||||
if 0 <= address <= 2097152:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def rom_interval(offset, length, strings=True, debug=True):
|
||||
"""returns hex values for the rom starting at offset until offset+length"""
|
||||
global rom
|
||||
|
||||
Reference in New Issue
Block a user