Commit Graph
161 Commits
Author SHA1 Message Date
Henrik Rydgård cae47b3df5 Merge pull request #22246 from hrydgard/more-misc-changes
sceFont: let glyphs draw past bytesPerLine, like the hardware does
2026-09-07 11:21:34 -06:00
Henrik RydgårdandClaude Opus 5 27ca0f80fc sceFont: let glyphs draw past bytesPerLine, like the hardware does
SetFontPixel refused to write any pixel whose x fell outside
bytesPerLine, so a glyph drawn into a buffer with a bytesPerLine
narrower than its rows came out mostly blank. The hardware doesn't
bound it that way - it works out an address and writes, so the rows
overlap and the glyph smears across them. The declared bufWidth and
bufHeight, plus the address check, are what keep it in bounds.

Cache invalidation now covers the wider of bytesPerLine * bufHeight and
where the last row actually ends, since those are no longer the same
thing when the rows overlap.

Fixes font/charglyphimage and font/charglyphimageclip, moved from
tests_next to tests_good. The other font tests are unaffected, so
whatever ails them is something else.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JvJR8oJNSCimCM9KXVLjfq
2026-09-07 09:27:13 -06:00
Henrik RydgårdandClaude Opus 5 b855cec6d4 sceMp3: stop decoding at endPos instead of running off the buffer
A game can notify more data than the file actually had - audio/mp3/stream
asks for 3360 bytes and notifies all of them even when the read came up
short - so the tail of the buffer holds stale bytes from the previous half.
We happily decoded those, six frames past the end of the stream, because the
end flag only suppressed the zero fill and never stopped the decoder.

Check it before decoding too. The post-decode check stays where it was: the
hardware rewinds in the same call that decodes the last frame, so the sum
reads back as zero right after it, which is what audio/mp3/getsumdecoded
records. Moving the whole thing up front breaks that test.

Fixes audio/mp3/stream, added to tests_good - it walks 27 refills end to end,
so it also covers the half-buffer handout.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-07 09:18:02 -06:00
Henrik Rydgård 24e8d931e0 sceMp3: hand out the stream buffer in halves, like the hardware does
The area after the 0x5c0 workarea is double buffered - a half only becomes
writable again once the decoder has consumed past its end, so decoding a
single frame usually frees nothing at all. We instead reported every byte a
decode had just consumed, which made sceMp3CheckStreamDataNeeded() answer
"yes" after every single frame.

Beats sleeps 50ms whenever that call says the file thread is behind, so it
slept once per decoded frame and delivered audio at 46% of realtime - the
badly stuttering custom soundtracks. It now decodes 3-4 frames per 3360 byte
refill, with the write pointer alternating between the two halves exactly as
audio/mp3/stream records from hardware, and keeps up.

AuGetInfoToAddStreamData/AuNotifyAddStreamData now derive the write position
from how much has been added rather than from how much is still buffered,
since the write pointer walks the halves in turn and doesn't follow the
decoder.

Fixes audio/mp3/notifyadd, moved to tests_good, and the "after decode" case
in audio/mp3/checkneeded.

sceMp3: note that the half-buffer split is only verified at 8192 bytes
2026-09-07 09:17:48 -06:00
Henrik RydgårdandClaude Opus 5 124b0a43ae sceMp3: point the game at the end of the buffered data, not the start
sceMp3GetInfoToAddStreamData always handed back the start of the work
area, so the pointer never moved as data was added - the hardware walks
it forward past what's already buffered. AuNotifyAddStreamData now
takes the new bytes from where the game was actually told to write, and
checks that range fits the buffer rather than just comparing the size.

Also compare readPos against endPos as signed. readPos is an int and a
game can notify a negative size, which made it promote to a huge u64
and look like the end of the stream, so we reported nothing left to
write where the hardware still wanted 6721 bytes.

Fixes audio/mp3/infotoadd, moved to tests_good. audio/mp3/notifyadd
gets both of its value differences fixed but still fails: after a
decode the hardware reports no space at all, while we free what the
decode consumed, so we do one round more than it does.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JvJR8oJNSCimCM9KXVLjfq
2026-09-05 13:50:49 -06:00
Henrik RydgårdandClaude Opus 5 0e6614cf19 Report PSP file attributes rather than the host's
DirectoryFileSystem passed the host's permission bits and directory
size straight through to the game. The PSP has neither - its FAT driver
makes a mode up from the entry type and whether it's writable, and
reports no size for a directory. So a game saw 0644/0755 and a 4096
byte directory on Linux, but 0664/0777 and 0 on Windows, where the file
layer already synthesizes those bits.

