You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-09-08 08:13:02 -07:00
tool to help narrow down the problem in a bank
This commit is contained in:
@@ -5962,6 +5962,14 @@ class Asm:
|
|||||||
#make sure the file ends with a newline
|
#make sure the file ends with a newline
|
||||||
fh.write("\n")
|
fh.write("\n")
|
||||||
|
|
||||||
|
def list_things_in_bank(bank):
|
||||||
|
objects = []
|
||||||
|
for blah in script_parse_table.items():
|
||||||
|
object = blah[1]
|
||||||
|
if hasattr(object, "address") and calculate_bank(object.address) == bank:
|
||||||
|
objects.append(object)
|
||||||
|
return objects
|
||||||
|
|
||||||
def list_texts_in_bank(bank):
|
def list_texts_in_bank(bank):
|
||||||
""" Narrows down the list of objects
|
""" Narrows down the list of objects
|
||||||
that you will be inserting into Asm.
|
that you will be inserting into Asm.
|
||||||
@@ -6032,6 +6040,27 @@ def dump_asm_for_movements_in_bank(bank, start=0, end=100):
|
|||||||
asm.dump()
|
asm.dump()
|
||||||
print "done dumping movements for bank $%.2x" % (bank)
|
print "done dumping movements for bank $%.2x" % (bank)
|
||||||
|
|
||||||
|
def dump_things_in_bank(bank, start=50, end=100):
|
||||||
|
""" is helpful for figuring out which object is breaking that bank.
|
||||||
|
"""
|
||||||
|
# load and parse the ROM if necessary
|
||||||
|
if rom == None or len(rom) <= 4:
|
||||||
|
load_rom()
|
||||||
|
run_main()
|
||||||
|
|
||||||
|
things = list_things_in_bank(bank)[start:end]
|
||||||
|
|
||||||
|
# create a new dump
|
||||||
|
asm = Asm()
|
||||||
|
|
||||||
|
# start the insertion process
|
||||||
|
asm.insert_multiple_with_dependencies(things)
|
||||||
|
|
||||||
|
# start dumping
|
||||||
|
asm.dump()
|
||||||
|
|
||||||
|
print "done dumping things for bank $%.2x" % (bank)
|
||||||
|
|
||||||
def index(seq, f):
|
def index(seq, f):
|
||||||
"""return the index of the first item in seq
|
"""return the index of the first item in seq
|
||||||
where f(item) == True."""
|
where f(item) == True."""
|
||||||
|
Reference in New Issue
Block a user