166 Commits
Author SHA1 Message Date
jpolo1224 82f21b16d2 VK: credit sashkinbro for the pipeline cache format and the Adreno split
Both landed as our own commits and both owe him more than they said.

The on-disk pipeline cache header -- length, version, vendorID, deviceID and
pipelineCacheUUID -- is his design from EmuCoreC 47220b153, used as-is, including
using the UUID as the invalidation key so a driver swap rebuilds rather than
feeding a driver a blob it cannot read. What was missing there was the wiring:
nothing passed the cache to vkCreate*Pipelines, so it saved an empty file. That
part, and sharing it with the shader interpreter, are ours.

Splitting Adreno and Turnip out to a 64-wide group size is his too (b9f0f3631).
Our comment had held all of mobile at 32 on the claim that Mali was also 64-wide,
which is wrong -- Valhall warps are 16 lanes and Bifrost 4-8. His split was the
better call and the reason ours changed.
2026-08-20 18:13:35 -04:00
jpolo1224 2ed8442c11 Release: 0.9.4 (versionCode 20) 2026-08-20 17:58:45 -04:00
jpolo1224 ab58fb087b lv2: stop logging sys_memory_container_get_size on every call
Tales of Xillia 2 (BLUS31397) polls this syscall in a loop: 20,664 calls in a 19
minute session, 5,123 of them inside a single second. It was logged at warning, so
each one wrote a line to external storage on Android -- the same shape as the SPU
recompiler diagnostics, and enough on its own to stop frames landing.

Reported as issue #76, an intermittent hang every few minutes that ends with
"Game has stopped responding - it is no longer drawing frames". That message comes
from the 30 second frame-stall watchdog, which is what a saturated log writer
looks like from the RSX thread.

Moved to trace. Nothing is lost: a container's size is fixed at creation, and
sys_memory_container_create and _destroy both still log at warning, so the events
that carry information are still recorded. sys_memory_get_user_memory_size in the
same file already has the equivalent treatment upstream -- it only logs when the
values it reports actually change.

Not confirmed as the cause of #76 yet; the reporter has not attached a log, and 19
minutes of play here did not reproduce the hang. It is the largest log source this
title produces by a wide margin.
2026-08-20 17:55:36 -04:00
jpolo1224 9829bc5402 Android: wait for the previous VM to actually stop before booting
Booting a game while another was still tearing down left the app frozen on the
last frame of the previous game.

The boot gate asked Emu.IsStopped(), whose default overload is

    m_state <= system_state::stopping

so it answers true while the previous VM is still stopping -- and while it is
loading. Kill() only signals the threads and hands the joining to a detached
"Emulation Join Thread", so the state reaches stopping at once and the guard read
that as stopped. The entire wait block was skipped precisely when it was needed,
which is why no "previous VM still running" line was ever logged.

On device: Stopping emulator at 0:10:14, BootGame at 0:10:17, and at 0:10:31 the
join thread was still waiting on PPU[0x1000004] "SPU Interrupt Thread0" -- 17.4
seconds -- with seven SPUs parked in EXIT|w|G-PAUSE and one PPU thread spinning at
100%.

Use the IsStopped(true) overload, which requires system_state::stopped and is
reached only once that join thread has finished. The ten second bound and the
boot-anyway fallback are unchanged, so a teardown that genuinely hangs still gets
reported rather than freezing the UI.

Only the three checks in _rpcsx_boot are changed. Other IsStopped() callers here
want "not running" and the loose overload is right for them.

This does not fix why that interrupt thread fails to exit, which is still open. It
stops a slow teardown from becoming a boot into a half-destroyed VM.
2026-08-20 17:34:07 -04:00
jpolo1224 0fb1757a84 PPU: report thread perf stats once, not on every stop-path pass
cpu_on_stop() is a teardown hook and nothing enforces that it runs a single time.
A PPU thread that re-enters the stop path without exiting reports again on every
pass: one thread ("SPU Interrupt Thread2") was producing "PPU thread perf stats
are not available." roughly every 10 microseconds, near 100,000 lines a second.

That is survivable on a desktop. On Android the log goes to external storage, so
it pins the log writer and drags down the shutdown it is describing -- the
emulator logged "Stopping emulator..." and never reached "All threads have been
stopped", leaving the next boot stuck on the last frame of the previous game.

Guard the reporting with a flag so it happens once per thread. The flag is
deliberately left out of serialization: it describes this run's reporting, not
guest state.

This does not address why the thread re-enters the stop path, which is a separate
question -- it stops that from being an emulator-wide stall while it is open.
2026-08-20 17:19:03 -04:00
jpolo1224 53e225cf96 RPCN: stop burning a core whenever a game is not running
The client thread's inner loop breaks out to the outer sem_rpcn.acquire() for
every state except one: connected and authentified with no game running. The
only blocking wait sits inside the `authentified && !Emu.IsStopped()` branch, so
that case fell through to `while (true)` with nothing to wait on and span a full
core for as long as the user stayed signed in outside a game -- at the menu,
between titles, and throughout shutdown.

Measured on a Retroid Pocket 6 sitting at the library: `RPCN Client` at 100%,
utime 21964 against stime 58, so a userspace spin rather than a syscall storm.

Wait in the fall-through case instead. Breaking out to the outer semaphore would
also stop the spin but nothing releases it when a game starts, so the pings would
never resume.

Only reachable once RPCN actually authenticates, which is why it survived
upstream: signing in is new on Android.
2026-08-20 17:19:03 -04:00
jpolo1224 d9a0481dcb SPU: move the per-block recompiler diagnostics to trace
A 15 minute Prototype session wrote 56,881 log lines, and 49,644 of them came from
the SPU recompiler -- peaking at 2,473 lines in a single second, written to
/sdcard. The bursts land exactly when a game is already stalling to compile new
blocks, which is the worst possible moment to add synchronous file writes, and
they stop when compilation finishes. That matches the reported symptom: seconds of
lockup that recover on their own.

Every one of these is per-block or per-instruction:

    8963  New SPU block compiled successfully   was success
    7833  Precompiling fallthrough              was notice
    4337  Precompiling filler space             was notice
    3449  SPU block is a loop                   was notice
    2418  MFC_EAH / MFC_Cmd not constant        was warning, per INSTRUCTION
    1516  Trampoline simplified                 was error, and is routine
     843  SPU Block Dump                        was notice, and is multi-line
     696  GETLLAR pattern entry point           was notice
    ~1400 PUTLLC16 / pattern breakage family    was notice and success

Upstream can afford these: a desktop has a fast disk and nobody is writing to
external storage. Demoted to trace, so they stay available by raising the SPU
channel and cost nothing during normal play.

The genuine faults keep their level -- MFC_Cmd invalid size and unknown command
are still errors, and they are rare.

This does not claim compilation is free. It removes the logging so what remains
can be measured, which is not possible while the instrument is this loud.
2026-08-20 17:03:56 -04:00
jpolo1224 a2f0059551 VK: run the conversion kernels 64-wide on Adreno
Adreno waves are 64 lanes, and a workgroup narrower than the wave does not pack
together with its neighbours -- it occupies a whole wave and masks the surplus
lanes off. At 32 that idled half of every wave on every dispatch, and these
kernels run on every texture upload of a kilobyte or more, plus every deswizzle
and detile.

Nothing argues the other way here. The kernels carry no shared memory and no
barriers, so group size is a scheduling hint with no LDS or synchronisation
cost to trade against.

Adreno and Turnip only. The comment this replaces claimed Mali was also 64-wide
and used that to justify holding everything at 32; that is wrong -- Valhall
warps are 16 lanes and Bifrost 4-8, so 32 already spans several of them and
there is no half-empty wave to reclaim. Xclipse is RDNA-derived and prefers
wave32 for compute. Both stay where they were.

Group size is baked into the generated GLSL, so this invalidates shader and
pipeline caches once on first launch after the update.
2026-08-20 16:22:21 -04:00
jpolo1224 cbee3cd44b VK: allow the compute work group size to be overridden for benchmarking
The mobile branch of the per-vendor group size table picks 32 by falling
through to the NVIDIA case. Adreno and Mali both run 64-wide waves, so 32
plausibly leaves half of each wave idle -- but that is reasoning, not a
measurement, and guessing wrong here costs performance silently.

Read ARMSX3_CS_GROUP_SIZE, which driver_env.txt already plumbs through
setenv(), so both candidates can be compared on one build without a settings
field or a second APK. Powers of two only, clamped to maxComputeWorkGroupSize
and maxComputeWorkGroupInvocations, because an over-large local_size_x fails
shader compilation rather than validation. The default is unchanged; this only
makes the question answerable.
2026-08-20 16:08:20 -04:00
jpolo1224 5d71742da9 VK: persist the driver pipeline cache across runs
Every vkCreate*Pipelines call passed VK_NULL_HANDLE for the pipeline cache, so
the driver re-did the whole of its own compilation work for every pipeline, in
every run. On mobile that work is a visible stall the first time each pipeline
is seen -- and it was being thrown away at every shutdown.

Give render_device a VkPipelineCache seeded from <cache>/vk_pipeline_cache.bin
and written back at teardown, and hand it to both pipeline creation calls. The
file is keyed on vendorID, deviceID and pipelineCacheUUID, so a driver update
or an adrenotools driver swap rejects the old blob and rebuilds rather than
feeding a driver a cache it cannot read. Oversized blobs are dropped instead of
being allowed to grow without bound -- the cache is shared by every title, so
one cold run is the cheaper failure.

This is orthogonal to the RSX shader cache: that one remembers WHICH pipelines
a title needs, this one makes each one cheap to create.

The shader interpreter was opening a private cache and destroying it on the way
out, which discarded exactly the expensive ubershader compiles. It now borrows
the device's. Teardown order already guarantees the pipe compiler threads are
joined before the device is destroyed, so the readback needs no extra locking.

vkGetPipelineCacheData was missing from the generated Android dispatch table;
regenerated with it, no other entry point changed.
2026-08-20 16:08:07 -04:00
jpolo1224 21a64b9eb7 Merge RPCS3 upstream: ROP output remap and an ISO magic-check fix
Seventeen commits. The substantial one is kd-11's ROP_OUTPUT_REMAP series
across rsx/fp, glsl and both backends, which ARMSX3 did not have at all.

Two conflicts.

nv4097.cpp: upstream added the ROP remap plumbing to the format-change checks,
we have profiler instrumentation and an ARM64 observe() on the two hot FIFO
reads. Different parts of the same file, so upstream's version is the base and
ours is re-applied on top. The g_xform_const_words increment is included
deliberately: the profiler reports average batch size as words/calls, so
dropping it would have printed 0 rather than nothing, which is worse than an
absent stat.

ISO.cpp: took upstream's magic-read check. It is a real fix --
`!file.read_at(...) == 5` parses as `(!x) == 5`, which is false for every x, so
the guard never fired and a short read left `magic` uninitialised. Our reverted
reader has no check there at all, and read_at returns a byte count in this
version too, so the corrected form applies cleanly.

This does NOT undo the ISO reader revert. The refactor that broke reading for
some users is still reverted; only the one-line magic check comes across.
2026-08-20 15:42:37 -04:00
jpolo1224 39571dc7c9 RPCN: stop sending requests with required fields empty
"Server error 1" is ErrorType::Malformed, and it was our fault rather than the
server's: two buttons posted queries with a required field blank, and the
server rejects the whole query rather than naming the field.

Reset password sends the account's email so the server can mail a token, but
the email box was only rendered while creating an account. Outside that mode it
sent an empty address every time. The box is always shown now.

Resend token sends the password, and Save deliberately clears that box, so
anyone who saved before pressing it sent an empty one. Having typed it a moment
ago is not the same as it being in the field.

Both are checked before sending now, along with account creation, and the
message names the field to fill in rather than failing at the server.

The error text is better too. Malformed, Invalid and the unknown case were
surfacing as a number with no way to act on it. Malformed now says outright
that it is a bug and asks which button was pressed, because if it appears again
the guards above have missed a path.

Not fixed here: sign-in reporting Invalid Password for credentials that work on
desktop. That is a distinct server code rather than a catch-all, and the cause
is not yet known -- desktop stores the password exactly as this does, so it is
not a hashing difference.
2026-08-20 14:06:40 -04:00
jpolo1224 bfeb232b28 Release: 0.9.3.1, and make upload signing opt-in
The ISO reader revert is confirmed working by the reporter, so this ships it.

Upload signing is now requested explicitly with -Parmsx3.uploadSigning rather
than used whenever keystore.properties happens to exist. Once that file was
created, every release build silently started signing with the upload key, and
an APK signed differently from the one already installed cannot be installed
over it -- so a sideload build becomes something testers cannot install, and
Android's error does not mention signatures.

It was being worked around by hiding keystore.properties by hand before each
build, which is the kind of step that gets forgotten exactly once and then
wastes a tester's evening. build-play-aab.sh passes the flag; nothing else
does, and asking for it without the keystore present is now an error rather
than a silent fallback.
2026-08-20 13:16:42 -04:00
jpolo1224 f707458b07 Revert the upstream ISO reader refactor
The upstream merge brought a six-commit ISO series that regressed reading on
some images. A tester's ISOs that loaded on 0.9.2 now fail at the very first
header read:

    ISO: init: Failed to read region information (region_count=0)
    ISO: iso_archive: Corrupt ISO file: Decryption failed

Both of his games fail identically, so it is not one bad dump, and other
people's ISOs still load, so it depends on the image format -- most likely the
3k3y path, which has its own watermark detection and key extraction at 0xF70
and 0xF80, separate from the plain one.

The reader is reverted to its 0.9.2 state. The change implicated is the region
count read moving from char_arr_BE_to_uint(sec0_sec1.data()) to
read_from_ptr<be_t<u32>>(sec0_sec1), alongside decrypt_data moving from raw
pointers to std::span, but this is not a targeted fix: it restores code that
demonstrably worked rather than guessing which line of the refactor is wrong.

is_valid() is kept, because System.cpp calls it and it is one line that has
nothing to do with the failure.

What this gives up is real: the series contained out-of-bounds write and
overflow hardening for ISO parsing. A reader that cannot open a user's games
is the worse of the two, and the hardening should come back with a version of
the refactor that works. The path validation from the same series that lives
outside these two files is untouched.

Unverified against the actual failure -- the ISOs here all load either way, so
this could not be reproduced locally. It is verified not to break what already
worked.
2026-08-20 12:48:38 -04:00
jpolo1224 eaba425972 Build: stamp the real commit into the version string
Builds were reporting whichever commit cmake last configured against, not the
one being built. rpcs3/git-version.h is generated at CONFIGURE time, and
build-variants.sh deliberately skips reconfiguring an already-correct build
dir because re-running cmake regenerates LLVM's headers and costs a full
rebuild. So the stamp froze, and every build after that lied about itself.

The gap was wide. HEAD is 20120-da26a455; the header on disk still said
19985-91952ae4, a commit from before 0.9.2.

This is not cosmetic. A tester running 0.9.3 reported that older commit in
their log, which sent an investigation hunting for a regression among upstream
ISO changes their build did not contain, and very nearly had a fix built and
sent for a version they were not running. A build that misreports itself makes
every report from it ambiguous.

stamp-git-version.sh writes the header from HEAD and is called by both build
entry points before anything compiles. It only writes when the contents differ,
so an unchanged HEAD does not force a rebuild, and ninja rebuilds just the
translation units that include it.
2026-08-20 12:43:45 -04:00
jpolo1224 da26a45548 Build: stage the legacy core in the Play script rather than trusting jniLibs
The script bundled whatever core happened to be sitting in jniLibs, and
build-variants.sh overwrites that path once per variant, so the file left there
is simply whichever ran last. Running the variants and then rebuilding the
bundle would have shipped an armv8.2 core inside a minSdk 30 bundle:
installable on devices that cannot execute it, failing at dlopen, with nothing
in the failure to point at the cause.

Play serves one bundle to every device, so the ISA floor has to be the lowest
ARMSX3 supports. The legacy core is now stripped into place by this script
every time, and it refuses to run if that core has not been built.

The bundle already shipped was correct -- the legacy core was staged by hand
before it was built -- but only by hand, which is the part worth removing.
2026-08-20 12:18:23 -04:00
jpolo1224 05e4547f67 Build: a grep -q behind pipefail inverts every positive check
The bundle verifier reported libarmsx3-core.so missing from a bundle that
plainly contained it, at base/lib/arm64-v8a/libarmsx3-core.so.

Under `set -o pipefail`, `unzip -l "$AAB" | grep -q x` fails whenever x IS
present: grep exits at the first match, closes the pipe, and unzip takes
SIGPIPE, so the pipeline reports failure. Every check for something that must
be there was inverted, and every check for something that must be absent passed
for the wrong reason -- grep found nothing, read to the end, and no signal was
raised.

Capturing the listing first and piping printf into grep instead only moved
which process took the signal. The listing is matched with `case` now, which
has no subprocess to kill.

