Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions backend/compilers/compilers.linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ msdos:
- bcc2.0
- bcc3.1

wiiu:
- ghs5.3.22

win32:
- msvc4.0
- msvc4.1
Expand Down
18 changes: 18 additions & 0 deletions backend/coreapp/compilers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
COMMON_GCC_PS1_FLAGS,
COMMON_GCC_PS2_FLAGS,
COMMON_GCC_SATURN_FLAGS,
COMMON_GHS_FLAGS,
COMMON_IDO_FLAGS,
COMMON_MSVC_FLAGS,
COMMON_MWCC_NDS_ARM9_FLAGS,
Expand All @@ -42,6 +43,7 @@
SATURN,
DREAMCAST,
SWITCH,
WIIU,
WIN32,
Platform,
)
Expand Down Expand Up @@ -212,6 +214,13 @@ class BorlandCompiler(Compiler):
library_include_flag: str = ""


@dataclass(frozen=True)
class GHSCompiler(Compiler):
platform: Platform = WIIU
flags: ClassVar[Flags] = COMMON_GHS_FLAGS
library_include_flag: str = "-I"


def from_id(compiler_id: str) -> Compiler:
if compiler_id not in _compilers:
raise APIException(
Expand Down Expand Up @@ -957,6 +966,13 @@ def available_platforms() -> List[Platform]:
cc='"${COMPILER_DIR}"/bin/mips64-elf-gcc -I "${COMPILER_DIR}"/mips64-elf/include -c ${COMPILER_FLAGS} "${INPUT}" -o "${OUTPUT}"',
)

# GHS
GHS5322 = GHSCompiler(
id="ghs5.3.22",
platform=WIIU,
cc='${WINE} "${COMPILER_DIR}/bin/cxppc.exe" -c -tmp="${OUTPUT}".s ${COMPILER_FLAGS} -o "${OUTPUT}" "${INPUT}"',
)

# IRIX
IDO53_IRIX = IDOCompiler(
id="ido5.3_irix",
Expand Down Expand Up @@ -1743,6 +1759,8 @@ def available_platforms() -> List[Platform]:
XCODE_GCC400_C,
XCODE_GCC400_CPP,
PBX_GCC3,
# WIIU
GHS5322,
# WIN32
MSVC40,
MSVC41,
Expand Down
18 changes: 18 additions & 0 deletions backend/coreapp/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,24 @@ def to_json(self) -> Dict[str, Union[str, List[str]]]:
),
]

COMMON_GHS_FLAGS: Flags = [
FlagSet(id="ghs_c_dialect", flags=["-c99", "-C99", "-ANSI", "-ansi", "-gcc"]),
FlagSet(
id="ghs_opt_level",
flags=["-Ospeed", "-Osize", "-Ogeneral", "-Odebug", "-Omoredebug"],
),
FlagSet(id="ghs_rtti_mode", flags=["--rtti", "--no_rtti"]),
FlagSet(id="ghs_exceptions_mode", flags=["--exceptions", "--no_exceptions"]),
FlagSet(id="ghs_ansi_alias_mode", flags=["-ansi_alias", "-no_ansi_alias"]),
FlagSet(
id="ghs_inlining_mode", flags=["--max_inlining", "--inlining", "--no_inlining"]
),
Checkbox("ghs_gnu_mode", "--g++"),
Checkbox("ghs_enable_noinline", "--enable_noinline"),
Checkbox("ghs_link_once_templates", "--link_once_templates"),
Checkbox("ghs_only_explicit_reg_use", "-only_explicit_reg_use"),
]

COMMON_MSVC_FLAGS: Flags = [
FlagSet(
id="msvc_opt_level", flags=["/Od", "/O1", "/O2", "/Os", "/Ot", "/Og", "/Ox"]
Expand Down
1 change: 1 addition & 0 deletions backend/coreapp/m2c_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class M2CError(Exception):
"ps2": "mipsee",
"psp": "mipsel",
# ppc
"wiiu": "ppc",
"gc_wii": "ppc",
"macosx": "ppc",
# arm
Expand Down
12 changes: 12 additions & 0 deletions backend/coreapp/platforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,17 @@ def from_id(platform_id: str) -> Platform:
has_decompiler=True,
)

WIIU = Platform(
id="wiiu",
name="Nintendo Wii U",
description="PowerPC",
arch="ppc",
assemble_cmd='powerpc-eabi-as -mgekko -o "$OUTPUT" "$PRELUDE" "$INPUT"',
objdump_cmd="powerpc-eabi-objdump -M broadway",
nm_cmd="powerpc-eabi-nm",
has_decompiler=True,
)

_platforms: OrderedDict[str, Platform] = OrderedDict(
{
"dummy": DUMMY,
Expand All @@ -268,6 +279,7 @@ def from_id(platform_id: str) -> Platform:
"dreamcast": DREAMCAST,
"macosx": MACOSX,
"msdos": MSDOS,
"wiiu": WIIU,
"win32": WIN32,
}
)
2 changes: 2 additions & 0 deletions frontend/src/components/PlatformSelect/PlatformIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import LogoPSP from "./psp.svg";
import LogoSaturn from "./saturn.svg";
import LogoSwitch from "./switch.svg";
import UnknownIcon from "./unknown.svg";
import LogoWiiU from "./wiiu.svg";
import LogoWin32 from "./win32.svg";

/** In release-date order */
Expand All @@ -33,6 +34,7 @@ const ICONS = {
ps2: LogoPS2,
psp: LogoPSP,
n3ds: LogoN3DS,
wiiu: LogoWiiU,
switch: LogoSwitch,
saturn: LogoSaturn,
dreamcast: LogoDreamcast,
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/components/PlatformSelect/wiiu.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions frontend/src/lib/i18n/locales/en/compilers.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@
"gcc2.8.1pm": "GCC 2.8.1 (Paper Mario)",
"gcc4.4.0-mips64-elf": "GCC 4.4.0 (mips64-elf)",

"ghs5.3.22": "GHS 5.3.22",

"ido5.3_irix": "IDO 5.3",
"ido5.3_asm_irix": "IDO 5.3 AS",
"ido5.3_c++_irix": "IDO 5.3 C++",
Expand Down