Commit Graph

64 Commits

Author SHA1 Message Date
Zephyron
a15719b21d hid_core: Add NpadCondition to shared memory to fix no-controller crash
Fix crash when launching games without a connected controller by adding
a global NpadCondition structure at offset 0x3E200 in HID shared memory.
Games read this structure on startup to verify controller state validity,
and crash with a userspace PANIC if the data is uninitialized.

The NpadCondition structure contains:
- is_initialized flag (set to 1)
- hold_type (controller orientation)
- is_valid flag (set to 1)

These fields are properly initialized when shared memory is created,
ensuring games see valid controller state data even before any
controllers are physically connected.

Fixes crash in The Legend of Zelda: Echoes of Wisdom and other titles
that validate controller state on startup.

Based on LotP's implementation of the NpadCondition structure.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-12 16:49:03 +10:00
Zephyron
56dba09e0c feat: REV15 audio renderer + HID fix (v0.8.0)
Complete SDK15 audio implementation with native float biquads.
Fixes TotK 1.4.2 and BotW 1.8.2 boot loops.

- Add REV15 float biquad filter support
- Implement VoiceInParameterV2 (0x188 bytes)
- Add SplitterDestinationV2b with biquad filters
- Fix HID sampling number (double state value)
- Add AudioSnoopManager and AudioSystemManager
- Implement FinalOutputRecorder system
- Add FFT and loudness calculator (ITU-R BS.1770)
- Add full Limiter effect

Resolves boot loops and controller detection in SDK20 games.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-11 14:10:08 +10:00
collecting
3a517f15da Initialize Variable 2025-09-26 02:37:40 +00:00
collecting
b65759e413 Initialize variable 2025-09-26 02:32:43 +00:00
Zephyron
56d8bd7dd3 feat: Add mouse wheel support for game input passthrough
- Implement mouse wheel event handling in SDL2 backend (emu_window_sdl2)
- Add wheel event routing from GRenderWindow to input subsystem
- Add debugging logs to trace mouse wheel events through input chain
- Support mouse wheel input for mods like Ultracam when games are running (WIP)

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-09-14 15:18:38 +10:00
Boss.sfc
fc480dcb69 fix: CachyOS LTO Compilation
Fix LTO linking issues on CachyOS with GCC 15.x

- Add LTO support to all core library targets (input_common, frontend_common,
  network, shader_recompiler, web_service) that were missing LTO configuration
- Create citron_configure_lto() helper function for consistent LTO handling
- Implement CachyOS-specific detection via /etc/os-release and kernel version
- Apply conservative LTO flags (-flto=auto -ffat-lto-objects) only for
  CachyOS + GCC 15+ to resolve linking errors with newer toolchains
- Other distributions continue using aggressive LTO settings for maximum performance
- Disable LTO on executable targets to prevent main function optimization issues

This resolves "undefined symbol" errors when building with -DCITRON_ENABLE_LTO=ON
on CachyOS while maintaining optimal LTO performance on other distributions.

Fixes linking errors including:
- Core::Frontend::EmuWindow symbols
- Core::System methods
- Settings::values
- Common logging functions

Tested on CachyOS with GCC 15.1.1 + LLD 20.1.8

