Commit Graph

6138 Commits

Author SHA1 Message Date
SamG-Coder e1e3a12227 fix(build): restrict POSIX exception runtime test to Unix 2026-09-28 09:09:02 +10:00
SamG-Coder fc26cff30f test(shader): cover decoded buffer address operands 2026-09-28 09:09:02 +10:00
SamG-Coder b25025c682 fix(agc): support explicit indexed draw commands 2026-09-28 09:09:02 +10:00
SamG-Coder 07930c6726 feat(videoout): present linear framebuffer layouts 2026-09-28 09:05:49 +10:00
SamG-Coder 67fce999c5 fix(libc): support SDK startup without allocator replacements 2026-09-28 09:03:10 +10:00
Darko Gjorgjijoski 42594eecd4 fix(relinker): report buffered output write failures 2026-09-28 00:25:42 +02:00
boykopovar 7656458121
Merge pull request #5 from yumlevi/feat/demons-souls-boot
Boot Demon's Souls to its first level: AGC recorder driver, runtime, audio, Bink fixes
2026-09-28 00:40:24 +03:00
devilismyfriend 9e5f8397f2 refactor(agc): drop outside references from the copy kernel comments
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0177gthrWEBBfBu5xJDXgBfo
2026-09-27 12:14:48 -07:00
devilismyfriend 9325ac08de docs(md): relink titles that ship their own libc with --skip-sce-module
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0177gthrWEBBfBu5xJDXgBfo
2026-09-27 11:54:31 -07:00
devilismyfriend 72336201b2 perf(libkernel): resolve initialised mutexes and conditions without the global lock
Every lock, unlock, signal and wait took the process-wide initialisation
mutex to read the handle, serialising all guest synchronisation. The
handle is now read atomically and the lock is only taken to initialise a
static initializer or to report a destroyed object.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0177gthrWEBBfBu5xJDXgBfo
2026-09-27 11:26:59 -07:00
devilismyfriend e764385d51 fix(libkernel): drop the scePthreadOnce stub that shadowed the implementation
The merge brought a NotImplemented scePthreadOnce_nid_postfix next to the
existing scePthreadOnce. The NID patcher gives the NID to the postfixed
symbol, so the stub replaced the working export and the title aborted at
its first once-initialisation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0177gthrWEBBfBu5xJDXgBfo
2026-09-27 11:26:58 -07:00
devilismyfriend 1e4430e917 fix(agc): drop cached textures on Vulkan device replacement
When the presentation device was replaced, textures created on the old
device stayed in the global sampled and storage texture caches and kept a
reference to the destroyed TextureDetiler, whose VkDevice was then read
corrupted ("missing Vulkan function: vkResetDescriptorPool" at startup).
The replacement now flushes the old device's cached storage textures and
publishes every unit shadow before waiting for the device, and the device
teardown erases the cache entries that belong to it.

Patch author: boykopovar (fix-vulkan-texture-lifetime.patch, PR #5 review).

Co-Authored-By: boykopovar <boykopovar@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0177gthrWEBBfBu5xJDXgBfo
2026-09-27 10:53:11 -07:00
devilismyfriend a503d0b617 Merge remote-tracking branch 'origin/main' into feat/demons-souls-boot
Brings in main up to 9958d26 (homebrew runtime, POSIX wrappers in
libkernel, sce_module guest modules and --skip-sce-module, the --to-intel
general pipeline, libSceRandom, libSceRtc, libScePosixForWebKit,
libRenoirCore, test wiring).

Resolutions where both sides implemented the same thing:
- libkernel pthread: main's structure (lazy static initialisation,
  destroyed markers, MutexOperations/CondOperations, mutex protocol and
  condattr clock) with this branch's TimedWait deadlines and condition
  (precise timed lock/wait on Windows), wait tracing, the adaptive mutex
  type 4, POSIX default ERRORCHECK mutexes, EDEADLK/EPERM results instead
  of throws, and condition clocks honoured for absolute timeouts.
- libc locale: the guest Dinkumware ABI (_Locimp, facet vtables, short
  ctype/case tables, locale ids, stream storage) is kept because guest code
  inlines those layouts; main's C character functions are kept on top.
- libc stdio/strings/math: main's stream functions (guest FILE status
  sync), strerror/perror, remove, formatting, string and math exports win
  over this branch's duplicates.
- libc paths: main's working directory with this branch's path aliases
  resolved on the normalised guest path.
- libkernel file: this branch's sceKernel* results as SCE errors, main's
  POSIX wrappers and both fstat helpers.
- relinker: this branch's stub lowering keeps its trampolines through the
  main executable path; guest modules refuse lowerings that need stubs.