Worth stating plainly: this was a verifier that would have reported a clean
bundle whatever went wrong, which is the failure mode the script exists to
prevent. It only surfaced because the one check that should have passed was the
one that failed.
2026-08-20 12:00:21 -04:00
jpolo1224 d02079f7c8 Build: reject a half-configured upload key, and find a JDK
Checking that keystore.properties exists was not enough. A template with the
placeholders still in it passed the check and went on to build, failing much
later inside signing with an error that says nothing about the cause. It now
rejects the placeholders too, so the message arrives before the fifteen minutes
rather than after them.

Also locate a JDK. The script assumed the calling shell had one on PATH, and
without it gradle fails with "Unable to locate a Java Runtime" several steps in,
which points at Java rather than at the environment. Android Studio's bundled
JDK is used when JAVA_HOME is unset, with /usr/libexec/java_home as a fallback
and a clear failure if neither exists.
2026-08-20 11:52:37 -04:00
jpolo1224 737a6927f1 Build: upload signing for Play, and minify off where it has to be
Two things stood between the flavor split and an uploadable bundle.

The release build type was debug-signed, with a comment saying to swap it
before any public build. It now uses an "upload" signing config when
keystore.properties exists and falls back to the debug key when it does not, so
GitHub alphas stay sideloadable without the key present while Play gets a
properly signed bundle. The keystore and the properties file are both already
gitignored, and nothing reads or echoes them outside the build.

build-play-aab.sh refuses to start without that file and prints the keytool
command to create one, rather than spending fifteen minutes producing a bundle
Play will reject.

Minify is off for the Play bundle and on everywhere else. This is not a
preference: AGP 9.2.1's R8 writes its mapping as mapping.prt, a compressed
per-class archive, while packageBundle still requires a plain mapping.txt, so
an AAB cannot be built with R8 enabled at all. ARMSX2 ships its Play build with
minify off entirely, so this matches existing practice rather than introducing
a compromise, and a 94 MB native core dominates a 76 MB APK -- shrinking the
Kotlin was never where the size is.

Driven by a gradle property, matching how armsx3.minSdk is already threaded
through by build-variants.sh, rather than by the variant API.

Verified: the github release APK still builds at 76.5 MB with R8 running.
2026-08-20 11:50:27 -04:00
jpolo1224 0b4d9599e8 Build: verify the Play bundle by extracting it, not by grepping it
An AAB is a ZIP and its entries are compressed, so grepping the archive finds
nothing and reports a clean bundle whatever is inside it. The first version of
this script did exactly that. It passed all five exclusion checks and then
failed to find the applicationId it was supposed to find, which is the only
reason the method got questioned at all -- every check that mattered was a
false pass.

It extracts the bundle now and reads base/manifest/AndroidManifest.xml for the
permissions, and the archive listing for the native libraries. Verified against
a real bundle: com.armsx3.play present, REQUEST_INSTALL_PACKAGES,
MANAGE_EXTERNAL_STORAGE, RECORD_AUDIO and the update provider all absent, and
libarmsx3_lsfg.so not among the shipped .so files.

The manifest is protobuf rather than text, so LC_ALL=C and grep -a stay: the
NUL bytes in it would otherwise make grep declare the file binary and print
nothing, which reads the same as a pass.
2026-08-20 11:46:58 -04:00
jpolo1224 769b64cb3a Build: split github and play flavors for a Play release
Play will not take the build ARMSX3 ships today, and the two runtime flags that
were already here could never have made it acceptable. The manifest said so:
it is the declared PERMISSION in the bundle that gets rejected, not the code
path behind a boolean. So the split is by source set, which is the only thing
that actually removes anything.

github keeps what a sideloaded build should have: the in-app updater, all-files
storage for an arbitrary data folder, and frame generation. play has none of
them, and its applicationId is com.armsx3.play so the two install side by side
instead of over each other.

Moved rather than flagged: com.armsx2.update and its FileProvider resource into
src/github, with no-op composables in src/play so that source set still
compiles. REQUEST_INSTALL_PACKAGES and MANAGE_EXTERNAL_STORAGE now live in the
github manifest, so the play bundle never declares them.

Frame generation is excluded by moving libarmsx3_lsfg.so into
src/github/jniLibs. A packaging block inside a productFlavor is NOT honoured --
it applied to both and dropped the library from the github build too, which the
build caught. Excluding the file is the whole exclusion: the shim is dlopen'd
by name and the core already reports the feature unavailable when it is absent,
which is the same path a device that cannot run it takes.

build-play-aab.sh builds the bundle and refuses to emit one that fails any of
five checks, because a flavor split is only worth as much as the thing that
notices when it stops working. It greps the bundle with LC_ALL=C and -a on
purpose: a NUL byte makes plain grep declare the file binary and say nothing,
which reads exactly like a pass.

build-variants.sh follows the rename to assembleGithubRelease; there is no
flavorless release variant any more.
2026-08-20 11:18:53 -04:00
jpolo1224 4b147a71af Save data: an unfinishable save fixup is not fatal
Both failures in the savedata fixup were logged as fatal while the code
carried straight on -- the loop continues, the emulator starts, and one save
is left as it was. On Android a fatal line goes to logcat at ANDROID_LOG_FATAL,
so it reads like a crash, and it was reported as one.

It is also permanent rather than transient when it happens. Android storage can
refuse a directory rename outright with EPERM, and nothing about launching
again changes that, so it fired on every single launch and looked like a fault
that was getting worse. A user hitting it has no way to tell that their games
are unaffected.

Both are errors now, and both say what the consequence is and what to delete if
it keeps happening, rather than repeating an alarm about something the emulator
has already decided to continue past.
2026-08-20 11:07:20 -04:00
jpolo1224 a7093fe962 Release: 0.9.3 (versionCode 18) 2026-08-20 08:35:23 -04:00
Megamouse bab81aa23e Fix rpcn type cast warnings 2026-08-20 11:03:16 +02:00
Megamouse 8a6c96745a Fix iso magic read check 2026-08-20 11:03:16 +02:00
Megamouse 358101c47b Fix unused variable warnings 2026-08-20 11:03:16 +02:00
yahfz c4eff69711 SPU LLVM: Document AVX-512 XFloat lowering 2026-08-20 09:36:19 +03:00
yahfz 5d2601599e [SPU LLVM] Optimize AVX-512 XFloat conversion 2026-08-20 09:36:19 +03:00
jpolo1224 07a24cf71d PPU: stop on a compile out-of-memory rather than limping on
Continuing with the modules that did compile is correct -- the dispatcher
entry for an uncompiled function interprets, nothing runs garbage -- but it is
per-instruction dispatch and it is slower than the interpreter outright. Saint
Seiya measured 6fps against 23 with most of its modules missing.

A game at that speed looks broken, and it gets reported as broken, when the
real answer is one restart away. An honest stop is better than a degraded run
that invites the wrong bug report.

So this ends the boot the way running out of memory always did. What is
different from before is the reason: the message names it and says what to do,
and it stays on screen because the overlay is drawn by the RSX thread rather
than the one this stops.

The fallback itself stays in place for the ordinary case of a single module
failing for some other reason, which is upstream's design and is worth keeping
-- one bad module costing its own functions is a fair trade. Running out of
memory is not that case: it takes most of the executable with it.
2026-08-20 00:33:33 -04:00
jpolo1224 187654eae6 Revert the frame-generation work entirely
Both changes that were brought back are out again. Neither recovered the frame
rate after switching frame generation off, and both broke rendering.

That is every attempt at this reverted. What remains is the code as it stood
before any of it: frame generation is slow, and switching it off does not
release what it allocated.

The GLES DSA shim is kept, because it belongs to the upstream merge and not to
this work -- it landed in the wrong commit and reverting that commit took it
with it, which broke the build for a reason unrelated to frame generation.

The findings from the three audits are still correct as descriptions of what
the code does. Acting on them, one at a time and with the reasoning written
down each time, still made the result worse on every attempt. So the fault is
not in the individual fixes but in something about this subsystem that reading
it has not revealed, and the next attempt should start from a measurement on
the device rather than from another reading of the source.
2026-08-20 00:16:33 -04:00
jpolo1224 276404e19d Framegen: restore the sync-fd handoff
This is the change that stopped turning frame generation off leaving the
frame rate tanked -- confirmed by which build that was reported on, and by the
SUBOPTIMAL acquire fix not reproducing it on its own.

It replaces the per-frame vkDeviceWaitIdle on framegen's device with a poll on
a sync fd exported from a fence framegen already creates. Reasons it is safe
to bring back while the other three stay reverted: it only runs when frame
generation is producing frames, every failure path falls back to the device
wait, and it changes no layout, no ownership and no barrier -- which is where
the rendering damage came from.

Still out, and staying out: the cross-device ownership barrier, the
generated-frame acquire semaphore with its teardown, and the deferred-present
guard in frame_context_cleanup.
2026-08-20 00:11:43 -04:00
jpolo1224 380f18484d VK: restore the SUBOPTIMAL acquire fix
Swept up in last night's blanket revert of the frame-generation work, and it
should not have been. It is the one change of the five that cannot affect
rendering: it corrects error handling and touches nothing about layouts,
ownership or synchronisation.

VK_SUBOPTIMAL_KHR is a success code and the image IS acquired.
present_generated_frame treated it as a failure and returned without
presenting, so the image was never handed back -- one swapchain image lost per
generated frame, permanently, on a driver that reports SUBOPTIMAL as a
standing condition. Once the pool empties the real frame's acquire blocks its
whole 100ms timeout every frame, which is ten frames a second, and only a
swapchain rebuild recovers it. That is why turning frame generation off never
gave the frame rate back.

The generated present's result is handled for the same reason: OUT_OF_DATE and
SURFACE_LOST also leave the image unpresented, and none of the recovery flags
were being raised because generated frames never pass through present().

The other four stay reverted. This one is restored on its own so that if
anything is still wrong, the cause is a single small change rather than five
entangled ones.
2026-08-20 00:07:39 -04:00
jpolo1224 2844667673 Merge RPCS3 upstream, and revert tonight's frame-generation work
Catches up 98 commits from RPCS3/rpcs3. Seven files conflicted:

PPUTranslator.cpp -- upstream fixed the ARM64 float-to-int saturation
inversion independently, and the two fixes are the same fix. Took upstream's
ordering so it stops re-conflicting, kept one line of the reasoning.

rpcn_types.h, rpcn_client.cpp -- our hand-rolled protocol 31 bump was a
stopgap to stop the server refusing us. Upstream's trophy sync (cb175278b) is
the real implementation, so it replaces ours outright.

nv0039.cpp -- upstream refactored the strided copy and extracted
validate_buffer_notify; ours was the older code plus a profiler include. Took
upstream's, re-added the include.

VKQueryPool.cpp -- both sides had real changes. Upstream added a lock around
the pool cache; ours has the bounded occlusion-query wait and the render-pass
fix for the Adreno device loss. Kept ours, re-applied their lock.

VKResourceManager.cpp -- upstream moved GC completion onto a
driver_manager_thread, which supersedes our flush parameter and offloader
dispatch entirely. Took theirs; no callers passed the second argument.

VKGSRender.cpp -- our flush-site counter and their driver-manager drain are
independent. Both kept.

Upstream also began attaching 3D and array levels through DSA, which
EXT_direct_state_access has no NamedFramebufferTextureLayer for, so the GLES
shim gains one that binds and uses the non-DSA entry point.

Reverted in the same commit, because they are what is on the tester's device
and it is broken: the sync-fd handoff, the SUBOPTIMAL acquire fix, the
cross-device ownership barrier, the generated-frame acquire semaphore, and the
deferred-present guard in frame_context_cleanup. Each was defensible on its
own reading of the code and the result was worse every time -- slower, judder
described as nauseating, and rendering faults that outlast switching frame
generation off. Five attempts is enough to stop treating the next theory as
better than the last.

What stays fixed is everything outside the present path. What goes back is the
state before tonight: frame generation is slow and does not release its memory
when switched off.
2026-08-20 00:01:42 -04:00
jpolo1224 da11248a31 VK: synchronise the generated-frame acquire, and free framegen with the renderer
Two things frame generation was getting away with rather than doing.

The acquire for a generated frame passed VK_NULL_HANDLE for both the semaphore
and the fence. The specification forbids that outright, and the practical
consequence is that nothing made the blit wait for the presentation engine to
finish with the image -- the UNDEFINED old layout on the barrier discards
contents, it does not order anything, so the blit could overwrite an image
still being scanned out. It acquires with a semaphore now and the submit waits
on it.

A ring of eight rather than a single semaphore, because a binary semaphore may
not be waited again before it has been signalled again and up to three
generated frames are acquired per flip. Eight is more than two flips of slack,
so a slot is never revisited before the submit that waits on it has retired.

The other is a crash rather than a hazard. Frame generation's images are file
-scope globals created on the renderer's device, and nothing released them, so
stopping a game and starting another at the same resolution skipped the
rebuild -- capture_presented_frame only rebuilds when the dimensions change --
and recorded images belonging to a destroyed device into a live command
buffer. They are released in ~VKGSRender now, after the vkDeviceWaitIdle it
already does and before the swapchain goes.

That location is the point. An earlier attempt at the same teardown ran from
inside the capture hook, which executes while the frame's primary command
buffer is still being built, and it destroyed rendering outright. A
device-idle point the renderer owns is where this always belonged.
2026-08-19 23:49:17 -04:00
jpolo1224 b3b8e707bc VK: acquire framegen's output before reading it
The blit that puts a generated frame on screen named
VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL for an image that was never in that
layout, and read it without ever taking ownership from the device that wrote
it. framegen releases its outputs with newLayout = VK_IMAGE_LAYOUT_GENERAL and
dstQueueFamilyIndex = VK_QUEUE_FAMILY_EXTERNAL, so this was a layout mismatch
and a missing queue-family acquire at the same time.

Undefined by the specification either way, and on a tiler the practical result
is reading whatever survived in cache instead of what framegen wrote -- which
is the corrupted rendering that appears whenever frame generation is switched
on.

The image is acquired from VK_QUEUE_FAMILY_EXTERNAL into the graphics family
and transitioned GENERAL -> TRANSFER_SRC_OPTIMAL before the blit, then
released back the same way afterwards, because framegen's own acquire barrier
on the next generation assumes it finds the image exactly as it left it.

This is about visibility and ownership, not timing: generate() already does
not return until framegen's submission has completed.
2026-08-19 23:46:19 -04:00
jpolo1224 32b3e17fd7 VK: stop generated frames leaking a swapchain image on every SUBOPTIMAL
present_generated_frame treated VK_SUBOPTIMAL_KHR as a failure. It is a
success code and the image IS acquired, so the early return left it held and
never presented -- one swapchain image gone per generated frame, permanently.
This driver reports SUBOPTIMAL as a standing condition rather than a one-off,
which present() already accounts for a few lines below, so the pool emptied
within a few frames of turning frame generation on.

Once it is empty the real frame's acquire in flip() blocks its full 100ms
timeout every frame. 100ms is ten frames a second, which is the hard lock that
was reported, and it explains the part that made no sense: turning frame
generation back off changed nothing, because the images are gone from the
swapchain and only a rebuild -- a resize or a restart -- brings them back.

The present result was discarded for the same frames. OUT_OF_DATE and
SURFACE_LOST also leave the image unpresented, and none of the recovery flags
were raised, because generated frames never pass through present() where that
handling lives. Both are now routed the same way.

Also submit with flush before presenting. The present runs on this thread
while multithreaded RSX would still have the submit queued on the offloader,
which presents a swapchain image before the blit that fills it.
2026-08-19 23:39:11 -04:00
jpolo1224 43dcf6d0ca Framegen: wait on a sync fd instead of idling framegen's whole device
Every generated frame ended with vkDeviceWaitIdle on framegen's device. It is
the hardest sync primitive Vulkan has and it ran once per frame, which is a
large part of why frame generation cost more than it returned.

It was there because the two devices share no semaphore. The upstream
semaphore path cannot supply one on Android: framegen's device deliberately
does not enable VK_KHR_external_semaphore_fd -- it shares through
AHardwareBuffer instead -- so vkImportSemaphoreFdKHR resolves to nullptr there
and every semaphore handed across is -1. That is not a flag that can be
flipped.

A fence can be exported where a semaphore cannot. framegen already creates one
per generation pass, so this adds VK_KHR_external_fence_fd, exports a sync fd
after the passes are submitted, and hands it back through a new
armsx3_lsfg_present_fenced. Our side polls that fd instead of idling a device.

Three things this deliberately does not do:

The existing completion fence is not the one exported. SYNC_FD export has copy
transference, which resets the source fence, so exporting it would leave the
slot-reuse wait at the top of present() blocking on a fence with no pending
signal -- a hang traded for a stall. A dedicated fence signalled by a
zero-batch submit is used instead, which signals once all previously submitted
queue work completes.

The extension is probed, not required. framegen's required-extension list
throws on a miss, so a driver without it would fail vkCreateDevice and lose
frame generation altogether -- a regression rather than a degradation.

The device wait stays as the fallback. A null entry point, a failed export, a
poll timeout or a poll error all fall back to it, and the warning for that is
emitted once per session rather than once per frame.