Signed-off-by: Boss.sfc <boss.sfc@citron-emu.org>
2025-07-22 21:37:37 +07:00
Zephyron
b2d9cf4a01 chore: update project branding to CITRON
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-06 16:11:33 +10:00
Zephyron
bfb82e577c chore: update project branding to citron
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-06 16:06:48 +10:00
liamwhite
dc94882c90 Merge pull request #13135 from german77/hid-interface
service: hid: Migrate HidServer to new IPC
2024-02-27 12:26:26 -05:00
liamwhite
15831b19a3 Merge pull request #13163 from german77/ring
core: hid: hid_core doesn't have access to LIBUSB
2024-02-25 14:01:05 -05:00
german77
e62cea20d1 core: hid: hid_core doesn't have access to LIBUSB 2024-02-25 10:06:43 -06:00
german77
ca7f949ee8 core: hid: Reintroduce vibration filter 2024-02-24 12:19:51 -06:00
Narr the Reg
fc6a87bba1 service: hid: Migrate HidServer to new IPC 2024-02-23 17:49:02 -06:00
Narr the Reg
d08f201e0c service: hid: Move and migrate AppletResource and ActiveVibrationDevice 2024-02-23 17:49:02 -06:00
FearlessTobi
310c1f50be scope_exit: Make constexpr
Allows the use of the macro in constexpr-contexts.
Also avoids some potential problems when nesting braces inside it.
2024-02-19 16:00:46 +01:00
german77
56721517ea core: hid: Remove driver errors from log 2024-02-18 10:54:56 -06:00
t895
50ecad547e android: Input mapping 2024-02-17 12:32:33 -05:00
t895
ac33847b30 hid_core: Prevent crash if we try to iterate through empty color devices list 2024-02-16 21:11:47 -05:00
t895
18494b0ad6 hid_core: Use dedicated "port" for android's input overlay 2024-02-16 21:09:42 -05:00
Narr the Reg
caf16982d9 service: set: Migrate ISystemSettingsServer to new IPC 2024-02-14 12:40:10 -06:00
Narr the Reg
0ac777460d service: hid: Free npad applet resource 2024-02-08 18:50:54 -06:00
Narr the Reg
b4d88a7bb4 service: hid: Migrate hidbus to new interface 2024-02-07 18:07:32 -06:00
liamwhite
5016de3626 Merge pull request #12928 from german77/motion-mp
service: hid: Add multiprocess support to six axis input
2024-02-06 10:24:46 -05:00
german77
12b6162852 service: irs: Migrate service to new interface 2024-02-06 00:14:16 -06:00
german77
8f192b494a service: hid: Add multiprocess support to six axis input 2024-02-05 17:19:31 -06:00
german77
372897aac4 service: hid: Ensure aruid data is initialized 2024-02-05 17:17:21 -06:00
Narr the Reg
818721d12d service: hid: Multiple fixes 2024-02-01 10:37:44 -06:00
liamwhite
21138b6a86 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
a0f7f2b309 service: hid: Implement GetPlayerLedPattern accurately 2024-01-30 10:57:03 -06:00
german77
b8f16f3538 service: hid: Implement home, capture and sleep buttons 2024-01-28 19:28:37 -06:00
german77
87e26de0fc service: hid: Restore active aruid 2024-01-28 18:27:25 -06:00
Narr the Reg
575183d6dc service: hid: Fully implement touch resource 2024-01-28 18:27:25 -06:00
german77
12e7ee2357 service: set: Implement more Qlaunch Settings 2024-01-28 09:32:46 -06:00
K900
8b47465586 input: add a missing null pointer check
There's a few other places where the result of GetAruidData is accessed without a null check,
but I couldn't find a code path that hits those.
2024-01-27 17:32:49 +03:00
liamwhite
4349cdba07 Merge pull request #12769 from german77/no-log
core: hid: Reduce controller requests
2024-01-26 09:57:40 -05:00
liamwhite
4d206d849e Merge pull request #12765 from german77/sys-hid
service: set: Implement more settings functions for Qlaunch
2024-01-26 09:55:47 -05:00
Narr the Reg
f2012e5aff service: hid: Don't try to vibrate if device isn't initialized 2024-01-25 23:46:46 -06:00
Narr the Reg
53b321c945 service: set: Implement more settings functions for Qlaunch 2024-01-25 17:14:18 -06:00
Narr the Reg
ad4622da2c core: hid: Skip duplicated vibrations 2024-01-23 11:33:08 -06:00
Narr the Reg
3b1c2896d9 core: hid: Only set polling mode if needed 2024-01-23 11:11:09 -06:00
liamwhite
57ff934f0d Merge pull request #12734 from german77/enable-applet
service: hid: Implement EnableAppletForInput
2024-01-21 19:15:53 -05:00
Narr the Reg
a7a7720752 core: hid: Allow to disable vibration 2024-01-21 16:44:31 -06:00
Narr the Reg
1b984738ab service: hid: Implement EnableAppletForInput 2024-01-21 14:05:18 -06:00
liamwhite
5838779162 Merge pull request #12660 from german77/better-vibration
service: hid: Fully implement abstract vibration
2024-01-20 13:34:54 -05:00
liamwhite
10535e0016 Merge pull request #12687 from german77/amiibo-lock
core: hid: Disable special features before disconnecting the controllers
2024-01-19 09:33:31 -05:00
liamwhite
932bd98824 Merge pull request #12709 from german77/npad-disc
service: hid: Clear controller status when aruid is no longer used
2024-01-19 09:33:16 -05:00
Narr the Reg
9f376cd901 service: hid: Clear controller status when aruid is no longer used 2024-01-19 00:09:49 -06:00
Narr the Reg
0b0e9ef18d core: hid: Disable special features before disconnecting the controllers 2024-01-16 14:44:54 -06:00
Narr the Reg
7f5adf8982 service: set: Implement stubbed functions 2024-01-15 23:17:03 -06:00
Narr the Reg
2cacb9d48c service: hid: Fully implement abstract vibration 2024-01-15 23:15:40 -06:00