From ff60685f4e08699ba9655bbdd9773b6f4a8d9140 Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Sat, 7 Jan 2012 15:13:24 -0600 Subject: text analysis and insertion code (TX_FAR targets only) hg-commit-id: e4c007ad1c11 --- extras/analyze_incbins.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'extras/analyze_incbins.py') diff --git a/extras/analyze_incbins.py b/extras/analyze_incbins.py index 7c7c93dd..4bc82c63 100644 --- a/extras/analyze_incbins.py +++ b/extras/analyze_incbins.py @@ -204,6 +204,32 @@ def dump_all_remaining_maps(): print "Inserting map id=" + str(map_id) wrapper_insert_map_header_asm(map_id) +def reset_incbins(): + "reset asm before inserting another diff" + asm = None + incbin_lines = [] + processed_incbins = {} + load_asm() + isolate_incbins() + process_incbins() + +def apply_diff(diff): + print "... Applying diff." + + #write the diff to a file + fh = open("temp.patch", "w") + fh.write(diff) + fh.close() + + #apply the patch + os.system("patch ../pokered.asm temp.patch") + + #remove the patch + os.system("rm temp.patch") + + #confirm it's working + subprocess.check_call("cd ../; make clean; LC_CTYPE=UTF-8 make", shell=True) + if __name__ == "__main__": #load map headers load_rom() -- cgit v1.2.3