Commit Graph
50087 Commits
Author SHA1 Message Date
Henrik Rydgård f9baffccb6 Setting reorganization, some changed strings, soft drop shadows for text on game screen 2026-10-31 01:22:27 +01:00
Henrik Rydgård d5acc2bde1 Fix an old Android Studio annoyance 2026-10-31 00:36:07 +01:00
Henrik Rydgård 698ff5b01a Gradle bump 2026-10-31 00:35:30 +01:00
Henrik Rydgård 67763e48a1 Add an "info textview" with a border. 2026-10-31 00:27:10 +01:00
Henrik RydgårdandClaude Opus 5.5 3ddea502dc Improve the Turkish and Traditional Chinese speed hacks link text
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 21:50:08 +01:00
Henrik RydgårdandClaude Opus 5.5 75e37ba5fe Translate the speed hacks hint and description
Also drops the warning from the translated link texts, now that the hint
under the link says it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 21:50:08 +01:00
Henrik RydgårdandClaude Opus 5.5 0e21ef5ff9 Settings: Explain the speed hacks on their page instead of in the link
The link is now just "Speed hacks", with a hint under it saying they can
cause rendering errors, and the page starts with a longer explanation.
Adds SettingsPage::Description() for text between the groups.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 21:50:08 +01:00
Henrik RydgårdandClaude Opus 5.5 9e4a16913a Translate the restore defaults button and prompt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 21:50:08 +01:00
Henrik RydgårdandClaude Opus 5.5 746e53d238 Settings: Let the restore defaults button go anywhere on the page
It now collects the page's settings when its view is created, so it can be
put first. Moved it to the top of Speed Hacks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 21:50:08 +01:00
Henrik RydgårdandClaude Opus 5.5 ac5f0310ce Settings: Add a "Restore defaults" button for a page, use it on Speed Hacks
SettingsPage::RestoreDefaults() adds a button that, after asking, puts the
config settings added to the page before it back to their defaults, running
the config's OnChanged reactions. Config::RestoreSettingToDefault() does the
work for a single setting, including those in blocks that reset as a whole.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 21:50:08 +01:00
Henrik Rydgård 678de71c12 Reorder things 2026-10-30 21:50:08 +01:00
Henrik Rydgård 6099025fc1 Replace "UI" with "User interface" in the UI 2026-10-30 21:50:08 +01:00
Henrik Rydgård 6b9830a030 Merge pull request #22855 from hrydgard/adhoc-transport
Adhoc: Put the relay and P2P transports behind an interface, in their own files
2026-10-30 21:19:14 +01:00
Henrik RydgårdandClaude Opus 5.5 969bc4a1be sceNetAdhoc: Drop PtpOpen's unused isClient
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 20:22:08 +01:00
Henrik RydgårdandClaude Opus 5.5 0e954b17cb adhoc_session.py: A reference image's alpha channel masks what until compares
For text over a moving background: only the opaque pixels count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 19:09:35 +01:00
Henrik RydgårdandClaude Opus 5.5 958d76ea77 sceNetAdhoc: Move the two transports into their own files
RelayTransport, with the aemu_postoffice helpers only it uses, goes to
AdhocTransportRelay.cpp, and P2PTransport to AdhocTransportP2P.cpp. The
helpers they share with sceNetAdhoc.cpp are declared in
AdhocTransport.h. Moved as they were.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 19:09:35 +01:00
Henrik RydgårdandClaude Opus 5.5 b5db43ca9d sceNetAdhoc: Put PTP, polling and socket cleanup behind AdhocTransport
The relay and P2P halves of PtpOpen, PtpListen, PtpClose, PtpSend,
PtpRecv, PtpAccept and their blocking retries, GetPtpStat, PtpFlush,
PollSocket and deleting all sockets move into RelayTransport and
P2PTransport. Connecting stays shared, with the transports answering
the steps that differ (start, check on, confirm, still pending).

