From ecc987f34cff6397e9785063effcc5f2e7dc33c5 Mon Sep 17 00:00:00 2001 From: jdflyer Date: Mon, 17 Jan 2022 20:00:12 -0700 Subject: Hyrule field speedhack and shiftability fixes --- tools/lcf.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tools') 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: -- cgit v1.2.3