PC port: full compile + link milestone (ge007.x86_64.exe builds clean)

All ~235 translation units now compile and the target links under MSYS2
GCC 16 + CMake/Ninja (ninja ge007 -k 0: 236/236, zero errors). N64 build
untouched; every src/ change is -DPORT-gated.

Portability fixes (findings D7-D17 in docs/PCPortResearch.md section 11):
- AI X-macro system: SWITCH() call sites activated to the author's
  hand-written byte-identical references under PORT; port/shim/
  bondaicommands.h + bondconstants.h + CPPLib.h re-emit the IDO paste
  tricks (isSubroutine, file-record macros, generated CALL) GCC-clean.
- 64-bit pointer-in-word initializers: monAnim jump targets now go
  through an index table resolved by the interpreter (chrai.h/propobj.c);
  UsetuplenZ.c credits pointer PORT-gated to 0.
- IDO printf engine compiled for PC (xprintf/xlitob/xldtob) with a
  shadow xstdio.h resolving the _Printf prototype clash.
- Host-libc gaps stubbed in port/: bcopy/bzero, __libm_qnan_f,
  tlbmanage*, g_ViXScales/YScales; chrObjRandom PRNG ported from .s.

Asset data strategy (D16): single-file assets compiled for real
(animation tables, fonts, textures, rareware logo); obseg per-file .c
excluded (colliding file-local globals the N64 build isolates via
per-ELF linking); 758 ROM-derived table symbols + ramrom_* + segment
markers stubbed in port/src/assetstubs.c / n64stubs.c.

fast3d is a no-op placeholder (port/src/gfxstub.c) until Phase 2 brings
in the real software RSP. Binary not yet runnable end-to-end: ROM
loading in romdata.c is still a TODO.
This commit is contained in:
James Dansereau committed 2026-08-20 20:27:06 -04:00
1 parent cd6cc158b6
commit 5ea46fabc1
35 files changed
+2417 -53

No files matched your search

+25 -1
View File
@@ -3118,6 +3118,15 @@ u32 monAnim35Taser[] = {
MONLOOP()
};
#if defined(PORT)
/* PC port (docs/PCPortResearch.md §11): monitor-animation jump targets.
* MONJUMPTO/MONJUMPCHANCE store an index into this table instead of a raw
* address (see chrai.h); the interpreter below resolves it. Must stay after
* every monAnim* array definition above. */
#define _PORT_MONANIM_PTR(name) name,
const u32 *_PORT_monAnimPtrs[_PORT_MONANIM_COUNT] = { _PORT_MONANIM_LIST(_PORT_MONANIM_PTR) };
#endif
/**
* Address 0x80031FD0.
*/
@@ -6858,17 +6867,32 @@ Gfx *process_monitor_animation_microcode(Model *model, ModelNode *node, MonitorR
}
break;
case TVCMD_SETCMDLIST:
#if defined(PORT)
save_ptr_monitor_ani_code_to_obj_ani_slot(screen, (u32 *) _PORT_monAnimPtrs[m->time]);
#else
save_ptr_monitor_ani_code_to_obj_ani_slot(screen, (u32 *) m->time);
#endif
break;
case TVCMD_RANDSETCMDLIST:
#if defined(PORT)
if ((randomGetNext() >> 16) < m->arg2)
{
save_ptr_monitor_ani_code_to_obj_ani_slot(screen, (u32 *) _PORT_monAnimPtrs[m->time]);
}
else
{
screen->offset += 3;
}
#else
if ((randomGetNext() >> 16) < m->arg2)
{
save_ptr_monitor_ani_code_to_obj_ani_slot(screen, (u32 *) m->time);
}
else
else
{
screen->offset += 3;
}
#endif
break;
case TVCMD_RESTART:
screen->offset = 0;