shithub: pokered

Download patch

ref: 4b0f1982bfb76743d9fd2d0b6d3e30a391e5e438
parent: a8ef3c70db97e3fc8e5f8764bb9a25c42b3e8628
author: Bryan Bishop <kanzure@gmail.com>
date: Sun Jan 15 11:34:32 EST 2012

update analyze_incbins for common.asm

hg-commit-id: ea7bf352f66c


--- a/extras/analyze_incbins.py
+++ b/extras/analyze_incbins.py
@@ -26,7 +26,7 @@
     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 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 @@
     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 @@
     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 @@
     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 @@
         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__":