mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
more de-dependency-looping
This commit is contained in:
parent
ca07f1d64c
commit
1342ab67db
@ -302,15 +302,7 @@ def load_map_group_offsets():
|
|||||||
map_group_offsets.append(offset)
|
map_group_offsets.append(offset)
|
||||||
return map_group_offsets
|
return map_group_offsets
|
||||||
|
|
||||||
def calculate_bank(address):
|
from pointers import calculate_bank, calculate_pointer
|
||||||
"""you are too lazy to divide on your own?"""
|
|
||||||
if type(address) == str:
|
|
||||||
address = int(address, 16)
|
|
||||||
if 0x4000 <= address <= 0x7FFF:
|
|
||||||
raise Exception, "bank 1 does not exist"
|
|
||||||
return int(address) / 0x4000
|
|
||||||
|
|
||||||
from pointers import calculate_pointer
|
|
||||||
|
|
||||||
def calculate_pointer_from_bytes_at(address, bank=False):
|
def calculate_pointer_from_bytes_at(address, bank=False):
|
||||||
"""calculates a pointer from 2 bytes at a location
|
"""calculates a pointer from 2 bytes at a location
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
""" Various label/line-related functions.
|
""" Various label/line-related functions.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from pointers import calculate_pointer
|
from pointers import calculate_pointer, calculate_bank
|
||||||
|
|
||||||
def remove_quoted_text(line):
|
def remove_quoted_text(line):
|
||||||
"""get rid of content inside quotes
|
"""get rid of content inside quotes
|
||||||
|
@ -2,6 +2,14 @@
|
|||||||
depedency loops.
|
depedency loops.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
def calculate_bank(address):
|
||||||
|
"""you are too lazy to divide on your own?"""
|
||||||
|
if type(address) == str:
|
||||||
|
address = int(address, 16)
|
||||||
|
#if 0x4000 <= address <= 0x7FFF:
|
||||||
|
# raise Exception, "bank 1 does not exist"
|
||||||
|
return int(address) / 0x4000
|
||||||
|
|
||||||
def calculate_pointer(short_pointer, bank=None):
|
def calculate_pointer(short_pointer, bank=None):
|
||||||
"""calculates the full address given a 4-byte pointer and bank byte"""
|
"""calculates the full address given a 4-byte pointer and bank byte"""
|
||||||
short_pointer = int(short_pointer)
|
short_pointer = int(short_pointer)
|
||||||
|
Loading…
Reference in New Issue
Block a user