Commit Graph

210 Commits

Author SHA1 Message Date
devilismyfriend 9c2a75601d feat(libs): agc packet builders, savedata memory, offline service stubs
- libSceAgc: SetIndexCount, SetBaseIndirectArgs, DispatchIndirect, wait
  and write-data patch functions, relaxed checks for what titles send,
  NOP fillers for LOD stats and wait-until-safe, NotImplemented stubs.
- libSceSaveData.native: short mount points, backup events, save-data
  memory slots.
- user/system service, store dialog, video-out flip modes and queue-full
  error, pad read, fibers, offline behaviour for network/NP modules, and
  new export-only modules Ampr, JpegEnc, Json2, MsgDialog.native,
  NpCppWebApi, NpUtility.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0177gthrWEBBfBu5xJDXgBfo
2026-09-25 16:27:49 -07:00
devilismyfriend 91557ebade feat(audio): AudioOut2 SDL output queue, ATRAC9 decoder in libSceAjm.native
- AudioOut2: one SDL device per context; the hardware grain queue level
  is derived from the SDL queued bytes so the title's poll-and-push loop
  runs at real time; ports are mixed per push with 7.1 folded to stereo.
- libSceAjm.native: instance and batch APIs; ATRAC9 decoding with
  variable-size frames inside superframes, padding, gapless parameters
  and handle re-creation on re-initialisation.
- AudioOut v1: sceAudioOutOutput(handle, NULL) drains instead of
  throwing.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0177gthrWEBBfBu5xJDXgBfo
2026-09-25 16:27:49 -07:00
devilismyfriend 8a69fefe13 perf(agc): batch GPU work in a recorder with host-imported guest memory
Replaces the synchronous per-command execution model, and with it the
upstream render-target, pipeline-cache, tile-buffer, batched-draw and
memory-ownership commits (5a280ce, 7ed5a0b, 46c799d, 598caac, 40df528),
whose files are removed.

- Recorder: one open command buffer per device; dispatches, resident
  draws, uploads, write-backs, labels, fills and copies record into it;
  timeline-semaphore serials let drains wait without the GPU mutex;
  completions run in order at reap.
- one worker thread per PM4 queue; labels and stores written by the GPU
  into the host import; GPU-side DISPATCH_INDIRECT; the buffer-fill
  kernel replaced by vkCmdFillBuffer; a dispatch cache validated by
  write watch; filler packets tolerated; rejected submissions dumped.
- guest memory: page-state cache, 64 KiB write generations, host imports
  with VK_EXT_external_memory_host, persistent mirrors of the executable
  image, GPU copies of misaligned sub-ranges.
- textures: shader-written images stay resident with deferred
  write-back (adjacent-generation rule for packed video planes), sampled
  views of storage images, DCC key handling, addrlib swizzle equations,
  bidirectional detiler.
- draws: MRT, more formats, dynamic viewport/scissor, cached pipelines,
  resident 64 KiB targets, draws recorded into the recorder.
- ShaderResources: two-stage build, descriptor and sampler caches, a
  content-keyed resource cache; presentation from the resident image.
- a label deferred behind a completion is no longer re-stored by the
  CPU at reap time unless a write-back overwrote it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0177gthrWEBBfBu5xJDXgBfo
2026-09-25 16:27:49 -07:00
devilismyfriend f3ac61000d feat(runtime): guest arena, kernel thread/sync/file APIs, crash hooks
- libc: reserve guest memory in one arena below the PS5 map limit with
  MEM_WRITE_WATCH (GuestArena) and a caching guest heap; the allocation
  registry gains a generation counter, an invalidator callback for the
  driver's page cache and a pin waiter for leased ranges. This replaces
  the fault-based GuestMemoryTracking/GuestMemoryBacking layer, whose
  files are removed.
- libkernel: mmap/mprotect/munmap on the arena, flexible memory budget,
  real sceKernelVirtualQuery; POSIX pthread layer, rwlocks, timed locks,
  TSD, event flags; 0.5 ms scheduler tick and high-resolution sleeps;
  TSC/clock/time functions; file APIs return SCE errno codes; the APR
  file-streaming API.
- libc: vectored crash reporter with backtraces for fatal exceptions,
  SIGABRT, UCRT invalid parameters and process exit; SSE4a EXTRQ/INSERTQ
  emulation for Intel hosts; %ls/%lc/%S/%C with the guest's 16-bit
  wchar_t; hand-written setjmp/longjmp for the guest jmp_buf; a path
  alias table for short save-data mount points; more string, stdio and
  math exports.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0177gthrWEBBfBu5xJDXgBfo
