Add SN64 compiler binaries (#511)

This commit is contained in:
Marijn van der Werf
2022-08-22 00:03:09 +02:00
committed by GitHub
parent f5bb1d2cd5
commit ea6d016e85
3 changed files with 44 additions and 0 deletions

View File

@@ -394,6 +394,38 @@ def download_n64():
)
set_x(psyq_obj_parser)
# SN
dest = COMPILERS_DIR / "gcc2.8.1sn"
if dest.is_dir():
print(f"{dest} already exists, skipping")
else:
dest.mkdir()
download_file(
url="https://github.com/marijnvdwerf/sn64/releases/download/1%2C0%2C0%2C2/asn64.exe",
log_name="asn64.exe",
dest_path=dest / "asn64.exe",
)
download_file(
url="https://github.com/marijnvdwerf/sn64/releases/download/1%2C0%2C0%2C2/cc1n64.exe",
log_name="cc1n64.exe",
dest_path=dest / "cc1n64.exe",
)
download_file(
url="https://github.com/marijnvdwerf/sn64/releases/download/1%2C0%2C0%2C2/cc1pln64.exe",
log_name="cc1pln64.exe",
dest_path=dest / "cc1pln64.exe",
)
download_file(
url="https://github.com/Mr-Wiseguy/pcsx-redux/releases/download/n64/psyq-obj-parser",
log_name="psyq-obj-parser",
dest_path=dest / "psyq-obj-parser",
)
# TODO: upload +x'd version of this
psyq_obj_parser = dest / "psyq-obj-parser"
psyq_obj_parser.chmod(
psyq_obj_parser.stat().st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
)
def download_ps1():
if host_os != LINUX:

View File

@@ -314,6 +314,16 @@ GCC272SN = GCCCompiler(
cc='cpp -P "$INPUT" | ${WINE} "${COMPILER_DIR}"/cc1n64.exe -quiet -G0 -mcpu=vr4300 -mips3 -mhard-float -meb ${COMPILER_FLAGS} -o "$OUTPUT".s && ${WINE} "${COMPILER_DIR}"/asn64.exe -q -G0 "$OUTPUT".s -o "$OUTPUT".obj && "${COMPILER_DIR}"/psyq-obj-parser "$OUTPUT".obj -o "$OUTPUT" -b -n',
)
GCC281SNCXX = GCCCompiler(
id="gcc2.8.1sn-cxx",
base_id="gcc2.8.1sn",
platform=N64,
cc='cpp -E -undef -D__GNUC__=2 -v -lang-c++ -D__cplusplus -Dmips -D__mips__ -D__mips -Dn64 -D__n64__ -D__n64 -D_PSYQ -D__EXTENSIONS__ -D_MIPSEB -D__CHAR_UNSIGNED__ -D_LANGUAGE_C_PLUS_PLUS "$INPUT" '
'| ${WINE} "${COMPILER_DIR}"/cc1pln64.exe ${COMPILER_FLAGS} -o "$OUTPUT".s '
'&& ${WINE} "${COMPILER_DIR}"/asn64.exe -q -G0 "$OUTPUT".s -o "$OUTPUT".obj '
'&& "${COMPILER_DIR}"/psyq-obj-parser "$OUTPUT".obj -o "$OUTPUT" -b -n',
)
# MACOS9
MWCPPC_CC = 'printf "%s" "${COMPILER_FLAGS}" | xargs -x -- ${WINE} "${COMPILER_DIR}/MWCPPC.exe" -o object.o "${INPUT}" && printf "%s" "-dis -h -module ".${FUNCTION}" -nonames -nodata" | xargs -x -- ${WINE} "${COMPILER_DIR}/MWLinkPPC.exe" "${OUTPUT}" > "${OUTPUT}.s" && python3 ${COMPILER_DIR}/convert_gas_syntax.py "${OUTPUT}.s" ".${FUNCTION}" > "${OUTPUT}_new.s" && powerpc-linux-gnu-as "${OUTPUT}_new.s" -o "${OUTPUT}"'
@@ -651,6 +661,7 @@ _all_compilers: List[Compiler] = [
IDO71,
GCC272KMC,
GCC272SN,
GCC281SNCXX,
GCC281,
# GC_WII
MWCC_233_144,

View File

@@ -18,6 +18,7 @@
"gcc2.7.2-psyq": "gcc 2.7.2 (psyq)",
"gcc2.7.2kmc": "GCC 2.7.2 (KMC)",
"gcc2.7.2sn": "GCC 2.7.2 (SN)",
"gcc2.8.1sn-cxx": "GCC 2.8.1 (SN) (C++)",
"gcc2.8.1": "GCC 2.8.1",
"gcc2.8.1-psyq": "gcc 2.8.1 (psyq)",
"gcc2.95.2-psyq": "gcc 2.95.2 (psyq)",