mirror of https://github.com/pret/pokecrystal.git
more cleaning
This commit is contained in:
parent
c79db81d43
commit
0768fead4f
|
@ -534,7 +534,7 @@ temp_opt_table = [
|
||||||
[ "E", 0x100, -1 ],
|
[ "E", 0x100, -1 ],
|
||||||
]
|
]
|
||||||
|
|
||||||
#construct real opt_table
|
# construct a more useful version of opt_table
|
||||||
opt_table = {}
|
opt_table = {}
|
||||||
for line in temp_opt_table:
|
for line in temp_opt_table:
|
||||||
opt_table[line[1]] = [line[0], line[2]]
|
opt_table[line[1]] = [line[0], line[2]]
|
||||||
|
@ -550,7 +550,6 @@ end_08_scripts_with = [
|
||||||
relative_jumps = [0x38, 0x30, 0x20, 0x28, 0x18, 0xc3, 0xda, 0xc2]
|
relative_jumps = [0x38, 0x30, 0x20, 0x28, 0x18, 0xc3, 0xda, 0xc2]
|
||||||
relative_unconditional_jumps = [0xc3, 0x18]
|
relative_unconditional_jumps = [0xc3, 0x18]
|
||||||
|
|
||||||
#TODO: replace call and a pointer with call and a label
|
|
||||||
call_commands = [0xdc, 0xd4, 0xc4, 0xcc, 0xcd]
|
call_commands = [0xdc, 0xd4, 0xc4, 0xcc, 0xcd]
|
||||||
|
|
||||||
all_labels = {}
|
all_labels = {}
|
||||||
|
@ -563,8 +562,10 @@ def load_labels(filename="labels.json"):
|
||||||
load_labels()
|
load_labels()
|
||||||
|
|
||||||
def find_label(local_address, bank_id=0):
|
def find_label(local_address, bank_id=0):
|
||||||
global all_labels
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
global all_labels
|
||||||
|
|
||||||
# keep an integer
|
# keep an integer
|
||||||
if type(local_address) == str:
|
if type(local_address) == str:
|
||||||
local_address1 = int(local_address.replace("$", "0x"), 16)
|
local_address1 = int(local_address.replace("$", "0x"), 16)
|
||||||
|
@ -585,7 +586,7 @@ def find_label(local_address, bank_id=0):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def asm_label(address):
|
def asm_label(address):
|
||||||
# why using a random value when you can use the eff. address?
|
# why using a random value when you can use the address?
|
||||||
return ".ASM_" + hex(address)[2:]
|
return ".ASM_" + hex(address)[2:]
|
||||||
|
|
||||||
def output_bank_opcodes(original_offset, max_byte_count=0x4000):
|
def output_bank_opcodes(original_offset, max_byte_count=0x4000):
|
||||||
|
@ -810,7 +811,8 @@ def output_bank_opcodes(original_offset, max_byte_count=0x4000):
|
||||||
|
|
||||||
def has_outstanding_labels(byte_labels):
|
def has_outstanding_labels(byte_labels):
|
||||||
"""
|
"""
|
||||||
if a label is used once, it means it has to be called or specified later
|
If a label is used once in the asm output, then that means it has to be
|
||||||
|
called or specified later.
|
||||||
"""
|
"""
|
||||||
for label_line in byte_labels.keys():
|
for label_line in byte_labels.keys():
|
||||||
real_line = byte_labels[label_line]
|
real_line = byte_labels[label_line]
|
||||||
|
|
Loading…
Reference in New Issue