nugget moves to redux-1129-pin: this branch's previous pin plus the
sr-write test main pins. nugget main also carries spu-offvoice and msan
tests that still need Redux fixes.
Command 4Dh now keeps the motor mapping it is handed and replies with the
previous one, as the hardware does, instead of always claiming the motors are
unmapped. The mapped bytes of the 42h read command drive SDL_RumbleGamepad,
with the old single-motor method still honoured until config commands are used.
Effects carry the same one second deadline as the controller watchdog, so the
motors stop on their own if the machine stops polling.
Also runs nugget's rumble test from pcsxrunner.
On every coprocessor the condition input reads as false, so BCzF always
branches and BCzT never does, and rt bit 1 is ignored. With SR.CUz clear
they raise a coprocessor unusable exception, COP0 included. The interpreter
models both; the dynarecs only the branch, as they check CU nowhere.
BC2x used to run as whatever GTE op its offset encoded.
Bumps src/mips for the tests/cop-branch test.
Keeps the rewrite's cdrom.cc and the XA path through the ATV matrix. The
save state Registers message keeps schedule_mask/schedule_targets and gains
main's muldiv_ready and gte_ready.
A Lua event listener whose handle is collected while its own callback
runs (or that calls remove() from inside it) deleted the closure that
was executing and the list node signal() was iterating on. Defer the
free until the outermost signal() returns.
gte.cc took the deletion, since the GTE got rewritten and split upstream.
cdrom.cc took this branch's rewrite whole and had the two things main grew
since re-applied by hand: the magic_enum include path, and the CDRomLogger
data/seek hooks. There is no audio hook because CDDA playback isn't here yet.
The in-place path placed the compressed payload a fixed 16 bytes past the end of the decompressed image. That gap is data-dependent, not a constant: the NRV2E decompressor's write head can race well ahead of its read head across a compressible region, and a payload whose worst-case match lands late enough overruns the gap and silently corrupts on decompression.
Compute the real number. inPlaceOverlapMargin walks the bitstream exactly as the unpacker does, writes nothing, and records the peak (olen - ilen); that maximum is the smallest offset at which an overlapping decode is safe, and the compressed load address is derived from it.
Includes a round-trip test, with a compressible-head payload that needs far more than 16 bytes and would have corrupted under the old constant.
Signed-off-by: Nicolas 'Pixel' Noble <[email protected]>
46 tests covering register I/O, instruction correctness, and
documented discrepancies between Sony's SDK reference and psx-spx.
All tests verified against SCPH-5501 silicon.
Key hardware findings:
- ORGB saturates (not truncates) negative/large IR values
- AVSZ3 uses SZ1+SZ2+SZ3 (not SZ0+SZ1+SZ2)
- H register sign-extends on CFC2 read despite being unsigned
- MVMVA cv=2 (FC) and mx=3 (garbage) produce deterministic results
- RES1 (data reg 23) is fully read/write despite SDK saying prohibited
- All single-16bit control registers sign-extend on CTC2 write
- lm flag toggles IR clamp between [-0x8000,0x7fff] and [0,0x7fff]
- GTE requires COP2 enable (CU2 bit in CP0 SR) and has no interlock
Signed-off-by: Nicolas 'Pixel' Noble <[email protected]>