Commit Graph

3140 Commits

Author SHA1 Message Date
georgemoralis
faf9cce67e added config mode support 2026-02-23 23:19:46 +02:00
georgemoralis
a8f51584bf
Merge branch 'main' into user_and_settings 2026-02-21 09:56:50 +02:00
Stephen Miller
248b3e2d30
Core: Force logging of critical errors (#4061)
* Ignore enabled flag on critical log entries

This ensures critical errors (asserts and unreachables) are logged when the log file exceeds 100MB, or when logging is disabled.

* I apparently need sleep
2026-02-21 09:53:28 +02:00
Stephen Miller
1eb09ab440
Kernel.Equeue: Various event fixes (#4059)
* Fix vblank event data

* Various logical fixes for timer events

Store timer timeouts in nanoseconds now, properly handle event "replacement", avoid employing small timers when adding events to equeues, fix stored timer data

* Clang
2026-02-21 09:37:59 +02:00
georgemoralis
06b901a47b
Gpu fixes misc (#4050)
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
* fixed image copy to ignore stencil aspect

* Added logging for "Encountered unresolvable image overlap with equal memory address."

* fixed overlap issues with different pitch , added more detailed logging for rest of overlap issues

* improved log error

* maybe mipmaps ?

* array layers or different mip map range

* rewrote case  new image has fewer mip levels than cached image

* array with 2 layers?

* last case

* improved

* no it didn't work
2026-02-19 21:11:33 +02:00
Vladislav Mikhalin
f6d71646c0
threads: initialize TLS on thread creation (#4048)
* initialize TLS on thread creation
* initialize tls in dimensions toypad writer thread
* clear most of the stack on thread init with some black magic
2026-02-19 21:26:33 +03:00
georgemoralis
a99c814739
Image copy Enhancement (#4041)
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
* copy image handle 2d->3d copies and opossite now

* make gcc happy

* fixed colouring issue
2026-02-17 22:41:18 +02:00
georgemoralis
f73bdc5ee0 miss inputs folder creation
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
2026-02-17 22:01:03 +02:00
georgemoralis
fb4ca27022
Merge branch 'main' into user_and_settings 2026-02-17 00:12:56 +02:00
georgemoralis
237a02ef3e fix mac build 2026-02-17 00:12:23 +02:00
kalaposfos13
3a99051df9
filesystem: fix crashes caused by returning a pointer from an std::vector (#4043)
Co-authored-by: Stephen Miller <56742918+StevenMiller123@users.noreply.github.com>
2026-02-16 22:56:35 +02:00
kalaposfos13
aee58a7b5c clang, formatter of night 2026-02-16 21:55:32 +01:00
kalaposfos13
e1ad33155d KBM -> joystick input smoothing v2 2026-02-16 21:54:10 +01:00
kalaposfos13
d0ea7f04c4 fix macos 2026-02-16 17:44:42 +01:00
Stephen Miller
547198af6f
Lib.VideoOut: Fix pending flips limit (#4039)
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
* Hardcoded limit to pending flips

Real hardware has a fixed-size queue, and doesn't depend on the number of registered buffers.
While the kernel supposedly uses an array of 18 elements, my tests suggest the cap is 16 pending flips.

* Assert on trying to flip unregistered buffer

I haven't seen anything do this intentionally yet, but I do have cases where games do this unintentionally (do to unimplemented functions).
2026-02-16 08:31:35 +02:00
georgemoralis
3b6baa8aa6 reimplemented sceUserServiceGetLoginUserIdList
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
2026-02-15 21:35:11 +02:00
kalaposfos13
11294dae16 process motion controls for all controllers, not just the first one 2026-02-15 18:27:00 +01:00
kalaposfos13
4421ee155d how was this not an issue before 2026-02-15 18:26:21 +01:00
kalaposfos13
e11c977f2d thank you -Wsizeof-array-argument for being smarter than me 2026-02-15 11:41:02 +01:00
georgemoralis
12f5403214 started mapping usermanager to userservice 2026-02-15 12:35:04 +02:00
georgemoralis
11f096bb7d added inputs folder 2026-02-15 12:15:50 +02:00
georgemoralis
8d60671ec7 fixed compile issues 2026-02-15 12:05:34 +02:00
georgemoralis
1cf22f2484 update emulator_settings to latest 2026-02-15 11:53:47 +02:00
georgemoralis
a9df50cc9b
Merge branch 'main' into user_and_settings 2026-02-15 10:31:05 +02:00
Stephen Miller
4a370519a5
Lib.GnmDriver: Fix flip arg for sceGnmSubmitAndFlipCommandBuffers (#4038)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
* There is a mountain of evidence suggesting that flip_arg for these functions should be a 64-bit integer.

This fixes "memory" errors in some Unity titles.

* oops

* Fix sceVideoOutGetEventData

This bug went unnoticed for a while because the selection of Unity games I had at the time didn't actually care.
This + the prior fix is needed for Unity titles.
2026-02-15 09:29:33 +02:00
Valdis Bogdāns
0f92285e50
GR2-win-crash-fix (#4033)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
* Improve stack clearing logic in ExecuteGuest

Added a check for fiber stacks before clearing the stack in ExecuteGuest.
That fixes Gravity Rush 2 crash on Windows.

* Refactor ExecuteGuest to simplify stack clearing logic

This enough for GR2

* Recover thread initialization in ExecuteGuest function

* Enhance null check for thread control block

* Fix condition to check tcb before clearing stack
2026-02-14 23:30:09 +02:00
Stephen Miller
98af227a8d
More hotfixes (#4036)
User events don't increment fflags, so don't increment it.
Also added a bugfix for dce events, as static_cast wasn't properly unpacking event.data.
2026-02-14 22:47:28 +02:00
Niram7777
8d4cbdbca9
Log actually not always compact (#4035) 2026-02-14 22:31:19 +02:00
Stephen Miller
e0850d5cfc
Kernel.Equeue: Only reset trigger state on events that clear. (#4032)
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
* Don't clear events that don't need clearing

Unless the event has the clear flag, it will be returned multiple times after triggering.

* Fix event flags

As older code suggests, the PS4 kernel does append the clear flag to various event types internally. This is visible when observing the returned event data from sceKernelWaitEqueue (or kevent, if you're feeling ambitious)

Add flag is also removed from events internally.
2026-02-14 01:59:23 +02:00
kalaposfos13
9126e07eca up is still not down
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
2026-02-13 10:47:29 +01:00
kalaposfos13
5f4b413c4a Merge remote-tracking branch 'origin/main' into user_and_settings 2026-02-13 10:47:20 +01:00
kalaposfos13
d189b0cc29
up is not down (#4031)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
2026-02-13 11:37:28 +02:00
georgemoralis
7c0303db56
Merge branch 'main' into user_and_settings 2026-02-13 10:31:17 +02:00
Stephen Miller
1a06020f70
Core: Mount system fonts (#4028)
* Mount system fonts

Now that font LLE works, these are necessary for some titles.

* Make fonts path configurable

By user request.
2026-02-13 09:02:30 +02:00
Stephen Miller
50130a6b7c
Prevent protects during unmaps (#4029)
Some games fail in this VirtualProtectEx call because they unmapped on one thread while another thread is hitting exception handling.
2026-02-13 08:34:24 +02:00
kalaposfos13
c7509777d2 the loathsome clang-formatter 2026-02-12 23:00:09 +01:00
kalaposfos13
5e7333dfdb sir clang offnir, the all-formatting 2026-02-12 22:56:04 +01:00
kalaposfos13
fe442ad13c Merge remote-tracking branch 'origin/main' into user_and_settings 2026-02-12 22:51:11 +01:00
kalaposfos13
baa766857d parameter cleanup 2026-02-12 22:35:17 +01:00
kalaposfos13
9b8c15276a merge fixes 2026-02-12 22:31:45 +01:00
kalaposfos13
1472781784 Merge remote-tracking branch 'origin/main' into user_and_settings 2026-02-12 22:31:24 +01:00
Stephen Miller
cdafdb7443
Better handle check in scePadRead, scePadReadState (#4027) 2026-02-12 22:34:43 +02:00
Stephen Miller
0435ada3a5
Update np_web_api_internal.cpp (#4025)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
2026-02-11 23:22:38 +02:00
kalaposfos13
7bdb5eb7e1
improved motion controls emulation (#4022) 2026-02-11 18:09:34 +02:00
kalaposfos13
c2a47d2a99
Handle operand fields execlo and exechi for S_MOV (#4023)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
Co-authored-by: TheTurtle <geoster3d@gmail.com>
2026-02-11 16:00:13 +02:00
Vladislav Mikhalin
8c59571961
pad: refactoring (#4016)
* pad: refactoring

* clang is not my friend
2026-02-11 11:15:33 +02:00
Stephen Miller
68679b24aa
Fix log errors (#4020)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
Just a typical day of me pushing something a month ago, nobody testing/reviewing it, then finding out it's broken when that code inevitably makes it into production.
2026-02-11 08:31:23 +02:00
Stephen Miller
6a7f8a9e5a
Libs.LibcInternal: _Fofind, _Lockfilelock, _Unlockfilelock, _Foprep, _Fopen, fopen, fflush, _Nnl, _Fspos, fseek, _Frprep, fread, _Fofree, fclose, _Mtxinit, _Mtxlock, _Mtxunlock, _Mtxdst implementations (#4019)
* Initial definitions

* internal__Fofind

* Libcinternal threads

fopen stores a valid pthread mutex in the FILE struct. Since this is exposed to the game/app, we need to handle this accurately.

* internal__Foprep (and various other functions called in it)

* Actual fopen implementation

At long last, an actual function I'm supposed to implement.

* fflush + compile fixes

* fseek implementation

Comes with functions fseek calls, aside from fflush which I pushed earlier.

* fread, _Frprep

Also changed some parameter names a tad to match how I named things in my decomp.
And fixed some bugs with how I was handling the weird offseted mode thing

* fclose, _Fofree

Not confident on this one, but we'll see I guess.

* Bug fixing

No more crashes at least, fread seems to be broken though.

* fopen bugfixes

Behavior now matches LLE, at least in how LLE font seems to use it.

* Fix _Frprep

Seems like everything works now?

* Logging

Probably going to need to swap lseek and read logs to debug/trace later but this is for debugging.

* Remove alignment check

Seems I must've misinterpreted some of what Ghidra spat out, since libSceNgs2 is calling with size 1, nmemb 4.

* Reduce fseek, fread logs to trace

* Clang
2026-02-11 08:13:28 +02:00
Marcin Mikołajczyk
99661aa6b3
RE encountered NpTus functions (#4018) 2026-02-10 23:59:07 +02:00
georgemoralis
a706b325f4
optimize sdl3 audio out (#4015)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
2026-02-09 22:59:39 +02:00