diff --git a/tools/disasm_script.py b/tools/disasm_script.py index 807b0629c8..8f857581a0 100755 --- a/tools/disasm_script.py +++ b/tools/disasm_script.py @@ -600,8 +600,15 @@ class ScriptDSLDisassembler(ScriptDisassembler): elif opcode == 0x41: self.write_line(f"{self.var(argv[0])} &=c {argv[1]:X};") elif opcode == 0x42: self.write_line(f"{self.var(argv[0])} |=c {argv[1]:X};") elif opcode == 0x43: - argv_str = ", ".join(self.var(arg) for arg in argv[1:]) - self.write_line(f"{self.addr_ref(argv[0])}({argv_str});") + addr = argv[0] + if addr in self.symbol_map: + func_name = self.symbol_map[addr] + + argv_str = ", ".join(self.var(arg) for arg in argv[1:]) + self.write_line(f"{func_name}({argv_str});") + else: + print(f"script API function {addr:X} is not present in symbol_addrs.txt, please add it") + exit(1) elif opcode == 0x44: self.write_line(f"spawn {self.addr_ref(argv[0])};") elif opcode == 0x45: self.write_line(f"{self.var(argv[1])} = spawn {self.addr_ref(argv[0])};") elif opcode == 0x46: self.write_line(f"await {self.addr_ref(argv[0])};")