Commit Graph
50549 Commits
Author SHA1 Message Date
Henrik Rydgård 9d5e39b33c Merge pull request #22997 from hrydgard/content-uri-open-error
Android storage: Don't treat a failed content URI open as a handle
2026-11-08 18:34:30 +01:00
Henrik RydgårdandClaude Opus 5.5 be50e76471 Android storage: Open content URIs through the cached provider client
Like the queries. Opening a file through the content resolver takes and
drops a stable reference to the provider for each call, and is a few ms
slower: opening for a read or an overwrite went from about 25 and 12 ms
to 22 and 10.5 ms in the storage test, on a phone's SD card. If the
provider has died, it falls back to the resolver.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 18:09:21 +01:00
Henrik RydgårdandClaude Opus 5.5 c2612c143b Android storage: CreateDir succeeds when the folder is already there
Creating a taken name on a content URI now fails with ALREADY_EXISTS
(instead of making "name (1)"), so CreateDir failed whenever its
existence check missed the folder, by a race or a failed query. It
promises true for a folder that's already there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 17:09:15 +01:00
Henrik Rydgård 9dc79eb81d Merge pull request #22994 from hrydgard/adhoc-discover
sceNetAdhocDiscover: Run the library's state machine; peers become visible when a PSP's would
2026-11-08 16:49:52 +01:00
Henrik RydgårdandClaude Opus 5.5 1860f9c604 Instance sync: Yield for up to 5 ms before sleeping
A short sleep takes 15.6 ms on Windows by default, and the pair tests
waited in one about every emulated millisecond, so they ran at about
PSP speed there instead of 8x-16x. joinrace, the longest, hit the
120 s wall timeout. On a Mac with the sleep made 15.6 ms long, joinrace
times out the same way, and with this change it takes as long as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 16:23:29 +01:00
Henrik Rydgård 469032de46 Merge pull request #22993 from hrydgard/adhoc-pdprecv-buffer
Ad hoc, Inet, MP3: Take buffers that run past the end of memory
2026-11-08 15:59:32 +01:00
Henrik RydgårdandClaude Opus 5.5 44d21b6975 Android storage: Don't treat a failed content URI open as a handle
Opening a content URI now fails with a StorageError (-2 for a file that
isn't there) rather than always -1, and DirectoryFileHandle::Open only
checked for -1. So opening a missing file on the memory stick succeeded,
with fd -2. Seeking it fails, and on 32-bit ReadEntireFile took that as a
4 GB file and the resize threw, which is how saving new savedata crashed.

ReadEntireFile now also catches a failed seek on 32-bit, where it isn't
negative as an s64, and sizes the vector can't hold.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 15:08:01 +01:00
Henrik RydgårdandClaude Opus 5.5 41a02ffcb3 sceMp3LowLevelDecode: Don't require room for 1152 samples
Since b1ffcde9fc the output buffer had to hold 1152 stereo samples, but
an MPEG-2 or 2.5 frame makes 576, so a buffer near the end of memory
that fits the frame failed. When the buffer can't take the biggest
frame, decode aside and copy only what the frame made.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 14:42:58 +01:00
Henrik RydgårdandClaude Opus 5.5 77fed58257 sceNetAdhocMatching: Don't copy from a missing SendData or SelectTarget buffer
Since 74178a8106 a data or opt buffer that runs past the end of memory
is passed on as NULL, and SendData and SelectTarget then copied dataLen
or optLen bytes from it, crashing the emulator. Return INVALID_ARG, as
CancelTargetWithOpt already does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 14:42:58 +01:00
Henrik RydgårdandClaude Opus 5.5 13cf93c75f sceNetInet: Take receive buffers that run past the end of memory
Recv, Recvfrom and Recvmsg wanted the game's whole buffer length to be
valid memory (5610c9ff9b), checked again on every retry of a blocked
call. That length is only how much the game can take, as with PdpRecv
and PtpRecv, whose buffers a PSP takes past the end of memory
(pspautotests net/adhoc/pdp and ptp). Now only the start has to be
valid, and the host is given no more than fits. Sends still need all of
the data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 14:42:58 +01:00
Henrik RydgårdandClaude Opus 5.5 60d531f9ef sceNetAdhoc: Take a PdpRecv buffer that runs past the end of memory
Since 74178a8106 the PdpRecv syscall wants the game's whole buffer
length to be valid memory. Gods Eater Burst receives into the end of the
scratchpad (0x00013800) with a length of 2049, one byte past it, so every
receive failed with INVALID_ARG and its multiplayer session never got
the other side's datagrams.

A PSP takes such a buffer, and with nothing waiting leaves the length
alone (pspautotests net/adhoc/pdp). Handle it the way 185bbd5b5d does
for PtpRecv: receive no more than fits in memory, and give the game its
length back if the call fails without waiting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 14:42:58 +01:00
Henrik Rydgård fc84ce6555 Merge pull request #22992 from hrydgard/module-start-stop-results
Modules: Match start/stop results, state checks and QueryModuleInfo checks
2026-11-08 14:35:09 +01:00
Henrik Rydgård c04b85d035 Merge pull request #22991 from hrydgard/rtl-text
Lay out right-to-left text consistently across text drawers, fix fa_IR/ar_AE strings
2026-11-08 14:33:53 +01:00
Henrik Rydgård ef02d2f87d Merge pull request #22996 from hrydgard/translation-terminology-revert
Translations: Put back translators' wording in mostly human translations
2026-11-08 14:25:40 +01:00
Henrik RydgårdandClaude Opus 5.5 061549ca12 Translations: Undo mistranslation fixes that were only rewordings
Many of the "mistranslation" fixes replaced a translator's looser but
sensible wording with a more literal one, like zh_CN "Unofficial"
(the heading over unpromoted achievements), which was "custom
achievements". In the files where human translations are the
majority, those go back. Fixes of real errors stay: opposite or wrong
meanings, a different setting or button named, typos, garbled text
and text in another language. So do the resets of gibberish to
English.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 14:20:15 +01:00
Henrik RydgårdandClaude Opus 5.5 f7e87351e2 Translations: Undo the terminology pass in mostly human translations
The "one word for each term" pass replaced translators' own wording
with a uniform term, which made the text less natural. In the files
where human translations outnumber AI ones, the values go back to what
they were, except where the old wording was actually wrong: mostly a
save state called a game save (most of them in zh_TW), plus a few that
named the wrong thing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 14:10:32 +01:00
Henrik RydgårdandClaude Opus 5.5 1439187e54 Offer Arabic and Persian wherever a text drawer can shape them
They were only listed on Windows and Android, from before the Cocoa and
SDL3_ttf drawers existed, so Mac, iOS and Linux didn't have them.

The SDL drawer now takes the paragraph direction from the RTL embedding
TextDrawer adds, and strips the marks before FriBidi sees them. Otherwise
the marks count as a second level, and every Arabic line would go through
FriBidi's reordering and shaping instead of SDL3_ttf's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 14:07:20 +01:00
Henrik RydgårdandClaude Opus 5.5 b90b7b093b adhoc_session.py: until --slack, for screens a pixel off
Hannah Montana's dialog panels land a pixel higher on one run than another,
which a text-only reference can't absorb.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 13:45:13 +01:00
Henrik RydgårdandClaude Opus 5.5 71619e3407 sceNetAdhocDiscover: Wake from the WOL state too
Mode 1 puts adhocctl in the WOL state, which is for consoles in sleep mode
(Dissidia's Card Exchange asks for both to be put to sleep) and only ends with
WOL_INTERRUPT. We have no sleep mode, so it now wakes at once with that event,
as the DISCOVER state does with WOL, and the library goes on to scan and host.
WOL_INTERRUPT also allows RequestSuspend, and no
longer forces the state back to WOL.

Dissidia's Card Exchange now trades Friend Cards between two instances instead
of searching forever.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 13:45:13 +01:00
Henrik RydgårdandClaude Opus 5.5 d3aac5a29c Ad hoc: Show peers in the peer list when a PSP would
- Fixes #14557

A joiner and the host see each other in their peer lists about 1.23 s
after the Join, within a few ms of each other (pspautotests
net/adhoc/pair/timing and net/adhoc/pair/joinrace). The host saw a joiner
as soon as the server told it, half a second before the joiner even
counted as connected, so in Legend of the Dragon, whose Discover host
leaves 70 ms after it sees the other console, the joiner never saw it. A
peer that leaves goes from the list about 11 ms later (vanishtiming).
Only what the game reads (GetPeerList, GetPeerInfo) waits; sends don't.

A Disconnect while another is still on its way is BUSY, with no second
event (net/adhoc/pair/joinrace).

Legend of the Dragon itself only pairs two consoles whose MAC addresses'
CRC32s, as signed numbers, are less than 2^31 apart (3 pairs in 4);
otherwise both host. Headless instances 1 and 3 are such a pair, 1 and 2
aren't.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 13:45:13 +01:00
Henrik RydgårdandClaude Opus 5.5 f9d878c128 sceNetAdhocDiscover: Run the library's state machine
Discover takes turns at scanning for the game's group (joining the lowest
BSSID) and creating it, for random lengths of time, until a peer is in the
group or the timeout passes, through our adhocctl like the firmware module
does. A console in mode 0 sleeps in the DISCOVER state until another is
near; we have no way to tell, so it wakes at once, which a PSP alone
doesn't (net/adhoc/discover moves to the expected failures). The result
codes were swapped: 0 is found, 2 timed out (net/adhoc/pair/discover).

The firmware module can be run instead with DisableHLEFlags
sceNetAdhocDiscover, for comparing: that needs the kernel adhocctl
functions it imports and ifhandle's allocator. Its sceNetRand import (in
sceNet_lib) stays unimplemented, which only changes when it flips between
scanning and hosting. It prints the same as the HLE in net/adhoc/discover.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 13:45:13 +01:00
Henrik RydgårdandClaude Opus 5.5 d09368e1cf Modules: Match start/stop results, state checks and QueryModuleInfo checks
All from modules/startresult and modules/queryinfo:

