summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorjdflyer <jdflyer10@gmail.com>2022-01-17 20:00:12 -0700
committerjdflyer <jdflyer10@gmail.com>2022-01-17 20:00:12 -0700
commitecc987f34cff6397e9785063effcc5f2e7dc33c5 (patch)
treef313955fb3df6bdf6437a1d6b902797710fec6d0 /tools
parent824a9eabc9e54bb5f5c6318fe0eb7e62aff2173c (diff)
Hyrule field speedhack and shiftability fixes
Diffstat (limited to 'tools')
-rw-r--r--tools/lcf.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/lcf.py b/tools/lcf.py
index a350382ae9..214ac5b383 100644
--- a/tools/lcf.py
+++ b/tools/lcf.py
@@ -104,9 +104,16 @@ def lcf_generate(output_path,shiftable,map_file):
addr = symbol['addr']
if shiftable==True:
for line in map_file:
+ literals_found = []
if type(symbol['name'])==str and line.find(' '+symbol['name']+' ')!=-1 and name[0] != "@" or type(symbol['label']) == str and line.find(' '+symbol['label']+' ')!=-1:
linesplit = line.split()
if len(linesplit) > 3 and linesplit[2]!="NOT":
+ if line.find("lit_")!=-1:
+ lbl = symbol['label']
+ for literal in literals_found:
+ if literal == lbl:
+ print("Warning! two literals with the same name found!\n"+lbl)
+ literals_found.append(symbol['label'])
addr = int(linesplit[2],16)
file.write(f"\t\"{symbol['label']}\" = 0x{addr:08X};\n")
else: