Files
goldeneye-pc-port/port/include/pcmodels.h
T
James Dansereau 8f631462f3 PC port: phase 2 — D59-D68 milestone: full intro renders; blocker is D69 (BG-file BE headers)
D59/D64: the 'external GL DLL' crash was an unbounded blood-RLE write
(sentinel die_blood_image_end lost its N64 section adjacency on PC)
clobbering the gun-barrel sub-DL at ptr_logo_and_walletbond_DL+0x200.
D60: osPiStartDma DMA-target validation (VirtualQuery-based) in libultra.c.
D61/D63: TEMP env-gated ROM-read / VTX-pool / menu probes (strip list in
HANDOFF Task 3). D62: OSMesgQueue/OSScMsg PC layout verification.
D65/D65b: enum HEADS/BODIES signed sentinels under PORT (PC GCC picks
unsigned underlying types; N64 semantics were signed).
D66: romCopyAligned + ramrom replay 64-bit pointer width (s32 truncation
of .bss targets > 4 GiB). D67: struct image_entry N64 layout
reconstruction (dataoffset:24 first, all-u32 bitfields, sizeof==8).
D68: Globalimagetable BE->LE fixup (port/src/gimgfixup.c): bswap the
IMAGESEG-marked Gfx w1 words in the 17 ROM-copied DLs + sImageTableEntry.
index in the 32 tables after texReset's romCopy; marker scan moved to
bytes 6..7 under PORT; compiled globalDL shadows synced post-texLoad for
explosion.c's g_ExplosionDisplayLists.

Result: game boots, plays intro music, and renders the entire ~3.5-minute
intro (logo -> gun barrel with Brosnan -> cast screen) at ~59 fps. New
blocker D69: load_bg_file faults on first stage load - BG-file headers are
N64 big-endian segment-0x0F offsets read LE on PC. Full analysis + strategy
in PCPortResearch.md §F/D69; HANDOFF rewritten for the D69 session.
2026-08-24 03:27:29 -04:00

50 lines
1.8 KiB
C

#ifndef PORT_PCMODELS_H
#define PORT_PCMODELS_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/* D50 (docs/PCPortResearch.md): PC-layout model sidecars — Plan B (D48/D49).
*
* N64 ROM model files are 32-bit-pointer big-endian images the PC build
* cannot read in place (D37/D43). tools_pc/d43_emit.py converts all of them
* offline to PC-layout RZ sidecars:
* data/pcmodels-<region>/pcmodels.bin single concatenated image
* data/pcmodels-<region>/manifest.csv name,offset,size (decimal)
*
* romdataInit reserves romSize + pcmodelsReserveSize() at CART_BASE and
* pcmodelsLoadSidecars() copies the sidecar image to [CART_BASE+romSize, ...).
* pcmodelsPatchTable() — called once from load_object_fill_header, after
* obInit() has run — redirects every model entry's hw_address into the
* extension region and sets rom_size to the PC compressed size, so the
* existing romCopy/decompressdata load path serves PC bytes unmodified.
*/
/* Bytes to reserve immediately after the ROM (0 = no sidecar image found;
* the game boots but model loads will fail). romImg is the validated ROM
* image; the country byte at +0x3E selects the region directory. */
uint32_t pcmodelsReserveSize(const uint8_t *romImg);
/* Copy the sidecar image to cartBase+romSize and parse the manifest.
* Returns 1 on success. */
int pcmodelsLoadSidecars(uintptr_t cartBase, uint32_t romSize);
/* One-shot patch of file_resource_table + resource_lookup_data_array for
* every manifest row. Must run after obInit() (obInit derives rom_size from
* adjacent hw_address deltas). No-op if the sidecar image is absent. */
void pcmodelsPatchTable(void);
uint32_t pcmodelsTotalSize(void);
/* Cart address where the sidecar image lives (0 if absent). */
uintptr_t pcmodelsSidecarBase(void);
#ifdef __cplusplus
}
#endif
#endif /* PORT_PCMODELS_H */