- A nonzero module_start result deletes the module. sceKernelStartModule
  returns 0 for 1 (no resident) and the value itself otherwise.
- A nonzero module_stop result leaves the module started, and
  sceKernelStopModule returns CAN_NOT_STOP for 1 and the value otherwise.
- Only a never-started module can be started (ERROR otherwise). Stopping one
  that was never started gives NOT_STARTED, and unloading a started module
  gives NOT_REMOVABLE.
- sceKernelQueryModuleInfo checks the pointer before the id, and with an SDK
  version past 2.07 accepts only info sizes 0x40 and 0x60.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 13:17:35 +01:00
Henrik RydgårdandClaude Opus 5.5 8c5e6cbd42 Threads: A negative return from a thread gives exit status ILLEGAL_ARGUMENT
Returning from the thread entry with a negative value now gives the same exit
status as passing it to sceKernelExitThread, 0x800200D2 (threads/returnstatus).
That's also what sceKernelWaitThreadEnd returns, and what a module_start or
module_stop that returns a negative value hands back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 13:17:35 +01:00
Henrik RydgårdandClaude Opus 5.5 036c609c40 fa_IR, ar_AE: Store strings in logical order, without the LRM marks
Most values started with a left-to-right mark, which forced a left-to-
right layout, and many had their Latin words and punctuation moved by
hand to look right that way. Now that RTL text is laid out right to
left everywhere, those strings came out scrambled.