Now both platforms report what the PSP does: 0777 for directories, 0664
for writable files, 0444 for read-only ones, and no size on a
directory. The parent ".." entry keeps its 4096, which is what the
hardware reports for that one.

Also fixes the synthetic PSP directory entry using 0x777 where 0777 was
meant.

Fixes io/directory/directory, moved to tests_good.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-05 09:58:10 -06:00
Henrik RydgårdandClaude Opus 5 5a84f287c4 sceIoRename: refuse wildcards, an existing destination, and don't wait on XDEV
Three ways our rename differed from the PSP's:

- A wildcard in either path was passed through to the host, so
  renaming "test*.txt" could quietly rename a real file. The PSP
  doesn't expand them here, it rejects them outright.
- Renaming onto a file that already exists succeeded, because the host
  rename() replaces the destination. The PSP refuses, and renaming a
  file onto itself counts as that too.
- Crossing devices returned the right error, but after the same wait
  as everything else. The hardware fails that one immediately.

Fixes io/file/rename, moved to tests_good.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JvJR8oJNSCimCM9KXVLjfq
2026-09-04 18:13:10 -06:00
Henrik RydgårdandClaude Opus 5 d675b467c1 sceUtility: fix the system param string size check and the adhoc channel error
Two things utility/systemparam caught:

A negative size passed to sceUtilityGetSystemParamString went through
Memory::IsValidRange, where it became an enormous range and came back
as a generic -1. The PSP just reports that the string doesn't fit, same
as any other size too small to hold it.

sceUtilityGetSystemParamInt returned 0x800ADF4 for an automatic adhoc
channel unconditionally. The FIXME there wondered whether the hardware
only does that once adhocctl is initialized - it does. Before any adhoc
module is up, which is the state nearly every game asks this in, the
hardware returns 0 and writes the channel out.

Fixes utility/systemparam/systemparam, moved to tests_good.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JvJR8oJNSCimCM9KXVLjfq
2026-09-04 18:12:24 -06:00
Henrik Rydgård ebfd1d755f Bump the tests, fixing the tls test and also the timezone conversion 2026-07-30 01:34:46 +02:00
Henrik Rydgård e9a0e54e92 sceRtc: Deepseek's implementation of parsing various date formats 2026-07-29 23:41:29 +02:00
Henrik Rydgård c8093171a5 Use the new AI workflow to have DeepSeek figure out an ancient problem with mailbox tests 2026-07-29 23:04:44 +02:00
Henrik Rydgård 2b509e4b1e Minor cleanups, revert change in sceKernelMbx 2026-07-29 20:30:17 +02:00
Henrik Rydgård d6b33ba58d test.py comments 2026-07-29 19:49:17 +02:00
Henrik Rydgård a555fe8924 Partially implement sceReg 2025-04-03 14:13:50 +02:00
Henrik Rydgård 249281366e Use the new sceAtrac implementation by default
Inverts/renames the setting to allow going back to the old sceAtrac
implementation, to work around any compatibility issue.

