summaryrefslogtreecommitdiff
path: root/extras/add_map_labels_to_map_headers.py
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2013-09-10 20:08:49 -0500
committerBryan Bishop <kanzure@gmail.com>2013-09-10 20:08:49 -0500
commite47308a1f88f19dfc0ee5cb42dc643a520d9175b (patch)
tree7ae7bb3ff46ceeab012869db3cbdad86545a0496 /extras/add_map_labels_to_map_headers.py
parenta684941cfcf88942cbecaecf997609acc3652a1a (diff)
parent37c80175368352710e20f752ebfdc1e9e3ac3e2b (diff)
Merge branch kanzure/master into dannye-incbins
Conflicts: extras
Diffstat (limited to 'extras/add_map_labels_to_map_headers.py')
m---------extras0
-rw-r--r--extras/add_map_labels_to_map_headers.py41
2 files changed, 0 insertions, 41 deletions
diff --git a/extras b/extras
new file mode 160000
+Subproject 7aa016fb528bcc8dcb30c6a887957851623eccc
diff --git a/extras/add_map_labels_to_map_headers.py b/extras/add_map_labels_to_map_headers.py
deleted file mode 100644
index 89e6f361..00000000
--- a/extras/add_map_labels_to_map_headers.py
+++ /dev/null
@@ -1,41 +0,0 @@
-#author: Bryan Bishop <kanzure@gmail.com>
-#date: 2011-01-04
-#purpose: insert labels into map headers
-import sys
-
-asm = None
-asm_lines = []
-def load_asm():
- global asm, asm_lines
- asm = open("../pokered.asm", "r").read()
- asm_lines = asm.split("\n")
-
-def find_with_start_of_line(name):
- global asm_lines
- for line in asm_lines:
- if len(line) > len(name) and ": " in line:
- if line[:len(name)] == name: return True
- return False
-
-def process_lines():
- global asm, asm_lines
- for line in asm_lines:
- if not "_h:" in line: continue #skip
- index = asm_lines.index(line)
- name = line.split("_h:")[0]
-
- if "Blocks" in asm_lines[index+3]: continue #skip, already done
- #if not (str(name + "Blocks:") in asm): continue #skip, no block label found
- if not find_with_start_of_line(name + "Blocks:"): continue #skip
-
- orig_line = asm_lines[index+3]
- fixed_line = orig_line.split(",")
- fixed_line[0] = " dw " + name + "Blocks"
- fixed_line = ",".join(fixed_line)
-
- asm_lines[index+3] = fixed_line
-
-if __name__ == "__main__":
- load_asm()
- process_lines()
- sys.stdout.write("\n".join(asm_lines))