Files
Joseph MattielloandClaude Opus 5.5 92b6fa382d cart identity: backfill hdr_byte0 as the loader maps it; fail unchecked audits (#976)
Review fixes for PR #1170.

* cart_matrix_identify.py recorded the file's first byte for images the
  loader maps elsewhere, so --check would mismatch fresh probe-stamped
  rows (Codex).  It now follows ParseFileType's order: ABS/COF/JAGR/DRI
  headers are RAM programs (cart slot untouched, $00); a $400-marker image
  is a cartridge (its own byte 0); an Alpine image ((size + 8192) a whole
  MiB, or the $802000 header-stub shape, ported) reads the loader's $FF
  fill.  The two shapes that depend on the raw-binary scorer (exact MiB
  without the marker, e.g. Rayman Demo #973, and headerless images) take
  the mapping from the row's own BIOS column: a run where the boot ROM ran
  was a cartridge mapping, one without a boot phase was not; when the
  column says neither, hdr_byte0 is left out for the probe to fill and
  --check skips only that field.  Re-stamped the committed matrix: 85 rows
  change byte 0 only (Rayman Demo and BadCode4 (rom) to $FF, the RAM
  programs to $00); no reject label changes; cells byte-identical;
  --check clean against the private corpus.
* --check exited 0 when a row's file was missing or empty, or when it
  verified nothing (Codex).  It now exits 1 on any of those, and the
  backfill exits 1 when it could not stamp a row.  --check compares field
  by field instead of the whole stamp string.
* The probe's identity path dlsyms FindRomIdentifier and
  FindVerifiedRomVariant, which were not in the wide test ABI, so a real
  sweep would have stamped filedb=0 on every row (found while checking
  Kimi's live-core concern).  Added to link-test.T and exports-test.list,
  and cart_boot_matrix.sh now refuses a core that lacks any identity
  symbol.  Kimi's ordering concern itself does not hold: harness_load_rom
  runs retro_load_game, which loads the image (JaguarLoadFile) before
  probe_identity reads it; the probe now says so.
* The $F6..$FE byte-0 range cites its source (JaguarCartNeedsBIOS and
  LooksLikeBjlRamImage in src/core/file.c, #784/#785 corpus survey).

Tests: scripts/test_cart_matrix_identify.py (byte-0 mapping per loader
path, row-driven decisions, stamp format, field compare, end-to-end
backfill + check, and failures on mismatch / missing / empty / nothing
checked).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 00:03:43 -05:00

138 lines
3.3 KiB
Perl

/* Wide symbol export script for white-box test builds.
*
* The release / production ABI is link.T, which exports only retro_*.
* This script is used when the Makefile is invoked with
* TEST_EXPORTS=1 (set automatically by the `test` target). It
* exposes the internal symbols our headless test harnesses dlsym
* into for white-box testing of the emulator state.
*
* If you add a new symbol here, that's an extension to the test ABI
* only — it does NOT change the production-shipped .so / .dll.
*/
{
global:
retro_*;
DSP*;
dsp_*;
m68k_*;
Jaguar*;
jaguar*;
Halfline*;
jaguarMainRAM;
m68kClockScalePct;
riscClockScalePct;
jaguarMainROM;
jagMemSpace;
FindRomIdentifier;
FindVerifiedRomVariant;
busArbiter;
riscClockScalePct;
gpuPCSample;
m68kPCSample;
m68kPCSampleIdx;
pcQueue;
pcQPtr;
startM68KTracing;
a6Queue;
d0Queue;
GPU*;
gpu_*;
JERRY*;
UART*;
JLink*;
VM*;
InitializeEventList;
SubtractEventTimes;
GetTimeToNextEvent;
HandleNextEvent;
SetCallbackTime;
EventStateSave;
EventStateLoad;
TOM*;
OP*;
tomRam8;
regs;
ltxd;
rtxd;
lrxd;
rrxd;
sclk;
smode;
SetSSIWordsXmittedFromButch;
lowerField;
vjs;
videoBuffer;
game_width;
game_height;
perf_counters_dump;
perf_counters_reset;
perf_counters_register;
perf_counters_find;
CDROM*;
CDIntf*;
CDTrace*;
CrashDetect*;
BUTCH*;
GetRamPtr;
bootConfig;
cd_boot_strategy_*;
jaguar_cd_*;
ResolveBootConfig;
BlitterCompare*;
BlitterIsHung;
BlitterNeverEndsApprox;
BlitterReadLong;
BlitterWriteLong;
DAC*;
Joystick*;
joypad0Buttons;
joypad1Buttons;
InputDev*;
Quad*;
MTState*;
mtMem;
NVMBios*;
NVM_*;
JGD*;
jgd*;
shadowHiresResolveHits;
shadowHiresResolveMissValue;
shadowHiresResolveMissEpoch;
shadowHiresResolveMissNoPage;
shadowHiresN;
shadowHiresActive;
shadowFBActive;
blitMemo*;
TitleDB*;
/* Texture dump/replacement (#369) probes + the shadow-framebuffer
* presentation functions the replacement tests drive directly. */
TexDump*;
TexReplace*;
texDumpEnabled;
texReplaceEnabled;
ShadowFB*;
shadowLineRGB;
shadowLineTag;
/* RGB16-direct pack presentation (#528): the gate drives the seam
* both RGB16 renderers use. TomLinePackRGB is NOT covered by
* TOM* -- the prefix differs in case. */
shadowFBReplActive;
TomLinePackRGB;
/* Nx surface probes: the tier-3 (>1x pack art) gates drive the OP's
* own resolve function and read the Nx line planes directly. */
ShadowHires*;
shadowHiresLineSub;
shadowHiresLineTag;
shadowHiresLineRepl;
shadowHiresReplActive;
/* TitleHook* is NOT covered by TitleDB* -- the applier lives in its
* own translation unit and its own name prefix. */
TitleHook*;
vjtrace_*;
VJPerf*;
vjPerfActive;
VJDebug*;
vjDebugFrame;
local: *;
};