summaryrefslogtreecommitdiff
path: root/extras/analyze_incbins.py
diff options
context:
space:
mode:
Diffstat (limited to 'extras/analyze_incbins.py')
-rw-r--r--extras/analyze_incbins.py26
1 files changed, 26 insertions, 0 deletions
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()