No change in behaviour, except that a relay poll asks the postoffice
whether a socket is readable once instead of twice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 19:09:35 +01:00
Henrik RydgårdandClaude Opus 5.5 7202562695 sceNetAdhoc: Put PDP behind an AdhocTransport interface
The relay and P2P halves of PdpCreate, PdpDelete, PdpSend, PdpRecv, the
blocking PDP receive, GetPdpStat and game mode's readiness checks move into
RelayTransport and P2PTransport, which Transport() picks between by
serverHasRelay. No change in behaviour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 19:09:35 +01:00
Henrik Rydgård 36b6db5458 Merge pull request #22851 from hrydgard/adhoc-9-fixes
Ad hoc 9/9: Fixes from playing games, and 8x faster ad hoc tests
2026-10-30 13:09:06 +01:00
Henrik Rydgård e3a25dccdf Merge pull request #22854 from hrydgard/ui-io-off-thread
UI: Move file I/O off the render thread in a few screens
2026-10-30 13:08:45 +01:00
Henrik RydgårdandClaude Opus 5.5 181c90f758 pspautotests: matchingjoin no longer counts the host's hellos
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 12:26:52 +01:00
Henrik RydgårdandClaude Opus 5.5 c1058fd589 sceNetAdhoc: Disconnect is BUSY until a Create or Connect has connected
As on a PSP (pspautotests net/adhoc/abandon): the Disconnect fails and
the join goes on to CONNECT. Before, it was accepted, and the join's late
answer from the server could still connect us afterwards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 12:04:33 +01:00
Henrik RydgårdandClaude Opus 5.5 f6f9a00eb7 UI: Move file I/O off the render thread in a few screens
On Android the render thread runs the UI, and surfaceDestroyed waits for
it, so slow storage (SAF especially) there stutters and can become an ANR.

- Store: only check whether the game is installed when an install or
  uninstall finishes, not every frame.
- Savedata: read the modification time with SIZE on the GameInfo worker.
  The popup asked for it every frame, and each button on first draw.
- FirmwareScreen: scan the NAND, and erase it, on a worker thread. It
  rescanned on every RecreateViews, which is after every popup.
- GameScreen: look up the installed update, plugins and what the firmware
  can play on a worker thread. They ran on every RecreateViews, which
  happens as each piece of game info arrives.
- LaunchFile: wait only for the file type, and for PARAM.SFO just in the
  cases that use it.

Also add --start-screen=firmware.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-30 12:01:36 +01:00
Henrik Rydgård 61865a5c89 Merge pull request #22853 from hrydgard/windows-misc-fixes
Windows: Fix D3D11 init error handling, delete old build scripts
2026-10-30 11:56:29 +01:00
Henrik RydgårdandClaude Opus 5.5 d12e19ed35 test.py: Keep the ad hoc tests' ports below Linux's ephemeral ports
With offsets of up to 30000, a port net/adhoc/limits listened on could
be one an outgoing connection was using, and the listen failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 11:53:44 +01:00
Henrik RydgårdandClaude Opus 5.5 a0669ffbe4 sceNetAdhoc: Don't let an abandoned group join put us in the group
When the game gives up on a join (game mode timed out, or it
disconnected), a join still queued isn't sent anymore, and the rest of
the server's answer to one already sent is dropped: its players, and the
BSSID that came last and connected us. Players joining a group we've
just left (before the server knew) are dropped too, instead of staying
in our peer list.

Replaces the previous fix, which only dropped a late BSSID: on Windows
the join itself was still queued when game mode timed out in
net/adhoc/gamemode, and went out after it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 11:53:44 +01:00
Henrik Rydgård 56c84bb5c0 Merge pull request #22852 from hrydgard/ci-armhf-qemu
CI: Test ARM32 under qemu, and fix the MD5/SHA-1 bus error it found
2026-10-30 11:25:15 +01:00
Henrik RydgårdandClaude Opus 5.5 9d8ef5e8f5 sceNetAdhoc: Ignore the server's answer to a timed-out game mode join
When entering game mode timed out before the server's group BSSID came
back, the late BSSID was taken for a normal group's, and the state went
to CONNECTED: every later CreateEnterGameMode then got ALREADY_CONNECTED.
At the ad hoc tests' 8x speed the 1 s timeouts in net/adhoc/gamemode are
125 ms of wall time, short enough for that on Windows; at 50x it happens
on macOS too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 11:21:57 +01:00
Henrik RydgårdandClaude Opus 5.5 1310070e5a Windows: Fix D3D11 init error handling, delete old build scripts
- Fixes #22842

D3D11 init only took the failure path on E_FAIL, so any other failed
HRESULT from D3D11CreateDevice reported success without a device. Also
stop the generic message overwriting the more specific ones.

The build-x86/x64.cmd scripts targeted VS2015, checked misspelled
variables so never caught a failed build, and nothing uses them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 11:17:06 +01:00
Henrik Rydgård 7705639152 Merge pull request #22849 from hrydgard/adhoc-8-tools
Ad hoc 8/9: Tools for testing multiplayer with several instances
2026-10-30 10:43:49 +01:00
Henrik Rydgård 6598087eb4 Merge pull request #22850 from hrydgard/adhoc-packet-decrypt
Tools: scripts to decrypt and decode captured real-PSP ad hoc traffic
2026-10-30 10:43:20 +01:00
Henrik RydgårdandClaude Opus 4.8 b7852eace2 Tools: adhoc_decrypt.py / adhoc_recover.c for debugging real-PSP ad hoc captures
A real PSP encrypts its ad hoc link, so a sniffed capture of two consoles is
ciphertext. These decrypt and decode it (PDP/PTP/matching framing), to compare
what a game does on hardware against what PPSSPP sends at the sceNetAdhoc HLE
level - a debugging aid for hardware-vs-emulator divergence. Not needed to run
multiplayer (PPSSPP works at HLE and never encrypts) and unrelated to cross-play
(the link is console-authenticated).

