Files
virtualjaguar-libretro/link-test.T
T
Joe MattielloandClaude Opus 5.5 1fb655012e fix(tom): derive HC readback from emulated time so AvP marines attack (#1094)
HC ($F00004) free-runs 0..HP once per half-line on hardware (JTRM), so
its low bits at a CPU read are effectively random.  Alien vs Predator
uses them as its marines' fire roll -- `move.w $F00004,d0 / and #7 /
cmp #2` at 68K $015ADA -- while its Predators roll the game's software
RNG.  The core returned a per-read counter reset to 0 / (HP+1)/2 every
half-line, so a once-per-AI-tick read always saw $0000 or $05A6: low
bits 0 or 6, never 2.  Marines walked up to an Alien player and never
fired (30 of 30 rolls measured from the corridor savestate).

The readback is now the elapsed fraction of the current half-line:
time to the next half-line event at slice start, less how far the 68K
has run into the slice (JaguarSliceElapsedUs, stall and clock scale
included), scaled to HP+1 ticks.  Byte reads of $F00004/5 use it too.
tomRam8[HC] is unchanged (the OP's second-half-line test reads bit 10),
and the read-phase counter is gone; nothing new is serialized.

Measured after: the same marine rolls all eight HC&7 values (2 on 12
of 111), crouches, fires, and the Alien's health drops.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-10-25 23:08:14 -04:00

136 lines
3.2 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;
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: *;
};