summaryrefslogtreecommitdiff
path: root/tools/fix_sections.py
diff options
context:
space:
mode:
authorluckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com>2018-07-08 17:34:41 -0400
committerluckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com>2018-07-08 17:34:41 -0400
commitca09233c9eca4c6b9b0ccfba436dcd7e3b3e669c (patch)
tree4f7596be6169491f801756fdda59d6b51a751afe /tools/fix_sections.py
parent116b3b251931b0cd973d5d3f312fa32c2b16b197 (diff)
Build files in maps/
Diffstat (limited to 'tools/fix_sections.py')
-rw-r--r--tools/fix_sections.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/fix_sections.py b/tools/fix_sections.py
index e00917c..fa40b4b 100644
--- a/tools/fix_sections.py
+++ b/tools/fix_sections.py
@@ -11,13 +11,17 @@ debug_lines_startswith = [
"endc"
]
-with open("pokegold-spaceworld.link", "r") as f:
+with open("pokegold-spaceworld-gen.link", "r") as f:
linkerscript = f.read()
def clean_section(line, file, multiple):
global linkerscript
lines = line.lstrip().split("\"")
- file += "@" + lines[1] if multiple else ""
+ if "@" not in lines[1] and not file == lines[1]:
+ file += ("@" + lines[1]) if multiple else ""
+ else:
+ file = lines[1]
+
linkerscript = linkerscript.replace("\"" + lines[1] + "\"", "\"" + file + "\"")
if "ROMX" in lines[2]:
return "SECTION \"%s\", ROMX" % file
@@ -32,7 +36,7 @@ def clean_section(line, file, multiple):
else:
raise
-TEMP_PATH = ""
+TEMP_PATH = "temp/"
for root, dirs, files in os.walk(cwd):
for file in files: