Commit Graph
22 Commits
Author SHA1 Message Date
jpolo1224 02975d4f67 Changelog for 0.1.1 2026-08-03 14:08:20 -04: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 78d757a863 Unbreak the core gate suite: pbp.c needs miniz on every target that links the core
disc.c reaches chd.c only under #ifdef USE_CHD, which is why TEST_CORE_SOURCES can
simply filter it out. Its CD_EXT_PBP case has no such guard, so every gate that links
the core also compiles psx/dev/cdrom/pbp.c -- and that #include's miniz.h and calls
into it. Neither the header path nor the archive was on those command lines, so from
the moment PBP support landed the whole suite failed to build with

    psx/dev/cdrom/pbp.c:8:10: fatal error: 'miniz.h' file not found

taking cpu, cpu-spec, gte, cheats, spu-width, mcard-diverge and cdrom-getlocp with it.
A gate that cannot be built is a gate that is not defending anything.

Both come out of the libchdr build (miniz is one of its deps) and both are empty when
USE_CHD=0, so this is the same shape the CHD-aware targets already use. The archive is
an order-only prerequisite so it stays out of the $^ the recipes hand the compiler.
2026-08-03 14:04:00 -04:00
jpolo1224 3a715576a3 Add PBP (PSP EBOOT) disc support: multi-disc PSTITLEIMG, deflate block reader, serial probe 2026-08-03 13:25:23 -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 cf8f441ce1 Pre-fetch cover art to <DataRoot>/covers with a Download cover art action 2026-08-03 13:25:23 -04:00
jpolo1224 5eb3fb119a Onboarding: require all-files access before adding a game folder, not only for a custom data root 2026-08-03 13:25:23 -04:00
jpolo1224 f0c3c6793f Reject non-PS1 images in the BIOS picker instead of accepting any 128KB-8MB file 2026-08-03 11:30:13 -04:00
jpolo1224 4c5c5ee2d8 Onboarding: write the chosen BIOS into settings.toml, not just a SharedPreference 2026-08-03 11:30:13 -04:00
jpolo1224 9f28d82a9a Default new installs to Material You on Android 12+ instead of the blue baseline palette 2026-08-03 11:07:15 -04:00
jpolo1224 f183295e8c Add 0.1.0 changelog 2026-08-03 10:49:08 -04:00
jpolo1224 a557b17931 Enable R8 for release; keep the JNI bridge and app packages so native callbacks survive 2026-08-03 10:49:08 -04:00
jpolo1224 16d0e8e045 Default GPU presentation to OpenGL ES instead of software 2026-08-03 10:49:08 -04:00
jpolo1224 860c2e7cfd GPU: return GPU type 2 for GPUINFO(7); latch GPUREAD instead of rebuilding from zero 2026-08-03 10:49:08 -04:00
jpolo1224 9c3b5dcc38 Relicense to LGPL-3.0; add NOTICE with upstream and contributor credits 2026-08-03 10:48:49 -04:00
jpolo1224 9bdee32f70 GP1(08) mirrors video mode into GPUSTAT bits 14/16-22; recompute on state load; gp1-mode-mirror gate 2026-08-03 07:53:55 -04:00
jpolo1224 2238978b4f Fix SWL/SWR: sample rt before pending load, honour cache isolation; add against-spec CPU gate (test-cpu-spec) 2026-08-03 05:48:12 -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