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.
* 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>
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.
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.
Also adds some code for enabling multi-user support inside apps maybe, but it's probably hardcoded in more places since Cemu currently only shows the active account.
* Update OpenSSL hash functions to OpenSSL 3.0
* Fix invalid sscanf format in DownloadManager
* Fix unset return value warning
* Fix erroneous check on otpMem in iosu_crypto