Commit Graph
4503 Commits
Author SHA1 Message Date
Henrique Reis Neves ab94de0eb6 kernel: return ENOENT from unlink when the file does not exist (#5393)
posix_unlink never checked that the path exists. For a missing file it
opened the host path, the open failed, IOFile::Unlink returned early
because the file was not open, and the call still returned 0. On the
console unlink(2) fails with ENOENT, so sceKernelUnlink should return
0x80020002. Check the path with MntPoints::Exists first, as
posix_truncate already does.

Also check for a null path before calling strlen on it, and report
EFAULT like the other path functions in this file instead of crashing.
2026-10-20 04:52:06 -07:00
Henrique Reis Neves 36f836f16d kernel: return EINVAL from ftruncate for bad lengths and read-only fds (#5401)
posix_ftruncate returned 0 for a negative length and for a descriptor
opened with O_RDONLY, because the result of SetSize was ignored, and it
returned EROFS for a directory. On the console ftruncate(2) fails with
EINVAL when the length is negative (checked before the descriptor) and
when the descriptor is not open for writing, which includes directories,
so sceKernelFtruncate should return 0x80020016 in those cases.

Check the length first like posix_truncate does, return EINVAL for
directories and read-only handles, and report EIO when SetSize fails.
2026-10-20 04:51:16 -07:00
Henrique Reis Neves 8b5ed6d09d kernel: return EBADF when writing to a file opened read-only (#5400)
write, writev and pwritev on a file opened with O_RDONLY returned -1
from HostFile::Write without setting errno, so callers saw a stale errno
and sceKernelWrite returned 0x80020000 (or whatever was left in errno).
writev and pwritev also added the -1 of every buffer to the total. On
the console write(2) fails with EBADF when the descriptor is not open for
writing, so sceKernelWrite should return 0x80020009.

Add File::IsReadOnly next to IsWriteOnly and check it the same way read,
readv and preadv already check IsWriteOnly.
2026-10-20 04:51:04 -07:00
Henrique Reis Neves d415c71bfe kernel: return ENOENT from mkdir when the parent does not exist (#5399)
posix_mkdir used fs::create_directories, so mkdir("/data/a/b") with no
/data/a returned 0 and created both directories. On the console mkdir(2)
only creates the last component and fails with ENOENT when the parent is
missing, so sceKernelMkdir should return 0x80020002. Use
fs::create_directory and report ENOENT in that case.

Also check for a null path before logging it and calling strlen on it,
and report EFAULT like posix_rmdir does, instead of crashing.
2026-10-20 04:50:46 -07:00
artemkaVG 6752d8b19e shader_recompiler: Handle buffer cache invalidation instructions (#5447)
Correct the operand-free metadata for BUFFER_WBINVL1 and
BUFFER_WBINVL1_SC and lower both to the existing device memory barrier.
2026-10-20 04:46:51 -07:00
Valdis Bogdāns f9d07487dd Fix global CE task scheduling (#5446)
Added:
- Global FIFO for CE tasks across graphics submissions.

Updated:
- CE/DE waits to yield through the scheduler.
- CE counter lifetime and GPU-idle tracking.
- Cleanup of pending and nested tasks during shutdown.

Removed:
- CE task ownership and counter resets tied to individual DCBs.

@raphaelthegreat requested global CE task ownership and a separate
change shared by the Horizon fixes.
2026-10-20 04:28:47 -07:00
BeneausVillach 699009c949 texture_cache: don't copy stale CPU-dirty image contents in ExpandImage (#5444)
* texture_cache: don't copy stale CPU-dirty image contents in ExpandImage

When the source image is CPU-dirty its contents are stale; copying them after RefreshImage overwrites the fresh upload. Only copy (and inherit GpuModified) when the source holds GPU-written data.

* Use HasGpuValidData()
2026-10-20 04:10:22 -07:00
Marcin Mitura e41215e79f kernel: Register missing filesystem symbols and fix /dev/null device (#5404) 2026-10-20 13:13:18 +03:00
sstbrkbtk 7c960eae13 Allow file type identification for '/addcont' path (#5448) 2026-10-20 00:41:51 -07:00
artemkaVG a808e7626e shader_recompiler: Accept S_SLEEP as a scheduling hint (#5445)
* shader_recompiler: Accept S_SLEEP as a scheduling hint

Treat the finite scalar scheduling delay as a no-op during functional
translation instead of rejecting shaders that contain it.

* shader_recompiler: Warn when ignoring S_SLEEP

Keep the scheduling hint visible in the log, matching other unsupported
flow-control hints.
2026-10-19 19:58:22 -07:00
artemkaVG a7fb1e73a3 file_sys: Report stable file identities in stat and fstat (#5309) 2026-10-19 18:24:05 -07:00
Baltazar Menvielle f68923fe80 net: report recv_queue_length in sceNetGetSockInfo (#5437)
FillSockInfo always left recv_queue_length at 0. Knowledge is Power
(CUSA08013) polls sceNetGetSockInfo on its PlayLink UDP sockets and
never calls recv while the queue reads empty, so incoming datagrams
from the companion app were never read. Fill it from FIONREAD for
host sockets.
2026-10-19 20:20:49 +03:00
Gih-pt d5ba5fd06c core/libSceVoice: stub a disconnected microphone to fix BO2 and BO3 hangs (#5421)
* voice: implement port state with no microphone connected

* voice: log errors on failure returns
2026-10-19 19:44:52 +03:00
artemkaVG 524be7c1d4 shader_recompiler: Exclude GetUserData from Phi folding (#5427) 2026-10-19 19:19:14 +03:00
artemkaVG 08225c2b35 shader_recompiler: Account for singleton dimensions in LDS barrier analysis (#5429) 2026-10-19 19:18:57 +03:00
johulk d3ff0e0cc2 texture_cache: keep subresource data when its parent image is first created (#5433) 2026-10-19 19:13:51 +03:00
Marcin Mitura d615b3887b Ajm: Auto-detect and safely parse RIFF headers for ATRAC9 (#5430)
* Ajm: Fix ATRAC9 RIFF header parsing and sample counting

* Ajm: Return fatal codec error on invalid ATRAC9 RIFF header
2026-10-19 13:37:08 +03:00
georgemoralis 7f6b94a107 np_auth rewrite (#5390)
* add proto command for authorizationCode retrieve

* update np_handler to parse auth code

* implementation for authorizationCode
2026-10-19 13:01:28 +03:00
Marcin Mitura 0ebea15c24 app_content: Implement TemporaryData mount and unmount (#5426) 2026-10-18 09:19:22 -07:00
squidbusandMarcin Mitura ba1320f38b app_content: Implement sceAppContentAddcontUnmount (#5423)
* app_content: Implement sceAppContentAddcontUnmount

* app_content: Avoid mount spam looking up add-on content

* Apply review suggestion

Co-authored-by: Marcin Mitura <mitura07@wp.pl>

---------

Co-authored-by: Marcin Mitura <mitura07@wp.pl>
2026-10-18 09:08:27 -07:00
Marcin Mitura cd3cc8022a usbstorage: Correct OrbisUsbStorageDeviceInfo layout and population (#5424)
- Correct structure fields (VID/PID, rev, string lengths, serial number).
- Populate valid descriptor fields and set exFAT feature flag.
2026-10-18 05:53:50 -07:00
Marcin Mitura 860a477160 videodec2: Drain pending frames and wrap in RAII (#5405)
- Drain decoded frames into an internal queue on each submit to fix AVERROR(EAGAIN).
- Store frames in the queue as unique_ptr with RAII deleters like in avplayer.
2026-10-17 23:48:38 +03:00
Marcin Mitura e6c79a5fe0 video_core/amdgpu: Fix CE/DE counter synchronization in PM4 packets (#5406)
- Validate ce_task.handle before calling done() in WaitOnCeCounter to prevent null coroutine handle dereference
- Fix relative counter comparison in WaitOnDeCounterDiff to evaluate ce_count - de_count, avoiding unsigned integer underflow
2026-10-17 16:37:22 +03:00
freshstart2066-createandBIGFERRY999 626f3ace60 video_core: Support stencil-only depth targets and decouple stencil sizing (#5384)
Co-authored-by: BIGFERRY999 <bigferry24@gmail.com>
2026-10-17 16:05:26 +03:00
artemkaVG 603cff43dd shader_recompiler: Stabilize phi deduplication order (#5364) 2026-10-17 15:53:50 +03:00
artemkaVG 78bedfac49 shader_recompiler: Preserve CFG fallthrough edges (#5365) 2026-10-17 15:52:33 +03:00
squidbus 3e92a547ed externals: Update mesa-kosmickrisp (#5414) 2026-10-17 15:43:07 +03:00
Marcin Mitura 32021e41bc kernel/time: Remove log info from sceKernelConvertLocaltimeToUtc (#5408) 2026-10-16 22:31:48 +03:00
Marcin Mitura 5aa7ffa3f4 music: Implement libSceMusicPlayerService HLE (#5392)
- Add libSceMusicPlayerService HLE implementation (32 APIs).
- Add audio playback pipeline using SDL3 with support for MP3, FLAC, and AAC decoding.
- Support playlist transactions, track insertion/removal, seek, pause/unpause, volume control, repeat, and shuffle modes.
- Support playlist auto-advance to subsequent tracks upon track completion.
- Implement sceMusicPlayerServiceReceiveEvent with timed wait, returning 0x812f010a on timeout.
- Hook sceSystemServiceIsBgmPlaying and sceShellCoreUtilIsBgmPlaying to MusicPlayerService playback state.
- Add dr_flac single-header FLAC decoder to externals.
2026-10-15 23:19:39 +03:00
Marcin Mitura b2d7ec7d31 kernel, rtc: Fix timezone and DST calculation (#5389)
- Use localtime_r on POSIX and localtime_s on Windows to retrieve host
  timezone offset and DST state in posix_gettimeofday and
  sceKernelConvertUtcToLocaltime.
- Fix offset sign and DST handling in sceRtc local time conversions
  and RFC formatting functions.
- Replace hardcoded +120 (CEST) in sceSystemServiceParamGetInt with
  actual host timezone.
2026-10-15 13:35:49 +03:00
Matheus Fillipe 314c45632e cpu_patches: Work around Rosetta 2 mistranslating negated scalar compares (#5297)
* cpu_patches: Work around Rosetta mistranslating negated scalar compares

* cpu_patches: Patch negated scalar compares outside of EH frame functions
2026-10-15 01:38:59 -07:00
georgemoralis 5dad16928a allowing headers with surrounding whitespace (#5388) 2026-10-15 09:55:57 +03:00
Marcin Mitura 805e12c0f6 usbd: Implement libSceUsbStorage HLE for virtual USB media access (#5338)
- Add libSceUsbStorage HLE implementation (usbstorage.cpp/h) under USBD_LIB.
- Support device discovery (sceUsbStorageGetDeviceList, sceUsbStorageGetDeviceInfo, sceUsbStorageIsExist).
- Support device mapping (sceUsbStorageRequestMap, sceUsbStorageRequestMapWSB, sceUsbStorageRequestUnmap).
- Support directory traversal (sceUsbStorageGetdentsOpen, sceUsbStorageGetdentsRead, sceUsbStorageGetdentsClose).
- Mount host user directory mnt/usb0 to guest /mnt/usb0.
- Register libSceUsbStorage in InitHLELibs.
2026-10-14 22:13:10 -07:00
artemkaVG ab1dd384dc shader_recompiler: Emit undefined 64-bit integers (#5366) 2026-10-14 19:33:10 -07:00
squidbus 232fa4db18 kernel: Try lock without wait in timed mutex if deadline has passed (#5386) 2026-10-14 19:31:14 -07:00
squidbus 7be8e97f55 app_content: Implement sceAppContentTemporaryDataMount (#5385) 2026-10-14 16:55:17 -07:00
nikmparis217-ux b3d46e96f1 vk_runtime: Copy every mip level in CopyImageWithBuffer (#5368) 2026-10-14 16:47:42 -07:00
Henrique Reis NevesandClaude Opus 5.5 15abf68c9b kernel: fail rmdir on non-empty directories with ENOTEMPTY (#5373)
posix_rmdir used fs::remove_all, so a guest rmdir() on a directory that
still had files in it deleted the whole tree and returned success. On
the console rmdir(2) fails with ENOTEMPTY and leaves the directory
alone. Use fs::remove and report ENOTEMPTY when the host says the
directory is not empty.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 22:12:45 +03:00
kalaposfos13 c20cc3371b Properly check where an input came from for digital->analog input smoothing (#5377)
* Properly check where an input came from for digital->analog input smoothing

* attempt 2
2026-10-14 20:00:47 +02:00
Marcin Mitura 124328bcd3 kernel: Implement I/O event queue APIs with Core::Net integration (#5192)
- Implement sceKernelAddReadEvent and sceKernelDeleteReadEvent (EVFILT_READ) for files and Core::Net sockets.
- Implement sceKernelAddWriteEvent and sceKernelDeleteWriteEvent (EVFILT_WRITE) for files and Core::Net sockets.
- Implement sceKernelAddFileEvent and sceKernelDeleteFileEvent (EVFILT_VNODE).
- Implement sceKernelGetEventFflags and sceKernelGetEventError getters.
- Validate vnode filter flags against libkernel disassembly.
- Register corresponding NIDs in libkernel.
2026-10-14 18:49:17 +03:00
Lander Gallastegiandgeorgemoralis e6faa2e3b6 video_core: garbage collector (part 2) (#3396)
* Use general dirty flag

* clang-format

* Handle non-linear image download

* Layout transition

* Invalidate buffer cache memory on image download

* Sync texture downloads

* Correctly capture arguments

* Account for big downloads

* (test) image gpu dirty

* Revert "(test) image gpu dirty"

This reverts commit a63d1daa00.

* Test only download non-GPU modified images

* Revert tests and maintain gpumodified

* Handle GPU modified ranges

* Demote logs to debug/info

* tracker renamed to page_manager

* clang-format

* Test not collecting gpu modified ranges

* Use general dirty flag

* clang-format

* Handle non-linear image download

* Layout transition

* Invalidate buffer cache memory on image download

* Sync texture downloads

* Correctly capture arguments

* Account for big downloads

* (test) image gpu dirty

* Revert "(test) image gpu dirty"

This reverts commit a63d1daa00.

* Test only download non-GPU modified images

* Revert tests and maintain gpumodified

* Handle GPU modified ranges

* Demote logs to debug/info

* tracker renamed to page_manager

* clang-format

* Test not collecting gpu modified ranges

* Better handling of GPU written in shader hle

* Use correct type for address

* clang-format

* clang-format

* Temporarily add the 2GB budget

* clang-format

* Handle zero size

* Fix for scheduler.wait hack removal

* Fix header

* Fix compillation

* clang-format

* Move insteed of copy

* Fir PM_PAGE_SIZE

* clang-format

* texture cache gc (deletion order) + activate buffer cache gc (causes lots of regressions)

* Wait for gpu after gc if buffers deleted

* Disable buffer gc for now

* some tests

* clang-format

* clang-format

* fix submodules

* nuke buffer gc

* revert back to old shader hle behaviour

* micro tile small mips (fix driverclub)

* remove debug logs

* clang-format

* clang-format part 2: now it's personal

* lmao

* texture download fixes

* clang-format

* remove 2gb budget mock

* better image size calculation

* better image tiler sync

* copy dimmensions values

* pack pitch and height into a 32 bit uint

* don't download multisample, stencil and not compatible

* correctly count memory usage when crating sample backings

* fall back to allocating over budget

* some fixes

* proper logic to decide if a image can be downloaded

---------

Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
2026-10-14 18:02:38 +03:00
georgemoralis fe06e92096 started 0.20.1 WIP 2026-10-14 17:42:29 +03:00
georgemoralis 529ceb32f5 tagged 0.20.0 v.0.20.0 2026-10-14 17:20:58 +03:00
kalaposfos13 f47bbd5d6e core: log SIGABRT signals on POSIX (#5370) 2026-10-14 10:17:40 +03:00
Ultra 7295d120b6 Update AGENTS.md (#5372) 2026-10-13 22:09:51 +01:00
Marcin Mitura 23c4133382 renderer_vulkan: Handle null index base address in BindIndexBuffer (#5358) 2026-10-13 00:07:45 +03:00
georgemoralis b72489d8c2 added new notifications (#5361) 2026-10-12 23:34:30 +03:00
metr1k-91 0ae50a4b09 Removed the signaling_info setting as it is no longer in use. (#5360) 2026-10-12 22:38:13 +03:00
georgemoralis e0a466753a added matching delay (#5354) 2026-10-11 14:52:02 -05:00
kalaposfos13 9901cfe661 signindialog: basic error returns (#5323)
* signindialog: basic error returns

* copyright 2026
2026-10-11 12:01:45 -07:00