- AGC driver: main's rendering wait is executed by this branch's workers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0177gthrWEBBfBu5xJDXgBfo
2026-09-27 10:52:21 -07:00
Pacuka 83f43d1004 feat(agc): emit indexed indirect draws
sceAgcDcbDrawIndexIndirect and sceAgcDcbDrawIndexIndirectMulti emit
DRAW_INDEX_INDIRECT (0x25) and DRAW_INDEX_INDIRECT_MULTI (0x38) like their
non-indexed counterparts, with 20-byte records.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 19:43:16 +02:00
Pacuka 5fdcd571cd fix(recompiler): widen constants of 64-bit operands instead of repeating them
readU32Pair read a literal or inline constant into both halves of a 64-bit
source. A literal is now zero-extended, an integer inline constant
sign-extended and a float inline constant becomes the matching double.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 18:59:46 +02:00
adriadam10 e73cd7dec3 feat(tools): report progress changes on pull requests
progress.py stores the names of implemented and pending items, can
measure another source tree with --root and prints a Markdown diff of
two runs with --compare. The Progress report workflow compares every
pull request with its base, and Progress comment posts the result as a
single comment, updated on every push and removed when progress no
longer changes. Commenting runs as a separate workflow_run so pull
requests from forks never run with write permissions.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-27 18:47:32 +02:00
adriadam10 3c6b0af6f7 feat(tools): add progress map for system libraries and shader instructions
tools/progress.py counts implemented prx functions and RDNA instructions
recognized by the shader recompiler, and renders treemaps, badges and an
index page. The Progress workflow deploys them to GitHub Pages on every
push to main, so nothing generated is committed to the repository.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-27 18:21:34 +02:00
boykopovar 9958d26f4f
Merge pull request #31 from Pouare514/idea/prx-renoir
libs: add libRenoirCore.PS5 stub prx (23 NIDs)
2026-09-27 18:12:16 +03:00
Pouare514 5099184d4d feat(prx): fmodstudio unknown NIDs throw via NotImplemented
Convert 5 remaining pure stubs (log + return 0) to throwing with
literal NID, keep trailing return 0. Real SDL/state-tracking impls
(20 studio + 2 libfmod + C++ classes) untouched. Remove stale
logging-stub comments only around touched stubs.

Throwing: Cm2cmtCv8cA, EfM9xXvBmxk, Js90KQXVS4s, oCYWES02VPc, vVwA2cZA5e4
2026-09-27 16:10:41 +02:00
Pouare514 7cdb23eacd fix(libcohtml): throw via NotImplemented_nid_no_patch for 50 stubs 2026-09-27 16:06:18 +02:00
Pouare514 b6dea0b51b Renoir stubs throw with NID name for progress monitoring 2026-09-27 15:53:27 +02:00
Pouare514 a719359cd1 prx: make libRenoirCore.PS5 stubs throw NotImplemented 2026-09-27 15:49:18 +02:00
boykopovar e06dbff7d6
Merge pull request #10 from boykopovar/feat/sce-module-load
Feat/sce module load
The game can expect its modified prx from the `sce_module`/`sce_modules` folder. The relinker now converts PRX files from sce_module to `dll`/`so` format with `.guest.prx` postfix. During linking, libraries from `sce_module` are given priority. If a library from `sce_module` fails to import a symbol or contains a syscall, an exception will be thrown.

This made it possible to remove the GuestLocale formats that were customized for specific guests. Launched apps now use their own PRX files from the `sce_module` folder.
Locale handling functions now use `std::locale`.

Added a lot of posix functions to `libkernel` (they are thin wrappers and do what the existing non-posix versions do)
2026-09-27 15:47:36 +03:00
Pouare514 030e62dfa3 feat(prx): fmod real audio output via SDL + identify 22/27 NIDs
- libfmod: route createSound (OPENMEMORY WAV/RAW, file placeholder sine)
  + playSound + update() mixer pump into SDL queue (48k stereo F32,
  mirrors libSceAudioOut). Channel::setVolume/isPlaying/position now
  track real PCM cursor with loop support. Silent fallback via
  ANYPS5_FMOD_SILENT=1, NOSOUND output, or SDL open failure.
  Link SDL2-static like libSceAudioOut.
- NIDs: recompute from public FMOD headers (fmod.h/hpp + fmod_studio
  2.0) with exact Itanium manglings (g++ nm) + SHA1+suffix
  (NidCompute.cpp). Identify 2/2 libfmod (setFileSystem, setCallback)
  + 20/25 studio (const createInstance, getEvent, getCoreSystem,
  getSoundInfo, etc.). Replace stubs with ABI-compatible real
  impls; 5 studio remain unknown (Cm2cmtCv8cA, EfM9xXvBmxk,
  Js90KQXVS4s, oCYWES02VPc, vVwA2cZA5e4).
- Tests: coverage OK (51+42 Legends NIDs, missing 0), audio smoke
  (WAV 4800f + RAW 2048f, volume, channelsPlaying, stop) OK real
  and silent.
