Commit Graph

175 Commits

Author SHA1 Message Date
Exzap
466ad8d35e Latte/Vulkan: Set RoundingModeRTE for all float types
Seems like GLSL's unpackHalf2x16() is affected by the 16bit rounding setting
2023-03-02 16:22:28 +01:00
Exzap
f8ea594447 Latte: Small refactor for shader decompiler
Latte: Small refactor for shader decompiler
2023-03-02 16:22:19 +01:00
Exzap
4a564e2447 Latte/Vulkan: Set shader rounding mode via VK_KHR_SHADER_FLOAT_CONTROLS 2023-03-02 16:22:05 +01:00
lisa-wolfgang
4c697d3755
Add cross-platform "disable screen saver" setting (#497) 2023-02-24 22:10:07 +01:00
Exzap
80b1c50b50 coreinit: Fix thread scheduler not resetting quantum
When a thread was force-rescheduled (e.g. via OSYieldThread) the next time it resumed it would not reset the time slice duration (remainingCycles) back to ppcThreadQuantum. As a consequence threads were often immediately rescheduled and only on the next turn they would get their full time slice.

Aside from (very slightly) improving performance, this also fixes the OSDisableInterrupts warning spam in the log for TPHD.
2023-02-22 13:37:14 +01:00
Exzap
9d25b88368 Latte: Add support for MIN_DX10 shader instruction 2023-02-22 13:37:14 +01:00
Crementif
05e0f349e0
debugger: Disable Linux read/write breakpoints for now (#669)
It seems that there's some differences for some distros so until a proper solution is found, just disable it for now.
2023-02-20 00:29:32 +01:00
Crementif
6d75776b28
Add GDB stub for debugging (#657)
* Implement GDB stub debugger

Can be enabled by using the "--enable-gdbstub" option (and the debugger GUI, although that's untested) which'll pause any game you launch at start-up. Will start at port 1337 although it'll eventually be user-editable. The code is a bit weirdly sorted and also just needs a general cleanup, so expect that eventually too. And uses egyptian braces but formatting was easier to do at the end, so that's also something to do.

It has been tested to work with IDA Pro, Clion and the standalone interface for now, but I plan on writing some instructions in the PR to follow for people who want to use this. Memory breakpoints aren't possible yet, only execution breakpoints.

This code was aimed to be decoupled from the existing debugger to be able to be ported to the Wii U for an equal debugging experience. That's also why it uses the Cafe OS's thread sleep and resuming functions whenever possible instead of using recompiler/interpreter controls.

* Add memory writing and floating point registers support

* Reformat code a bit

* Format code to adhere to Cemu's coding style

* Rework GDB Stub settings in GUI

* Small styling fixes

* Rework execution breakpoints

Should work better in some edge cases now. But this should also allow for adding access breakpoints since it's now more separated.

* Implement access breakpoints

* Fix some issues with breakpoints

* Fix includes for Linux

* Fix unnecessary include

* Tweaks for Linux compatibility

* Use std::thread instead of std::jthread to fix MacOS support

* Enable GDB read/write breakpoints on x86 only

* Fix compilation for GCC compilers at least

The thread type varies on some platforms, so supporting this is hell... but let's get it to compile on MacOS first.

* Disable them for MacOS due to lack of ptrace

---------

Co-authored-by: Exzap <13877693+Exzap@users.noreply.github.com>
2023-02-19 15:41:49 +01:00
goeiecool9999
05d82b09e9
Add back missing flag to keep background image in background (#667) 2023-02-19 14:52:19 +01:00
goeiecool9999
cbb79fd34c
Separate imgui contexts for TV and Pad windows. (#664) 2023-02-18 11:56:43 +01:00
Exzap
f3ff919be2
Code clean up + replace some wstring instances with utf8 (#640) 2023-01-29 13:53:31 +01:00
Exzap
8651c4bae7 coreinit: Correctly return success code in FSRemove 2023-01-28 10:05:29 +00:00
Exzap
404af95a2c Latte: Less aggressive texture readback
By mistake we would read affected textures back after every single drawcall. As an optimization if the same texture gets drawn to multiple times we'll try to only read it back once at the end of the sequence.
2023-01-27 09:57:10 +00:00
Exzap
859dc78e90 coreinit: Dont yield uninterruptible threads in spinlock 2023-01-27 09:57:10 +00:00
Exzap
387b712959 Logging: Add TextureReadback logtype and clean up code 2023-01-27 09:57:10 +00:00
Exzap
9bbfd33842 Latte: FragCoord w should not be reciprocal
Fixes rendering in various Virtual Console DS titles
2023-01-27 09:57:10 +00:00
Exzap
43b5ad2f1c PPCInterpreter: Improve overflow handling 2023-01-27 09:57:10 +00:00
Exzap
4b5014c16a coreinit: Fix memory mapping API
Fixes Unity based games freezing on boot
2023-01-27 09:57:10 +00:00
goeiecool9999
33bd10b4e0
Vulkan: Use the correct resolution for out-of-date check (#595) 2022-12-29 00:19:05 +01:00
SSimco
fcab8f8f1a
Linux: Add CMake find module for wayland + make wayland optional (#572) 2022-12-15 08:44:14 +01:00
Tillsunset
4491560b32
Add check for backwards delete (#564) 2022-12-09 18:01:08 +01:00
SSimco
fca7f5dfe4
Linux: Add Vulkan support for wayland (#553) 2022-12-07 16:45:25 +01:00
Exzap
2c81d240a5
Make codebase more CPU-agnostic + MacOS disclaimer (#559) 2022-12-07 01:48:24 +01:00
Tom Lally
445b0afa95
Better screenshot error handling (#552) 2022-12-05 17:16:08 +01:00
Tom Lally
dd538d477c
Correctly create screenshot directory if it does not exist (#551) 2022-12-03 17:57:32 +01:00
Tom Lally
b361b154d8
Cross-platform screenshots (#543)
Co-authored-by: Tom Lally <tomlally@protonmail.com>
Co-authored-by: Exzap <13877693+Exzap@users.noreply.github.com>
2022-12-02 04:51:07 +01:00
goeiecool9999
2cfb7f3737
Automatically scale imgui text based on display pixel density (#545) 2022-12-01 15:58:08 +01:00
goeiecool9999
d3721c3f46
Fix render resolution at different UI scales (#514) 2022-11-30 13:39:32 +01:00
goeiecool9999
a3476c7b7c
macOS: Workaround for MoltenVK stride limitation (#534) 2022-11-30 01:26:42 +01:00
Tillsunset
6f985c3c78
Fix black screen when graphics packs are used (#541) 2022-11-29 10:54:11 +01:00
Tillsunset
87d2f8ad55
Fix shader preset regex (#536) 2022-11-28 08:24:52 +01:00
goeiecool9999
bc104859f3
Vulkan: return to more conventional swapchain sync method, encapsulate more code (#525) 2022-11-25 09:51:47 +01:00
goeiecool9999
cbdf381b31
Fix gamepad hotkey and game profile setting (#510) 2022-11-24 12:29:29 +01:00
goeiecool9999
f4c2d16a3a
Attempt to fix flicker on resize, don't recreate if image was already acquired. (#522) 2022-11-21 19:06:35 +01:00
goeiecool9999
3a94a276da
Vulkan: Further simplify swapchain code (#502) 2022-11-21 16:47:43 +01:00
goeiecool9999
9ce52ad83a
Linux/macOS: Implement overlay CPU/memory statistics (#480) 2022-11-20 19:53:45 +01:00
MythicalPlayz
c17097369b
Redownload BOSS files if they are not found (#504) 2022-11-20 17:21:20 +01:00
goeiecool9999
57c8dec335
fix two if statements checking range of number wrong (#494) 2022-11-17 15:42:08 +01:00
SSimco
b1c70588fe
Enable online features for Unix (#486) 2022-11-15 17:03:46 +01:00
goeiecool9999
e9d10a9581
Linux+OpenGL: Implement GUI vsync setting (#477) 2022-11-13 08:29:25 +01:00
goeiecool9999
4d68446f14
Vulkan: Further swapchain code improvements. (#473) 2022-11-11 08:14:38 +01:00
bslhq
be287a1f4e
ImGui: match all begin()/end() (#470) 2022-11-09 02:45:40 +01:00
goeiecool9999
138510106c
Vulkan: Fix freeze when closing pad view (#435) 2022-11-06 00:40:00 +01:00
Exzap
ec6726e85c Use generic EC_POINT_get_affine_coordinates 2022-11-06 00:32:33 +01:00
goeiecool9999
348d86648f
Vulkan: Refactor swapchain code (#399) 2022-11-04 15:22:29 +01:00
Tillsunset
521f2fb707
MacOS: Workaround for Metal stride limitation (#445) 2022-11-03 12:51:32 +01:00
goeiecool9999
a129d22a57
Vulkan: Experimental fix for self-dependency barriers during renderpass (#431) 2022-11-03 00:43:26 +01:00
Adrian Graber
d4e14d2b05
Implement proper microphone support (#251) 2022-11-03 00:24:34 +01:00
goeiecool9999
c3182aedd9
GeneralSettings: Update vsync after settings close (#401) 2022-10-31 17:54:26 +01:00
Tillsunset
9ebbfb3ae2
Fix some compiler warnings (#416) 2022-10-26 14:47:44 +02:00
gurrgur
3869b47c35
OpenGL: Bind back buffer before clearing (#222) (#414) 2022-10-26 14:07:34 +02:00
GaryOderNichts
d303a7f502
coreinit: Implement OSGetSystemTick (#415) 2022-10-26 14:06:16 +02:00
GaryOderNichts
2461464ba7
FSA: Add missing path translations (#413) 2022-10-26 00:25:46 +02:00
gurrgur
76c75f767b
Use portable format specifiers (#411)
Fixes #387
2022-10-25 20:38:29 +02:00
Exzap
028b3f7992
Make controller button code thread-safe (#405)
* Refactor spinlock to meet Lockable requirements
* Input: Refactor button code and make it thread-safe
2022-10-23 15:47:42 +02:00
Tillsunset
1bcc064593
Add check for "." in FSC path (#402) 2022-10-23 13:06:20 +02:00
MythicalPlayz
c217b3ee32
GameList: Use title name based on console language (#388) 2022-10-21 00:17:11 +02:00
MythicalPlayz
271a4e4719
Fixed Discord Rich Presence not working on games that are on MLC (#383) 2022-10-18 17:08:09 +02:00
MythicalPlayz
753040f73a
Added Boot Image for Gamepad (#372) 2022-10-17 11:26:32 +02:00
Exzap
ada8bbb3b4
Linux/MacOS: Greatly improve performance (#370)
std::unordered_set is implemented as a flat hashtable on libstdc++ which makes clearing expensive due to invoking memset on the entire table. To get the best performance across all platforms this replaces the unordered_set with a custom high-performance sparse bitset
2022-10-14 13:45:40 +02:00
Exzap
f65dbe8437 Fix encoding error in input profile filenames
- Controller profile filenames now encode unicode characters correctly
- Removed dependency on boost::filesystem. There is still an indirect dependency on it from another boost module it seems
- Refactored some code to use FileStream instead of ifstream/ofstream
2022-10-12 14:27:01 +02:00
SSimco
d6ba61cf64
Add support for non portable mode (#356) 2022-10-12 08:03:26 +02:00
Exzap
2b9edced81
Minor tweaks and code clean up (#357) 2022-10-11 09:17:34 +02:00
MythicalPlayz
b07e9efba4
Add support for choosing network service (incl Pretendo+Custom) (#302) 2022-10-11 04:04:47 +02:00
Exzap
52cc7c5996
Follow imgui recommendation and streamline build dependencies (#355) 2022-10-11 01:43:15 +02:00
goeiecool9999
431c5a101f
Linux: Print demangled symbols on backtrace (#312) 2022-10-10 02:35:04 +02:00
Tillsunset
0c9fb3143f
memory optimization, using posix_memalign (#350) 2022-10-09 10:43:45 +02:00
Tillsunset
638e9e1f87
Workaround for the h264 video crash on macOS (#348) 2022-10-09 08:45:26 +02:00
Tillsunset
b724a657e6
MoltenVk: Add missing texture decoders (#332) 2022-10-08 15:07:54 +02:00
emiyl
00968acc1d
dedicated decoder for R4G4 and R4G4B4A4 to R8G8B8A8 (#331) 2022-10-07 02:39:06 +02:00
Tillsunset
fb5ecca157
Vulkan: Use correct texture clear in LatteDraw_handleSpecialState8_clearAsDepth (#321) 2022-10-02 19:18:35 +02:00
Tillsunset
11f6e2b7ee
Vulkan: Implement texture decoder for R5G6B5_UNORM to R8G8B8A8_UNORM (#320) 2022-10-02 01:48:13 +02:00
emiyl
9541c8ae85
MoltenVk: Workaround for unsupported format R5_G6_B5_UNORM (#318) 2022-09-30 18:07:00 +02:00
Exzap
cceb4f6d0e
Vulkan: Always disable blending for integer formats (#317)
Should fix a warning in the Vulkan validation layer and avoid a sigtrap in MoltenVk
2022-09-30 15:59:16 +02:00
emiyl
ecfbbd4e26
MoltenVK: Workaround for unsupported formats (#315) 2022-09-30 15:28:56 +02:00
Narr the Reg
3767257220
nfp: Fix corruption, correct structs and use write counters (#310) 2022-09-29 13:00:46 +02:00
Exzap
9caf57c2c5
Vulkan: Fix incorrect encoding for substituted R4G4 format (#288)
Fixed incorrect channel order when VK_FORMAT_R4G4_UNORM_PACK8 is substituted with VK_FORMAT_R4G4B4A4_UNORM_PACK16
2022-09-24 11:44:44 +02:00
Exzap
3bceb39966
Remove PUBLIC_RELEASE flag and tie asserts to debug config (#287)
Removes the -DPUBLIC_RELEASE flag. Cemu's debug asserts are now only enabled if the build configuration is Debug. Similarly, on Windows the console is only shown for Debug builds.
2022-09-24 08:43:27 +02:00
Crementif
510d80038d
[coreinit] Add OSIsDebuggerPresent 2022-09-19 21:41:01 +02:00
Exzap
12b6830546
GX2: Add crash workaround for FFL uninitialized texture (#264)
When a game tries to generate Miis without the FFL files being dumped (<mlc>/sys/title/0005001b/10056000/content/) it will cause it to create and use a texture with invalid parameters.
This workaround catches and replaces bad texture parameters to avoid crashing further down the line.

Resolves crashes in Sonic Lost World, Super Mario 3D World and probably a few others.

We had this workaround in pre-2.0 Cemu already but it was dropped during refactoring.
2022-09-17 16:32:46 +02:00
Tillsunset
41dcd48048
Fix a small regression when building in Macos (#262) 2022-09-17 13:52:12 +02:00
Herman Semenov
03f5967408
Fix incorrect streamout buffer index in GS + refactor various code (#258) 2022-09-17 03:45:18 +02:00
Maximilian Downey Twiss
4a3d02db55
Properly list files in CMakeLists instead of using GLOB (#249) 2022-09-17 03:24:57 +02:00
Exzap
63206eb9a8
coreinit: Return error code instead of success in Acquire failure (#260)
Spotted by @Fs00
It's currently not known if any games are affected by this
2022-09-16 14:25:38 +02:00
Francesco Saltori
664d7ee902
Clean up more Cemuhook leftovers (#253) 2022-09-16 13:34:41 +02:00
Exzap
680beaaf21 Rename path _utf8Wrapper to _utf8ToPath for better clarity 2022-09-09 23:49:38 +02:00
Exzap
168ecf8825 FSC: Use utf8 path strings instead of wchar
Also introduced helper function _utf8ToPath() to convert a utf8-encoded string to fs::path
2022-09-09 23:49:38 +02:00
Exzap
1ce629126a FSC: Refactor FileTree and remove redundant path parser class 2022-09-09 23:49:38 +02:00
Exzap
b8462cec8b FSC: Refactor to use FSCPath instead of legacy code 2022-09-09 23:49:38 +02:00
Exzap
0e0602e8d9 FSC: Use utf8 for mounting and internal target path 2022-09-09 23:49:38 +02:00
Exzap
1e851fe7e2
Latte: Fix infinite loop in special state clearAsDepth() (#209)
This broke while refactoring code for the 2.0 release. Resolves Tokyo Mirage Session and Pokken freezing on boot. Probably also affects some other games

Also updated .gitignore
2022-09-08 17:33:31 +02:00
Tom Lally
6cdb6eed17
Cleanup udiv128 (#206) 2022-09-08 02:12:53 +02:00
bitscher
4eaa600b57
Fix various compiler warnings given by Clang (#170) 2022-09-07 20:04:32 +02:00
bslhq
4d1be950e3
Fix various issues related to title names (#192)
Fixed various issues related to title names:
1. If console language is set to non-English, the title names in Title Manager may be empty.
2. Game list do not show custom names if list style set to icon or small icon.
3. Custom title names for some languages (like JP or CN) appear confusing if re-edited.
4. Unexpected overrides of variable values in ParsedMetaXml.h
2022-09-07 19:58:56 +02:00
Jun Bo Bi
b752d2eddd
fix clang-cl (#202) 2022-09-07 18:22:40 +02:00
goeiecool9999
e20bfd00ec
Separate filestream.h into OS specific implementation files (#190) 2022-09-07 02:42:25 +02:00
Tom Lally
f8b5024c09
Improved macro clarity. (#188) 2022-09-07 02:27:52 +02:00
Exzap
5a69505d13
Fix double %% on shader compilation screen
It was a relic from previously using sprintf where % has to be escaped with %%
2022-09-05 15:53:50 +02:00
SSimco
0ed4fdcd78
Update fmt version to 9.1.0 (#177) 2022-09-05 14:48:44 +02:00
Jun Bo Bi
a54a3ec74e
Fix build using clang-cl on windows and improve driver detection (#129) 2022-09-04 23:15:40 +02:00