The hand-ordered ones are converted to logical order, checked to look
exactly as before. Lines that were already in logical order with a
stray mark in front just lose the mark, which also fixes how they
looked until now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:11:15 +01:00
Henrik RydgårdandClaude Opus 5.5 ffe3d7bee5 TextDrawer: Lay out right-to-left text the same way on every backend
GDI and DirectWrite started every line left to right, while the SDL,
Cocoa and Android drawers took the direction from the first strong
character. So a Hebrew line mixing in Latin words came out in the wrong
order on Windows, and on the others when it started with "PPSSPP".

When the UI language is right to left, each line containing RTL text now
goes to the backend inside an explicit RTL embedding (RLE ... PDF),
which all of them honor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:11:15 +01:00
Henrik Rydgård fc11ace620 Merge pull request #22990 from hrydgard/translation-fixes
Translations: Fix mistakes and unify terminology across languages
2026-11-08 12:10:41 +01:00
Henrik Rydgård 601b545e37 Merge pull request #22989 from hrydgard/startmodule-no-entry-status
Modules: Write 0 to the status when starting a module with no entry
2026-11-08 12:07:56 +01:00
Henrik Rydgård 08af3d1351 Merge pull request #22987 from hrydgard/firmware-screen-and-remaster-fonts
Firmware screen fix, MH3rd HD remaster fonts, touch layout reset confirmation
2026-11-08 11:48:47 +01:00
Henrik RydgårdandClaude Opus 5.5 57b870cf43 Modules: Write 0 to the status when starting a module with no entry
sceKernelStartModule left the status word untouched for a module without
module_start, so the caller read whatever was on its stack. The PSP writes 0
there (modules/nostart).

