forked from Ports/goldeneye-pc-port
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.
50 lines
1.3 KiB
C
50 lines
1.3 KiB
C
#ifndef PORT_SYSTEM_H
|
|
#define PORT_SYSTEM_H
|
|
|
|
/*
|
|
* Platform primitives: time, logging, paths, exit.
|
|
* Modelled on the PD port's port/include/system.h.
|
|
*/
|
|
|
|
#include <stdint.h>
|
|
#include "platform.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* --- Time --------------------------------------------------------------- */
|
|
|
|
/* Monotonic microseconds since an arbitrary origin. */
|
|
uint64_t sysGetMicroseconds(void);
|
|
/* Wall-clock seconds since the epoch (for timestamps). */
|
|
int64_t sysGetTime(void);
|
|
/* Sleep for the given number of microseconds. */
|
|
void sysSleep(uint32_t micros);
|
|
|
|
/* --- Logging ------------------------------------------------------------ */
|
|
|
|
void sysLogPrintf(enum LogLevel level, const char *fmt, ...)
|
|
__attribute__((format(printf, 2, 3)));
|
|
|
|
/* --- Paths -------------------------------------------------------------- */
|
|
|
|
/*
|
|
* Resolve a path relative to the data dir. "$S/" prefixes the data dir,
|
|
* "$E/" prefixes the executable dir. Returns a pointer to a static buffer.
|
|
*/
|
|
const char *sysResolvePath(const char *path);
|
|
|
|
/* Return the directory containing the executable. */
|
|
const char *sysGetExeDir(void);
|
|
|
|
/* --- Lifecycle ---------------------------------------------------------- */
|
|
|
|
void sysExit(int code);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* PORT_SYSTEM_H */
|