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>
- Convert ENUM() macro calls to standard C++ enum class syntax
- Add explicit numeric values to each enum member for clarity
- Manually define EnumMetadata<T>::Canonicalizations() specializations
- Manually define EnumMetadata<T>::Index() specializations
- Special handling for ResolutionSetup which requires signed (s32) values
Benefits:
- Improved type safety and compiler error messages
- Better IDE support for navigation and refactoring
- More explicit and self-documenting code
- Easier to debug enum-related issues
- Eliminates macro expansion complexity
Signed-off-by: Zephyron <zephyron@citron-emu.org>
Support the romfslite folder type introduced in Atmosphere 1.9.5 for
memory-optimized mod loading. The emulator now detects and loads
romfslite folders the same way as romfs folders.
Signed-off-by: Zephyron <zephyron@citron-emu.org>
Add static_cast<f32>() to integer-to-float conversions in audio_core
to satisfy Android NDK's -Werror=implicit-int-float-conversion flag.
Fixes compilation errors in fft.cpp, loudness_calculator.cpp, and
limiter.cpp on Android builds.
Signed-off-by: Zephyron <zephyron@citron-emu.org>
Add proper recovery mechanism for null pointer execution (PC < 0x1000)
by returning from invalid function calls using the Link Register instead
of blindly continuing execution.
Fixes infinite crash loop in games like Little Nightmares III.
Signed-off-by: Zephyron <zephyron@citron-emu.org>
Implements ScaleFX algorithm for pixel art upscaling with edge
preservation. Supports both OpenGL and Vulkan with FP16/FP32
variants for hardware optimization.
ScaleFX is designed to reduce pixelation while preserving sharp
edges, ideal for low-resolution and pixel art games.
Signed-off-by: Zephyron <zephyron@citron-emu.org>
- Add Res1_4X resolution setup with down_shift=2
- Mark as EXPERIMENTAL in UI labels
- Support on both Qt and Android frontends
Signed-off-by: Zephyron <zephyron@citron-emu.org>
Implements two-stage PGO build system with CMake integration and
automated build scripts for Windows, Linux, and macOS. Supports
MSVC, GCC, and Clang compilers.
PGO enables runtime profiling-based optimizations for improved
emulator performance. Includes helper scripts to streamline the
build workflow and resolve platform-specific issues.
Signed-off-by: Zephyron <zephyron@citron-emu.org>
Use getMainLooper() instead of myLooper() in Handler initialization
and add view attachment checks to prevent crashes.
Reported-by: Shadai (theonlyshadai) on Discord
Signed-off-by: Zephyron <zephyron@citron-emu.org>
QImage does not have a flipped() method. Replace with the correct mirrored(false, true) call to perform vertical image flipping for
screenshot capture.
Signed-off-by: Zephyron <zephyron@citron-emu.org>