Commit Graph

27 Commits

Author SHA1 Message Date
BoiledElectricity 470d43df6d [hid_core] fix bounds-check aruid index in GetControllerFromNpadIdType (#4064)
GetIndexFromAruid returns AruidIndexMax as the “not found” value, but both
GetControllerFromNpadIdType overloads were using that value to index
controller_data without checking it first.

when a game routes through DisconnectNpad before its applet resource is
registered, we can end up indexing past the end of controller_data. That seems
to be what was crashing some games on launch, especially on macOS and Android,
where the out-of-bounds read is less likely to just slide by unnoticed.

So yeah, AruidIndexMax is a sentinel, not a real controller_data index, so we
should not treat it like one.

  Fixes: https://github.com/eden-emulator/Issue-Reports/issues/438
  Fixes: https://github.com/eden-emulator/Issue-Reports/issues/439

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4064
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
2026-06-05 19:26:21 +02:00
lizzie 2aa2ac7d9a [hle/service{nvdrv,apm}] fixes for TetrisSwitch (#3983)
- testriswitch submits buffers with a fence id of -1, just skip them instead of trying to process them?
- apm:u, which is removed, but hey, backwards compat never hurted
- another instance of shared_memory crashing NPad

Signed-off-by: lizzie <lizzie@eden-emu.dev>

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3983
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
2026-05-24 01:04:32 +02:00
lizzie cbeea5b954 [hle] handle NPad shared_memory being null on certain updates and cases (#3860)
Does NOT fix root issue with shared_memory of NPad yet, that is something probably separate
I'd like to suspect it's because every NPad by default it's expected to have shared memory, even when not explicitly initialized, but seems unlikely

Signed-off-by: lizzie <lizzie@eden-emu.dev>

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3860
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Reviewed-by: crueter <crueter@eden-emu.dev>
2026-04-27 04:01:49 +02:00
maufeat c984c387d7 [hid] shared memory crashes (#3784)
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3784
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Co-authored-by: maufeat <sahyno1996@gmail.com>
Co-committed-by: maufeat <sahyno1996@gmail.com>
2026-03-27 23:32:51 +01:00
lizzie 395613b01f [common/logging] Simplify logging logic and fix issues when logging before system is created (#3688)
- our logging code was bigger than spdlog itself, why???? just keep it simple
- fix issues when logging before logging system is even started
- removes the "initialized logging twice" issue
- removes uneeded indirection in file logging
- uses direct formatting instead of jumping hoopla-around the fmt::format() ressult
- code duplication and dead code removal as usual

I did explore dup2() but I think it's not worth the hassle
I did try `fwopen()` but it's better if things are just kept as-is.

there is a lot of noise because I removed a bunch of redundant files on logging and just put everything in one file

now normally this wouldn't be a good idea, however consider: the complexity of logging; it's less than 500 lines... does it really need a whole subsystem?!?!?! ITS JUST LOGGING

Signed-off-by: lizzie <lizzie@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3688
Reviewed-by: crueter <crueter@eden-emu.dev>
Reviewed-by: DraVee <chimera@dravee.dev>
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
2026-03-12 18:29:15 +01:00
lizzie 191e4c75a1 [meta] fix license headers (#2547)
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2547
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
2025-09-21 21:58:59 +02:00
lizzie 9d2681ecc9 [cmake] enable clang-cl and WoA builds (#348)
Compilation and CMake fixes for both Windows on ARM and clang-cl, meaning Windows can now be built on both MSVC and clang on both amd64 and aarch64.

Compiling on clang is *dramatically* faster so this should be useful for CI.

Co-authored-by: crueter <crueter@eden-emu.dev>
Co-authored-by: crueter <crueter@crueter.xyz>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/348
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Reviewed-by: crueter <crueter@eden-emu.dev>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
2025-09-09 20:47:49 +02:00
german77 bdd95714d5 core: hid: Reintroduce vibration filter 2024-02-24 12:19:51 -06:00
Narr the Reg b765a7e22c service: hid: Free npad applet resource 2024-02-08 18:50:54 -06:00
german77 e12d580819 service: hid: Ensure aruid data is initialized 2024-02-05 17:17:21 -06:00
Narr the Reg 06bb386941 service: hid: Multiple fixes 2024-02-01 10:37:44 -06:00
liamwhite 6e85d48a8b Merge pull request #12780 from german77/touch_resource5
service: hid: Fully implement touch resource
2024-02-01 11:33:44 -05:00
Narr the Reg ac45bf3adb service: hid: Implement GetPlayerLedPattern accurately 2024-01-30 10:57:03 -06:00
Narr the Reg 575f4308e0 service: hid: Fully implement touch resource 2024-01-28 18:27:25 -06:00
Narr the Reg df295231b8 service: set: Implement more settings functions for Qlaunch 2024-01-25 17:14:18 -06:00
Narr the Reg 4af74a15a8 service: hid: Implement EnableAppletForInput 2024-01-21 14:05:18 -06:00
liamwhite 48d9e11d9d Merge pull request #12660 from german77/better-vibration
service: hid: Fully implement abstract vibration
2024-01-20 13:34:54 -05:00
Narr the Reg 77f3deb03a service: hid: Clear controller status when aruid is no longer used 2024-01-19 00:09:49 -06:00
Narr the Reg e2313faec9 service: hid: Fully implement abstract vibration 2024-01-15 23:15:40 -06:00
german77 194746c558 service: hid: Create abstracted pad structure 2024-01-11 19:35:04 -06:00
liamwhite 03a5484633 Merge pull request #12600 from german77/npad-impl
service: hid: Hook interface implementations
2024-01-07 20:41:06 -05:00
german77 73a46f5fcb service: hid: Make sure there's an active aruid handle 2024-01-06 23:49:52 -06:00
german77 94693e5e4b service: hid: Implement GetLastActiveNpad 2024-01-06 23:30:43 -06:00
german77 1f3c770e79 service: hid: Implement AssigningSingleOnSlSrPress 2024-01-06 23:30:42 -06:00
german77 c599f3700b service: hid: Implement SetNpadSystemExtStateEnabled 2024-01-06 23:30:41 -06:00
german77 243494192f service: hid: Implement CaptureButtonAssignment 2024-01-06 21:18:44 -06:00
Narr the Reg 146975c880 hid_core: Move hid to it's own subproject 2024-01-05 11:41:15 -06:00