The session key is ephemeral and not in the capture, but the data cipher has a
known-plaintext weakness, so a capture with some guessable plaintext is enough
to recover it - no console memory needed, and not a break of the key exchange.
The two fixed KIRK keys used already ship in ext/libkirk. docs/adhoc-packet-
decryption.md covers capturing, decrypting and recovery.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-30 10:24:15 +01:00
Henrik RydgårdandClaude Opus 5.5 043875a607 pspautotests: matching2 and matchingorder no longer depend on timing
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:15:35 +01:00
Henrik RydgårdandClaude Opus 5.5 c52f8c9657 Headless: --speed and --port-offset, and run the ad hoc tests at 8x
--speed=PERCENT runs a --realtime headless at an alternate speed (speed
control while connected is allowed for it), and pacing follows it. The
ad hoc tests now run at 800%, which takes their part of test.py -g from
about 71 s to 12 s; only local network round trips stay real time.

test.py also gives each ad hoc test run its own --port-offset: a
connection the previous run made with the same ports is still in TCP
TIME_WAIT, and connecting again failed with EADDRINUSE once runs came
close together.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:15:35 +01:00
Henrik RydgårdandClaude Opus 5.5 e7548e1bea sceNetAdhoc: Measure socket and game mode timeouts in emulated time
The timeouts of blocking socket calls and of entering game mode are the
PSP's, but they were measured on the wall clock, so they came out
shorter in PSP time whenever emulation ran fast or slow. The wait for
the ad hoc server, which is a host-side round trip, stays on the wall
clock.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:15:35 +01:00
Henrik RydgårdandClaude Opus 5.5 b707ff4306 test.py: Update the reasons for poll and ptp
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:15:35 +01:00
Henrik RydgårdandClaude Opus 5.5 eb254d86e8 sceNetAdhoc: Don't take a refused PTP connect for an established one
On macOS, calling connect() again on a socket whose non-blocking
connect was refused returns EISCONN; only SO_ERROR and a failing
getpeername tell it apart from a connection. PtpConnect took EISCONN at
its word, so in P2P mode a connect to a port nobody listened on
"succeeded", and the game sent into nothing. Check getpeername first
and use SO_ERROR when it fails.

PollSocket also reports a refused connect as DISCONNECT now, as a PSP
does (net/adhoc/poll), instead of only ever noticing success.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:15:35 +01:00
Henrik RydgårdandClaude Opus 5.5 c67315779b sceNetAdhocctlInit: Log loudly when called twice
A PSP is left uninitialized by it (net/adhoc/adhocctl); not emulated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:15:35 +01:00
Henrik RydgårdandClaude Opus 5.5 8912d956ff test.py: Run the passing single-console ad hoc tests with the good ones
alerts, discover, gamemode, limits, loopback, self, socketids and term
pass, so they move to tests_good. They run in real time against the
built-in server, about 71 s together. The ad hoc tests left in
tests_next say why they don't pass yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:15:35 +01:00
Henrik RydgårdandClaude Opus 5.5 603a63bc09 sceNetAdhocMatching: Report the pool as empty right after Init
A PSP reports the pool size less 0x20 and a maximum of 0 until anything
is allocated (net/adhoc/matching, recorded on a PSP). With a context the
faked half-pool maximum stays, since that isn't measured.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:15:35 +01:00
Henrik RydgårdandClaude Opus 5.5 34a6ace9ae sceNetAdhoc: Don't write the local MAC into the game's address argument
PdpCreate, PtpOpen and PtpListen use the local MAC whatever the game
passes (a stale MAC from an old savestate would otherwise break them),
but they did it by overwriting the game's copy. A game that passes
someone else's MAC from a table then has its own MAC in that table.
pspautotests net/adhoc/pdp passes its "other" MAC to PdpCreate and later
sends to it; every one of those sends came back to itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:15:35 +01:00
Henrik RydgårdandClaude Opus 5.5 6b14884e26 sceNetAdhoc: sceNetAdhocTerm leaves adhocctl and the group alone
A PSP stays in its group through sceNetAdhocTerm and sceNetAdhocInit,
and matching keeps working; only the sockets go, and calls on them
return NOT_INITIALIZED until the next init (net/adhoc/term, recorded on
a PSP). We also terminated adhocctl, so a game that restarts the adhoc
library inside a group found itself disconnected. Every other caller
already terminates adhocctl itself first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:15:35 +01:00
Henrik RydgårdandClaude Opus 5.5 a8a63fa11d sceNetAdhoc: Start socket IDs over at 1 after sceNetAdhocTerm
A PSP hands out socket IDs from 1 again after sceNetAdhocTerm and
sceNetAdhocInit (net/adhoc/socketids, recorded on a PSP). We kept
counting up. Pangya: Fantasy Golf tears down the network between its
room and the round, and then keeps using socket 1 without looking at
what PdpCreate returned, so every send and receive failed with
INVALID_SOCKET_ID and each player saw the other as "Off-line".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:15:35 +01:00
Henrik RydgårdandClaude Opus 5.5 d0d6f0f61b sceNetAdhocMatching: A child lists its parent first after a keepalive
- Fixes #22331

