Skip to content

v0.2.0

Latest

Choose a tag to compare

@github-actions github-actions released this 01 Nov 13:47
· 9 commits to main since this release
v0.2.0
4636323

psport v0.2.0

The shadNet login goes over TLS or is refused in clear, and the secrets that carry it leave the
environment; libSceNgs2 and libSceAudiodec are native, AnyPS5's Ngs2 port is retired; FSR 3.1 frame
generation, a driver pipeline cache and VRR pacing arrive; the texture collector follows the live VRAM
budget; guest threads, stacks and TLS are reused; the system-dialog modules and the process-identity
calls are served natively (Atelier Ryza saves); the launcher gains --list-compat and
--builtin-patches-dir; frame captures gain dump and draw-skip tools. Windows is still groundwork, not
a supported platform: the platform layer moves behind ps_host_* and the CI builds a package per tag.
Every title rebuilds its shader cache once (ShaderBinaryVersion 16, ShaderMetaVersion 14,
PipelineKeyVersion 7).

BREAKING CHANGE

  • Online play against a shadNet server off this machine without TLS needs
    PS_ONLINE_ALLOW_PLAINTEXT_LOGIN=1 (8aed8f1, #1297). That includes the default
    play.seamlesshunt.com:31313. Without it the login is refused and the log says
    PS_SHADNET_TLS=1 for a TLS server, or PS_ONLINE_ALLOW_PLAINTEXT_LOGIN=1 to accept the risk
    (gpu/net/psport_net_tls.cpp). A launcher either exports PS_SHADNET_TLS=1 for a TLS server or
    PS_ONLINE_ALLOW_PLAINTEXT_LOGIN=1 for a plain one; a loopback server stays plain with neither.
  • The same variable gates the WebAPI bearer token: https is used verified even when the game
    disabled checks; plain http only to loopback or with PS_ONLINE_ALLOW_PLAINTEXT_LOGIN=1;
    PS_SHADNET_TLS=1 turns the derived http://<host>:31315 into https (fffcea8).
  • Not footered, but a launcher must also act on them (see Launch interface): the title's built-in
    patch file Bloodborne.xml no longer ships in psport (--builtin-patches-dir); PS_NGS2=anyps5
    no longer selects a backend; PS_GC_PRESSURE_PERCENT is gone; run.sh no longer exports
    PS_COPY_GPU_BUFFERS and PS_GPU_WRITE_TWINS*.

Launch interface

  • Launcher queries: new psport --list-compat (print_compat, src/main/cli.c): the titles psport
    has been seen to run, from src/main/compat_titles.inc (TITLE(title_id, name, version, state, note_en, note_es, note_ru), state playable, experimental, broken or unsupported);
    tools/games_table.py writes the title tables of README*.md and docs/<lang>/GAMES.md from the
    same table (--check fails while they differ). No other --list-* or --check-* query is new.
    --list-features gains secrets_handoff (Linux IMPLEMENTED, WIN32 EXPERIMENTAL) and
    frame_gen_fsr (probed); host_features.inc renames audio to audio_out and splits input into
    input_pad, input_pad_motion, input_keyboard, input_mouse.
  • Command line: --builtin-patches-dir DIR (also PS_BUILTIN_PATCHES_DIR, passed by run.sh; the
    option wins). Without either, psport's own folder is used as before. A missing file no longer
    stops the launch: one Patches: line says so and the title's own patches are skipped.
    patches/ stays as the install folder's marker. --user-id N is read through
    ps_host_command_line (so Linux gets the local user id) and is ignored by main; a value with a
    non-digit or over 10 digits leaves the id empty and logs a warning (it was cut to 10 digits).
  • shadNet secrets (src/net/runtime_secrets.c, run.sh): PS_SHADNET_SECRETS_FILE (mode 0600,
    removed once read) or PS_SHADNET_SECRETS=stdin carry the password and token; PS_SHADNET_PASSWORD
    and PS_SHADNET_TOKEN still work. All are overwritten in the start block and unset; PsNetHost ABI
    4. runtime_secrets_take sets PR_SET_DUMPABLE=0 before reading them (logged with pid and value
    read back) and restores it only when none was taken.
  • PS_STOP_FILE (src/main/signals.c): a launcher that cannot send SIGTERM creates the file; the
    window thread ends the game as on a window close, or the watcher writes the exit summary after 5 s.
  • New variables: PS_SHADNET_TLS, PS_ONLINE_ALLOW_PLAINTEXT_LOGIN, PS_SHADNET_SECRETS_FILE,
    PS_SHADNET_SECRETS, PS_STOP_FILE, PS_BUILTIN_PATCHES_DIR, PS_FRAME_GEN,
    PS_FRAME_GEN_FIT_DISPLAY, PS_VRR, PS_PACE_AT_START, PS_DRIVER_PIPELINE_CACHE,
    PS_MOUSE_PAD_FILTER, PS_READBACK_TILED_KB, PS_RED_ZONE_GUARD, PS_RED_ZONE_GUARD_DIAG,
    PS_FAULT_CLOBBER_RED_ZONE, PS_NGS2_TRACE, and the capture tools PS_SKIP_DRAWS,
    PS_CAPTURE_FRAMES, PS_CAPTURE_SUMMARIZE, PS_CAPTURE_DUMP, PS_CAPTURE_DUMP_TEX,
    PS_CAPTURE_DUMP_VSCONST. PS_NGS2=native stays accepted, anyps5 logs that it was retired.
    PS_GC_PRESSURE_PERCENT removed (PS_GC_BUDGET_MB still caps).
  • psport.ini keys: frame_gen (off or fsr), frame_gen_fit_display, mouse_pad_filter
    (default 1). With PS_FRAME_GEN set the launcher owns the value: the file is left alone and the
    menu's restart carries the choice in the environment. Each change prints
    Frame generation setting: <off|fsr> (flushed).
  • Defaults moved into psport: the GPU buffer copy and the write twins are chosen on every host and
    logged with their reason; run.sh no longer exports PS_COPY_GPU_BUFFERS, PS_GPU_WRITE_TWINS
    or PS_GPU_WRITE_TWINS_MAX (the variables stay as test levers; twins limit 1024 bytes, measured:
    65536 cost 4-8% in Bloodborne, 55 against 60 FPS on an RTX 2080).
  • Debug run folder: link.txt (the loader's linking decisions) and imports.txt (imports without
    implementation, stubs, versions left to the host runtime) are split from run.log;
    tools/missing_imports.py writes a Markdown table per title from them.
  • Data folder layout: the driver VkPipelineCache is saved beside the shader cache. No change to
    user/ or out/ otherwise.

Network (gpu/net/, src/net/, src/runtime/)

  • shadNet login: PS_SHADNET_TLS=1 makes the whole connection TLS with full certificate checks;
    plain TCP only to a loopback server or with PS_ONLINE_ALLOW_PLAINTEXT_LOGIN=1, counted when
    allowed (gpu/net/psport_net_tls.cpp).
  • The online module's TLS is mbedTLS (cpp-httplib 0.45 backend, mbedTLS's GPL-2.0-or-later option;
    SSL_CERT_FILE still names the CA bundle); shadNet messages are written by gen_proto.py over a
    bounds-checked wire reader instead of libprotobuf (ExtractBlob compares its length in size_t).
    The build check refuses OpenSSL, abseil and protobuf in any bundle, also with PS_BUNDLE_NET=1;
    the module itself stays out of public bundles.
  • Logs: PsNetRedact handles header values, cookies and URL queries of libhttp and the WebAPI
    libraries (header names, lengths and allow-listed values only); other players' NPIDs go from INFO
    to DEBUG, the own NPID is cut to 3 characters.
  • shadNet protocol: BBSC packets 0x23 to 0x27 are dispatched; TCP keepalive and a 20 s grace before
    SignedOut; signaling replies go to the packet's source; the local server publishes character ids
    (Bloodborne's ServerChrId sentinel 0x8000000000000000, WORKAROUND quirk
    bloodborne_server_chara_id clears it at 0x1c43f0e); notice CheckTime is a date string.
  • libSceNet: __sys_socketex, __sys_socketclose, __sys_netcontrol and _ioctl served offline
    (other ioctls ENOTTY, counted); socket(AF_UNIX) creates a host socket, a connect to a local
    path gets ENOENT, counted; epoll waits retry a host EINTR with the remaining timeout
    (0x80410104 only after sceNetEpollAbort); sceNetEpollCreate accepts a null name; unknown
    socket levels, options, types and families, epoll_ctl and epoll_create1 failures return the
    net or NP error with a counted log instead of asserting.
  • Call report: calls with no connection (ENETUNREACH, NP signed out, NP and HTTP stubs) are counted
    as offline, with name and code, from import_offline.inc.

