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.
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.
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.
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.
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.
* 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()
* 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.
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.
- 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.
- 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.
- 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.
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>
- 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.