diff --git a/tools/asm-differ/diff.py b/tools/asm-differ/diff.py index 55ead3b757..69f85203fd 100755 --- a/tools/asm-differ/diff.py +++ b/tools/asm-differ/diff.py @@ -381,6 +381,7 @@ def complete_symbol( import itertools import json import os +import platform import queue import re import string @@ -399,7 +400,8 @@ def complete_symbol( try: import watchdog - from colorama import Back, Fore, Style + from colorama import Back, Fore, Style, just_fix_windows_console + just_fix_windows_console() except ModuleNotFoundError as e: fail(MISSING_PREREQUISITES.format(e.name)) @@ -3599,7 +3601,10 @@ def display_thread(self, initial_output: str) -> None: self.less_proc = None if ret != 0: # fix the terminal - os.system("tput reset") + if platform.system() == "Windows": + os.system("cls") + else: + os.system("tput reset") if ret != 0 and self.pending_update is not None: # killed by program with the intent to refresh output = self.pending_update diff --git a/tools/asm-differ/diff_settings.py b/tools/asm-differ/diff_settings.py index 2f93cbc004..4778ea764d 100644 --- a/tools/asm-differ/diff_settings.py +++ b/tools/asm-differ/diff_settings.py @@ -1,4 +1,5 @@ import os +import sys import platform from typing import Optional @@ -28,7 +29,12 @@ def apply(config, _): config["make_command"] = ["ninja"] # TODO gc-wii-binutils - devkitpro = env("DEVKITPRO", "/opt/devkitpro") - devkitppc = env("DEVKITPPC", f"{devkitpro}/devkitPPC") - objdump = f"{devkitppc}/bin/powerpc-eabi-objdump{get_exe_suffix()}" + objdump = f"tools/mwcc_compiler/powerpc-eabi-objdump{get_exe_suffix()}" + if not os.path.exists(objdump): + devkitpro = env("DEVKITPRO", "/opt/devkitpro") + devkitppc = env("DEVKITPPC", f"{devkitpro}/devkitPPC") + objdump = f"{devkitppc}/bin/powerpc-eabi-objdump{get_exe_suffix()}" + if not os.path.exists(objdump): + print(f"ERROR: could not find powerpc-eabi-objdump{get_exe_suffix()}", file=sys.stderr) + sys.exit(1) config["objdump_executable"] = objdump