mirror of
https://github.com/jkdansereau/goldeneye-pc-port.git
synced 2026-10-24 00:02:45 +02:00
Initial scaffolding for a PC port of GoldenEye 007, modeled on the Perfect Dark PC port (same Rare "Indy" engine). The N64 build (Makefile + IDA) is untouched; the PC build is a parallel CMake build. Build: - CMakeLists.txt: SDL2 + zlib + OpenGL. Compiles src/game/*.c + curated engine files + libultra audio/gu + port/. Per-region macro sets (ROMID US/EU/JP) mirror the N64 Makefile's LCDEFS exactly. - build-pc.sh, cmake/: configure+build helper and target/SDL2 modules. Port layer (port/): - video/audio/input/fs/romdata/config/system/mixer: stubs with TODO(Phase N) markers and correct interfaces. - libultra.c: libultra OS shims (message queues, VI, PI, AI, EEPROM, controller, PFS/motor no-ops, region-gated osTvType). - gesched.c: software-RSP scheduler replacing src/sched.c task submission. - n64stubs.c: inert stubs for N64-boot + rmon symbols. - random.c: PRNG ported verbatim from src/random.s (bit-exact). - ucode.c: RSP/ASP/GSP microcode segment markers (dummies; Phase 3 TODO). Docs: - docs/PCPortResearch.md: architecture, GE-specific deltas, phased plan, and the scaffolding review (findings A1-A4/B1-B4/C1-C2 + resolutions). - PORTING.md: top-level entry point. See docs/PCPortResearch.md for the full plan.
29 lines
944 B
CMake
29 lines
944 B
CMake
# Determine the target architecture and set TARGET_ARCH / TARGET_IS_64BIT.
|
|
# Modelled on the Perfect Dark PC port's cmake/TargetArch.cmake.
|
|
|
|
function(target_architecture OUT_VAR)
|
|
if(CMAKE_CROSSCOMPILING)
|
|
# Derive from the cross-compiler target, e.g. x86_64-w64-mingw32-gcc
|
|
string(REGEX MATCH "^(i[3-6]86|x86_64|aarch64|arm|powerpc|wasm32)" _arch
|
|
"${CMAKE_C_COMPILER_TARGET}")
|
|
else()
|
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|amd64|AMD64)$")
|
|
set(_arch "x86_64")
|
|
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(i[3-6]86|x86)$")
|
|
set(_arch "i686")
|
|
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64)$")
|
|
set(_arch "aarch64")
|
|
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm)$")
|
|
set(_arch "arm")
|
|
else()
|
|
set(_arch "${CMAKE_SYSTEM_PROCESSOR}")
|
|
endif()
|
|
endif()
|
|
|
|
if(_arch STREQUAL "i386")
|
|
set(_arch "i686")
|
|
endif()
|
|
|
|
set(${OUT_VAR} "${_arch}" PARENT_SCOPE)
|
|
endfunction()
|