diff --git a/backend/compilers/compilers.linux.yaml b/backend/compilers/compilers.linux.yaml index 92dbbb8fc..4942b9e82 100644 --- a/backend/compilers/compilers.linux.yaml +++ b/backend/compilers/compilers.linux.yaml @@ -212,6 +212,9 @@ msdos: - bcc2.0 - bcc3.1 +wiiu: + - ghs5.3.22 + win32: - msvc4.0 - msvc4.1 diff --git a/backend/coreapp/compilers.py b/backend/coreapp/compilers.py index 340f64730..8199f65e3 100644 --- a/backend/coreapp/compilers.py +++ b/backend/coreapp/compilers.py @@ -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, @@ -42,6 +43,7 @@ SATURN, DREAMCAST, SWITCH, + WIIU, WIN32, Platform, ) @@ -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( @@ -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", @@ -1743,6 +1759,8 @@ def available_platforms() -> List[Platform]: XCODE_GCC400_C, XCODE_GCC400_CPP, PBX_GCC3, + # WIIU + GHS5322, # WIN32 MSVC40, MSVC41, diff --git a/backend/coreapp/flags.py b/backend/coreapp/flags.py index fed9b866c..c3dc4f08e 100644 --- a/backend/coreapp/flags.py +++ b/backend/coreapp/flags.py @@ -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"] diff --git a/backend/coreapp/m2c_wrapper.py b/backend/coreapp/m2c_wrapper.py index 364d94ce3..485c146d1 100644 --- a/backend/coreapp/m2c_wrapper.py +++ b/backend/coreapp/m2c_wrapper.py @@ -23,6 +23,7 @@ class M2CError(Exception): "ps2": "mipsee", "psp": "mipsel", # ppc + "wiiu": "ppc", "gc_wii": "ppc", "macosx": "ppc", # arm diff --git a/backend/coreapp/platforms.py b/backend/coreapp/platforms.py index d35af3bc1..4f1598fcb 100644 --- a/backend/coreapp/platforms.py +++ b/backend/coreapp/platforms.py @@ -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, @@ -268,6 +279,7 @@ def from_id(platform_id: str) -> Platform: "dreamcast": DREAMCAST, "macosx": MACOSX, "msdos": MSDOS, + "wiiu": WIIU, "win32": WIN32, } ) diff --git a/frontend/src/components/PlatformSelect/PlatformIcon.tsx b/frontend/src/components/PlatformSelect/PlatformIcon.tsx index 7c45aedbb..d4331af2e 100644 --- a/frontend/src/components/PlatformSelect/PlatformIcon.tsx +++ b/frontend/src/components/PlatformSelect/PlatformIcon.tsx @@ -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 */ @@ -33,6 +34,7 @@ const ICONS = { ps2: LogoPS2, psp: LogoPSP, n3ds: LogoN3DS, + wiiu: LogoWiiU, switch: LogoSwitch, saturn: LogoSaturn, dreamcast: LogoDreamcast, diff --git a/frontend/src/components/PlatformSelect/wiiu.svg b/frontend/src/components/PlatformSelect/wiiu.svg new file mode 100644 index 000000000..e18ceaf66 --- /dev/null +++ b/frontend/src/components/PlatformSelect/wiiu.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/frontend/src/lib/i18n/locales/en/compilers.json b/frontend/src/lib/i18n/locales/en/compilers.json index 77b62817e..8e934ed13 100644 --- a/frontend/src/lib/i18n/locales/en/compilers.json +++ b/frontend/src/lib/i18n/locales/en/compilers.json @@ -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++",