From 4b0f1982bfb76743d9fd2d0b6d3e30a391e5e438 Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Sun, 15 Jan 2012 16:34:32 -0600 Subject: [PATCH] update analyze_incbins for common.asm hg-commit-id: ea7bf352f66c --- extras/analyze_incbins.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/extras/analyze_incbins.py b/extras/analyze_incbins.py index a4ca2b2b..353e5ea6 100644 --- a/extras/analyze_incbins.py +++ b/extras/analyze_incbins.py @@ -26,7 +26,7 @@ def offset_to_pointer(offset): if type(offset) == str: offset = int(offset, base) return int(offset) % 0x4000 + 0x4000 -def load_asm(filename="../pokered.asm"): +def load_asm(filename="../common.asm"): "loads the asm source code into memory" global asm asm = open(filename, "r").read().split("\n") @@ -83,7 +83,7 @@ def process_incbins(): def find_incbin_to_replace_for(address): """returns a line number for which incbin to edit - if you were to insert bytes into pokered.asm""" + if you were to insert bytes into common.asm""" if type(address) == str: address = int(address, 16) for incbin_key in processed_incbins.keys(): @@ -152,7 +152,7 @@ def generate_diff_insert(line_number, newline): newfile_fh.close() try: - diffcontent = subprocess.check_output("diff -u ../pokered.asm " + newfile_filename, shell=True) + diffcontent = subprocess.check_output("diff -u ../common.asm " + newfile_filename, shell=True) except AttributeError, exc: raise exc except Exception, exc: @@ -192,7 +192,7 @@ def insert_map_header_asm(map_id): fh.close() #apply the patch - os.system("patch ../pokered.asm temp.patch") + os.system("patch ../common.asm temp.patch") #remove the patch os.system("rm temp.patch") @@ -227,8 +227,8 @@ def apply_diff(diff, try_fixing=True): fh.close() #apply the patch - os.system("cp ../pokered.asm ../pokered1.asm") - os.system("patch ../pokered.asm temp.patch") + os.system("cp ../common.asm ../common1.asm") + os.system("patch ../common.asm temp.patch") #remove the patch os.system("rm temp.patch") @@ -238,7 +238,7 @@ def apply_diff(diff, try_fixing=True): subprocess.check_call("cd ../; make clean; LC_CTYPE=UTF-8 make", shell=True) except Exception, exc: if try_fixing: - os.system("mv ../pokered1.asm ../pokered.asm") + os.system("mv ../common1.asm ../common.asm") return False if __name__ == "__main__":