Commit Graph
11 Commits
Author SHA1 Message Date
moonpower 7be4ca8d52 Stop re-probing the Adreno/Mali busy nodes once SELinux refuses them
Retail Android denies an untrusted app these sysfs reads, so the sampler was
generating a kernel audit record per node twice a second for a number it can
never get — noise that buries the real content of a user's bug report. Latch
the refusal after one round; the OSD still prints "n/a".
2026-08-05 22:49:57 +02:00
moonpower 70c94aec21 Fix dead PBP support and the stop-vs-launch crash chains
PBP: the frontend's IsDiscPath never accepted .pbp (kind=none, 'Invalid launch
request.'), pbp_read_sector returned 0-on-success against the TS_* convention,
and the reader indexed image blocks with the core's 150-based disc LBA. Tracks
now live in absolute LBA space like cue/chd, reads return real TS types, the
subchannel polarity matches chd, and zipped PBPs rank as launch candidates.

Crash chains from the Samsung tombstone: device create()s are calloc'd so a
failed psx_init no longer makes psx_destroy free garbage; psx_disc_create and
the raw-disc malloc are NULL-checked; queue_destroy tolerates NULL; a shutdown
requested between runs is dropped at run() entry instead of killing the next
session on frame 1; its SDL_QUIT push is gated on a live loop (the event-queue
mutex may be destroyed between sessions) and a stale queued quit is flushed
before the loop starts.

Also: disc-probe gate links again (psx/perf.c was missing from its sources).
2026-08-05 21:04:08 +02:00
moonpower dc5c9b494d Fix Android rendering, audio, and SAF lifecycle 2026-08-04 22:38:40 +02:00
jpolo1224 189e264bb4 Identify .chd discs through the core's own disc reader, so they get cover art
A CHD never produced a serial. Ps1DiscId reads SYSTEM.CNF itself, and it cannot see
inside a compressed container, so every .chd fell through to Ps1TitleSerials -- a
curated filename table of two dozen USA titles behind a USA-only region filter. A CHD
library therefore showed placeholder tiles for everything the table did not list, and
the new Download cover art action could not help because it fetches by serial.

The serial is not only art: RetroAchievements identifies against it, per-game settings
key off it and play time accrues under it. A CHD had none of that either.

Writing a CHD parser in Kotlin would have been wrong twice over. CHD v5 Huffman-
compresses its own hunk map, so it is a few hundred lines of bit-level decoding before
the filesystem is even reachable; and a decoder that is slightly wrong returns a
PLAUSIBLE WRONG serial rather than failing, which silently attaches one game's art,
settings and achievements to another. Relaxing the region filter has the same defect --
a USA serial fetches the wrong regional box art with total confidence.

So the disc goes to the reader that already boots it. psx/discid.c walks the ISO9660
root directory to SYSTEM.CNF and parses its BOOT line through the same psx_disc_t
vtable the emulated drive reads through, which means the build still contains exactly
ONE CHD decoder and there is nothing for a second one to disagree with. Everything
psx_disc_open handles comes along for free: .cue, .bin, .iso, .pbp and .chd.

Geometry is detected, not assumed. The same filesystem arrives in four shapes and
nothing in the container says which: a CHD puts ISO sector 0 at LBA 150 because its
LBA space includes the lead-in, a raw rip puts it at 0 -- or a few sectors in, if the
dump captured the pregap -- and the user data sits 24, 16 or 0 bytes into the sector
depending on MODE2/MODE1/2048. Each candidate is carried through to a serial-shaped
BOOT line before being accepted, so a geometry that finds a plausible volume descriptor
but no SYSTEM.CNF falls through to the next instead of becoming a wrong answer. The
normalisation accepts the same shape Ps1DiscId.kt does, on purpose: the two are routes
to one identity and a disagreement would split a game's settings in half.

Kotlin keeps the fast path. It still reads .bin/.cue/.iso/.pbp itself and only calls
native for containers it cannot open, plus as a last resort when its own walk and byte
scan both came up empty -- which can only add serials where there were none. That does
mean identification can touch native now; it costs nothing, because Pasx2Application
already loads SDL2 + libarmsx on its warm-up thread at process start and MainActivity
calls initializeOnce regardless. Every call is guarded, so a process without the
library degrades to exactly the previous behaviour and says so in serial_probe.log.

Gated by tests/disc_serial.c (make test-disc-serial): the CHD addressing driven through
a synthetic vtable that mimics it, MODE1/MODE2/2048 sectors, pregap rips, a track table
that disagrees with the filesystem, SYSTEM.CNF 9000 sectors in, fourteen BOOT spellings,
and the cases that must yield NOTHING -- PSX.EXE, MAIN.EXE, a PS2 BOOT2 line, a short
serial, a missing SYSTEM.CNF, no volume descriptor, a corrupt root extent. libchdr's
decompression is deliberately not re-tested; it is what already boots these discs.
Pass --image <path> to identify a real image end to end.

One consequence worth knowing: a .chd with no serial in its filename keyed its per-game
settings off the filename stem and now keys off the real serial, so per-game settings,
cheats, custom names, per-game BIOS and the per-game memory card ASSIGNMENT revert to
global once for those entries. Save states are untouched (they key on disc path plus
fingerprint, not serial) and no memory card file is affected.
2026-08-03 14:04:27 -04:00
jpolo1224 80469ad93a Default Skip BIOS off: it breaks some games, so the faithful boot is the right default 2026-08-03 13:25:23 -04:00
jpolo1224 16d0e8e045 Default GPU presentation to OpenGL ES instead of software 2026-08-03 10:49:08 -04:00
jpolo1224 1056e1c771 Boot BIOS launch URI, GTE against-spec gate (test-gte), ORGB live-conversion fix 2026-08-02 20:34:16 -04:00
jpolo1224 f240536690 Add PGO pipeline: instrumented/optimised build modes, Android profile flush, staleness guard 2026-08-02 13:03:46 -04:00
jpolo1224 29aac6c04a Strip session instrumentation for release; gate offset census behind ARMSX_TEST_OFFSET_CENSUS 2026-08-02 12:34:01 -04:00
jpolo1224 0d22376375 Known-good: GPUINFO(5) E5 layout fix, five CD-ROM fixes, SIO0 deselect fix, RA toasts, mcard divergence warning, serial extraction, SPU widths, session instrumentation 2026-08-02 12:08:37 -04:00
jpolo1224 3a12d1a066 Known-good baseline: BIOS text, MGS audio, Silent Hill, present geometry 2026-08-02 07:01:46 -04:00