mirror of
https://github.com/jkdansereau/goldeneye-pc-port.git
synced 2026-10-23 15:52:42 +02:00
- scripts/gen_romassets.py: emit absolute cart-address asset symbols (0x10000000 + rom_offset) from filelist.<r>.csv + the asset .s files, in file_resource_table.inc.c order. US region (romassets_u.s). - romdata.c: load/validate the GE-specific header (magic, name @0x20, cart ID @0x3C, country @0x3E) and map the .z64 at cart base 0x10000000 so every &asset-symbol is a live host pointer. - libultra.c: osPiStartDma/osPiRawStartDma now service reads as bounds-checked memcpys from the mapped ROM (synchronous completion). - system.c: implement sysResolvePath ($S data dir, $E exe dir). - video.c: real SDL2 window + GL context + clear/swap frame loop with FPS accounting; main.c runs a Phase 1 demo loop (ESC quits) until the software RSP/scheduler can drive mainproc(). - CMakeLists: project(... ASM), wire romassets_<region>.s, drop assetstubs.c (replaced by generated symbols); n64stubs.c keeps only pure-RAM segment markers. - docs: findings D18-D23 (header offsets, BE music table, .rz tracks, scanner-prefixed manifest names, CMake ASM gotcha, absolute-symbol approach). Verified: baserom.u.z64 (12MB) passes validation and maps at 0x10000000; window opens and renders until killed; asset offsets spot-checked against ROM bytes (music bank seqCount=63 BE, first track offset 508).
4.5 KiB
4.5 KiB
AGENTS.md — GoldenEye 007 PC Port
What this is
n64decomp/007: WIP decompilation of GoldenEye 007 (N64), byte-matches US/EU/JP ROMs.- Active work: PC port modelled on the Perfect Dark PC port (same Rare "Indy" engine family).
- Read
docs/PCPortResearch.mdfirst — architecture, GE-specific RSP deltas, phased plan, and review findings (A1–C2 in §11).
Non-negotiables
- N64 build untouched.
Makefile,tools/,rsp/,ld/belong to the N64 build. Never modify them for the PC port. - Game code compiles unmodified.
src/game/*.c+ the curatedsrc/*.clist compile as-is for the host. All N64 hardware dependencies are satisfied by theport/layer. If a game file seems to need a change, stop — the fix belongs inport/. - Region macros mirror the Makefile.
CMakeLists.txtREGION_DEFSmust match the N64 Makefile's per-region macro set exactly (finding A1). Divergence = silent branch divergence + link failures. src/libultrare/Makefile.libultrareis ground truth for original-vs-Rare libultra files (finding B3). The PC build compiles:libultra/audio,libultrare/audio(drvrNew/env/reverb),libultra/gu, andlibultrare/io/vitbl.conly. All otherio/+os/files are excluded and shimmed inport/src/libultra.c.rsp/graphics/gmain.sis the RSP ground truth — the authoritative reference for which GBI commands GE emits (modified fast3d, 1545 lines). We do not run it on PC;port/fast3d/replaces it. Use it to validate the software RSP's command decoding and the custom CC/RM modes.
Critical files
| File | Role |
|---|---|
docs/PCPortResearch.md |
Research + plan + findings (A1–C2). Read first. |
CMakeLists.txt |
PC build (parallel to the N64 Makefile). Source list + REGION_DEFS live here. |
port/src/ |
Shims: libultra.c (OS API), gesched.c (scheduler), n64stubs.c (boot/TLB/FPU/rmon), random.c (PRNG ported verbatim from random.s), ucode.c (microcode segment markers), main.c, video.c, … |
port/fast3d/ |
Software RSP (adapted from the PD port). The main Phase 2 work. |
rsp/graphics/gmain.s |
GE's RSP ucode — ground truth for GBI/CC/RM. |
PD_PORT_CHECKOUT |
Perfect Dark PC port checkout — ground truth for the port layer. Its port/fast3d/ is the starting point for ours. |
Build
./build-pc.sh ntsc-final # or pal-final / jpn-final
Needs CMake + SDL2 + zlib + OpenGL (MSYS2 packages: see build-pc.sh header). ROM goes in ./data/ (not distributed).
Verification ritual (after any build-affecting change)
- Undefined symbols. Every symbol referenced by the compiled set (see
CMakeLists.txt:SRC_GAME,SRC_ENGINE,SRC_LIBAUDIO,SRC_LIBULTRARE_AUDIO,SRC_LIBULTRARE_DATA,SRC_GU,SRC_PORT*) must be defined exactly once in the compiled set or inport/. Symbols that live in EXCLUDED files (libultra/io/*,libultrare/io/*exceptvitbl.c,libultra/os/*,libultrare/os/*,sched.c,rmon.c,vi.c,src/*.s) must be provided byport/src/libultra.c,gesched.c,n64stubs.c,random.c, orucode.c. - Duplicates. No symbol defined twice across the compiled set (watch
sp_*stacks,rmon*,os*shims, segment markers). - Syntax. Every touched file must parse; once the toolchain is installed,
./build-pc.shis the final word.
Run /linkcheck for this sweep. Record new findings in docs/PCPortResearch.md §11 style (next label after the last used).
Phase status
- Phase 0 (scaffolding): done, committed.
- Compile+link milestone: all ~235 TUs compile and
ge007.x86_64.exelinks clean (ninja ge007 -k 0, 236/236). Findings D7–D17 indocs/PCPortResearch.md§11; asset stubs inport/src/assetstubs.c, fast3d no-ops inport/src/gfxstub.c(delete when real fast3d lands). - Phase 1 (boot to window): done — ROM loads/validates/maps at cart base 0x10000000 (
romdata.c), SDL2 window + GL clear loop (video.c), absolute asset symbols fromscripts/gen_romassets.py→port/src/romassets_<r>.s(findings D18–D23). - Phase 2 (rendering): bring in PD fast3d (replaces
port/src/gfxstub.c), verify custom CC/RM modes againstgmain.s, port the scheduler; replace asset stubs with ROM-backed data (D16). - Phase 2 (rendering): bring in PD fast3d, verify custom CC/RM modes against
gmain.s, port the scheduler. - Phase 3 (audio + input): libaudio → SDL; decide the ASP strategy (C2:
aspMain*dummies inucode.c). - Phase 4 (saves + polish): file-backed EEPROM; PFS/motor already no-op stubs.