Repository navigation
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 exportsPS_SHADNET_TLS=1for a TLS server or
PS_ONLINE_ALLOW_PLAINTEXT_LOGIN=1for a plain one; a loopback server stays plain with neither. - The same variable gates the WebAPI bearer token:
httpsis used verified even when the game
disabled checks; plainhttponly to loopback or withPS_ONLINE_ALLOW_PLAINTEXT_LOGIN=1;
PS_SHADNET_TLS=1turns the derivedhttp://<host>:31315intohttps(fffcea8). - Not footered, but a launcher must also act on them (see Launch interface): the title's built-in
patch fileBloodborne.xmlno longer ships in psport (--builtin-patches-dir);PS_NGS2=anyps5
no longer selects a backend;PS_GC_PRESSURE_PERCENTis gone;run.shno longer exports
PS_COPY_GPU_BUFFERSandPS_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, fromsrc/main/compat_titles.inc(TITLE(title_id, name, version, state, note_en, note_es, note_ru), stateplayable,experimental,brokenorunsupported);
tools/games_table.pywrites the title tables ofREADME*.mdanddocs/<lang>/GAMES.mdfrom the
same table (--checkfails while they differ). No other--list-*or--check-*query is new.
--list-featuresgainssecrets_handoff(LinuxIMPLEMENTED,WIN32EXPERIMENTAL) and
frame_gen_fsr(probed);host_features.increnamesaudiotoaudio_outand splitsinputinto
input_pad,input_pad_motion,input_keyboard,input_mouse. - Command line:
--builtin-patches-dir DIR(alsoPS_BUILTIN_PATCHES_DIR, passed byrun.sh; the
option wins). Without either, psport's own folder is used as before. A missing file no longer
stops the launch: onePatches:line says so and the title's own patches are skipped.
patches/stays as the install folder's marker.--user-id Nis read through
ps_host_command_line(so Linux gets the local user id) and is ignored bymain; 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) orPS_SHADNET_SECRETS=stdincarry the password and token;PS_SHADNET_PASSWORD
andPS_SHADNET_TOKENstill work. All are overwritten in the start block and unset;PsNetHostABI
4.runtime_secrets_takesetsPR_SET_DUMPABLE=0before 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 toolsPS_SKIP_DRAWS,
PS_CAPTURE_FRAMES,PS_CAPTURE_SUMMARIZE,PS_CAPTURE_DUMP,PS_CAPTURE_DUMP_TEX,
PS_CAPTURE_DUMP_VSCONST.PS_NGS2=nativestays accepted,anyps5logs that it was retired.
PS_GC_PRESSURE_PERCENTremoved (PS_GC_BUDGET_MBstill caps). psport.inikeys:frame_gen(offorfsr),frame_gen_fit_display,mouse_pad_filter
(default 1). WithPS_FRAME_GENset 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.shno longer exportsPS_COPY_GPU_BUFFERS,PS_GPU_WRITE_TWINS
orPS_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) andimports.txt(imports without
implementation, stubs, versions left to the host runtime) are split fromrun.log;
tools/missing_imports.pywrites a Markdown table per title from them. - Data folder layout: the driver
VkPipelineCacheis saved beside the shader cache. No change to
user/orout/otherwise.
Network (gpu/net/, src/net/, src/runtime/)
- shadNet login:
PS_SHADNET_TLS=1makes the whole connection TLS with full certificate checks;
plain TCP only to a loopback server or withPS_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_FILEstill names the CA bundle); shadNet messages are written bygen_proto.pyover a
bounds-checked wire reader instead of libprotobuf (ExtractBlobcompares its length insize_t).
The build check refuses OpenSSL, abseil and protobuf in any bundle, also withPS_BUNDLE_NET=1;
the module itself stays out of public bundles. - Logs:
PsNetRedacthandles 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'sServerChrIdsentinel 0x8000000000000000, WORKAROUND quirk
bloodborne_server_chara_idclears it at 0x1c43f0e); noticeCheckTimeis a date string. - libSceNet:
__sys_socketex,__sys_socketclose,__sys_netcontroland_ioctlserved offline
(other ioctlsENOTTY, counted);socket(AF_UNIX)creates a host socket, a connect to a local
path getsENOENT, counted; epoll waits retry a hostEINTRwith the remaining timeout
(0x80410104only aftersceNetEpollAbort);sceNetEpollCreateaccepts a null name; unknown
socket levels, options, types and families,epoll_ctlandepoll_create1failures 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
asoffline, with name and code, fromimport_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
inExportCall): 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).PLAYon a voice never set up returns0x804A0052. A failing export logs its first
failure per export and code; anNgs2summary follows the call report;PS_NGS2_TRACE=1traces the
first 64 calls of each export. ca2258d224: native Ngs2 is the only backend (Runtime: Ngs2 backend: native (gpu/ngs2));
gpu/ngs2_anyps5removed 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. libScePadvibration 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=0orPS_MOUSE_PAD_FILTER=0keeps 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, rowframe_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=1presents 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,0turns it off): the driver'sVkPipelineCacheis saved
beside the shader cache, read before the preload, keyed by device, driver and
pipelineCacheUUID. Pipeline-compile threads size fromPsThreads::Available()(affinity mask,
cgroup v2cpu.max) instead ofhardware_concurrency().- Sparse binds: empty bind infos (
bindCount0) 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 ofvkQueueBindSparsefor 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 ins64(budgets under about 2 GB madestd::max<u64>wrap and pressure never
started).PS_GC_BUDGET_MBcaps;PS_GC_PRESSURE_PERCENTremoved. 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/cpcursor); packet sizes are read
before the packet runs;S_GETREG_B32of a register other thanHW_IDreads 0, counted.
Graphics, shaders (shader_recompiler/, vk_pipeline_serialization.cpp)
S_SETPC_B64jump 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::Serializestores the copy shader's stream-out stores and
Info::stores(ShaderMetaVersion14; a warm cache loaded GS stages without them and drew without
capture); the source is kept per permutation and per pipeline (StageSpecialization::xfb_source,
PipelineKeyVersion7); 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;ShaderBinaryVersion16).DB_ALPHA_TO_MASK(0xA2DC) drives
alphaToCoverageEnablefrom MRT0's alpha, also without a color target.DB_RENDER_CONTROL
DEPTH_COPY/STENCIL_COPYcopy 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
failspsport_gpu_initwith its errno), texture cache (an image at guest address 0 is not created),
common infrastructure (IOFileshort counts,RecursiveLockmisuse). - Frame captures (
vk_frame_capture*.cpp,gpu/diag/psport_skip_draws.cpp):PS_SKIP_DRAWSleaves
out draws by shader pair (#N, or@<W>x<H>/@0x<address>for colour attachment 0);
PS_CAPTURE_FRAMESrecords 1 to 8 consecutive frames;PS_CAPTURE_SUMMARIZE=1|2adds value
summaries, per-draw state, vertex, index and compute data;PS_CAPTURE_DUMPwrites each pass's
targets as PNGs (480x270);PS_CAPTURE_DUMP_TEXdumps the images a draw samples (BC1-BC5 decoded
on the CPU) with its samplers;PS_CAPTURE_DUMP_VSCONSTwrites 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 thePS_SKIP_DRAWSgrammar.
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, orpthread_tryjoin_npfor 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 nullrbpand return address through a stub. Guest threads leave without the CRT's
unwindinglongjmpon Windows. PS_DMEM_MBgrowth above 5056 MiB (9152 with Bloodborne's heap patch) is gated to 7/8 of
MemAvailableor 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
sceKernelDebugOutTextbecome 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_openand
shm_unlinkare native (anonymous memfd; delete-on-close temp file on Windows). Shared semaphores
and event flags (attr bit 0x100) are accepted.sceKernelGetEventErrorreads 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/urandomopens natively on Windows. - Exit paths: failures end through
runtime_exit(call report,summary.txt, thenps_host_exit;
exit status unchanged); GPU fatal exits (device lost, fiber panic, unsupported guest memory: 24,
134, 1) throughps_host_exit_at_once(_exiton Linux), writing the report andsummary.txt;
the watchdog and termination handlers write the whole exit summary.PS_STOP_FILEends 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.UserServicegainsIsLoggedIn,
GetRegisteredUserIdListandsceUserServiceIsSharePlayClientUser(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 (sceLncUtilRegisterCdlgSharedMemoryNameand
Unregister: checked, logged, counted) are answered. Atelier Ryza saves and loads again
(GameData00). - NpCommon heap, kernel memory and
np::Objectnew,_sceNpHeapMalloc/Realloc/Freeand
sceNpHeapGetStat(first-fit allocator over the guest buffer, block table host-side, failures
counted).scePlayGoGetLocuschecks its order and limits (1000 ids, at most the chunk count, no
duplicates) and countsBAD_CHUNK_ID(0x80b2000c) as status. A dumped libSceSysmodule's load of
libSceAppContent counts as a reference./dev/dipsw(four switch ioctls read 0),sceVideoOutAddDriver
andDeleteDriver,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_framebounds reroutes the leaves' non-stack memory accesses through a trampoline
that lowersrsppast 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_ZONEmakes the Linux fault handler clobber the red zone to validate the pass.
Functions with jump tables are stepped over (Bloodborne: 2242), FDEs withpc_begin0 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
CreateSymbolicLinkWis
refused (error 1314); cleanup no longer usesnftw.
Windows platform (groundwork, not supported)
ps_host_*platform layer:ps_host_window.h(SDL3 window, events, displays, pointer and text
entry ingpu/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.pyreports OS code
outsidesrc/platform/andgpu/platform/(--strictfails 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 mapPAGE_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.txtbuildspsport.exe, the capability check, the probe and the GPU
library;windows.ymlbuilds only version tags; atoolchain-win32-Ntag publishes CLANG64's
packages (signature-checked database), psport's FFmpeg, magic_enum, miniz and a CMake toolchain
file; a tagvX.Y.Zpublishespsport-windows-vX.Y.Z-x86_64.zipand its.sha256on its release
(nix-cache.ymledits the release when the Windows job created it first).
Licences and packaging
LICENSES.json(every component with licence, review state and provenance) andLICENSES/(texts);
tools/check_licenses.pychecks the manifest against the tree (report-only,--strictexits 1);
every bundle and the AppImage carryLICENSES.md,LICENSES.jsonandLICENSES/; the notices read
packaging/vendored.txt, checked bycheck_bundle_licences.sh. SPDX headers insrc/,
gpu/shim,gpu/platform.LICENSES.mdis laid out in groups with a forks table; Supermedo,
Mrsuss60 and willl03 are credited with what is taken from each.Bloodborne.xmlleaves psport for the launcher (--builtin-patches-dir).
tools/regress/regress.sh,restart.shandplay_ab.shdefaultPS_BUILTIN_PATCHES_DIRto a
decanter checkout'scrates/ps/data/bloodborne.- Inherited names: runtime include guards
PS_RUNTIME*_H,PS_SECTION, CMakeps_ipo_*, host
thread namespsport:*;BB_*environment variables stay.docs/en/ARCHITECTURE.mdlists
--list-compatandtools/games_table.py. Atelier Ryza isplayableincompat_titles.inc;
CUSA50989 is named Symphonia as itsparam.sfodoes. - CMake policies
CMP0167andCMP0218set explicitly.