armsx3_lsfg_present keeps its signature and forwards to the new path with a
null fd, so the two bodies cannot drift. ABI goes to 3; the version check is
left exact rather than loosened.
2026-08-19 23:28:22 -04:00
jpolo1224 cd829558a8 Revert "VK: turn frame generation pipelining back on"
This reverts commit 35b374f068.
2026-08-19 23:20:52 -04:00
jpolo1224 35b374f068 VK: turn frame generation pipelining back on
The serialised path submits the frame, then blocks on that whole submission
before framegen may read the capture, then blocks again on framegen's device.
Two full stalls per frame, one of them a complete frame of GPU work on the
critical path. That is the reason frame generation costs more than it gives
back on this hardware.

Pipelining exists to remove the first of those: it runs a frame behind and
interpolates the pair ending at the PREVIOUS frame, which the game has had a
whole frame to finish, so the wait is normally already satisfied when it is
reached.

It was disabled because the held-back frame could be recycled underneath it.
That is fixed at the choke point in the commit before this one, so this is
the switch and nothing else.

Kept as its own commit deliberately: if the pipelined path misbehaves on
device, reverting this alone returns to the serialised path with the reclaim
fix still in place.
2026-08-19 23:16:26 -04:00
jpolo1224 3d257cfc0f VK: pay the deferred present from frame_context_cleanup, not one call site
Frame generation's pipelined path holds one frame back by a present, and the
guard that stopped that frame being recycled underneath it lived in
advance_queued_frames. There are two functions that walk m_queued_frames and
call frame_context_cleanup, and that was one of them.

check_present_status() is the other. It had no check at all, and
flush_command_queue calls it unconditionally on the way out -- so any of the
twenty or so flushes in a frame could retire the held-back frame, and
flush_command_queue(true) drains the queue outright, which made it certain
rather than likely. flip()'s own acquire-retry spin calls it too, exactly when
swapchain images are scarce, which is the condition pipelining creates by
design. That is the "already retired" that fired twice on device and kept
pipelining switched off.

The guard moves into frame_context_cleanup itself, which is the single point
every reclaim path goes through, so a seventh path added later cannot miss it.

Also stop a dropped present leaving a stale present_image behind. Leaving it
set is not harmless: the slot rotates back around and trips
ensure(present_image == umax) in flip(), and reinitialize_swapchain selects
contexts by that field and then calls frame_context_cleanup, whose first line
asserts a command buffer the context no longer has. Dropping a present should
cost a frame on screen, not a fatal two frames later.

No behaviour change on its own: nothing sets m_deferred_present_frame while
pipelining is disabled.
2026-08-19 23:16:26 -04:00
jpolo1224 4f310af3e2 Revert: do not tear framegen down from the capture hook
Releasing framegen's resources when the setting went to off broke rendering.
Arkham City lost its character models, then almost everything stopped drawing.

Both halves are reverted: the release_shared_images() call and the shutdown()
that followed it. Adding a vkDeviceWaitIdle on our device before the release
did not fix it, which rules out the in-flight capture blit being the whole
story -- the damage reaches past the shared images, and I do not yet know how
far. Guessing again on a renderer that draws nothing is not worth the trade.

What the revert restores is the known-good behaviour and the known bug with
it: switching frame generation off keeps every byte it allocated, so the frame
rate does not recover until the game is restarted. That is worse than it
should be and better than a black screen.

The teardown itself is still the right thing to do. It has to happen somewhere
the present path is not mid-flight -- a device-idle point owned by the
renderer -- rather than from inside the capture hook, which runs while the
frame's primary command buffer is still being built and submitted.
2026-08-19 23:05:10 -04:00
jpolo1224 97d9abd579 VK: keep shader compilation off the cores the frame depends on
Shader compilation "dips" are not the renderer waiting on a pipeline. Both
async shader modes are built so nothing ever stalls for one -- the interpreter
draws it or the draw is dropped. The dip is the compile work itself competing
for cores the emulator is already short of.

The pipeline compiler workers never set an affinity at all. PPU, SPU and RSX
all do, and the big.LITTLE policy deliberately fences the SPUs off the prime
core so RSX can have it -- and then a shader burst was free to land on exactly
that core anyway. They are pinned to thread_class::general now, which is the
existing policy for helper threads and already resolves to the little cluster
on big.LITTLE and to every core on a uniform machine, so desktop is unchanged.

The pool was also sized to the wrong thing. The auto heuristic counts host
threads, so an 8-thread phone asked for 2 workers -- a number chosen for cores
those workers are now not allowed on, while its 3 little cores sat idle
through every burst. It sizes to the cluster it is pinned to instead, which
raises compile throughput without taking anything back from emulation: the
cores it adds are the ones nothing else wanted.

Not touched: the driver's compiler itself, which is Qualcomm's and is the
actual cost. This only stops it fighting the emulator for the same cores.
2026-08-19 22:51:42 -04:00
jpolo1224 8c3a017b51 VK: shut framegen's device down too when it is switched off
Releasing the shared images and the context was not enough. Measured on
device: the release ran exactly once at the moment frame generation was turned
off, and the frame rate still did not come back.

What was left is framegen's own VkDevice. It is created lazily on first use
and nothing ever tore it down -- shutdown() existed with no callers at all --
so a second logical device stayed alive on the same GPU for the rest of the
process, holding queues, allocators and driver-side state. On a tiler that is
not free, and it is the part that survived the previous fix.

Safe to do from here because initialize() is lazy and guarded by its own
initialized() check inside generate(), so switching frame generation back on
rebuilds the device rather than finding it missing.
2026-08-19 22:48:40 -04:00
jpolo1224 7c03c75903 VK: give the memory back when frame generation is switched off
Turning frame generation on cost performance, as it should. Turning it off did
not give any of it back, and only restarting the game did.

Everything frame generation needs is allocated on the present path and nowhere
else: two shared input images, up to three generated outputs, and a context on
framegen's own Vulkan device holding imported AHardwareBuffers for all of
them. The "off" branch of that path was a bare early return, so none of it was
ever released -- the feature stopped doing work while keeping every byte it
had taken. On a tiler that is the expensive half.

The teardown already existed and was reachable from exactly one place, the
resize path, which is why this survived: it needs frame generation to have run
and then be turned off in the same session to show at all.

Only the mode going to off frees anything. The same branch also caught a frame
with no source image, which is a transient state on the present path rather
than the user switching the feature off -- tearing down there would destroy
and rebuild the context repeatedly. The two conditions are separate now.
2026-08-19 22:41:39 -04:00
jpolo1224 ac897144b3 PPU: survive running out of memory while compiling, and say so
Arkham City never finished compiling, and neither did LEGO Batman 2. The log
said "LLVM crash recovery invoked" 240 times and then killed main_thread,
which looks like a codegen bug and is not one.

What actually happened: utils::memory_commit failed with ENOMEM inside the
disposable LLVM worker. That thread dying is how run_recoverable_llvm reports
any failure, so an out-of-memory device was indistinguishable from bad
codegen. It cost a long detour through max_map_count, disk space and
overcommit before the errno in the fatal gave it away, so the JIT's allocator
now uses a checked commit and throws a plain "Out of memory" instead.

The fatal part was the symbol resolvers. ppu_initialize ensure()d that every
group's __resolve_symbols was present, but that function lives in the compiled
output: when every module in a group fails, it is simply absent. The ensure
turned a partial compile into a dead main_thread, which discarded the 170
modules that HAD compiled and surfaced as a boot that never ends.

That contradicts the design either side of it -- a module that fails to load
is deliberately not fatal, because a guest function with no compiled code
keeps its dispatcher entry and is interpreted. A missing resolver is now the
same: report it, skip it, let that group interpret. Losing one group's speed
beats losing the boot.

Also tell the user. Out of memory is the only compile failure they can act on,
and the useful action is not obvious: compiled modules are already in the
cache, so starting the game again resumes rather than restarting the work. One
message after the workers join, not one per module -- once memory is short
every remaining module fails identically, and two hundred popups would be
worse than none.

Lowering Max LLVM Compile Threads also avoids it, and is deliberately not
suggested in the message: compile time is already the common complaint, and
halving the workers to dodge a case that is now survivable is a bad trade.
2026-08-19 22:21:58 -04:00
jpolo1224 d1e1d9975b Input: connect vibration, which was three unconnected halves
Rumble did nothing in any game. Everything needed for it existed and none of
it was wired to anything else.

The core side was fine throughout: the virtual pad is created with
CELL_PAD_CAPABILITY_ACTUATOR, its two VibrateMotors are initialised, and
_rpcsx_getPadRumble reads them, so cellPadSetActDirect had somewhere to land.

Above that, three dead links in a row.

The pump that polls getPadRumble and drives the phone's vibrator was written
and never started -- startRumblePump had no callers at all. The core cannot
notify the JNI layer when the guest writes the motors, so with nothing
polling, no guest rumble could ever reach the device. It now runs for the VM's
lifetime, started once the emulator is past boot and stopped in a finally, so
the abnormal-teardown path that exits via stopRequested cannot leave the motor
buzzing on whatever value a dead guest last wrote.

The enable flag was two flags. NativeApp.sRumbleEnabled had three writers --
the settings toggle, the in-game menu and app start -- and no readers. The
pump consulted a private copy in Rpcs3Bridge that only setPadVibration wrote,
and setPadVibration had no callers either. So the toggle wrote one store and
the pump read another. There is one flag now; the private copy is a read-only
accessor onto it.

Rumble is polled on port 0 only. The device has one vibrator, so there is
nothing to spend a second port on.
2026-08-19 21:25:47 -04:00
jpolo1224 007c4a56a1 RPCN: say on entry that the account is saved
The account screen reported nothing until a button was pressed, so after a
restart a saved account looked like no account: the username was filled in and
the password box said one was stored, but nothing said the thing the user
wanted to know.

It now reads the state from the core on entry and says so.

The wording matters here, because "logged in" is not a state that exists.
RPCN keeps no persistent session -- every connection re-authenticates from the
saved credentials, and the client is destroyed as soon as the last shared_ptr
to it goes, which happens the moment a sign-in test returns. So a restart
cannot preserve a login, and claiming one would be a lie that breaks the first
time someone checks. What survives is the ACCOUNT, and that is what the line
reports; "Signed in as" is reserved for a live authenticated client, which
means a game is actually online.

peek_instance is added for that: reporting state must not be the thing that
creates a client, or opening the settings screen would spawn the three RPCN
threads and immediately tear them down again.
2026-08-19 20:09:52 -04:00
jpolo1224 b27b61f86e Network: expose the rest of the core's Net settings, and saved RPCN servers
The Network tab offered three of the ten settings the core's Net node has.
The seven it did not were reachable only as raw core overrides, and one of
them is the setting that answers the question the tab exists to answer.

RPCN replaces Sony's PSN. A publisher's own backend never was PSN, so a game
that talked to one is not reachable through RPCN at all -- it is reachable by
resolving its hostnames somewhere else, which is DNS address and IP swap
list. Those had no writer anywhere in the app, so "use a custom server" had
no answer short of hand-editing config.yml. They are first in the tab now,
and their descriptions say which of the two layers they belong to, because
that distinction is the whole confusion.

Added with them: IP address, Bind address, PSN Country, Derive MAC from PSID
and Clans Enabled -- all six Settings.kt sites each, plus the bridge
dispatch, the setters, the search index and the tab's reset list. A key
missing from the dispatch is dropped in silence with no build error, so the
emitted keys and the handled keys were diffed rather than eyeballed.

EditableTextRow was dead ARMSX2 DEV9-era code with no callers, a hardcoded
"0.0.0.0" and no controllerFocusable, which would have made every one of
these rows unreachable on a pad. It takes a placeholder and a description now
and registers with the pad-nav registry.

Saved RPCN servers are a view onto cfg_rpcn's own "Hosts" list rather than a
second store, so add, remove, reset and anything the core does to it agree by
construction. Reset restores the shipped list and selects np.rpcs3.net, which
is the way back after typing a custom address over the top of it; removal of
the official entry is refused, matching upstream's own guard, and reported
instead of silently doing nothing. Host descriptions are user text being
pasted into a JSON field, so they are escaped on the way out.

Also exposes cfg_rpcn's experimental IPv6 support, which had no UI either,
and fixes the PSN row's label -- it still read "PSN (Simulated)" from when it
was a two-state toggle that could not select RPCN.
2026-08-19 19:50:51 -04:00
jpolo1224 b13bdd341b RPCN: sync the protocol to 31 and make the sign-in test work
Three things stood between the new RPCN account screen and the live server.

The client announced protocol 30, so np.rpcs3.net rejected every connection
with "Protocol Version Error (outdated RPCS3?)" before any credential was
looked at. Raising RPCN_PROTOCOL_VERSION alone is not enough -- the version
is a contract over the command enum, so the three commands added upstream
alongside it (GetRoomMemberDataExternalList, UnlockTrophy, SyncTrophies) have
to exist too, or every opcode after the insertion point shifts and the
mismatch shows up later as garbled replies instead of a clean refusal.

The other two were in the sign-in test, which was the one RPCN entry point
written standalone instead of through rpcn_with_connection.

It asked for the client with get_instance(0, true), and that flag does not
return an error: it calls fmt::throw_exception, which off a guest thread is a
fatal abort. Tapping "Test sign-in" before PSN status had reached the core
therefore killed the process. It reads like a validity check and behaves like
an assert, which is why desktop's get_rpcn_connection passes the default.

That state is easy to reach by accident, and not through user error:
Settings.applyTo() only runs at game boot or while a game is live, so
choosing RPCN from the library updates the UI and the store but leaves
config.yml on Disconnected until something boots. Testing an account does not
depend on that setting in the first place -- it needs credentials and a
reachable server -- so the check is dropped rather than deferred.

With the abort gone it hung instead, silently, with nothing in the log after
"Loading RPCN config". rpcn_thread's state machine only acts on want_conn
while disconnected, and wait_for_authentified sets want_auth alone: on a
fresh client the thread woke, found no connection request, broke back to its
semaphore and never released sem_authentified. Connecting first is what
np_handler does, and the four account operations already did it through the
shared helper. Sign-in now reports a real result either way.

Also correct a comment claiming cfg_rpcn stores a password hash. It does not;
set_password writes the string straight into rpcn.yml as plaintext.
2026-08-19 19:36:35 -04:00
digant73 e5e280cd3f Fix duplicate path addition 2026-08-20 00:27:30 +02:00
jpolo1224 7c6c26c210 Input: pace edges only, and never drop a release
The pacing added in 0.9 holds a button transition open long enough for the guest
to sample it. It ran on every write, and it could not tell a repeat from an edge.

Analog triggers write through it on every motion event -- dozens a second while
held, every one of them "pressed". Those repeats consumed the queue, so the
release that followed was the entry that reached TRANSITION_MAX_PENDING and got
silently dropped. Three symptoms, one cause: the queue replaying stale states 40ms
apart is the delay and the apparent double-press, and the dropped release is the
button that "presses itself and stays down until you press it again". Only
triggers showed it because only triggers stream same-state writes.

A repeat now returns immediately without touching the pacing budget, so a
trigger's pressure stays current and cannot starve its own release. And the
overflow branch no longer drops a release: losing a press costs one input, losing
a release leaves the pad holding a button the user let go of with nothing to clear
it. A late release beats a stuck one.

Reported against 0.9.2 in Ratchet & Clank (long jump is R2 held plus X), with 0.8
working -- 0.8 predates the pacing. The earlier guess at this, that a Retroid
trigger in "both" mode had two writers, was wrong; that guard is still correct on
its own terms but it was not what broke this.
2026-08-19 18:10:25 -04:00
jpolo1224 6b0d57b32e RPCN: make online reachable
The RPCN client has been compiled into this core the whole time -- rpcn_client,
rpcn_config, the localized login and account-creation error strings, 302 symbols
in the shipped library. None of it could be reached.

"PSN status" is a three-valued core setting (Disconnected, Simulated, RPCN) and
the port surfaced it as a BOOLEAN:

    setEnum("Net@@PSN status", if (enabled) "Simulated" else "Disconnected")

so np_psn_status::psn_rpcn had no writer anywhere in the app. And even had it
been selectable, an RPCN account needs an NPID, a password and a server, and
there was no screen to enter any of them -- grepping the whole UI for "npid"
returned nothing but two error-message strings. Online was not broken here, it
was unreachable, and anyone reporting "online doesn't work" was right in a way
nobody could act on.

Seven exports carry the account operations the core already implements: read and
write the config, create an account, resend the activation token, send a reset
token, reset the password, and test a sign-in. Each returns a finished sentence
on failure and an empty string on success, rather than an ErrorType or an
rpcn_state -- otherwise both enums would need a second copy on the Kotlin side,
kept in step by hand across a dlopen boundary that is explicitly allowed to
version-skew. They are resolved without ensure() like the frame-gen group, so a
core predating them degrades to "unavailable" instead of refusing to load.

The setting becomes a three-way picker, and psnStatus becomes an Int. Its readers
accept a stored Boolean so installs written before this read back as Simulated,
which is what true meant.

The account section appears only when RPCN is selected -- offering it otherwise
invites setting up an account the emulator will not use. It seeds from the core's
saved config, and the password field stays blank with its label saying one is
stored, because cfg_rpcn keeps a hash and there is no plaintext to show.