R-Type Tactics loads the libfont.prx on its disc after its LoadExec and gives
up on its fonts when that status is negative (0xDEADBEEF from the stack fill),
then crashes writing through a pointer it never set. This only showed once
the disc's libfont became the default over our HLE sceFont.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:41:08 +01:00
Henrik RydgårdandClaude Opus 5.5 9dced61def Translations: Use one word for each term within a language
Recurring terms (save state, savedata, cheats, relay, rendering,
upscaling, Memory Stick, default, analog stick and so on) were
translated several ways within one file. Each file now uses the form it
already used most, or the standard term where a minority form was the
correct one. Save states and the game's own savedata are kept apart,
most visibly in zh_TW, which used one word for both. zh_TW also gets
Taiwan terms where it had mainland ones, and the same English string in
two sections now reads the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 10:45:30 +01:00
Henrik RydgårdandClaude Opus 5.5 659f84169f Translations: Put back resets that weren't clearly wrong
The previous two commits reset some values to English that were usable:
ku_SO's sensible Kurmanji strings (wrong dialect and script for the
file, but readable), Indonesian text in jv_ID, and values where only a
word or a stale suffix was off. Those are back, with the broken part
fixed where there was one. Values that were gibberish or said something
else stay in English.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 10:33:14 +01:00
Henrik RydgårdandClaude Opus 5.5 476707cd6d Translations: Fix mistranslations and typos
Values that said something other than the English: opposite meanings
(Move Up/Down swapped, Disabled as "Enable", a lossless codec as lossy,
"(slower)" as "low latency"), the wrong sense of a word ("Recent" as
current, backend as background, Resume as summarize, Cancel as Ignore),
messages naming the wrong setting or fallback backend, swapped and
duplicated strings, and text in the wrong language (Brazilian forms in
pt_PT, Latvian in lt-LT, Hungarian in hr_HR, Tajik in tg_PH). Also a
batch of spelling mistakes.

Gibberish values that couldn't be translated with confidence, most of
them in ku_SO, lo_LA, km_KH and jv_ID, are back to the English string.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 10:14:14 +01:00
Henrik RydgårdandClaude Opus 5.5 131521f79e Translations: Update strings whose English changed after translation
- InsufficientOpenGLDriver: now a Yes/No question about switching to
  DirectX, but many languages still had the old "update your drivers"
  text, which asks nothing.
- BufferedRenderingRequired still pointed at the removed rendering mode
  setting, and "Skip buffer effects" kept the old "(non-buffered,
  faster)" suffix.
- "Save frame dump" was still "Dump next frame to log", and Software
  rendering was still "(experimental)".
- "Completed %1" (softcore) had the same text as "Mastered %1"
  (hardcore) in many languages.
- The generic restart prompt named one particular setting in three
  languages.