Note that we can never delete the old implementation, old savestates
will still use it - can't convert an existing session.
2025-03-20 23:10:21 +01:00
Henrik Rydgård 4325ec945b Add new sas integration unit test 2025-03-19 12:14:29 +01:00
Henrik Rydgård dc9426facc Enable all the atrac tests for CI, forgot this. 2025-03-18 10:02:36 +01:00
Henrik Rydgård 424741861c Enable the new atrac impl when running tests 2025-03-18 09:36:34 +01:00
Henrik Rydgård b99348383c Some new findings, loop work 2025-03-18 09:36:33 +01:00
Henrik Rydgård 168afab263 Temporarily disable the gpu/vertices/texcoords test that is not quite working 100% on ARM 2024-04-29 11:43:31 +02:00
Unknown W. Brackets f18afc5f51 headless: Update tests. 2022-12-01 01:36:30 -08:00
Unknown W. Brackets f9c6f0a39e headless: Update tests. 2022-10-29 08:53:19 -07:00
Unknown W. Brackets deba3d40bc headless: Update tests. 2022-10-25 22:15:47 -07:00
Henrik Rydgård a13ab3f76b Merge pull request #16274 from unknownbrackets/gpu-boundingbox
Correct accuracy of bounding box test
2022-10-23 12:53:18 +02:00
Unknown W. Brackets 813bfded92 x86jit: Correct vh2f NAN handling (#16275)
* x86jit: Correct vh2f NAN handling.

Allows another test to pass.

* x86jit: Reuse MAccessibleDisp().
2022-10-23 10:09:29 +02:00
Unknown W. Brackets 10531ec9e6 headless: Update tests. 2022-10-22 22:49:41 -07:00
Unknown W. Brackets 01896a8275 headless: Update passing tests. 2022-10-18 21:35:51 -07:00
Unknown W. Brackets 49eb100d1a headless: Update tests. 2022-10-15 12:16:34 -07:00
Unknown W. Brackets 4a64a863e7 headless: Update tests. 2022-10-01 23:51:30 -07:00
Unknown W. Brackets 1dc1b2c35b headless: Use display buf for compare screenshot.
This is what the test actually uses too.
2022-09-20 14:05:50 -07:00
Unknown W. Brackets 7483923d07 softgpu: Correct clear rect off by one issues. 2022-09-20 12:57:05 -07:00
Unknown W. Brackets 67055ff270 headless: Update tests. 2022-09-20 10:49:59 -07:00
Unknown W. Brackets ca248e1201 softgpu: Fix s8 primitives in throughmode.
Also always cull no-position verts, hardware too.  Matches tests.
2022-09-18 07:46:18 -07:00
Unknown W. Brackets c65880fa90 headless: Add some new and passing tests. 2022-09-18 06:40:15 -07:00
Unknown W. Brackets a88c9a0680 softgpu: Remove incorrect offsetting for X/Y. 2022-02-20 09:13:20 -08:00
Unknown W. Brackets 1a787a2bca Headless: Add flag to run failing tests. 2022-01-29 14:07:26 -08:00
Unknown W. Brackets 864d0200fb Mp3: Delay low level init. 2022-01-27 00:24:10 -08:00
Unknown W. Brackets 9e688eaa7c Rtc: Fix day of week stack bounds issue.
Also, add a couple other tests showing as passing now.
2022-01-26 00:43:05 -08:00
Unknown W. Brackets e75d2a097b Savedata: Fix indeterminate timing of field update.
This makes the test pass consistently, instead of depending on thread
timing.
2022-01-26 00:31:30 -08:00
Unknown W. Brackets f1254b1976 Ge: Fix sceGeBreak error case.
Seems to be some compiler optimization.
2022-01-25 19:50:35 -08:00
Unknown W. Brackets e82b54e4b6 softgpu: Cull no-pos and through s8 pos verts.
Seems like these just don't draw anything, ever.
2022-01-25 19:29:11 -08:00
Unknown W. Brackets 61e30e8f8b softgpu: Fix cull in throughmode.
Was only an issue for triangles used to draw rectangles, but caused our
test to fail.

Also move a test that was failing due to an outdated prx to passing.
2022-01-25 19:07:33 -08:00
Unknown W. Brackets 07b67ef572 softgpu: Fix pixel ID for invalid blend factors.
They should still be treated as FIX, we were accidentally using our
special values.
2022-01-24 00:08:33 -08:00
Unknown W. Brackets 6c723c0517 softjit: Fix src blend factor handling.
This was causing us to skip a shift, oops.
2022-01-24 00:05:00 -08:00
Henrik Rydgård eba93f2ee0 Merge pull request #15340 from unknownbrackets/softgpu-textures
Correct UV rotation and through mipmaps, optimize texenv blend a bit
2022-01-24 08:19:34 +01:00
Unknown W. Brackets 818d17183b softgpu: Correct clear mode dither.
It does apply, but have to be careful about alpha.
2022-01-23 12:39:50 -08:00
Unknown W. Brackets 3010cd56d1 softgpu: Correct simple rectangles with mipmaps.
Might be used for fonts, we could potentially check for bias/slope, but
mipmaps are uncommon in direct through draws anyway.
2022-01-23 12:26:58 -08:00
Unknown W. Brackets 0425b8d630 samplerjit: Fix Linux stack corruption.
Oops, nearest was not using the red zone correctly.
2022-01-22 10:47:32 -08:00
Unknown W. Brackets 1cbbd197b2 Headless: Return an exit code on test failure. 2022-01-22 00:14:16 -08:00
Unknown W. Brackets 47a8e5e612 Headless: Update passing tests.
Also make GitHub Actions run only passing.
2022-01-22 00:14:15 -08:00