Every one of these blocks on the network and runs on Dispatchers.IO. Untested
against a live server: the flow matches what the desktop dialog does, but no
account has been created from a device yet.
2026-08-19 18:06:33 -04:00
jpolo1224 d0f9356199 PKG install: notice when it fails, and say why
Three faults on the same path, all of which turned a failed install into a
successful-looking one.

The extraction loop discarded what write() returned, and extract_success was
declared true and never assigned again -- the two occurrences in the file are its
declaration and the branch that reads it. So the failure branch was unreachable,
every file logged "Created file" whatever happened, and m_written_bytes counted
bytes INTENDED rather than written, which is why progress reaches 100% on an
install that did not complete. A short write now stops the file, logs what it got
against what it wanted, and marks the entry failed.

Nothing checked free space either. A full device gave one of two outcomes and
neither said "disk full": a hard abort out of ensure(r > 0) in fs::file::write,
or -- if the backend returned a short write instead of failing -- a truncated
file recorded as installed, which surfaces much later as a corrupt game nobody
can account for. The PKG header carries data_size, its own total for its
contents, so this preflight is exact rather than a floor; the 64MiB margin covers
directory entries and filesystem overhead that figure excludes.

Third, every error reached the UI as "Installation failed". app_version is not a
crash and not a bad file: it is the installer correctly refusing a game update
because the base game is not installed, or because the update does not match the
version that is. Desktop RPCS3 explains that in a dialog. Here it was
indistinguishable from a broken package, which is how a Tekken Tag 2 update came
in as an emulator bug report.
2026-08-19 17:42:42 -04:00
Megamouse c122edd638 unpkg: Fix buffer size checks 2026-08-19 23:30:34 +02:00
Megamouse d12d8782af unpkg: Mark pkg installation as failed if any thread throws an exception 2026-08-19 23:30:34 +02:00
jpolo1224 e73a40d9ce Input: one writer per trigger when a pad reports both ways
Retroid pads have an L2/R2 mode called "both": the trigger sends
KEYCODE_BUTTON_L2/R2 AND an analog axis. sendTrigger writes the pad button from
the axis, and the key path wrote it again -- one physical squeeze, two independent
writers on the same button, which arrives as a delayed or doubled press. Long
jumps in the Ratchet games hold R2 and were unreliable because of it; a reporter
had it in 0.9.2 and says 0.8 was fine.

sendTrigger already carries the opposite guard: a pad with no trigger axis at all
leaves "the key path in sole charge", added when Switch Pro controllers had their
held trigger cancelled by every stick movement. This is that guard's mirror, and
the two together mean exactly one writer owns a trigger on every pad -- the axis
where there is an axis, the key where there is not.

Keyed on the physical keycode before remapping, because what decides ownership is
how the hardware reports the trigger, not what the user bound it to.

Pads that report triggers ONLY as keys are unaffected: they have none of the three
axes, so the guard does not fire and the key path still owns them.
2026-08-19 17:27:42 -04:00
jpolo1224 5a34aeb06f Yakuza: also fix the FIFO desync, and get a host backtrace on Android
Past the loading screen the game hits a second, separate failure: the RSX FIFO
desyncs and reads a RET with an empty call stack -- 19 of them in one session,
last cmd 0x20000 every time. recover_fifo() resets it each time and eventually
gives up and kills the RSX thread ("Dead FIFO commands queue state"). The game
then sits at 0 fps with audio playing perfectly, because everything except the
renderer is still alive, which reads as a hang rather than a dead thread. The
semaphore acquires that time out alongside it are downstream: a desynced FIFO
never runs the release that would satisfy them.

Ordered & Atomic plus a 20us wake-up delay clears it. That is what the fatal
message itself recommends, and this is the first evidence here that the advice
is worth anything -- the same suggestion sits unanswered on two other reports.
Which of the two does the work is not established; both were changed at once and
it has not been A/B'd. Both cost performance, hence per-title rather than global.

Also: get_backtrace and get_backtrace_symbols were #ifndef ANDROID, so they
compiled to nothing on the only platform this port runs on. Every native fault so
far has had to be read out of a tombstone or symbolized by hand, and an access
violation gets neither -- that path freezes the emulator instead of aborting, so
the process survives and Android never writes one. Implemented with
_Unwind_Backtrace, which bionic always has, and dladdr for names; frames print
library-relative because the shipped .so is stripped and loaded at a random base,
and that offset is what llvm-symbolizer takes against the unstripped build.

The access violation handler now prints it. Yakuza reached that path once, reading
location 0xc on the RSX thread with the FIFO empty and parked at a self-jump, and
guest state alone could not say which of our functions dereferenced null.
2026-08-19 17:16:00 -04:00
jpolo1224 99a0fa5dd9 cellGame: refuse a game data install onto a full device
Nothing downstream checks free space. The game creates its directory, starts
copying, and the writes fail one at a time with nobody reading the return value --
so the install bar stops partway and sits there. That is indistinguishable from
the emulator hanging, which is exactly how it turned up: Yakuza Dead Souls stalled
at 78% on a device with 809MB free and produced not one line of log about it.

CELL_GAME_ERROR_NOSPACE is what the real system returns here and games already
handle it -- they put up their own "not enough space" dialog -- so this turns a
silent stall into the message the title was written to show.

The floor is 256MB and deliberately small. How much a game will write is not known
at this point (the size a title declares is advisory and many pass
CELL_GAME_SIZEKB_NOTCALC), so this cannot predict a failure; it only catches the
case where there was never a chance. An install that would have fit is unaffected.

Free space is logged either way, so a stall that is NOT this now says so.
2026-08-19 16:47:31 -04:00
jpolo1224 65454fef8e Yakuza Dead Souls: disable FIFO reordering
The game runs at 1fps with the flattener on, and not by being slow: the RSX blocks
on nv406e::semaphore_acquire until the wait times out, draws one frame, and does
it again. 145 timeouts in a single session, all on semaphore 0x50300FE0, while the
GPU itself was doing 3.06 ms of work per frame -- so roughly 997 ms of every frame
was the timeout. The acquire outruns the release that should satisfy it from the
very first frame: awaited 0x1 against an observed 0x0, and still 8 behind at 0x68.

Disabling reordering clears it completely and the game boots and plays.

The cause is NOT established, and the obvious candidate does not hold:
flattening_helper only drops registers carrying always_ignore, and that set is four
INVALIDATE methods with no semaphore in it -- a semaphore release takes the default
branch and flushes the batch, which is the safe path. So this is an empirical
per-title workaround and the mechanism is still open.

Both serials: BLUS30826 is the US disc, NPUB31509 the PSN release the original
report came from.