A child's GetMembers starts with itself, then switches to the parent
first one keepalive interval after it was accepted
(net/adhoc/pair/matchingorder, recorded on two PSPs). We kept it self
first. Bomberman's client checks that the first member is the host
before it marks itself ready, so its lobby stayed empty and the host's
start failed with "failed to connect to the game".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:15:14 +01:00
Henrik RydgårdandClaude Opus 5.5 0d686c1a95 sceNetAdhocGameMode: Send the master every period, changed or not
A PSP sends its master every 12 ms after the initial sync, and a peer's
replica reports each one as an update. PPSSPP only sent a master that
had changed, so a replica polled until updated waited for the next
change. Also take every packet waiting each period, not one: every
member sends each period. Measured in pspautotests
net/adhoc/pair/gamemodesync.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:15:14 +01:00
Henrik RydgårdandClaude Opus 5.5 478d10ff19 sceNetAdhoc: A PTP connection only gives up with data outstanding
When the peer has left, a PSP drops the connection once data sent to it
has gone unacknowledged for (rexmt_cnt + 1) * rexmt_int. A connection
that only receives never fails. Count from the first data the peer
couldn't acknowledge: sent after it left, or within 10 ms before
(pspautotests net/adhoc/pair/vanishtiming).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:15:14 +01:00
Henrik RydgårdandClaude Opus 5.5 8bb1f8462f sceNetAdhoc: A PTP connection is established as soon as it's up
GetPtpStat only looked at a connection in progress 33 ms after the last
connect attempt, and PollSocket reported CONNECT 1 ms after it whether
the connection was up or not. On a PSP both show it the moment it's up,
about 5 ms after the connect (pspautotests net/adhoc/pair/ptpconnect).
The old timings were tuned for GvG Next Plus, Bleach and Fate; Fate's
network match still works.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:15:14 +01:00
Henrik RydgårdandClaude Opus 5.5 3c9c01048a sceNetAdhocctl: Time GAMEMODE and leaving game mode as a PSP does
GAMEMODE comes 4.38 s after CreateEnterGameMode, or 1.35 s after
JoinEnterGameMode or the last member's arrival, whichever is later,
instead of a fixed 2 s after the last member (plus 60 ms for a member,
a workaround for Pocket Pool). DISCONNECT comes 650 ms after
ExitGameMode. Measured in pspautotests net/adhoc/pair/gamemodetiming.

A member that joins early still gets GAMEMODE before the host: it
doesn't know when the host entered game mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:15:14 +01:00
Henrik RydgårdandClaude Opus 5.5 882eee4c13 sceNetAdhocMatching: A denied P2P request goes back to a known peer
CancelTarget on an incoming P2P request marked the peer timed out. It
only escaped a TIMEOUT if one of its hellos came in before the next
timeout check, which it no longer does now that timeouts are checked
all the time. On a PSP it's a peer known from its hellos again, with no
TIMEOUT (pspautotests net/adhoc/pair/matching3).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:15:14 +01:00
Henrik RydgårdandClaude Opus 5.5 08c76b8b25 sceNetAdhocGameMode: Create master and replicas as a PSP does
pspautotests net/adhoc/pair/gamemode:
- CreateMaster with size 0 fails with INVALID_DATALEN.
- CreateReplica for a MAC that isn't in the game mode group fails with
  0x80410D13. PPSSPP made one, and then blocked the thread forever
  waiting to sync with it.
- CreateReplica for the same MAC again gives ALREADY_CREATED. The check
  compared the pointer instead of the MAC, so it never matched.
- A replica's ID is the member's place in the member list, host first:
  the client's replica of the host is 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:15:14 +01:00