Languages I can't translate confidently go back to the English string.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 10:03:33 +01:00
Henrik RydgårdandClaude Opus 5.5 b981160b50 he_IL: Store the last reversed strings in logical order
The PSP dialog buttons and messages, the credits and the confirm button
setting were still stored reversed, or with their words reordered, for
text drawing without bidi support. All text drawers handle bidi now, so
they showed backwards. The two-line "Please wait" messages also get back
their line break.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 09:59:33 +01:00
Henrik RydgårdandClaude Opus 5.5 192454a979 Translations: Fix broken lines, escapes and stray accelerators
Outside [DesktopUI] an & is shown as is, so accelerators copied into
labels like "Pause when not focused" appeared on screen. Also fixes
mangled \n escapes, menu accelerators placed on a space or doubled,
lines without an = (never loaded) and a doubled "Warning:" prefix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 09:57:36 +01:00
Henrik RydgårdandClaude Opus 5.5 0c48c35e5b Translate the touch control layout reset confirmation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 09:54:58 +01:00
Henrik Rydgård 8664e74bdb Merge pull request #22984 from hrydgard/replacement-cleanup
Replacement cleanup
2026-11-08 09:45:18 +01:00
Henrik Rydgård bfd58279e2 Merge pull request #22983 from hrydgard/umd-swap-and-audio-stream
UMD swap: Own the loader ResolveFileLoaderTarget returns
2026-11-08 09:16:29 +01:00
Henrik RydgårdandClaude Opus 5.5 c3db109525 Touch control layout: Confirm before resetting
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 09:08:48 +01:00
Nemoumbra a87904a842 Rename one more location 2026-11-07 19:29:17 +03:00
Nemoumbra ba4c9ada3d Better func replacement comments 2026-11-07 18:59:54 +03:00
Nemoumbra e63d608cb0 More replacement-related renames 2026-11-07 18:37:03 +03:00
Henrik RydgårdandClaude Opus 5.5 c7c5fc0ac6 sceFont: Use the HLE and our own fonts for the Monster Hunter 3rd HD remaster
- Fixes #22982

This remaster only ever ran in the PS3's emulator, and its unofficial
Simplified Chinese translation renders no Chinese text with the
firmware's sceFont and fonts, which we now use whenever a firmware is
installed. Its entry in the HD remaster table now says so: sceFont stays
HLE'd whatever the settings and compat flags say, and the HLE sceFont
loads our fonts rather than the NAND's (and doesn't install any from the
disc's updater).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 16:21:04 +01:00
Henrik RydgårdandClaude Opus 5.5 cb0e01d647 Firmware screen: Always show the install-from-game-discs option
It came after the early return for an empty NAND, so it was hidden exactly
when it matters most, before any firmware is installed. It now sits under
the description, which is there in every state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 16:21:02 +01:00
Nemoumbra 7ab6f32052 Rename REPFLAG_HOOKENTER to REPFLAG_HOOK 2026-11-07 18:01:45 +03:00
Henrik RydgårdandClaude Opus 5.5 6cee44702e UMD swap: Delete the old disc's loader only once the new one is mounted
UmdMount deleted the old loader as soon as the new file was resolved, but
the old disc's file systems stayed mounted until MountGameISO replaced
them. A swap that then failed (an unsupported file, or an ISO
ConstructBlockDevice rejects) left the game reading its old disc through
a deleted loader, and even a successful swap could free it under a read
still going on the IO thread. Now the new disc is mounted first, which
takes pspFileSystem's lock that reads hold, and a failed swap deletes the
new loader and leaves the old disc alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 15:59:42 +01:00
Henrik RydgårdandClaude Opus 5.5 17659b03c2 UMD swap: Own the loader ResolveFileLoaderTarget returns
UmdMount gave g_loadedFile the new loader before ResolveFileLoaderTarget,
which deletes it and returns another for a PBP directory or a PS1 disc
image, and wraps it in a ZipFileLoader that owns it for a zip. After that,
the next swap deleted the dangling loader again (a Play crash report shows
it in UpdateLoadedFile), and for a zip the wrapper that was mounted had no
owner. Reproduced in headless with game.umd.insert: inserting a directory
with an EBOOT.PBP, then a disc image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 15:33:42 +01:00
Henrik Rydgård 9f286ee4ca Merge pull request #22980 from hrydgard/ios-work
iOS: Metal only (drop MoltenVK), and full debug symbols in archives
2026-11-07 14:16:37 +01:00
Henrik RydgårdandClaude Opus 5.5 5cb78a99b7 iOS: Remove copysym.sh
The archive gets the dSYM by itself now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 13:56:09 +01:00
Henrik RydgårdandClaude Opus 5.5 488270d275 iOS: Don't strip the static libraries when archiving
Archiving stripped their debug info before the app linked them, so the
dSYM only covered the app target's own files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 13:43:21 +01:00