2026-09-27 13:24:34 +02:00
Pouare514 279587cb16 fix(libcohtml): provide libcohtml.Prospero.prx for DT_NEEDED
Copy the patched libcohtml.prx to libcohtml.Prospero.prx (exact DT_NEEDED name) via a post-build copy in the module CMakeLists, wired into the libs umbrella target. OUTPUT_NAME with a dot was rejected: the parent pipeline derives unpatched/patched paths from the directory target name, so renaming output would break it; dotted CMake target names are supported (e.g. libSceSaveData.native) but the parent-owned NID-patch rule is kept untouched. Adds DEPLOY.md deploy note. All 50 raw NIDs re-verified in the renamed file export table.
2026-09-27 12:57:23 +02:00
Pouare514 c0515bdcce feat(prx): add libfmod and libfmodstudio replacements covering Legends NIDs 2026-09-27 12:32:13 +02:00
boykopovar 179841caff feat(relinker): report full module path when windows loading fails 2026-09-27 13:10:06 +03:00
Pouare514 a4248cb114 feat(libcohtml): add stub prx exporting 50 Minecraft Legends NIDs 2026-09-27 12:00:15 +02:00
Pouare514 0722f3e5fc prx: add libRenoirCore.PS5 replacement with 23 Renoir stubs for libcohtml
Minecraft Legends' libcohtml.Prospero.prx imports 23 NIDs from lib
libRenoirCore.PS5_v1 (docs/legends-unresolved-nids.json). Clear names are
unknown, so each export is exposed under its raw NID via APS5_EXPORT
alias (<NID>_nid_no_patch_cut), which nid_patcher strips to the
literal NID instead of hashing.

Stubs follow KytyPS5 UnresolvedImportStub policy (log call + return 0)
via APS5_LOG_OUT rather than throwing NotImplemented.
2026-09-27 11:57:54 +02:00
boykopovar 43d2e8b4dc fix(codegen): decode xadd byte and popcnt instruction lengths fix 2026-09-27 12:49:46 +03:00
boykopovar e3dc9a6acc fix(relinker): accept zero alignment for empty tls segments 2026-09-27 12:41:52 +03:00
boykopovar 52b683d208 fix(relinker): skip generated guest prx files during sce module scan 2026-09-27 11:43:42 +03:00
boykopovar e526f1f528 feat(libc): replace guest locale implementation with std::locale 2026-09-27 11:43:42 +03:00
boykopovar bfa1ac0751 fix(relinker): scan complete function ranges for windows tls accesses 2026-09-27 11:43:41 +03:00
boykopovar 9cc36a02fe feat(libkernel): add __progname str value 2026-09-27 11:43:40 +03:00
boykopovar f5ea673c10 feat(libkernel): impl posix stdio wrappers, reusing sceKernel file ops 2026-09-27 11:43:40 +03:00
boykopovar 7a925c68e5 fix(libkernel): handle clock_second 13 in clock_gettime and clock_getres 2026-09-27 11:43:39 +03:00
boykopovar 13c648bebb feat(libkernel): impl file, time, process, signal for posix 2026-09-27 11:43:38 +03:00
boykopovar 62c16792ff feat(libkernel): impl pthread condition variables + posix thread attribute queries 2026-09-27 11:43:37 +03:00
boykopovar a709e220f2 feat(libkernel): implement posix mutex locking and timed waits 2026-09-27 11:43:37 +03:00
boykopovar ae2e5cba7e feat(libc): implement heap trace info 2026-09-27 11:43:36 +03:00
boykopovar c9cb3cae39 feat(libkernel): implement disabled address sanitizer state + replacement tables 2026-09-27 11:43:36 +03:00
boykopovar 9fd6816356 fix(libkernel): store rtld allocator table separately from application heap 2026-09-27 11:43:35 +03:00
boykopovar dbb56adcf6 feat(libkernel): implement process, cpu, uuid, gpi, gpo, sync funcs 2026-09-27 11:43:34 +03:00
boykopovar 55e1c4a238 feat(libkernel): implement application heap and thread atexit registration 2026-09-27 11:43:33 +03:00
boykopovar 2e654e4f89 feat(relinker): scan sce modules for syscalls 2026-09-27 11:43:33 +03:00
boykopovar 630cb018c0 feat(relinker): add --skip-sce-module flag 2026-09-27 11:43:32 +03:00
boykopovar 5887c8d6e2 feat(libkernel): add memory segment, backtrace, heap error report definitions 2026-09-27 11:43:32 +03:00
boykopovar 40101471ee feat(libkernel): add new posix, pthread, semaphore, process funcs definitions 2026-09-27 11:43:31 +03:00
boykopovar 0783e369da feat(libkernel): add definitions for standard guest libc imports 2026-09-27 11:43:31 +03:00