Since the native EGL path, the Android context stays current on the
render thread until the render manager and the draw context are gone, and
it's destroyed with every surface. So the GL calls skip mode avoided
after the emu thread exits (Android was the only platform that set it)
can just run, and nothing it would have leaked outlives the context.
It was also a trap: a shader created while it was on was never compiled,
but not marked failed either, so a program linked from it later failed
with "missing shader". Reports of that stopped with 3cb6ada66a, which
already took most of its uses away.
ThreadEnd still frees the steps that never got submitted without running
them, now called a dry run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With a display resolution set (iAndroidHwScale), the surface has a fixed
size, and a rotation doesn't change it, so no surfaceChanged came to
re-fix it there. Landscape kept rendering into the portrait-sized buffer.
A layout listener on the SurfaceView now re-measures and re-fixes it,
which brings a surfaceChanged with the new size.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pixel_in_dps_y is the inverse of a pixel's height in UI coordinates, so use the ratio of the resolutions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Smooth R, G, B and gray ramps, gray steps over the whole range and near
black and white, color bars, two hue wheels (fading to white and to
black), and 1-pixel black and white lines around 128 and 188 patches,
showing whether a resampled image is averaged in linear light or encoded.
The header names the backend and whether VR is on, for comparing outputs.
Also --start-screen=colortest.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
UIContext's destructor now copes with a context that was never given a
draw context, so a test can measure views with one.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
FlowLayout lays out its children left to right at their natural size and
starts a new row when the next one doesn't fit, instead of squeezing
them. Weighted children fill what's left of their row. Like LinearLayout,
it has SetPadding for space inside its edges.
On narrow screens the toolbar buttons used to run off the edge; now they
wrap onto a second row.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
After measuring the weighted children, the measured size could grow beyond
the AT_MOST size the parent allowed.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
At shutdown the kernel objects are cleared before the net module stops
its Apctl thread, so this fired from nearly every game that used it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From going through what report.ppsspp.org still gets from v1.20.4 and
later. The logging stays:
- Module load options: invalid positions are rejected (and reported)
before this, the rest is handled.
- Savedata versions 1-3 are normal, only higher ones are rejected.
- sceNetAdhocMatchingInit, sceIoAssign and the screenshot dialog's init:
every call was reported.
- sceKernelStopUnloadSelfModuleWithStatus is implemented, like the
version without status, which already wasn't reported.
- Thread attributes we ignore, morph and spline vertex types, BREAK, and
the POPS emulator invalidating code near the PC.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>