Audio (gpu/ngs2/, src/audio/, tools/hwtest/)

  • libSceNgs2 native (gpu/ngs2, firmware 11.00's 47 exports plus the three PS5 ones, each wrapped
    in ExportCall): system, rack and voice APIs; DSP modules (envelope, biquad, LFE, compressor,
    limiter, peak meter, gain ramps, distortion, channel matrix); render (sampler, submixer,
    mastering, limiter); waveform parse and calc for RIFF, VAG/HEVAG, ATRAC9 (LibAtrac9, hardened
    against three out-of-table reads) and generators; reverb rack 0x2001; custom racks 0x4001-0x4003
    with modules 0x12-0x15, 0x18, 0x19, 0x1b, 0x1f (modules without a spec pass input through,
    counted); pan, geometry and FFT exports. Where the firmware loops or faults, psport answers with
    an error and counts it.
  • The ATRAC9 state of a decoder is allocated in host memory at its first PLAY and freed by
    RackDestroy (Ryza's 128-voice rack asks for 1068640 bytes instead of 13938272; failure answers
    0x804A0307). PLAY on a voice never set up returns 0x804A0052. A failing export logs its first
    failure per export and code; an Ngs2 summary follows the call report; PS_NGS2_TRACE=1 traces the
    first 64 calls of each export.
  • ca2258d224: native Ngs2 is the only backend (Runtime: Ngs2 backend: native (gpu/ngs2));
    gpu/ngs2_anyps5 removed after matching it in 9 titles; no AnyPS5 code in the tree.
  • libSceAudiodec native (same exports, NIDs and ABI; libavcodec and LibAtrac9): offline, 50 PCM
    outputs and 13188 call-log lines identical to the old port.
  • libScePad vibration checks initialised (0x80920005), param (0x80920001), handle
    (0x80920003) in the firmware's order. Mouse motion produced by a pushed controller stick (past
    12000 of 32767; Steam Desktop Layout, reWASD) is dropped before mouse look and libSceMouse; first
    drop logged, count in the exit report; mouse_pad_filter=0 or PS_MOUSE_PAD_FILTER=0 keeps it.
  • Hardware tests (OpenOrbis homebrew) tools/hwtest/: ngs2_api, ngs2_render, ngs2_reverb,
    ngs2_waveform, ngs2_custom, ngs2_limiter, ngs2_pan, audio3d_pan (compare with
    PS_AUDIO_DUMP).

