diff --git a/backend/Dockerfile b/backend/Dockerfile index 8266bd73a..ed9a3985b 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -136,6 +136,7 @@ ARG ENABLE_PSP_SUPPORT ARG ENABLE_SATURN_SUPPORT ARG ENABLE_SWITCH_SUPPORT ARG ENABLE_WIN32_SUPPORT +ARG ENABLE_XBOX360_SUPPORT ENV ENABLE_DREAMCAST_SUPPORT=${ENABLE_DREAMCAST_SUPPORT} \ ENABLE_GBA_SUPPORT=${ENABLE_GBA_SUPPORT} \ @@ -150,7 +151,8 @@ ENV ENABLE_DREAMCAST_SUPPORT=${ENABLE_DREAMCAST_SUPPORT} \ ENABLE_PSP_SUPPORT=${ENABLE_PSP_SUPPORT} \ ENABLE_SATURN_SUPPORT=${ENABLE_SATURN_SUPPORT} \ ENABLE_SWITCH_SUPPORT=${ENABLE_SWITCH_SUPPORT} \ - ENABLE_WIN32_SUPPORT=${ENABLE_WIN32_SUPPORT} + ENABLE_WIN32_SUPPORT=${ENABLE_WIN32_SUPPORT} \ + ENABLE_XBOX360_SUPPORT=${ENABLE_XBOX360_SUPPORT} ENTRYPOINT ["/backend/docker_entrypoint.sh"] diff --git a/backend/compilers/compilers.linux.yaml b/backend/compilers/compilers.linux.yaml index 7d209b6a8..d8d638107 100644 --- a/backend/compilers/compilers.linux.yaml +++ b/backend/compilers/compilers.linux.yaml @@ -213,3 +213,7 @@ win32: - msvc7.1 - msvc8.0 - msvc8.0p + +xbox360: + - msvc_ppc_14.00.2110 + - msvc_ppc_16.00.11886.00 diff --git a/backend/coreapp/compilers.py b/backend/coreapp/compilers.py index 04a150aaf..7715702af 100644 --- a/backend/coreapp/compilers.py +++ b/backend/coreapp/compilers.py @@ -42,6 +42,7 @@ DREAMCAST, SWITCH, WIN32, + XBOX360, Platform, ) from django.conf import settings @@ -1497,6 +1498,20 @@ def available_platforms() -> List[Platform]: cc=BORLAND_MSDOS_CC, ) +CL_XBOX = '${WIBO} "${COMPILER_DIR}/cl.exe" /c /nologo ${COMPILER_FLAGS} /Fd"Z:/tmp/" /Bk"Z:/tmp/" /Fo"Z:${OUTPUT}" "Z:${INPUT}"' + +MSVC_PPC_14_00_2110 = MSVCCompiler( + id="msvc_ppc_14.00.2110", + platform=XBOX360, + cc=CL_XBOX, +) + +MSVC_PPC_16_00_11886_00 = MSVCCompiler( + id="msvc_ppc_16.00.11886.00", + platform=XBOX360, + cc=CL_XBOX, +) + _all_compilers: List[Compiler] = [ DUMMY, DUMMY_LONGRUNNING, @@ -1724,6 +1739,9 @@ def available_platforms() -> List[Platform]: # Borland, DOS BORLAND_20_C, BORLAND_31_C, + # Xbox 360 + MSVC_PPC_14_00_2110, + MSVC_PPC_16_00_11886_00, ] _compilers = OrderedDict({c.id: c for c in _all_compilers if c.available()}) diff --git a/backend/coreapp/platforms.py b/backend/coreapp/platforms.py index 75a140371..37c033c15 100644 --- a/backend/coreapp/platforms.py +++ b/backend/coreapp/platforms.py @@ -24,9 +24,9 @@ class Platform: name: str description: str arch: str - assemble_cmd: str - objdump_cmd: str - nm_cmd: str + assemble_cmd: str | None = None + objdump_cmd: str | None = None + nm_cmd: str | None = None diff_flags: Flags = field(default_factory=lambda: COMMON_DIFF_FLAGS, hash=False) supports_objdump_disassemble: bool = False # TODO turn into objdump flag has_decompiler: bool = False @@ -52,7 +52,9 @@ def to_json( "name": self.name, "description": self.description, "arch": self.arch, + "has_assembler": self.assemble_cmd is not None, "has_decompiler": self.has_decompiler, + "has_objdump": self.objdump_cmd is not None, } if include_compilers: ret["compilers"] = [ @@ -248,6 +250,13 @@ def from_id(platform_id: str) -> Platform: nm_cmd="arm-none-eabi-nm", ) +XBOX360 = Platform( + id="xbox360", + name="Xbox 360", + description="PowerPC (64-bit, big-endian)", + arch="ppc", +) + _platforms: OrderedDict[str, Platform] = OrderedDict( { "dummy": DUMMY, @@ -266,5 +275,6 @@ def from_id(platform_id: str) -> Platform: "macosx": MACOSX, "msdos": MSDOS, "win32": WIN32, + "xbox360": XBOX360, } ) diff --git a/backend/coreapp/views/scratch.py b/backend/coreapp/views/scratch.py index 51ae0fb1e..d46accadd 100644 --- a/backend/coreapp/views/scratch.py +++ b/backend/coreapp/views/scratch.py @@ -76,7 +76,7 @@ def cache_object(platform: Platform, file: File[Any]) -> Assembly: obj_bytes = file.read() is_elf = obj_bytes[:4] == b"\x7fELF" is_macho = obj_bytes[:4] == b"\xcf\xfa\xed\xfe" - is_coff = obj_bytes[:2] in (b"\x4c\x01", b"\x64\x86") + is_coff = obj_bytes[:2] in (b"\x4c\x01", b"\x64\x86", b"\xf2\x01") if not (is_elf or is_macho or is_coff): raise serializers.ValidationError("Object must be an ELF, Mach-O, or COFF file") diff --git a/frontend/src/components/PlatformSelect/PlatformIcon.tsx b/frontend/src/components/PlatformSelect/PlatformIcon.tsx index 7c45aedbb..3bbd70b76 100644 --- a/frontend/src/components/PlatformSelect/PlatformIcon.tsx +++ b/frontend/src/components/PlatformSelect/PlatformIcon.tsx @@ -18,6 +18,7 @@ import LogoSaturn from "./saturn.svg"; import LogoSwitch from "./switch.svg"; import UnknownIcon from "./unknown.svg"; import LogoWin32 from "./win32.svg"; +import LogoXbox360 from "./xbox360.svg"; /** In release-date order */ const ICONS = { @@ -36,6 +37,7 @@ const ICONS = { switch: LogoSwitch, saturn: LogoSaturn, dreamcast: LogoDreamcast, + xbox360: LogoXbox360, }; export const PLATFORMS = Object.keys(ICONS); diff --git a/frontend/src/components/PlatformSelect/xbox360.svg b/frontend/src/components/PlatformSelect/xbox360.svg new file mode 100644 index 000000000..748f6f116 --- /dev/null +++ b/frontend/src/components/PlatformSelect/xbox360.svg @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/src/lib/i18n/locales/en/compilers.json b/frontend/src/lib/i18n/locales/en/compilers.json index d7b65ebff..f86d32cff 100644 --- a/frontend/src/lib/i18n/locales/en/compilers.json +++ b/frontend/src/lib/i18n/locales/en/compilers.json @@ -112,6 +112,9 @@ "msvc8.0": "Microsoft Visual C/C++ 8.0", "msvc8.0p": "Microsoft Visual C/C++ 8.0 (Patched)", + "msvc_ppc_14.00.2110": "Microsoft C/C++ Compiler 14.00.2110 for PowerPC", + "msvc_ppc_16.00.11886.00": "Microsoft C/C++ Compiler 16.00.11886.00 for PowerPC", + "mwcc_20_72": "2.0 build 72 (MW 1.2base)", "mwcc_20_79": "2.0 build 79 (MW 1.2sp2)", "mwcc_20_82": "2.0 build 82 (MW 1.2sp2p3)",