2026-09-25 16:27:49 -07:00
boykopovar 40df5282e6 perf(agc): track guest memory ownership + optimize gpu synchronization 2026-09-25 19:47:18 +03:00
boykopovar e392506e0a feat(pad): add enums + edit mapping 2026-09-25 16:59:23 +03:00
boykopovar dde8fa53e6 chore(pad): update circle, cross, r1 input to pad mapping 2026-09-25 12:26:41 +03:00
boykopovar 598caac0ce perf(agc): batch draws and cache descriptors, samplers, and buffers 2026-09-25 11:40:03 +03:00
boykopovar 6b8e16b73e feat(video): fullsceen mode by f11 2026-09-25 11:18:58 +03:00
boykopovar 9453f47828 feat(video): open centered window at 60% of display size 2026-09-25 11:13:03 +03:00
boykopovar 11bee5527d fix(video): preserve client aspect ratio when resizing 2026-09-25 11:07:51 +03:00
boykopovar a7fb4cbf72 fix(video): recreate swapchain after window minimization 2026-09-25 10:49:46 +03:00
boykopovar 46c799da67 perf(agc): use device-local tile buffers and cache spir-v validation 2026-09-25 09:14:03 +03:00
boykopovar 7ed5a0beea perf(agc): optimize pipeline cache key construction 2026-09-25 08:25:59 +03:00
boykopovar 5a280ced87 perf(agc): keep render targets on gpu across acquire_mem 2026-09-25 08:22:43 +03:00
boykopovar 05c8146744 refactor(pad): libScePad files structure refactor 2026-09-25 00:04:19 +03:00
boykopovar ce287648bf feat(pad): add read input state logic to libScePad 2026-09-24 23:59:12 +03:00
boykopovar 9a4c8eab8b fix(libc): update locale signatures + add sysv abi to math funcs 2026-09-24 22:57:49 +03:00
boykopovar 2778c1e86e perf(agc): keep render targets on gpu across draws 2026-09-24 21:30:00 +03:00
boykopovar bf43995e8e feat(shader): implement enable cache field in recompile request 2026-09-24 20:59:34 +03:00
boykopovar e98d2163f4 refactor(log): remove extra logs + refactor timing logging 2026-09-24 20:35:59 +03:00
boykopovar 2539e9787f perf(agc): avoid guest memory uploads for rect-list fault buffers 2026-09-24 14:57:39 +03:00
boykopovar fa6d023b1b feat(agc): support rendertarget64kb shader textures 2026-09-24 11:18:35 +03:00
boykopovar c9a82af00c fix(libc): add guest-compatible c++ locale abi 2026-09-24 10:51:11 +03:00
boykopovar 594656581e feat(libs): add new std symbols + unused filter off by default 2026-09-24 10:28:33 +03:00
boykopovar d765867146 feat(libs): add new sceAgcDriver functions def 2026-09-24 08:00:36 +03:00
boykopovar f5bc2d7649 feat(libs): add new sceAgc functions def 2026-09-24 07:54:15 +03:00
boykopovar 9f2b41b9a1 fix(libc): route guest allocations through application heap 2026-09-24 06:53:12 +03:00
boykopovar 7ed9ef1e9b perf(agc): move color transfers to + gpu resources cache 2026-09-23 22:32:42 +03:00
boykopovar 630d918b4a feat(agc): add timing logs for path after recompling 2026-09-23 22:11:41 +03:00
boykopovar 10e4d5e469 perf(shader): make -ools validation and optimization optional 2026-09-23 21:48:51 +03:00
boykopovar 65c6214a68 fix(agc): validate rect-list addressing model + logs refactor 2026-09-23 21:26:21 +03:00
boykopovar 3da19adf3f refactor(video): use presentation without maintenance extensions 2026-09-23 20:10:01 +03:00
boykopovar f129f6cde5 fix(agc): accept valid hardware screen offset values 2026-09-23 16:22:20 +03:00
boykopovar 069ee78158 feat(shader): generate tessellation shaders for rect-list primitives 2026-09-23 16:13:33 +03:00
boykopovar e341cd1b30 feat(window): add fps and frame counter to window title 2026-09-23 15:30:13 +03:00
boykopovar 762b91df59 feat(libkernel): app metadata param.json parsing impl 2026-09-23 15:18:48 +03:00
boykopovar cf1953058b feat(libkernel): add app metadata reading module 2026-09-23 15:09:31 +03:00
boykopovar 282257fd98 feat(video): add resizable aspect-ratio-aware window 2026-09-23 14:27:47 +03:00
boykopovar bbde0f4680 feat(agc): support tiled color target layout 2026-09-23 13:15:30 +03:00
boykopovar 2df58cf09c fix(kernel): support page-aligned mprotect for loaded images 2026-09-23 12:45:39 +03:00
boykopovar 0b3ffe47b0 fix(shader): distinguish descriptor resources by register 2026-09-23 12:20:33 +03:00
boykopovar 30987b6543 fix(agc): allow texture descriptor performance modulation 2026-09-23 11:49:36 +03:00
boykopovar 8cd216e9d7 fix(agc): remove raw buffer restriction and decode guest buffer descriptors 2026-09-23 11:44:46 +03:00
boykopovar ab7d9a180a fix(agc): fix texture detiler context lifetime 2026-09-23 11:17:53 +03:00
boykopovar b521e1f811 test(agc): add texture resource and detiling coverage 2026-09-23 10:57:27 +03:00
boykopovar fa09114296 feat(agc): add texture and sampler descriptor bindings 2026-09-23 09:40:06 +03:00
boykopovar 7a5f5da623 feat(agc): add guest sampler creation 2026-09-23 09:28:03 +03:00
boykopovar d617677967 feat(agc): add guest texture upload - gpu detiling 2026-09-23 09:09:08 +03:00
boykopovar 596830be3e feat(agc): add gpu texture detiling shader 2026-09-23 08:56:52 +03:00