Files
goldeneye-pc-port/port/include/video.h
T
James Dansereau cd6cc158b6 Add PC port scaffolding (CMake build + port layer)
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.
2026-08-17 19:17:06 -04:00

47 lines
1.1 KiB
C

#ifndef PORT_VIDEO_H
#define PORT_VIDEO_H
/*
* Video: SDL2 window + OpenGL context + frame pacing.
* Modelled on the PD port's port/include/video.h.
*
* The game's VI (osViSetMode / osViVSyncCallback / osViWaitVSync) is mapped
* onto this layer. The software RSP (fast3d) renders into the GL context that
* this layer owns.
*/
#include <PR/ultratypes.h>
#include <PR/gbi.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Initialize the window + GL context. Returns 0 on success. */
int videoInit(void);
void videoDestroy(void);
/* Frame boundary hooks, driven by the port scheduler (gesched.c). */
void videoStartFrame(void);
void videoSubmitCommands(Gfx *cmds); /* runs the software RSP on the list */
void videoEndFrame(void);
/* VSync / framerate control. */
void videoSetVsync(int enabled);
void videoSetFramerateLimit(int fps); /* 0 = unlimited */
/* Window state queries (kept in sync with the options menu). */
int videoGetFullscreen(void);
void videoSetFullscreen(int enabled);
int videoGetMaximize(void);
void videoSetMaximize(int enabled);
/* Current FPS (measured). */
float videoGetFPS(void);
#ifdef __cplusplus
}
#endif
#endif /* PORT_VIDEO_H */