Skip to content

Commit

Permalink
asm-differ now works on Windows
Browse files Browse the repository at this point in the history
You need to put less.exe and tail.exe on PATH somewhere. I got tail.exe
from UnxUtils and less.exe from github.com/jftuga/less-Windows. Also you
need to put powerpc-eabi-objdump.exe (from devkitPPC) into
tools/mwcc_compiler.
  • Loading branch information
BR- committed Jan 28, 2024
1 parent 37ea54b commit acabd92
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
9 changes: 7 additions & 2 deletions tools/asm-differ/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ def complete_symbol(
import itertools
import json
import os
import platform
import queue
import re
import string
Expand All @@ -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))

Expand Down Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions tools/asm-differ/diff_settings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import sys
import platform
from typing import Optional

Expand Down Expand Up @@ -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

0 comments on commit acabd92

Please sign in to comment.