The STOCK entry is not optional. This port keeps one global config.yml, so a value
written for one game persists into the next; without the stock default, booting
Yakuza would leave FIFO reordering disabled for everything launched afterwards.
Same trap the Uncharted 3 entry documents.
2026-08-19 16:46:21 -04:00
kd-11 64da425e81 gl: Fix copy_image_static behavior when formats are mismatched 2026-08-19 20:43:05 +02:00
kd-11 b78bae0b9f rsx: Integrate ROP remapping to the interpreter system
- Base pipelines have the remapping active, optimized variants can toggle it away.
2026-08-19 14:08:55 +03:00
kd-11 ca25fbaa5d vk/gl: Support ROP output remap in the interpreter 2026-08-19 14:08:55 +03:00
kd-11 323e2d35a2 rsx/fp: Implement support for ROP_OUTPUT_REMAP in the backends 2026-08-19 14:08:55 +03:00
kd-11 57ecb42433 rsx/fp: Plumb through support for channel remapping during ROP 2026-08-19 14:08:55 +03:00
kd-11 84ceef9717 rsx/glsl: Shrink command space in ROP_CONTROL structure to make room 2026-08-19 14:08:55 +03:00
kd-11 0dd3d6528c rsx/prog: Move in-shader color remap to FP prolog
- We need it for some other stuff
2026-08-19 14:08:55 +03:00
Antonino Di Guardo ddd82ecada Make optional VSH on File âž” All Titles âž” Create LLVM Caches dialog (#19270)
Make optional VSH CPU compilation on `File âž” All Titles âž” Create LLVM
Caches` dialog. By default it is now excluded due to VSH caches are
fully covered by the dedicated submenu `File âž” Firmware`.
2026-08-19 08:15:27 +02:00
Ani 7973b8ac6d windows: Fix clang x64/arm64 builds 2026-08-18 21:54:09 +02:00
FlexBy420 3c15df4e4d Update sceNpTrophy.cpp 2026-08-18 14:19:42 +02:00
kd-11 719cf8a54a gl: Fix build warning 2026-08-18 13:47:28 +03:00
kd-11 1b879360b8 rsx: Fix OOB section writes generated due to mipmap dimension clamping 2026-08-18 13:47:28 +03:00
kd-11 ad059d03af vk: Avoid redundant copy when writing to mip level or Z layer 2026-08-18 13:47:28 +03:00
kd-11 78ba581137 vk: Extend copy image API to support 3D offsets and extents 2026-08-18 13:47:28 +03:00
kd-11 cd044148be gl: Avoid redundant copies when copying to mipmaps or 3D slices 2026-08-18 13:47:28 +03:00
kd-11 91cd82a0c2 gl: Extend copy image API to allow explicit 3D offsets 2026-08-18 13:47:28 +03:00
kd-11 e7c3d6ab26 gl: Implement support for explicit multi-layer image copy operations 2026-08-18 13:47:28 +03:00
kd-11 a88331bb22 rsx/vk: Implement support for multi-layer, multi-level and explicit mip/layer image transfers 2026-08-18 13:47:28 +03:00
kd-11 6892ee4c2e rsx: Fix mipmap gather source offsets 2026-08-18 13:47:28 +03:00
Megamouse 0059e4e92e unpkg: fix OOB read at end of file
Use sizeof(u128) instead of 16.
Clear padding after archive_read_block.
Use aligned_div instead of manually aligning blocks.
Fix local_buf size when using raw ptr of the original buffer.
2026-08-18 10:20:30 +02:00
Megamouse 46b7428fad unpkg: also check potential overflow in pkg data size check 2026-08-18 10:20:30 +02:00
Megamouse 582b5ba29e unpkg: fix OOB memset, use safe versions of write_to_ptr and read_from_ptr 2026-08-18 10:20:30 +02:00
FlexBy420 cb175278b6 RPCN: Sync trophies (#18760)
Add synching local trophies with RPCN server trophies, allows users to
essentially cloud save their trophies when they are connected to RPCN.

This PR also aims to add support for global earned % trophies simillar
to steam for RPCN part of website.

No local trophies and not connected to RPCN
<img width="1183" height="717" alt="obraz"
src="https://github.com/user-attachments/assets/f0b3add1-506d-43e5-8dae-cd34e041e2bd"
/>
After booting the game with RPCN enabled
<img width="1184" height="713" alt="obraz"
src="https://github.com/user-attachments/assets/d5992ddc-7fad-4b38-b4f9-006a832ffed5"
/>

RPCN Side PR
https://github.com/RipleyTom/rpcn/pull/140
2026-08-18 06:54:51 +02:00
yahfz 82164a54c1 [SPU LLVM] Avoid redundant XFloat normalization in SELB 2026-08-18 03:48:46 +02:00
Malcolmandjpolo1224 6161ecd7aa PPU: Stop inverting float-to-int saturation on ARM64
- This was breaking armored core 4/4a on ARM
- Original fix credit to jpolo1224 of armsx3 https://github.com/ARMSX2/ARMSX3/commit/87ccdb85152a707f5d0c8122ed39344b4648501e

Co-authored-by: jpolo1224 <jpolo1224@gmail.com>
2026-08-18 03:12:13 +02:00
Megamouse de33fda28c rsx_debugger: fix g8b8 conversion 2026-08-17 22:42:05 +02:00
Neil Monday f9f88aa9e5 Use max() to bring negative floats up to 0.0 before uint conversion. 2026-08-17 15:17:17 +02:00
Ani 3be5aa99cc gui: Correctly disable the View Folder button 2026-08-17 02:22:11 +02:00
Zion Nimchuk 3e68a7f385 Add 60 second retry to translation downloads in CI to avoid rate limits 2026-08-17 01:20:35 +02:00
kd-11 9a4b849260 rsx: Fix fbo offset scaling when src and dst bpp is mismatched 2026-08-17 00:15:54 +03:00
kd-11 9a24c8d11f gl/vk: Fix flattened interpreter input subresource range computation 2026-08-17 00:15:54 +03:00
kd-11 0617eff348 rsx: Ensure ref_address is properly set for all sampled images 2026-08-17 00:15:54 +03:00
kd-11 003b368980 rsx: Drill down the copy specification from descriptors when handling dynamic copies 2026-08-17 00:15:54 +03:00
kd-11 6f5f198acd rsx: Fix check for cyclic ref in fast_fbo_check 2026-08-17 00:15:54 +03:00
kd-11 107b751a43 rsx: Enable fast path when scanning for 3D mipmaps 2026-08-17 00:15:54 +03:00
kd-11 4475671bbf RSX: Allow process_framebuffer_resource_fast to take in descriptors with an offset
- Allows to skip going through the merge route when we already have a good match
2026-08-17 00:15:54 +03:00
kd-11 7e35f59997 RSX: Implement host-side mipmap scanning for 3D textures 2026-08-17 00:15:54 +03:00
kd-11 970d745818 rsx: Respect mip levels actually used during image reconstruction 2026-08-17 00:15:54 +03:00
kd-11 adec3ae7f9 rsx: Implement per-mip-level size calculation logic and use it to properly compute 3D texture slice height 2026-08-17 00:15:54 +03:00
kd-11 5e2d0eb762 rsx: Fix incorrect calculation of texture size when border texels are present
- The computation did not match get_subresources_layout behavior.
2026-08-17 00:15:54 +03:00
kd-11 26782525f4 rsx: Fix get_texture_size for 3D textures with mipmaps
- Depth also shrinks for every mip level
2026-08-17 00:15:54 +03:00
kd-11 d0e6d4eefc rsx: Minor improvements to texture cache
- Adds depth to temp subresource key to avoid 3D mismatch (resample)
- Fix narrowing warning for block_h calculations
2026-08-17 00:15:54 +03:00
kd-11 f19d398bec rsx: Check for completeness in X when gathering slices
- This was intentionally ommitted as a speedhack before, but makes sense to check just in case.
2026-08-17 00:15:54 +03:00
kd-11 6b80ac4805 rsx: Simplify merged source sorting when selecting slices
- Sort ranges is a relic and the information is duplicated in the sort_list object
2026-08-17 00:15:54 +03:00
kd-11 13ceef9f46 rsx: Fix slice gather from local resource (e.g blit engine output) 2026-08-17 00:15:54 +03:00
Walter ffc50905a6 [SPU LLVM] Avoid GFNI combine bug in SHUFB
Due to a bug where `SHUFB`'s GFNI constant generation path expects to be combine using a select instead of a OR, it was causing issues with on non-AVX512 CPUs so support was reverted (see #19217). That can still happen on AVX512 CPUs when the shuffle is single source. This patch fixes it and re-lower the target requirements back to just GFNI by avoiding the OR well on the GFNI path. I also renamed a variable and added a comment to better clarify its behavior.
2026-08-16 19:35:42 +03:00
kd-11 cbc7b60ba5 rsx: Cleanup 2026-08-16 13:50:03 +03:00
kd-11 47efd770a8 rsx: Clean up get_merged_texture_memory_region
- Cleaner generation of src_area and dst_area outputs.
- Normalized comparisons in 1bpp space then convert to target space after.
2026-08-16 13:50:03 +03:00
kd-11 f53547b173 rsx: Refactor deferred_subresource constructor into discrete wrappers for each output intent
- Instead of filling over 10 arguments and having the ctor silently drop half of them, we create proper wrappers to construct objects for a singular purpose.
2026-08-16 13:50:03 +03:00
kd-11 cb5b866c61 rsx: Refactor deferred_subresource to be more explicit
- Use defined src and dst rects as well as the transformation if any to be applied.
2026-08-16 13:50:03 +03:00
Zion Nimchuk 2f3c0f04d2 Update docker with updated SDL3 2026-08-16 09:57:33 +02:00
schm1dtmac 3f493fb209 [Qt] Hide titlebars by default 2026-08-16 02:07:48 +02:00
Antonino Di Guardo f7eb0d8d76 Enrich game list title (#19229)
Add on Game List title a brief recap of total number of entries in the
list and total number of Disc, HDD and all the other remaining types of
content.
2026-08-15 23:19:01 +00:00
digant73 fc93d932c8 Swap PR number with PR text in update manager 2026-08-15 13:28:58 +02:00
digant73 3cbf9b8b6c fix crash with vfs exception 2026-08-15 04:39:42 +03:00
kd-11 12b1efc266 rsx/fp: Fix decoding of LOOP and REP instructions
- Verified with hardware tests. RSX does not support proper loops.
- The LOOP/REP instruction simply codes a "REPEAT n" instruction for a block of code.
- There is no accumulator register. The compiler emits a preamble inside the loop block to simulate the running counter.
- Oddly enough, the original start and step values are stored in the instruction but are unused. Maybe useful for debugging real hardware?
2026-08-14 11:15:20 +03:00
Megamouse 4c63acfb40 Qt: Add unofficial build warning 2026-08-14 02:07:18 +02:00
Megamouse 3f4364fe74 Qt: Decrease layout margin in settings_dialog 2026-08-14 01:02:56 +02:00
Ani ee43ab7362 Revert "[SPU LLVM] Decrease SHUFB's constant generation target requirements"
This reverts commit 26e37d8c8c.
2026-08-14 00:19:17 +02:00
Megamouse 2dc6cf014c Qt: add Open Custom Gamepad Config Folder action to game list context menu 2026-08-13 21:36:51 +02:00
Megamouse c285c2fb41 Qt: fix settings_dialog tab index 2026-08-13 19:14:26 +02:00
Megamouse c41595e79f Qt: implement auto_scroll_label and use it for the settings descriptions 2026-08-13 14:42:31 +02:00
Lalit Shankar Chowdhury bf541b5828 qt: make settings description static 2026-08-13 14:42:31 +02:00
Megamouse 41e2d101e7 Update discord-rpc 2026-08-13 11:55:39 +02:00
kd-11 c27b38f300 vk: Run GC on the driver manager thread 2026-08-13 11:39:34 +03:00
kd-11 5bd7fd7817 vk: Implement an asynchronous driver manager thread 2026-08-13 11:39:34 +03:00
kd-11 7f9b8d23cd vk: Enhanced thread safety when handling the query subpool allocation cache 2026-08-13 11:39:34 +03:00
kd-11 01e3fed466 vk: Enhanced thread safety when handling descriptor subpools 2026-08-13 11:39:34 +03:00
kd-11 ea0e10e704 vk: Ensure all drawable surfaces invalidate fbo cache on deletion 2026-08-13 11:39:34 +03:00
kd-11 c2eb11eae6 vk: Seal some data leaks with the framebuffer cache
- Maybe fixes some device lost crashes when running in VRAM-constrained situations
2026-08-13 11:39:34 +03:00
Walter 26e37d8c8c [SPU LLVM] Decrease SHUFB's constant generation target requirements
The constant generation AVX512-ICL path only requires the feature GFNI, which exists on non-AVX512 CPUs. This was a hold-over from when the shuffle step was merged together. (The proceeding unsigned minimum is from SSE2)
2026-08-12 15:38:43 +03:00
Lalit Shankar Chowdhury 9b1eb45a47 PPU: implement AVX2 path for gv_rol32 2026-08-12 14:01:33 +03:00
kd-11 92870a3d4e rsx: nv0039 cleanup
- Enforce some behavior observed on real hardware
2026-08-12 03:33:10 +03:00
Nick Gregory f7cfdc6570 rsx: Fix nv0039 image (de)interleaving functionality 2026-08-11 19:40:15 +00:00
Megamouse a603fbba8c Update discord-rpc 2026-08-11 15:52:57 +02:00
Megamouse db907a2586 TAR: Simplify result string creation 2026-08-11 10:55:02 +02:00
Megamouse b9cee7a3a9 Fix IsPathInsideDir arguments during file extraction 2026-08-11 10:55:02 +02:00
Megamouse d7c15851b4 Qt: run initial dialogs on the main event loop 2026-08-11 08:56:42 +02:00
Megamouse a723152dea Qt: make sure progress dialog stays hidden in the beginning 2026-08-11 08:56:42 +02:00
RipleyTom 2f4034590f sys_net: fix possible event gap in recvfrom 2026-08-10 20:03:56 +03:00
RipleyTom 7b6a8cc2d6 sys_net: more fixes
Add parameter checks to sys_net_infoctl
Fix P2P getpeername() fatal
Fix possible deadlock in tcp_timeout_monitor
Remove vport assert from poll
Add upgrade path for new P2PS state in savestates
Fix P2PS close_stream() not waking threads
Fix possible deadlock in P2PS connect()
Ensure RST is sent on unhandled packets
2026-08-10 20:03:56 +03:00
RipleyTom 6df35891ad sys_net: fixes and improvements
Add thread lock for p2p sockets(used for poll/select to avoid event gap)
Fix poll/select returning EINTR if no sockets were polled
Implement sys_net_infoctl cmd 6(sys_net_get_sockinfo)
Cleanup sys_net_infoctl cmd 9 code
Add SYS_NET_STATE_* values to header
Rewrite P2P and P2PS poll/select implementations
Add extra P2PS state for disconnected and report it as readable with 0 bytes(EOF)
Fix P2PS sockets connecting without being bound first missing hashmap insert
Add missing error check in sceNpSignalingActivateConnection
2026-08-10 20:03:56 +03:00
Megamouse eaef23d43a unself: fix overflow checks 2026-08-10 17:35:26 +02:00
Megamouse 8cde4b2153 unself: fix more potential OOB 2026-08-10 17:35:26 +02:00
Megamouse ed3af84437 unself: add some sanity checks and optimize uncompress a bit 2026-08-10 17:35:26 +02:00
Megamouse 81b85e55e4 unself: cache buffer during decrypt 2026-08-10 17:35:26 +02:00
Megamouse 9af11f5cf1 unself: add some OOB checks 2026-08-10 17:35:26 +02:00
Megamouse d6d5c60823 ISO: mark archive as invalid on error and add sanity checks 2026-08-10 14:45:00 +02:00
Megamouse 0230580a88 ISO: exit loop at end of file 2026-08-10 14:45:00 +02:00
Megamouse ae98583ed2 ISO: ensure filename size during parsing 2026-08-10 14:45:00 +02:00
Megamouse 628ea5ec15 ISO: ensure we're not trying to install files outside of their parent 2026-08-10 14:45:00 +02:00
Megamouse 400d9a1c24 ISO: fix potential overflow 2026-08-10 14:45:00 +02:00
Megamouse 58ef670992 Add file path validations during extraction 2026-08-10 12:35:49 +02:00
Megamouse de13ae4753 Initialize emu callbacks before initializing the emulator 2026-08-10 12:35:49 +02:00
Megamouse f48ca59235 unedat: fix division by 0 2026-08-10 10:53:30 +02:00
Megamouse 804e06356b unedat: fix some data types to prevent overflow 2026-08-10 10:53:30 +02:00
Megamouse 70e3e15e2f unedat: Fix more potential OOB reads 2026-08-10 10:53:30 +02:00
Megamouse 852407b8cb unedat: don't use raw pointers everywhere and use more const 2026-08-10 10:53:30 +02:00
Megamouse f945ab62c0 Fix steam shortcut creation
Look for AutoLogin by first.
Look for MostRecent and Timestamp as fallbacks.
2026-08-10 09:10:42 +02:00
Megamouse ec208289fa elf: remove unnecessary -1 on both sides of a size check to prevent underflow 2026-08-10 02:34:41 +02:00
Megamouse b93c4733a8 Fix OOB buffer read in TRPLoader::LoadHeader 2026-08-10 01:33:53 +02:00
Walter 6d42df0ffc CPUTranslator: Add missing Intel Intrinsic header
MSVC compiles without it, but other compilers need it to be explicitly included.
2026-08-09 09:13:41 +03:00
Walter 502ea1f436 CPUTranslator: Additional constant folding for intrinsics
LLVM is unable to constant fold its X86 intrinsics directly, so this patch adds manual evaluation by calling their equivalent Intel Intrinsic.
2026-08-09 09:13:41 +03:00
Lalit Shankar Chowdhury 8d034a36e8 vk: Sort enumerated GPUs according to priority 2026-08-08 18:39:16 +03:00
Lalit Shankar Chowdhury 75fea2216b Qt: Remember last used path when adding games from folder or ISO
Signed-off-by: Lalit Shankar Chowdhury <lalitshankarch@gmail.com>
2026-08-08 16:29:09 +02:00
Florin9doi 3d587726a2 spu: Clear the MFC_LSA_offs bits higher than the limit 2026-08-05 15:19:12 +03:00
Sanjay Govind f3f52feddf Update SDL to 3.4.14 2026-08-05 08:47:26 +02:00
195 changed files with 12526 additions and 7076 deletions
+2 -2
View File
@@ -37,7 +37,7 @@ if [ "$DEPLOY_APPIMAGE" = "true" ]; then
# Download translations
mkdir -p "./AppDir/usr/translations"
ZIP_URL=$(curl -fsSL "https://api.github.com/repos/RPCS3/rpcs3_translations/releases/latest" \
ZIP_URL=$(curl -fsSL --retry 3 --retry-delay 60 "https://api.github.com/repos/RPCS3/rpcs3_translations/releases/latest" \
| grep "browser_download_url" \
| grep "RPCS3-languages.zip" \
| cut -d '"' -f 4)
@@ -45,7 +45,7 @@ if [ "$DEPLOY_APPIMAGE" = "true" ]; then
echo "Failed to find RPCS3-languages.zip in the latest release. Continuing without translations."
else
echo "Downloading translations from: $ZIP_URL"
curl -L -o translations.zip "$ZIP_URL" || {
curl -fsSL --retry 3 --retry-delay 60 -o translations.zip "$ZIP_URL" || {
echo "Failed to download translations.zip. Continuing without translations."
exit 0
}
+1 -1
View File
@@ -29,7 +29,7 @@ rm -rf "rpcs3.app/Contents/Frameworks/QtPdf.framework" \
mkdir -p "rpcs3.app/Contents/translations"
ZIP_URL="https://github.com/RPCS3/rpcs3_translations/releases/latest/download/RPCS3-languages.zip"
echo "Downloading translations from: $ZIP_URL"
if curl -fsSL "$ZIP_URL" -o "translations.zip"; then
if curl -fsSL --retry 3 --retry-delay 60 "$ZIP_URL" -o "translations.zip"; then
echo "Successfully downloaded translations."
if unzip -o translations.zip -d "rpcs3.app/Contents/translations" >/dev/null 2>&1; then
rm -f translations.zip
+2 -2
View File
@@ -28,7 +28,7 @@ curl -fsSL 'https://api.rpcs3.net/config/?api=v1' | iconv -f ISO-8859-1 -t UTF-8
# Download translations
mkdir -p ./bin/share/qt6/translations
ZIP_URL=$(curl -fsSL "https://api.github.com/repos/RPCS3/rpcs3_translations/releases/latest" \
ZIP_URL=$(curl -fsSL --retry 3 --retry-delay 60 "https://api.github.com/repos/RPCS3/rpcs3_translations/releases/latest" \
| grep "browser_download_url" \
| grep "RPCS3-languages.zip" \
| cut -d '"' -f 4)
@@ -36,7 +36,7 @@ if [ -z "$ZIP_URL" ]; then
echo "Failed to find RPCS3-languages.zip in the latest release. Continuing without translations."
else
echo "Downloading translations from: $ZIP_URL"
curl -L -o translations.zip "$ZIP_URL" || {
curl -fsSL --retry 3 --retry-delay 60 -o translations.zip "$ZIP_URL" || {
echo "Failed to download translations.zip. Continuing without translations."
exit 0
}
+2 -2
View File
@@ -18,7 +18,7 @@ curl -fsSL 'https://api.rpcs3.net/config/?api=v1' | iconv -t UTF-8 1> ./bin/GuiC
# Download translations
mkdir -p ./bin/qt6/translations
ZIP_URL=$(curl -fsSL "https://api.github.com/repos/RPCS3/rpcs3_translations/releases/latest" \
ZIP_URL=$(curl -fsSL --retry 3 --retry-delay 60 "https://api.github.com/repos/RPCS3/rpcs3_translations/releases/latest" \
| grep "browser_download_url" \
| grep "RPCS3-languages.zip" \
| cut -d '"' -f 4)
@@ -26,7 +26,7 @@ if [ -z "$ZIP_URL" ]; then
echo "Failed to find RPCS3-languages.zip in the latest release. Continuing without translations."
else
echo "Downloading translations from: $ZIP_URL"
curl -L -o translations.zip "$ZIP_URL" || {
curl -fsSL --retry 3 --retry-delay 60 -o translations.zip "$ZIP_URL" || {
echo "Failed to download translations.zip. Continuing without translations."
exit 0
}
+4 -4
View File
@@ -30,23 +30,23 @@ jobs:
matrix:
include:
- os: ubuntu-24.04
docker_img: "rpcs3/rpcs3-ci-jammy:2.0"
docker_img: "rpcs3/rpcs3-ci-jammy:2.1"
build_sh: "/rpcs3/.ci/build-linux.sh"
compiler: clang
UPLOAD_COMMIT_HASH: d812f1254a1157c80fd402f94446310560f54e5f
UPLOAD_REPO_FULL_NAME: "rpcs3/rpcs3-binaries-linux"
- os: ubuntu-24.04
docker_img: "rpcs3/rpcs3-ci-jammy:2.0"
docker_img: "rpcs3/rpcs3-ci-jammy:2.1"
build_sh: "/rpcs3/.ci/build-linux.sh"
compiler: gcc
- os: ubuntu-24.04-arm
docker_img: "rpcs3/rpcs3-ci-jammy-aarch64:2.0"
docker_img: "rpcs3/rpcs3-ci-jammy-aarch64:2.1"
build_sh: "/rpcs3/.ci/build-linux-aarch64.sh"
compiler: clang
UPLOAD_COMMIT_HASH: a1d35836e8d45bfc6f63c26f0a3e5d46ef622fe1
UPLOAD_REPO_FULL_NAME: "rpcs3/rpcs3-binaries-linux-arm64"
- os: ubuntu-24.04-arm
docker_img: "rpcs3/rpcs3-ci-jammy-aarch64:2.0"
docker_img: "rpcs3/rpcs3-ci-jammy-aarch64:2.1"
build_sh: "/rpcs3/.ci/build-linux-aarch64.sh"
compiler: gcc
name: RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }}
+14 -2
View File
@@ -332,7 +332,15 @@ struct MemoryManager1 : llvm::RTDyldMemoryManager
{
const u64 pagea = utils::align(oldp, page_quarter);
const u64 psize = utils::align(std::min(newp, c_page_size) - pagea, page_quarter);
utils::memory_commit(reinterpret_cast<u8*>(block) + (pagea % c_max_size), psize, prot);
// try_ rather than memory_commit: a commit failure here is the device being out of
// memory, and the caller has a real fallback -- the module does not compile and its
// functions are interpreted. The fatal version reported it as "LLVM crash recovery
// invoked", which reads like a codegen bug and sent this diagnosis the wrong way.
if (!utils::try_memory_commit(reinterpret_cast<u8*>(block) + (pagea % c_max_size), psize, prot))
{
fmt::throw_exception("Out of memory (commit failed: size=0x%x, align=0x%x)", size, align);
}
// Advance
oldp = pagea + psize;
@@ -343,7 +351,11 @@ struct MemoryManager1 : llvm::RTDyldMemoryManager
// Allocate pages on demand
const u64 pagea = utils::align(oldp, c_page_size);
const u64 psize = utils::align(newp - pagea, c_page_size);
utils::memory_commit(reinterpret_cast<u8*>(block) + (pagea % c_max_size), psize, prot);
if (!utils::try_memory_commit(reinterpret_cast<u8*>(block) + (pagea % c_max_size), psize, prot))
{
fmt::throw_exception("Out of memory (commit failed: size=0x%x, align=0x%x)", size, align);
}
}
return reinterpret_cast<u8*>(block) + (olda % c_max_size);
+28
View File
@@ -24,6 +24,11 @@
#include <stacktrace>
#endif
// Not only under _WIN32 below: the access-violation handler prints a host backtrace on every
// platform, and on Android that is the only stack anyone gets -- the handler freezes the
// emulator rather than aborting, so no tombstone is ever written.
#include "stack_trace.h"
#ifdef _WIN32
#include <Windows.h>
#include <Psapi.h>
@@ -2317,6 +2322,29 @@ bool handle_access_violation(u32 addr, bool is_writing, bool is_exec, ucontext_t
{
vm_log.notice("\n%s", dump_useful_thread_info());
vm_log.fatal("Access violation %s location 0x%x (%s)", is_writing ? "writing" : (is_exec ? "executing" : "reading"), addr, (is_writing && vm::check_addr(addr)) ? "read-only memory" : "unmapped memory");
// The host stack, which is the half that was missing.
//
// dump_useful_thread_info prints GUEST state, and for a fault taken on an emulator
// thread rather than inside guest code that says where the emulator was in the game,
// not which of our functions dereferenced null. Nor is there a tombstone to fall back
// on: this path freezes the emulator instead of aborting, so the process survives and
// Android never writes one.
//
// Yakuza Dead Souls reads location 0xc on the RSX thread with the FIFO empty and
// parked at a self-jump -- so the fault is in whatever runs while no commands are
// pending, and there are several candidates. Naming the frame settles it.
if (const auto stack = utils::get_backtrace_symbols(utils::get_backtrace(32)); !stack.empty())
{
std::string out;
for (usz i = 0; i < stack.size(); i++)
{
fmt::append(out, "\n #%02u %s", i, stack[i]);
}
vm_log.fatal("Host backtrace:%s", out);
}
}
while (Emu.IsPausedOrReady())
+57 -3
View File
@@ -724,15 +724,24 @@ struct coord3_base
struct { T width, height, depth; };
};
constexpr coord3_base() : position{}, size{}
constexpr coord3_base()
: position{}, size{}
{
}
constexpr coord3_base(const position3_base<T>& position, const size3_base<T>& size) : position{ position }, size{ size }
constexpr coord3_base(const position3_base<T>& position, const size3_base<T>& size)
: position{ position }, size{ size }
{
}
constexpr coord3_base(T x, T y, T z, T width, T height, T depth) : x{ x }, y{ y }, z{ z }, width{ width }, height{ height }, depth{ depth }
constexpr coord3_base(T x, T y, T z, T width, T height, T depth)
: x{ x }, y{ y }, z{ z }, width{ width }, height{ height }, depth{ depth }
{
}
constexpr coord3_base(const area_base<T>& area, T z = 0, T depth = 1)
: x{ area.x1 }, y{ area.y1 }, z{ z }
, width{ area.x2 - area.x1 }, height{ area.y2 - area.y1 }, depth{ depth }
{
}
@@ -755,6 +764,51 @@ struct coord3_base
{
return{ static_cast<NT>(x), static_cast<NT>(y), static_cast<NT>(z), static_cast<NT>(width), static_cast<NT>(height), static_cast<NT>(depth) };
}
void flip_horizontal()
requires std::is_signed_v<T>
{
auto x2 = x + width;
x = x2;
width = -width;
}
void flip_vertical()
requires std::is_signed_v<T>
{
auto y2 = y + height;
y = y2;
height = -height;
}
bool is_flipped() const
requires std::is_signed_v<T>
{
return width < 0 || height < 0 || depth < 0;
}
area_base<T> to_area() const
{
return { x, y, x + width, y + height };
}
T abs_width() const
requires std::is_signed_v<T>
{
return width < 0 ? -width : width;
}
T abs_height() const
requires std::is_signed_v<T>
{
return height < 0 ? -height : height;
}
T abs_depth() const
requires std::is_signed_v<T>
{
return depth < 0 ? -depth : depth;
}
};
+259 -172
View File
@@ -1,172 +1,259 @@
#include "stdafx.h"
#include "stack_trace.h"
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#define DBGHELP_TRANSLATE_TCHAR
#include <DbgHelp.h>
#include <codecvt>
#else
#include <execinfo.h>
#endif
namespace utils
{
#ifdef _WIN32
std::string wstr_to_utf8(LPWSTR data, int str_len)
{
if (!str_len)
{
return {};
}
// Calculate size
const auto length = WideCharToMultiByte(CP_UTF8, 0, data, str_len, NULL, 0, NULL, NULL);
// Convert
std::vector<char> out(length + 1, 0);
WideCharToMultiByte(CP_UTF8, 0, data, str_len, out.data(), length, NULL, NULL);
return out.data();
}
std::vector<void*> get_backtrace(int max_depth, PCONTEXT ctx)
{
static struct sym_initer_t
{
sym_initer_t() noexcept
{
SymInitialize(GetCurrentProcess(), NULL, TRUE);
}
~sym_initer_t() noexcept
{
SymCleanup(GetCurrentProcess());
}
} s_initer{};
std::vector<void*> result = {};
const auto hProcess = ::GetCurrentProcess();
const auto hThread = ::GetCurrentThread();
CONTEXT context{};
if (ctx)
context = *ctx;
else
RtlCaptureContext(&context);
STACKFRAME64 stack = {};
stack.AddrPC.Mode = AddrModeFlat;
stack.AddrStack.Mode = AddrModeFlat;
stack.AddrFrame.Mode = AddrModeFlat;
#if defined(ARCH_X64)
const DWORD machineType = IMAGE_FILE_MACHINE_AMD64;
stack.AddrPC.Offset = context.Rip;
stack.AddrStack.Offset = context.Rsp;
stack.AddrFrame.Offset = context.Rbp;
#elif defined(ARCH_ARM64)
const DWORD machineType = IMAGE_FILE_MACHINE_ARM64;
stack.AddrPC.Offset = context.Pc;
stack.AddrStack.Offset = context.Sp;
stack.AddrFrame.Offset = context.Fp;
#else
#error "Unsupported architecture"
#endif
while (max_depth--)
{
if (!StackWalk64(
machineType,
hProcess,
hThread,
&stack,
&context,
NULL,
SymFunctionTableAccess64,
SymGetModuleBase64,
NULL))
{
break;
}
result.push_back(reinterpret_cast<void*>(stack.AddrPC.Offset));
}
return result;
}
std::vector<std::string> get_backtrace_symbols(const std::vector<void*>& stack)
{
std::vector<std::string> result = {};
std::vector<u8> symbol_buf(sizeof(SYMBOL_INFOW) + sizeof(TCHAR) * 256);
const auto hProcess = ::GetCurrentProcess();
auto sym = reinterpret_cast<SYMBOL_INFOW*>(symbol_buf.data());
sym->SizeOfStruct = sizeof(SYMBOL_INFOW);
sym->MaxNameLen = 256;
IMAGEHLP_LINEW64 line_info{};
line_info.SizeOfStruct = sizeof(IMAGEHLP_LINEW64);
SymInitialize(hProcess, NULL, TRUE);
SymSetOptions(SYMOPT_LOAD_LINES);
for (const auto& pointer : stack)
{
DWORD64 unused;
SymFromAddrW(hProcess, reinterpret_cast<DWORD64>(pointer), &unused, sym);
if (sym->NameLen)
{
std::string function_name = wstr_to_utf8(sym->Name, static_cast<int>(sym->NameLen));
// Attempt to get file and line information if available
DWORD unused2;
if (SymGetLineFromAddrW64(hProcess, reinterpret_cast<DWORD64>(pointer), &unused2, &line_info))
{
std::string full_path = fmt::format("%s:%u %s", wstr_to_utf8(line_info.FileName, -1), line_info.LineNumber, function_name);
result.push_back(std::move(full_path));
}
else
{
result.push_back(std::move(function_name));
}
}
else
{
result.push_back(fmt::format("rpcs3@0x%p", pointer));
}
}
return result;
}
#else
std::vector<void*> get_backtrace(int max_depth)
{
std::vector<void*> result(max_depth);
#ifndef ANDROID
int depth = backtrace(result.data(), max_depth);
result.resize(depth);
#endif
return result;
}
std::vector<std::string> get_backtrace_symbols(const std::vector<void*>& stack)
{
std::vector<std::string> result;
#ifndef ANDROID
result.reserve(stack.size());
const auto symbols = backtrace_symbols(stack.data(), static_cast<int>(stack.size()));
for (usz i = 0; i < stack.size(); ++i)
{
result.push_back(symbols[i]);
}
free(symbols);
#endif
return result;
}
#endif
}
#include "stdafx.h"
#include "stack_trace.h"
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#define DBGHELP_TRANSLATE_TCHAR
#include <DbgHelp.h>
#include <codecvt>
#elif defined(ANDROID)
// bionic has no backtrace()/backtrace_symbols(), which is why both were compiled out here and
// every native crash on this port had to be read out of a tombstone or symbolized by hand.
// _Unwind_Backtrace is always present, and dladdr gives the library-relative offset that
// llvm-symbolizer wants.
#include <unwind.h>
#include <dlfcn.h>
#else
#include <execinfo.h>
#endif
namespace utils
{
#ifdef _WIN32
std::string wstr_to_utf8(LPWSTR data, int str_len)
{
if (!str_len)
{
return {};
}
// Calculate size
const auto length = WideCharToMultiByte(CP_UTF8, 0, data, str_len, NULL, 0, NULL, NULL);
// Convert
std::vector<char> out(length + 1, 0);
WideCharToMultiByte(CP_UTF8, 0, data, str_len, out.data(), length, NULL, NULL);
return out.data();
}
std::vector<void*> get_backtrace(int max_depth, PCONTEXT ctx)
{
static struct sym_initer_t
{
sym_initer_t() noexcept
{
SymInitialize(GetCurrentProcess(), NULL, TRUE);
}
~sym_initer_t() noexcept
{
SymCleanup(GetCurrentProcess());
}
} s_initer{};
std::vector<void*> result = {};
const auto hProcess = ::GetCurrentProcess();
const auto hThread = ::GetCurrentThread();
CONTEXT context{};
if (ctx)
context = *ctx;
else
RtlCaptureContext(&context);
STACKFRAME64 stack = {};
stack.AddrPC.Mode = AddrModeFlat;
stack.AddrStack.Mode = AddrModeFlat;
stack.AddrFrame.Mode = AddrModeFlat;
#if defined(ARCH_X64)
const DWORD machineType = IMAGE_FILE_MACHINE_AMD64;
stack.AddrPC.Offset = context.Rip;
stack.AddrStack.Offset = context.Rsp;
stack.AddrFrame.Offset = context.Rbp;
#elif defined(ARCH_ARM64)
const DWORD machineType = IMAGE_FILE_MACHINE_ARM64;
stack.AddrPC.Offset = context.Pc;
stack.AddrStack.Offset = context.Sp;
stack.AddrFrame.Offset = context.Fp;
#else
#error "Unsupported architecture"
#endif
while (max_depth--)
{
if (!StackWalk64(
machineType,
hProcess,
hThread,
&stack,
&context,
NULL,
SymFunctionTableAccess64,
SymGetModuleBase64,
NULL))
{
break;
}
result.push_back(reinterpret_cast<void*>(stack.AddrPC.Offset));
}
return result;
}
std::vector<std::string> get_backtrace_symbols(const std::vector<void*>& stack)
{
std::vector<std::string> result = {};
std::vector<u8> symbol_buf(sizeof(SYMBOL_INFOW) + sizeof(TCHAR) * 256);
const auto hProcess = ::GetCurrentProcess();
auto sym = reinterpret_cast<SYMBOL_INFOW*>(symbol_buf.data());
sym->SizeOfStruct = sizeof(SYMBOL_INFOW);
sym->MaxNameLen = 256;
IMAGEHLP_LINEW64 line_info{};
line_info.SizeOfStruct = sizeof(IMAGEHLP_LINEW64);
SymInitialize(hProcess, NULL, TRUE);
SymSetOptions(SYMOPT_LOAD_LINES);
for (const auto& pointer : stack)
{
DWORD64 unused;
SymFromAddrW(hProcess, reinterpret_cast<DWORD64>(pointer), &unused, sym);
if (sym->NameLen)
{
std::string function_name = wstr_to_utf8(sym->Name, static_cast<int>(sym->NameLen));
// Attempt to get file and line information if available
DWORD unused2;
if (SymGetLineFromAddrW64(hProcess, reinterpret_cast<DWORD64>(pointer), &unused2, &line_info))
{
std::string full_path = fmt::format("%s:%u %s", wstr_to_utf8(line_info.FileName, -1), line_info.LineNumber, function_name);
result.push_back(std::move(full_path));
}
else
{
result.push_back(std::move(function_name));
}
}
else
{
result.push_back(fmt::format("rpcs3@0x%p", pointer));
}
}
return result;
}
#elif defined(ANDROID)
namespace
{
struct unwind_state
{
void** current;
void** end;
};
_Unwind_Reason_Code unwind_collect(_Unwind_Context* ctx, void* arg)
{
auto* state = static_cast<unwind_state*>(arg);
// A frame with no PC is the end of what the unwinder can see; keep the frames
// gathered so far rather than discarding a partial stack, which is still the
// answer most of the time.
const auto pc = _Unwind_GetIP(ctx);
if (!pc)
{
return _URC_END_OF_STACK;
}
if (state->current == state->end)
{
return _URC_END_OF_STACK;
}
*state->current++ = reinterpret_cast<void*>(pc);
return _URC_NO_REASON;
}
}
std::vector<void*> get_backtrace(int max_depth)
{
std::vector<void*> result(max_depth);
unwind_state state{ result.data(), result.data() + max_depth };
_Unwind_Backtrace(&unwind_collect, &state);
result.resize(state.current - result.data());
return result;
}
std::vector<std::string> get_backtrace_symbols(const std::vector<void*>& stack)
{
std::vector<std::string> result;
result.reserve(stack.size());
for (void* const pointer : stack)
{
Dl_info info{};
if (!dladdr(pointer, &info) || !info.dli_fname)
{
result.push_back(fmt::format("0x%p", pointer));
continue;
}
// Library-relative, because that is what symbolizes. The shipped .so is stripped
// and loaded at a random base, so an absolute PC is useless on its own; this
// offset is what llvm-symbolizer takes against the unstripped build output.
const auto base = reinterpret_cast<uptr>(info.dli_fbase);
const auto off = reinterpret_cast<uptr>(pointer) - base;
// Basename only: the full path is the app's private data dir and the same for
// every frame.
std::string_view lib = info.dli_fname;
if (const auto slash = lib.find_last_of('/'); slash != umax)
{
lib.remove_prefix(slash + 1);
}
if (info.dli_sname)
{
result.push_back(fmt::format("%s+0x%x (%s)", lib, off, info.dli_sname));
}
else
{
result.push_back(fmt::format("%s+0x%x", lib, off));
}
}
return result;
}
#else
std::vector<void*> get_backtrace(int max_depth)
{
std::vector<void*> result(max_depth);
int depth = backtrace(result.data(), max_depth);
result.resize(depth);
return result;
}
std::vector<std::string> get_backtrace_symbols(const std::vector<void*>& stack)
{
std::vector<std::string> result;
result.reserve(stack.size());
const auto symbols = backtrace_symbols(stack.data(), static_cast<int>(stack.size()));
for (usz i = 0; i < stack.size(); ++i)
{
result.push_back(symbols[i]);
}
free(symbols);
return result;
}
#endif
}
+106 -12
View File
@@ -1,3 +1,5 @@
import java.util.Properties
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.compose.compiler)
@@ -32,19 +34,21 @@ android {
// agree -- an APK that installs below its core's target is a dlopen failure at boot.
minSdk = (project.findProperty("armsx3.minSdk") as String?)?.toInt() ?: 33
targetSdk = 37
versionCode = 17
versionName = "0.9.2"
versionCode = 20
versionName = "0.9.4"
// ARMSX2's UI reads these. STORAGE_ALL_FILES gates the all-files storage path in
// onboarding; IN_APP_UPDATER gates the in-app GitHub-release updater.
//
// On because ARMSX3 ships as a sideloaded APK from its own GitHub releases, which is
// exactly the case an in-app updater is for. It must go back off, and the code and the
// REQUEST_INSTALL_PACKAGES permission must move into a github-only flavor, before any
// Play build exists: Play forbids self-updating apps, and it is the PERMISSION in the
// bundle that gets rejected, which this runtime flag does nothing about.
// These are the github values; the play flavor overrides all three below.
//
// The warning that used to live here was right and is now acted on: a runtime boolean
// does nothing about the PERMISSION in the bundle, which is what Play rejects. The
// permissions have moved into the github flavor's manifest, so the play bundle does not
// declare them at all.
buildConfigField("boolean", "STORAGE_ALL_FILES", "true")
buildConfigField("boolean", "IN_APP_UPDATER", "true")
buildConfigField("boolean", "FRAME_GENERATION", "true")
ndk {
// The core is arm64-only.
@@ -68,6 +72,40 @@ android {
}
}
// Two distributions, and they are not interchangeable.
//
// github is the sideloaded build: it updates itself from GitHub releases, can be pointed at
// an arbitrary data folder, and ships frame generation.
//
// play is what Google Play will accept. Self-updating is forbidden outright, all-files
// storage is a policy review it does not need, and frame generation is left out. The
// applicationId differs so the two install side by side instead of over each other.
flavorDimensions += "distribution"
productFlavors {
create("github") {
dimension = "distribution"
}
create("play") {
dimension = "distribution"
applicationId = "com.armsx3.play"
buildConfigField("boolean", "STORAGE_ALL_FILES", "false")
buildConfigField("boolean", "IN_APP_UPDATER", "false")
buildConfigField("boolean", "FRAME_GENERATION", "false")
// Frame generation is excluded by SOURCE SET, not by a packaging filter: a
// packaging block inside a flavor is not honoured and silently applied to both,
// which dropped the library from the github build too. libarmsx3_lsfg.so lives in
// src/github/jniLibs, so only that flavor bundles it.
//
// Excluding the file is the whole exclusion. The shim is dlopen'd by name, and the
// core already reports frame generation unavailable when the library is absent,
// which is the same path a device that cannot run it takes.
}
}
externalNativeBuild {
cmake {
path = file("src/main/cpp/CMakeLists.txt")
@@ -75,17 +113,73 @@ android {
}
}
// Reads android/armsx3-ui/keystore.properties when it exists:
//
// storeFile=/absolute/path/to/upload.jks
// storePassword=...
// keyAlias=upload
// keyPassword=...
//
// Absent, only the debug key exists and release builds stay sideload-only. The file is
// gitignored and nothing here echoes its contents.
signingConfigs {
val props = rootProject.file("keystore.properties")
if (props.exists()) {
val k = Properties().apply { props.inputStream().use { load(it) } }
create("upload") {
storeFile = file(k.getProperty("storeFile"))
storePassword = k.getProperty("storePassword")
keyAlias = k.getProperty("keyAlias")
keyPassword = k.getProperty("keyPassword")
}
}
}
buildTypes {
release {
isMinifyEnabled = true
isShrinkResources = true
// Off for the Play bundle, on for GitHub APKs.
//
// Not a preference: AGP 9.2.1's R8 writes its mapping as mapping.prt, a compressed
// per-class archive, while packageBundle still demands a plain mapping.txt, so an
// AAB cannot be built with R8 enabled at all. Set by build-play-aab.sh.
//
// The cost is small and there is precedent: ARMSX2 ships its Play build with minify
// off entirely, and here a 94 MB native core dominates a 76 MB APK, so shrinking the
// Kotlin saves comparatively little.
//
// A gradle property rather than the variant API, matching how armsx3.minSdk is
// already threaded through by build-variants.sh.
val noMinify = project.hasProperty("armsx3.noMinify")
isMinifyEnabled = !noMinify
isShrinkResources = !noMinify
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
// Debug-signed so alpha release builds are sideloadable without the
// upload key. Swap this for the real config before any public build.
signingConfig = signingConfigs.getByName("debug")
// The upload key when one is configured, the debug key otherwise.
//
// GitHub APKs are deliberately debug-signed so an alpha stays sideloadable without
// the upload key present. Play rejects a debug-signed bundle outright, so
// build-play-aab.sh refuses to run without keystore.properties.
//
// The file is gitignored (*.jks, keystore.properties) and read at build time, so no
// credential is ever in the repo or on a command line.
// The upload key ONLY when explicitly asked for, which build-play-aab.sh does.
//
// Opt-in rather than "use it if it exists": once the keystore was created, every
// release build silently started using it, and a differently-signed APK cannot be
// installed over an existing one. That turns a sideload build into something testers
// cannot install, and the error Android shows says nothing about signatures. It was
// being worked around by hiding keystore.properties by hand before each build, which
// is exactly the kind of step that gets forgotten once.
signingConfig = if (project.hasProperty("armsx3.uploadSigning")) {
signingConfigs.findByName("upload")
?: throw GradleException("armsx3.uploadSigning set but keystore.properties is missing")
} else {
signingConfigs.getByName("debug")
}
}
}
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Everything Google Play will not accept, declared by the github flavor alone so the play
bundle cannot inherit it by accident.
REQUEST_INSTALL_PACKAGES and the FileProvider are what the in-app updater needs: it downloads
a GitHub release APK and hands it to the system package installer. Play forbids apps that
update themselves outside the store, and it is the DECLARED PERMISSION that gets rejected, so
gating the code behind a runtime flag was never enough on its own.
MANAGE_EXTERNAL_STORAGE backs the all-files onboarding path, which lets the data folder live
anywhere on the device. The play build uses the app-specific directories instead (internal or
SD card), which are raw-writable under scoped storage with no permission at all.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
tools:ignore="ScopedStorage" />
<application>
<!-- Hands the downloaded update APK to the system package installer. -->
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.updateprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/update_paths" />
</provider>
</application>
</manifest>
@@ -23,16 +23,10 @@
Sideload/GitHub builds only. The Play flavour must NOT ship this (the
policy needs a declared exemption); that is what the STORAGE_ALL_FILES
buildConfig flag gates in code. -->
<!-- In-app updater: install the downloaded APK. SIDELOAD ONLY.
A self-updating app is a hard Play-policy violation, and it is this permission in the
bundle that gets rejected, not the runtime flag. ARMSX2 keeps it out of its Play build
with a github-only flavor and a build script that fails closed if it ever appears;
ARMSX3 has no Play build, so it lives here. Adding a Play target means moving this and
the provider below into a github flavor FIRST. -->
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
tools:ignore="ScopedStorage" />
<!-- REQUEST_INSTALL_PACKAGES, MANAGE_EXTERNAL_STORAGE and the updater's FileProvider are
declared by the GITHUB flavor only, in src/github/AndroidManifest.xml. Play rejects the
permission present in the bundle, not the code path behind a runtime flag, so none of
them may sit here where both flavors inherit them. -->
<!-- Optional motion controls (Pad settings). Not required, so the Play install
isn't gated for devices without a gyroscope. -->
@@ -204,18 +198,6 @@
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:excludeFromRecents="true"
android:exported="false" />
<!-- Hands the downloaded update APK to the system package installer. Paired with
REQUEST_INSTALL_PACKAGES above; see the note there before shipping to Play. -->
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.updateprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/update_paths" />
</provider>
</application>
@@ -62,6 +62,21 @@ struct RPCSXApi {
int (*frameGenImportShaders)(std::string_view path);
int (*frameGenShaderCount)();
const char *(*frameGenShaderError)();
const char *(*rpcnGetConfig)();
void (*rpcnSetConfig)(std::string_view host, std::string_view npid,
std::string_view password, std::string_view token);
const char *(*rpcnCreateAccount)(std::string_view npid, std::string_view password,
std::string_view onlineName, std::string_view email);
const char *(*rpcnResendToken)(std::string_view npid, std::string_view password);
const char *(*rpcnSendResetToken)(std::string_view npid, std::string_view email);
const char *(*rpcnResetPassword)(std::string_view npid, std::string_view token,
std::string_view password);
const char *(*rpcnTestLogin)();
const char *(*rpcnAddHost)(std::string_view desc, std::string_view host);
const char *(*rpcnDelHost)(std::string_view desc, std::string_view host);
void (*rpcnResetHosts)();
void (*rpcnSetIpv6)(bool enabled);
const char *(*rpcnStatus)();
void (*settingsBeginBatch)();
void (*settingsEndBatch)();
bool (*installSplitPkg)(JNIEnv *env, const int *fds, int count, long progressId);
@@ -155,6 +170,20 @@ struct RPCSXLibrary : RPCSXApi {
result.loginUser = reinterpret_cast<decltype(loginUser)>(dlsym(handle, "_rpcsx_loginUser"));
result.getUser = reinterpret_cast<decltype(getUser)>(dlsym(handle, "_rpcsx_getUser"));
result.settingsGet = reinterpret_cast<decltype(settingsGet)>(dlsym(handle, "_rpcsx_settingsGet"));
// Optional like the frame-gen group above: a core predating RPCN support simply has no
// such symbols, and the Kotlin side treats a null as "this build cannot do RPCN".
result.rpcnGetConfig = reinterpret_cast<decltype(rpcnGetConfig)>(dlsym(handle, "_rpcsx_rpcnGetConfig"));
result.rpcnSetConfig = reinterpret_cast<decltype(rpcnSetConfig)>(dlsym(handle, "_rpcsx_rpcnSetConfig"));
result.rpcnCreateAccount = reinterpret_cast<decltype(rpcnCreateAccount)>(dlsym(handle, "_rpcsx_rpcnCreateAccount"));
result.rpcnResendToken = reinterpret_cast<decltype(rpcnResendToken)>(dlsym(handle, "_rpcsx_rpcnResendToken"));
result.rpcnSendResetToken = reinterpret_cast<decltype(rpcnSendResetToken)>(dlsym(handle, "_rpcsx_rpcnSendResetToken"));
result.rpcnResetPassword = reinterpret_cast<decltype(rpcnResetPassword)>(dlsym(handle, "_rpcsx_rpcnResetPassword"));
result.rpcnTestLogin = reinterpret_cast<decltype(rpcnTestLogin)>(dlsym(handle, "_rpcsx_rpcnTestLogin"));
result.rpcnAddHost = reinterpret_cast<decltype(rpcnAddHost)>(dlsym(handle, "_rpcsx_rpcnAddHost"));
result.rpcnDelHost = reinterpret_cast<decltype(rpcnDelHost)>(dlsym(handle, "_rpcsx_rpcnDelHost"));
result.rpcnResetHosts = reinterpret_cast<decltype(rpcnResetHosts)>(dlsym(handle, "_rpcsx_rpcnResetHosts"));
result.rpcnSetIpv6 = reinterpret_cast<decltype(rpcnSetIpv6)>(dlsym(handle, "_rpcsx_rpcnSetIpv6"));
result.rpcnStatus = reinterpret_cast<decltype(rpcnStatus)>(dlsym(handle, "_rpcsx_rpcnStatus"));
result.settingsSet = reinterpret_cast<decltype(settingsSet)>(dlsym(handle, "_rpcsx_settingsSet"));
// Resolved without ensure(): a core built before frame generation existed simply has no such
// symbol, and refusing to load it over a missing optional feature would be worse than the
@@ -1078,3 +1107,169 @@ Java_net_rpcsx_RPCSX_frameGenShaderError(JNIEnv *env, jobject) {
const char *msg = rpcsxLib.frameGenShaderError ? rpcsxLib.frameGenShaderError() : "";
return env->NewStringUTF(msg ? msg : "");
}
// ---- RPCN ----
//
// Every one of these blocks on the network; the Kotlin side calls them off the UI thread.
// A null pointer means the core predates RPCN support, which is reported as a message
// rather than a crash so an old core degrades to "unavailable" instead of taking the app
// down.
static jstring rpcn_unavailable(JNIEnv *env) {
return env->NewStringUTF("This build of the emulator core has no RPCN support.");
}
extern "C" JNIEXPORT jstring JNICALL
Java_net_rpcsx_RPCSX_rpcnGetConfig(JNIEnv *env, jobject) {
if (!rpcsxLib.rpcnGetConfig) return env->NewStringUTF("");
const char *json = rpcsxLib.rpcnGetConfig();
return env->NewStringUTF(json ? json : "");
}
extern "C" JNIEXPORT jstring JNICALL
Java_net_rpcsx_RPCSX_rpcnStatus(JNIEnv *env, jobject) {
if (!rpcsxLib.rpcnStatus) return env->NewStringUTF("");
const char *json = rpcsxLib.rpcnStatus();
return env->NewStringUTF(json ? json : "");
}
extern "C" JNIEXPORT jstring JNICALL
Java_net_rpcsx_RPCSX_rpcnAddHost(JNIEnv *env, jobject, jstring desc, jstring host) {
if (!rpcsxLib.rpcnAddHost) return rpcn_unavailable(env);
auto str = [&](jstring s) -> std::string {
if (!s) return {};
const char *c = env->GetStringUTFChars(s, nullptr);
std::string out = c ? c : "";
if (c) env->ReleaseStringUTFChars(s, c);
return out;
};
const std::string d = str(desc), h = str(host);
const char *msg = rpcsxLib.rpcnAddHost(d, h);
return env->NewStringUTF(msg ? msg : "");
}
extern "C" JNIEXPORT jstring JNICALL
Java_net_rpcsx_RPCSX_rpcnDelHost(JNIEnv *env, jobject, jstring desc, jstring host) {
if (!rpcsxLib.rpcnDelHost) return rpcn_unavailable(env);
auto str = [&](jstring s) -> std::string {
if (!s) return {};
const char *c = env->GetStringUTFChars(s, nullptr);
std::string out = c ? c : "";
if (c) env->ReleaseStringUTFChars(s, c);
return out;
};
const std::string d = str(desc), h = str(host);
const char *msg = rpcsxLib.rpcnDelHost(d, h);
return env->NewStringUTF(msg ? msg : "");
}
extern "C" JNIEXPORT void JNICALL
Java_net_rpcsx_RPCSX_rpcnResetHosts(JNIEnv *, jobject) {
if (rpcsxLib.rpcnResetHosts) rpcsxLib.rpcnResetHosts();
}
extern "C" JNIEXPORT void JNICALL
Java_net_rpcsx_RPCSX_rpcnSetIpv6(JNIEnv *, jobject, jboolean enabled) {
if (rpcsxLib.rpcnSetIpv6) rpcsxLib.rpcnSetIpv6(enabled == JNI_TRUE);
}
extern "C" JNIEXPORT void JNICALL
Java_net_rpcsx_RPCSX_rpcnSetConfig(JNIEnv *env, jobject, jstring host, jstring npid,
jstring password, jstring token) {
if (!rpcsxLib.rpcnSetConfig) return;
auto str = [&](jstring s) -> std::string {
if (!s) return {};
const char *c = env->GetStringUTFChars(s, nullptr);
std::string out = c ? c : "";
if (c) env->ReleaseStringUTFChars(s, c);
return out;
};
const std::string h = str(host), n = str(npid), p = str(password), t = str(token);
rpcsxLib.rpcnSetConfig(h, n, p, t);
}
extern "C" JNIEXPORT jstring JNICALL
Java_net_rpcsx_RPCSX_rpcnCreateAccount(JNIEnv *env, jobject, jstring npid,
jstring password, jstring onlineName,
jstring email) {
if (!rpcsxLib.rpcnCreateAccount) return rpcn_unavailable(env);
auto str = [&](jstring s) -> std::string {
if (!s) return {};
const char *c = env->GetStringUTFChars(s, nullptr);
std::string out = c ? c : "";
if (c) env->ReleaseStringUTFChars(s, c);
return out;
};
const std::string n = str(npid), p = str(password), o = str(onlineName), e = str(email);
const char *msg = rpcsxLib.rpcnCreateAccount(n, p, o, e);
return env->NewStringUTF(msg ? msg : "");
}
extern "C" JNIEXPORT jstring JNICALL
Java_net_rpcsx_RPCSX_rpcnResendToken(JNIEnv *env, jobject, jstring npid,
jstring password) {
if (!rpcsxLib.rpcnResendToken) return rpcn_unavailable(env);
auto str = [&](jstring s) -> std::string {
if (!s) return {};
const char *c = env->GetStringUTFChars(s, nullptr);
std::string out = c ? c : "";
if (c) env->ReleaseStringUTFChars(s, c);
return out;
};
const std::string n = str(npid), p = str(password);
const char *msg = rpcsxLib.rpcnResendToken(n, p);
return env->NewStringUTF(msg ? msg : "");
}
extern "C" JNIEXPORT jstring JNICALL
Java_net_rpcsx_RPCSX_rpcnSendResetToken(JNIEnv *env, jobject, jstring npid,
jstring email) {
if (!rpcsxLib.rpcnSendResetToken) return rpcn_unavailable(env);
auto str = [&](jstring s) -> std::string {
if (!s) return {};
const char *c = env->GetStringUTFChars(s, nullptr);
std::string out = c ? c : "";
if (c) env->ReleaseStringUTFChars(s, c);
return out;
};
const std::string n = str(npid), e = str(email);
const char *msg = rpcsxLib.rpcnSendResetToken(n, e);
return env->NewStringUTF(msg ? msg : "");
}
extern "C" JNIEXPORT jstring JNICALL
Java_net_rpcsx_RPCSX_rpcnResetPassword(JNIEnv *env, jobject, jstring npid, jstring token,
jstring password) {
if (!rpcsxLib.rpcnResetPassword) return rpcn_unavailable(env);
auto str = [&](jstring s) -> std::string {
if (!s) return {};
const char *c = env->GetStringUTFChars(s, nullptr);
std::string out = c ? c : "";
if (c) env->ReleaseStringUTFChars(s, c);
return out;
};
const std::string n = str(npid), t = str(token), p = str(password);
const char *msg = rpcsxLib.rpcnResetPassword(n, t, p);
return env->NewStringUTF(msg ? msg : "");
}
extern "C" JNIEXPORT jstring JNICALL
Java_net_rpcsx_RPCSX_rpcnTestLogin(JNIEnv *env, jobject) {
if (!rpcsxLib.rpcnTestLogin) return rpcn_unavailable(env);
const char *msg = rpcsxLib.rpcnTestLogin();
return env->NewStringUTF(msg ? msg : "");
}
@@ -24,6 +24,45 @@ object GameDefaults {
// the node by hand.
"BCUS98233" to mapOf("Core@@Stub PPU Traps" to "1"),
"BCES01175" to mapOf("Core@@Stub PPU Traps" to "1"),
// Yakuza: Dead Souls. Runs at 1fps with FIFO reordering on -- not slowly, but in
// one-second steps: the RSX blocks on nv406e::semaphore_acquire until the wait times
// out, draws, and does it again. 145 timeouts in one session, all on semaphore
// 0x50300FE0, while the GPU itself was doing 3.06 ms of work per frame. The acquire
// consistently outruns the release that should satisfy it -- awaited 0x68 against a
// last_observed of 0x60 -- from the very first frame onward.
//
// Turning the flattener off clears it completely and the game boots and plays.
//
// Cause not established. The obvious candidate does not hold: flattening_helper only
// drops registers marked always_ignore, and that set is four INVALIDATE methods with
// no semaphore among them -- a semaphore release hits the default branch and flushes
// the batch, which is the safe path. So this is an empirical per-title workaround
// rather than a fix, and the real mechanism is still open.
//
// The other two are for a SECOND failure, further in: the FIFO desyncs and reads a RET
// with an empty call stack -- 19 of them in one session, last cmd 0x20000 every time --
// recover_fifo() resets it each time, and eventually gives up and kills the RSX thread
// outright ("Dead FIFO commands queue state"). The game then sits at 0 fps with audio
// still playing perfectly, because everything except the renderer is still alive. The
// stray semaphore acquires that time out alongside it are downstream of the same thing:
// a desynced FIFO never runs the release that would satisfy them.
//
// These two are what the fatal message itself recommends, and they work. Which of the
// two is doing the work is not established -- both were changed at once and the game
// has not been A/B'd since -- so both are kept. Ordered & Atomic is the likelier of the
// pair given the symptom, and both cost performance, which is why they are scoped to
// this title rather than turned on globally.
"BLUS30826" to mapOf(
"Video@@Disable FIFO Reordering" to "true",
"Core@@RSX FIFO Fetch Accuracy" to "\"Ordered & Atomic\"",
"Video@@Driver Wake-Up Delay" to "20",
),
"NPUB31509" to mapOf(
"Video@@Disable FIFO Reordering" to "true",
"Core@@RSX FIFO Fetch Accuracy" to "\"Ordered & Atomic\"",
"Video@@Driver Wake-Up Delay" to "20",
),
)
/**
@@ -45,6 +84,12 @@ object GameDefaults {
private val STOCK: Map<String, String> = mapOf(
// system_config.h: cfg::_int<-64, 64> stub_ppu_traps{ this, "Stub PPU Traps", 0, true }
"Core@@Stub PPU Traps" to "0",
// system_config.h: cfg::_bool disable_FIFO_reordering{ this, "Disable FIFO Reordering", false }
"Video@@Disable FIFO Reordering" to "false",
// system_config.h: fifo_setting rsx_fifo_accuracy{ this, "RSX FIFO Fetch Accuracy", rsx_fifo_mode::atomic }
"Core@@RSX FIFO Fetch Accuracy" to "\"Atomic\"",
// system_config.h: cfg::uint<0, 16667> driver_wakeup_delay{ this, "Driver Wake-Up Delay", 0, true }
"Video@@Driver Wake-Up Delay" to "0",
)
fun forSerial(serial: String?): Map<String, String> =
@@ -195,8 +195,29 @@ data class Ps3Settings(
* off by default and the UI says so plainly. */
val silenceAllLogs: Boolean = false,
val netEnabled: Boolean = false,
val psnStatus: Boolean = false,
/** Net/PSN status: 0 = Disconnected, 1 = Simulated, 2 = RPCN.
*
* Was a Boolean, which could only ever pick Disconnected or Simulated -- so
* np_psn_status::psn_rpcn had no writer anywhere in the app and RPCN, which is fully
* compiled into the core, was unreachable. */
val psnStatus: Int = 0,
val upnpEnabled: Boolean = false,
/** The IPv4 address games are told the console has. "0.0.0.0" means "work it out". */
val ipAddress: String = "0.0.0.0",
/** Which local interface the emulated network stack binds to. "0.0.0.0" = any. */
val bindAddress: String = "0.0.0.0",
/** DNS server for the emulated stack. This is the one that matters for private/fan
* game servers: RPCN replaces Sony's PSN, but a publisher's own backend was never PSN,
* so reaching a revival of one means resolving its hostnames somewhere else. */
val dnsAddress: String = "8.8.8.8",
/** Per-hostname redirects, "host=1.2.3.4" joined by "&&" -- finer than dnsAddress
* because it moves one hostname instead of every lookup. Parsed by np::dnshook. */
val ipSwapList: String = "",
/** Derive the console's MAC from its PSID rather than using a fixed one. */
val deriveMacFromPsid: Boolean = false,
/** Two-letter country code reported to PSN/RPCN. */
val psnCountry: String = "us",
val clansEnabled: Boolean = false,
/**
* 0 = Accurate, 1 = Approximate, 2 = Relaxed, 3 = Inaccurate.
*
@@ -1111,6 +1132,13 @@ data class Settings(
put("PS3/Net", "Internet enabled", "enum", ps3.netEnabled.toString())
put("PS3/Net", "PSN status", "enum", ps3.psnStatus.toString())
put("PS3/Net", "UPNP Enabled", "bool", ps3.upnpEnabled.toString())
put("PS3/Net", "IP address", "string", ps3.ipAddress)
put("PS3/Net", "Bind address", "string", ps3.bindAddress)
put("PS3/Net", "DNS address", "string", ps3.dnsAddress)
put("PS3/Net", "IP swap list", "string", ps3.ipSwapList)
put("PS3/Net", "Derive MAC from PSID", "bool", ps3.deriveMacFromPsid.toString())
put("PS3/Net", "PSN Country", "string", ps3.psnCountry)
put("PS3/Net", "Clans Enabled", "bool", ps3.clansEnabled.toString())
put("PS3/System", "Enter button assignment", "enum", ps3.enterButtonAssign.toString())
put("PS3/System", "Language", "enum", ps3.consoleLanguage.toString())
put("PS3/System", "License Area", "enum", ps3.consoleRegion.toString())
@@ -2084,6 +2112,13 @@ data class Settings(
put("ps3NetEnabled", ps3.netEnabled)
put("ps3PsnStatus", ps3.psnStatus)
put("ps3UpnpEnabled", ps3.upnpEnabled)
put("ps3IpAddress", ps3.ipAddress)
put("ps3BindAddress", ps3.bindAddress)
put("ps3DnsAddress", ps3.dnsAddress)
put("ps3IpSwapList", ps3.ipSwapList)
put("ps3DeriveMacFromPsid", ps3.deriveMacFromPsid)
put("ps3PsnCountry", ps3.psnCountry)
put("ps3ClansEnabled", ps3.clansEnabled)
put("ps3EnterButtonAssign", ps3.enterButtonAssign)
put("ps3ConsoleLanguage", ps3.consoleLanguage)
put("ps3ConsoleRegion", ps3.consoleRegion)
@@ -2429,8 +2464,20 @@ data class Settings(
audioBuffering = json.optBoolean("ps3AudioBuffering", def.ps3.audioBuffering),
audioBufferMs = json.optInt("ps3AudioBufferMs", def.ps3.audioBufferMs),
netEnabled = json.optBoolean("ps3NetEnabled", def.ps3.netEnabled),
psnStatus = json.optBoolean("ps3PsnStatus", def.ps3.psnStatus),
// optInt with a Boolean fallback for installs written before this was a
// tri-state: a stored `true` reads back as 1 (Simulated), which is what it
// meant.
psnStatus = if (json.opt("ps3PsnStatus") is Boolean)
(if (json.optBoolean("ps3PsnStatus")) 1 else 0)
else json.optInt("ps3PsnStatus", def.ps3.psnStatus),
upnpEnabled = json.optBoolean("ps3UpnpEnabled", def.ps3.upnpEnabled),
ipAddress = json.optString("ps3IpAddress", def.ps3.ipAddress),
bindAddress = json.optString("ps3BindAddress", def.ps3.bindAddress),
dnsAddress = json.optString("ps3DnsAddress", def.ps3.dnsAddress),
ipSwapList = json.optString("ps3IpSwapList", def.ps3.ipSwapList),
deriveMacFromPsid = json.optBoolean("ps3DeriveMacFromPsid", def.ps3.deriveMacFromPsid),
psnCountry = json.optString("ps3PsnCountry", def.ps3.psnCountry),
clansEnabled = json.optBoolean("ps3ClansEnabled", def.ps3.clansEnabled),
enterButtonAssign = json.optInt("ps3EnterButtonAssign", def.ps3.enterButtonAssign),
consoleLanguage = json.optInt("ps3ConsoleLanguage", def.ps3.consoleLanguage),
consoleRegion = json.optInt("ps3ConsoleRegion", def.ps3.consoleRegion),
@@ -2758,6 +2805,13 @@ data class Settings(
if (current.ps3.netEnabled != base.ps3.netEnabled) j.put("ps3NetEnabled", current.ps3.netEnabled)
if (current.ps3.psnStatus != base.ps3.psnStatus) j.put("ps3PsnStatus", current.ps3.psnStatus)
if (current.ps3.upnpEnabled != base.ps3.upnpEnabled) j.put("ps3UpnpEnabled", current.ps3.upnpEnabled)
if (current.ps3.ipAddress != base.ps3.ipAddress) j.put("ps3IpAddress", current.ps3.ipAddress)
if (current.ps3.bindAddress != base.ps3.bindAddress) j.put("ps3BindAddress", current.ps3.bindAddress)
if (current.ps3.dnsAddress != base.ps3.dnsAddress) j.put("ps3DnsAddress", current.ps3.dnsAddress)
if (current.ps3.ipSwapList != base.ps3.ipSwapList) j.put("ps3IpSwapList", current.ps3.ipSwapList)
if (current.ps3.deriveMacFromPsid != base.ps3.deriveMacFromPsid) j.put("ps3DeriveMacFromPsid", current.ps3.deriveMacFromPsid)
if (current.ps3.psnCountry != base.ps3.psnCountry) j.put("ps3PsnCountry", current.ps3.psnCountry)
if (current.ps3.clansEnabled != base.ps3.clansEnabled) j.put("ps3ClansEnabled", current.ps3.clansEnabled)
if (current.ps3.enterButtonAssign != base.ps3.enterButtonAssign) j.put("ps3EnterButtonAssign", current.ps3.enterButtonAssign)
if (current.ps3.consoleLanguage != base.ps3.consoleLanguage) j.put("ps3ConsoleLanguage", current.ps3.consoleLanguage)
if (current.ps3.consoleRegion != base.ps3.consoleRegion) j.put("ps3ConsoleRegion", current.ps3.consoleRegion)
@@ -3064,8 +3118,19 @@ data class Settings(
audioBuffering = if (overrides.has("ps3AudioBuffering")) overrides.getBoolean("ps3AudioBuffering") else base.ps3.audioBuffering,
audioBufferMs = if (overrides.has("ps3AudioBufferMs")) overrides.getInt("ps3AudioBufferMs") else base.ps3.audioBufferMs,
netEnabled = if (overrides.has("ps3NetEnabled")) overrides.getBoolean("ps3NetEnabled") else base.ps3.netEnabled,
psnStatus = if (overrides.has("ps3PsnStatus")) overrides.getBoolean("ps3PsnStatus") else base.ps3.psnStatus,
psnStatus = if (overrides.has("ps3PsnStatus"))
(if (overrides.opt("ps3PsnStatus") is Boolean)
(if (overrides.getBoolean("ps3PsnStatus")) 1 else 0)
else overrides.getInt("ps3PsnStatus"))
else base.ps3.psnStatus,
upnpEnabled = if (overrides.has("ps3UpnpEnabled")) overrides.getBoolean("ps3UpnpEnabled") else base.ps3.upnpEnabled,
ipAddress = if (overrides.has("ps3IpAddress")) overrides.getString("ps3IpAddress") else base.ps3.ipAddress,
bindAddress = if (overrides.has("ps3BindAddress")) overrides.getString("ps3BindAddress") else base.ps3.bindAddress,
dnsAddress = if (overrides.has("ps3DnsAddress")) overrides.getString("ps3DnsAddress") else base.ps3.dnsAddress,
ipSwapList = if (overrides.has("ps3IpSwapList")) overrides.getString("ps3IpSwapList") else base.ps3.ipSwapList,
deriveMacFromPsid = if (overrides.has("ps3DeriveMacFromPsid")) overrides.getBoolean("ps3DeriveMacFromPsid") else base.ps3.deriveMacFromPsid,
psnCountry = if (overrides.has("ps3PsnCountry")) overrides.getString("ps3PsnCountry") else base.ps3.psnCountry,
clansEnabled = if (overrides.has("ps3ClansEnabled")) overrides.getBoolean("ps3ClansEnabled") else base.ps3.clansEnabled,
enterButtonAssign = if (overrides.has("ps3EnterButtonAssign")) overrides.getInt("ps3EnterButtonAssign") else base.ps3.enterButtonAssign,
consoleLanguage = if (overrides.has("ps3ConsoleLanguage")) overrides.getInt("ps3ConsoleLanguage") else base.ps3.consoleLanguage,
consoleRegion = if (overrides.has("ps3ConsoleRegion")) overrides.getInt("ps3ConsoleRegion") else base.ps3.consoleRegion,
@@ -518,10 +518,69 @@ val EN: Map<String, String> = mapOf(
"backend.renderer.software" to "Software",
"net.internet.label" to "Internet Connection",
"net.internet.description" to "Lets the emulated PS3 reach the network. Required for anything online; leave off if you only play offline, since some games hang trying to connect.",
"net.psn.label" to "PSN (Simulated)",
"net.psn.label" to "PSN status",
"net.psn.off" to "Off",
"net.psn.simulated" to "Simulated",
"net.psn.rpcn" to "RPCN",
"rpcn.title" to "RPCN account",
"rpcn.description" to "RPCN is the community replacement for PSN, and what makes online play work. An account is created here, not on a website: the server emails you a token that activates it.",
"rpcn.server" to "Server",
"rpcn.username" to "Username",
"rpcn.password" to "Password",
"rpcn.password.stored" to "Password (one is saved \u2014 leave blank to keep it)",
"rpcn.email" to "Email address",
"rpcn.email.why" to "Only used to send the activation token, and a reset token if you forget your password.",
"rpcn.token" to "Token (from the activation email)",
"rpcn.save" to "Save",
"rpcn.test" to "Test sign-in",
"rpcn.create" to "Create account\u2026",
"rpcn.create.go" to "Create it",
"rpcn.create.hint" to "Fill in a username, password and email, then tap Create it.",
"rpcn.token.resend" to "Resend token",
"rpcn.reset" to "Reset password",
"rpcn.working" to "Contacting the server\u2026",
"rpcn.saved" to "Saved.",
"rpcn.signedIn" to "Signed in. Online should work in games that support it.",
"rpcn.created" to "Account created. Check your email for the token, enter it above and Save.",
"rpcn.token.sent" to "A new token has been emailed to you.",
"rpcn.reset.sent" to "Done. If you asked for a reset token, check your email, then enter it with a new password.",
"net.psn.description" to "Reports a signed-in PSN account to the game without contacting Sony. Some games gate features or trophies behind a PSN session and will not enable them otherwise. This does not connect to real PSN.",
"net.upnp.label" to "UPnP",
"net.upnp.description" to "Asks your router to open ports automatically for peer-to-peer play. Only useful with an online connection, and only if your router allows it.",
"net.dns.label" to "DNS server",
"net.dns.description" to "Which DNS server the emulated PS3 uses. This is what a private or fan-run game server needs: RPCN replaces Sony's PSN, but a publisher's own servers were never PSN, so reaching a revival of one means resolving its addresses somewhere else. Leave at 8.8.8.8 unless a server tells you otherwise.",
"net.swap.label" to "Hostname redirects",
"net.swap.description" to "Send individual addresses somewhere else, as host=1.2.3.4 joined by &&. Finer than changing the DNS server, because it moves one hostname instead of every lookup. Entries that do not parse are ignored.",
"net.ip.label" to "Console IP address",
"net.ip.description" to "The address games are told this console has. 0.0.0.0 lets the emulator work it out, which is almost always right.",
"net.bind.label" to "Bind address",
"net.bind.description" to "Which network interface to use when this device has more than one. 0.0.0.0 means any.",
"net.country.label" to "PSN country",
"net.country.description" to "Two-letter country code reported to PSN and RPCN. A few games change region-specific behaviour based on it.",
"net.mac.label" to "Derive MAC from PSID",
"net.mac.description" to "Generate the console's network address from its ID instead of using a fixed one, so it differs per user. Some online services notice when two consoles share an address.",
"net.clans.label" to "Clans",
"net.clans.description" to "Enable the clan features some online games expose. Needs a working RPCN sign-in.",
"net.address" to "Address",
"rpcn.hosts.title" to "Saved servers",
"rpcn.hosts.description" to "Keep more than one server and switch between them. The official server cannot be removed, so there is always a way back.",
"rpcn.hosts.add" to "Save current",
"rpcn.hosts.name" to "Name for this server",
"rpcn.hosts.remove" to "Remove",
"rpcn.hosts.reset" to "Reset to official",
"rpcn.hosts.added" to "Server saved to the list.",
"rpcn.hosts.removed" to "Server removed.",
"rpcn.hosts.resetDone" to "Back to the official server (np.rpcs3.net).",
"rpcn.hosts.selected" to "Switched server. Test sign-in to check it.",
"rpcn.need.username" to "Enter your username first.",
"rpcn.need.password" to "Enter your password first \u2014 Save clears the box, so type it again.",
"rpcn.need.newPassword" to "Enter the new password you want to set.",
"rpcn.need.email" to "Enter the email address for this account.",
"rpcn.account.saved" to "Account saved:",
"rpcn.account.saved.note" to "It stays saved between restarts. RPCN keeps no permanent session, so games sign in with this account when they go online \u2014 there is nothing to log into again.",
"rpcn.account.connected" to "Signed in as",
"rpcn.ipv6.label" to "Experimental IPv6",
"rpcn.ipv6.description" to "Use IPv6 for RPCN where available. Experimental upstream; leave off unless the server asks for it.",
"adv.section.cpuAccuracy" to "CPU Accuracy",
"adv.section.cpuAccuracy.help" to "How faithfully the PS3's Cell processor is emulated. Looser settings are faster but can corrupt graphics, physics or saves in games that depend on exact behaviour. Change one at a time.",
"adv.xfloat.label" to "SPU Float Accuracy",

Some files were not shown because too many files have changed in this diff Show More