Skip to content
Draft
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
4 changes: 3 additions & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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} \
Expand All @@ -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"]

Expand Down
4 changes: 4 additions & 0 deletions backend/compilers/compilers.linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,7 @@ win32:
- msvc7.1
- msvc8.0
- msvc8.0p

xbox360:
- msvc_ppc_14.00.2110
- msvc_ppc_16.00.11886.00
18 changes: 18 additions & 0 deletions backend/coreapp/compilers.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
DREAMCAST,
SWITCH,
WIN32,
XBOX360,
Platform,
)
from django.conf import settings
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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()})
Expand Down
16 changes: 13 additions & 3 deletions backend/coreapp/platforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"] = [
Expand Down Expand Up @@ -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,
Expand All @@ -266,5 +275,6 @@ def from_id(platform_id: str) -> Platform:
"macosx": MACOSX,
"msdos": MSDOS,
"win32": WIN32,
"xbox360": XBOX360,
}
)
2 changes: 1 addition & 1 deletion backend/coreapp/views/scratch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 2 additions & 0 deletions frontend/src/components/PlatformSelect/PlatformIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -36,6 +37,7 @@ const ICONS = {
switch: LogoSwitch,
saturn: LogoSaturn,
dreamcast: LogoDreamcast,
xbox360: LogoXbox360,
};

export const PLATFORMS = Object.keys(ICONS);
Expand Down
72 changes: 72 additions & 0 deletions frontend/src/components/PlatformSelect/xbox360.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions frontend/src/lib/i18n/locales/en/compilers.json
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand Down
Loading