Graphics, frame generation and presentation (gpu/shadps4/video_core/renderer_vulkan/, gpu/port/psport_settings.cpp)

  • FSR 3.1 frame generation (vk_frame_generation.h; off by default; frame_gen=fsr, PS_FRAME_GEN;
    offered by capability, row frame_gen_fsr): one generated frame per game frame with the UI over
    it, paced by the presenter, the game capped at half the refresh rate with FIFO. Switching in a
    session started with it frees the FSR context and generated frames once the GPU has passed them; a
    game started without it needs a restart (docs/en/upscaler.md). The hudless copy lists its class's
    UNORM and sRGB views. An exit line splits frames without capture by cause (no scene pass, no scene
    depth) with game time, and counts generated frames with the UI interpolated or restarted.
  • PS_VRR=1 presents with FIFO and holds the frame rate under the refresh rate; PS_PACE_AT_START
    keeps the limit before the game starts a frame.
  • PS_DRIVER_PIPELINE_CACHE (default on, 0 turns it off): the driver's VkPipelineCache is saved
    beside the shader cache, read before the preload, keyed by device, driver and
    pipelineCacheUUID. Pipeline-compile threads size from PsThreads::Available() (affinity mask,
    cgroup v2 cpu.max) instead of hardware_concurrency().
  • Sparse binds: empty bind infos (bindCount 0) are dropped; a failed bind is retried once, then an
    empty submission signals its tick (Windows queue hang, #1002). Promotions to VRAM spend a budget of
    1/8 of wall time charged with each batch's measured driver time, adjacent binds merge, slow
    batches are logged (RADV: 73-77 ms of vkQueueBindSparse for 168-172 one-block ranges, #1273).
  • Texture collector marks (texture_cache.cpp): collect, pressure and critical are 70/85/95 % of
    VK_EXT_memory_budget's current budget, refreshed once a second on every GPU; every mark capped at
    the budget; computed in s64 (budgets under about 2 GB made std::max<u64> wrap and pressure never
    started). PS_GC_BUDGET_MB caps; PS_GC_PRESSURE_PERCENT removed. Also: views clamp to the resolved
    image, extents compare per dimension, image hashes read memory as uploads do, overwritten edges drop
    stale data, scissors bound attachment-less passes, block formats fall back without storage.
  • PS_READBACK_TILED_KB (GetReadbackTiledLimitKb, default 64, 0 to 1048576): tiled targets up to it
    are tiled back into the game's memory after each GPU write, landing at a later fence without a
    Finish (Atelier Ryza's lens flare reads texel 0,0 of a 64x64 target, #1477).
  • Layer mode: guest threads wait for a mirrored block's demotion copy before writing, and demotions
    keep traps until it ran (Saga's heap links, #1218); counted every 10 s and in an exit line. Chained
    INDIRECT_BUFFERs replace their buffer (graphics, compute, gpu/cp cursor); packet sizes are read
    before the packet runs; S_GETREG_B32 of a register other than HW_ID reads 0, counted.

Graphics, shaders (shader_recompiler/, vk_pipeline_serialization.cpp)

  • S_SETPC_B64 jump tables: the CFG reads a table of offsets after the OrbShdr footer, links a
    compare chain on the loaded entry; the load becomes a select over the entries (dispatches were
    skipped).
  • Geometry shader stream-out: Info::Serialize stores the copy shader's stream-out stores and
    Info::stores (ShaderMetaVersion 14; a warm cache loaded GS stages without them and drew without
    capture); the source is kept per permutation and per pipeline (StageSpecialization::xfb_source,
    PipelineKeyVersion 7); GS programs whose layouts differ are logged; draws without capture are
    counted.
  • Valid-mask exports stay out of EXEC scopes (the kill path s_mov_b64 exec, 0; exp mrt0 off done vm
    discarded nothing; ShaderBinaryVersion 16). DB_ALPHA_TO_MASK (0xA2DC) drives
    alphaToCoverageEnable from MRT0's alpha, also without a color target. DB_RENDER_CONTROL
    DEPTH_COPY/STENCIL_COPY copy depth into the color target. A uint 8-bit T# at the stencil base of
    a depth image resolves to its stencil aspect. A colour-tiled T# overlapping a depth image's memory is
    no longer counted as a stale depth read; depth surfaces read as textures and depth override copies
    are logged and counted with totals in the exit summary.
  • Asserts became counted errors: register decoders (invalid data formats read as 0 bits; shaders
    without an OrbShdr footer skip their draws), page manager (a trap owner table that cannot be mapped
    fails psport_gpu_init with its errno), texture cache (an image at guest address 0 is not created),
    common infrastructure (IOFile short counts, RecursiveLock misuse).
  • Frame captures (vk_frame_capture*.cpp, gpu/diag/psport_skip_draws.cpp): PS_SKIP_DRAWS leaves
    out draws by shader pair (#N, or @<W>x<H> / @0x<address> for colour attachment 0);
    PS_CAPTURE_FRAMES records 1 to 8 consecutive frames; PS_CAPTURE_SUMMARIZE=1|2 adds value
    summaries, per-draw state, vertex, index and compute data; PS_CAPTURE_DUMP writes each pass's
    targets as PNGs (480x270); PS_CAPTURE_DUMP_TEX dumps the images a draw samples (BC1-BC5 decoded
    on the CPU) with its samplers; PS_CAPTURE_DUMP_VSCONST writes the stages' user data and bound
    buffers with the journaled writes since the capture was armed. A pass lists up to 64 shaders (was
    8). Diagnostics only; the last three select draws with the PS_SKIP_DRAWS grammar.

Kernel and runtime (src/kernel/, src/runtime/)

  • Guest threads: records of joined or detached threads go to a FIFO free list; host threads stay
    joinable and, once joined (guest join, or pthread_tryjoin_np for detached ones), their stack and
    TLS block go to a free list the next thread of the same size takes (Atelier Ryza's thousands of
    workers drained the 32 GiB low range and moved handles above 40 bits); the exit summary counts
    both. Thread creation logs the first 3 per name, then a digest at most every 10 s. Guest threads
    start with a null rbp and return address through a stub. Guest threads leave without the CRT's
    unwinding longjmp on Windows.
  • PS_DMEM_MB growth above 5056 MiB (9152 with Bloodborne's heap patch) is gated to 7/8 of
    MemAvailable or the cgroup or Job Object headroom; ps_host_memory_pressure() gives the texture
    collector a level (Host memory: ... line).
  • Guest debug output: descriptors 1 and 2 and sceKernelDebugOutText become prefixed, escaped log
    lines, cut at 512 bytes, limited to 200 per second, drops counted. Read, pread, readv, preadv and
    aio read complete short reads of regular files (up to 64 tries), counted. shm_open and
    shm_unlink are native (anonymous memfd; delete-on-close temp file on Windows). Shared semaphores
    and event flags (attr bit 0x100) are accepted. sceKernelGetEventError reads fflags
    (0x80020000 + fflags); queue events return beside small timers; fiber state changes before the
    context area attaches; equeue and fiber asserts are counted errors (stack overflow prints
    libSceFiber's PANIC, exit 134). /dev/urandom opens natively on Windows.
  • Exit paths: failures end through runtime_exit (call report, summary.txt, then ps_host_exit;
    exit status unchanged); GPU fatal exits (device lost, fiber panic, unsupported guest memory: 24,
    134, 1) through ps_host_exit_at_once (_exit on Linux), writing the report and summary.txt;
    the watchdog and termination handlers write the whole exit summary. PS_STOP_FILE ends in order.
  • Process identity calls answered natively (get_authinfo, __sys_get_proc_type_info,
    kern.proc.appinfo, sceKernelGetAppInfo, TitleWorkaroundIsEnabled, sandbox, regmgr,
    VrCaptureSize, LncUtilGetAppStatus, sceKernelError, GetModuleInfo,
    LoadStartModuleForSysmodule); unread console values take the retail branch, counted. Unlinked
    system libraries a console has as a file get a counted handle without an image; other names keep
    ENOENT.

System services (src/system/)

  • System-dialog modules (CommonDialog, SaveDataDialog, WebBrowserDialog) are served natively by the
    port; the loader keeps the dumped modules unlinked. UserService gains IsLoggedIn,
    GetRegisteredUserIdList and sceUserServiceIsSharePlayClientUser (true for a user id whose top
    nibble is 3). CommonDialog's LncUtil launcher calls (launch accepted but never completes, ESRCH;
    activation fails) and shared memory name calls (sceLncUtilRegisterCdlgSharedMemoryName and
    Unregister: checked, logged, counted) are answered. Atelier Ryza saves and loads again
    (GameData00).
  • NpCommon heap, kernel memory and np::Object new, _sceNpHeapMalloc/Realloc/Free and
    sceNpHeapGetStat (first-fit allocator over the guest buffer, block table host-side, failures
    counted). scePlayGoGetLocus checks its order and limits (1000 ids, at most the chunk count, no
    duplicates) and counts BAD_CHUNK_ID (0x80b2000c) as status. A dumped libSceSysmodule's load of
    libSceAppContent counts as a reference. /dev/dipsw (four switch ioctls read 0), sceVideoOutAddDriver
    and DeleteDriver, sceVshAvcapInit/Term.

Loader (src/loader/, gpu/port/psport_red_zone.cpp)

  • Linked modules start after the modules their NEEDED entries name; reorders and cycles are logged.
    libSceHmd is served natively (runtime_vr.c, a console with no headset); modules skipped as served
    natively are named in the log.
  • Red zone guard (PsGuestCode::RelocateBelowRedZone, capability
    ps_host_fault_frame_clobbers_red_zone: true on win32, false on Linux): a load-time pass over each
    function's .eh_frame bounds reroutes the leaves' non-stack memory accesses through a trampoline
    that lowers rsp past the 128-byte red zone; what it cannot prove safe is skipped and counted
    (short, jump-table, rsp/rip, no-FDE, patched). PS_RED_ZONE_GUARD=0|1|report;
    PS_RED_ZONE_GUARD_DIAG=1 (or report mode) adds decode histograms;
    PS_FAULT_CLOBBER_RED_ZONE makes the Linux fault handler clobber the red zone to validate the pass.
    Functions with jump tables are stepped over (Bloodborne: 2242), FDEs with pc_begin 0 are counted
    apart (45993); non-leaf [rbp-x] uses fall from 1524 to 16 in an offline run.
  • Mods view without link rights: junctions, hard links or copies when CreateSymbolicLinkW is
    refused (error 1314); cleanup no longer uses nftw.

Windows platform (groundwork, not supported)

  • ps_host_* platform layer: ps_host_window.h (SDL3 window, events, displays, pointer and text
    entry in gpu/platform/common/), ps_host_audio.h, ps_host_input.h, ps_host_fs
    (ps_host_fs_open_stream, ps_host_fs_walk, ps_host_fs_remove_tree), ps_host_gpu_memory_*
    (export and import of guest ranges for the GPU as shares), ps_host_env_get, ps_host_time_*,
    ps_host_thread_yield, ps_host_dl_find_loaded, ps_host_process_id, ps_host_list_mappings,
    ps_host_read_memory; behaviour on Linux unchanged. tools/check_os_code.py reports OS code
    outside src/platform/ and gpu/platform/ (--strict fails while any remains; the night runs it
    first).
  • Fixes found there: guest hook handlers, the resource copy hook and the game menu hooks use the
    System V ABI; views map PAGE_EXECUTE_READWRITE; placed mappings round to pages; fault reports end
    at once and carry UTC time and thread; /dev/urandom; patches/ ships in the Windows bundle.
  • Build: top-level CMakeLists.txt builds psport.exe, the capability check, the probe and the GPU
    library; windows.yml builds only version tags; a toolchain-win32-N tag publishes CLANG64's
    packages (signature-checked database), psport's FFmpeg, magic_enum, miniz and a CMake toolchain
    file; a tag vX.Y.Z publishes psport-windows-vX.Y.Z-x86_64.zip and its .sha256 on its release
    (nix-cache.yml edits the release when the Windows job created it first).

Licences and packaging

  • LICENSES.json (every component with licence, review state and provenance) and LICENSES/ (texts);
    tools/check_licenses.py checks the manifest against the tree (report-only, --strict exits 1);
    every bundle and the AppImage carry LICENSES.md, LICENSES.json and LICENSES/; the notices read
    packaging/vendored.txt, checked by check_bundle_licences.sh. SPDX headers in src/,
    gpu/shim, gpu/platform. LICENSES.md is laid out in groups with a forks table; Supermedo,
    Mrsuss60 and willl03 are credited with what is taken from each.
  • Bloodborne.xml leaves psport for the launcher (--builtin-patches-dir).
    tools/regress/regress.sh, restart.sh and play_ab.sh default PS_BUILTIN_PATCHES_DIR to a
    decanter checkout's crates/ps/data/bloodborne.
  • Inherited names: runtime include guards PS_RUNTIME*_H, PS_SECTION, CMake ps_ipo_*, host
    thread names psport:*; BB_* environment variables stay. docs/en/ARCHITECTURE.md lists
    --list-compat and tools/games_table.py. Atelier Ryza is playable in compat_titles.inc;
    CUSA50989 is named Symphonia as its param.sfo does.
  • CMake policies CMP0167 and CMP0218 set explicitly.