fixes #1960 this commit implements one particular approach for exiting emulation when the RPX being emulated calls `coreinit.exit`. I don't believe this might be the best way long term, but it seemed to be the best way given the state (and my knowledge of the codebase). This threads through 'End Emulation' (normally a debug only feature in the Cemu menu) into one more spot in the codebase, when `coreinit.exit` is called. Why did we go this way? Stopping PPC Emulation _while_ the emulator is actively executing an instruction (the call to `coreinit.exit`) seemed like a path of el derado everytime i tried it. calling `Shutdown`, or `ShutdownTitle` is not ideal because it doesn't do things like update status in discord or any of the other window actions, and they lock up because the emulator is already running the coreinit instructions (even if you launch it in a delayed thread, the PPC emulator is still doing stuff). so the only way to get this to somewhat work is _to reach out to the window system_. So I threaded through an `EndEmulation` request, which started off just calling `EndEmulation` that already existed. There is a note on that function about how it memory leaks if called repeatedly, and it's "not finished". However, this seemed better than looping forever, or just crashing with a debug assert. At least you still have a semi-functional window (even if memory is leaking), and a log window you can investigate? However, just calling endemulation didn't exit when Cemu was launched from the command line (my goal), it just returns to the main Cemu window. To make Cemu usable as a command line app that you can fire and forget, I threaded a new variable through, that when end emulation is called and the title was launched with `-g`, or `-t`, it just closes cemu altogether. this allows my CLI commands to "just work" |
||
|---|---|---|
| .github | ||
| bin | ||
| cmake | ||
| dependencies | ||
| dist | ||
| src | ||
| .clang-format | ||
| .gdbinit | ||
| .gitattributes | ||
| .gitignore | ||
| .gitmodules | ||
| boost.natvis | ||
| BUILD.md | ||
| CMakeLists.txt | ||
| CMakeSettings.json | ||
| CODING_STYLE.md | ||
| LICENSE.txt | ||
| README.md | ||
| vcpkg.json | ||
Cemu - Wii U emulator
This is the code repository of Cemu, a Wii U emulator that is able to run most Wii U games and homebrew in a playable state. It's written in C/C++ and is being actively developed with new features and fixes.
Cemu is currently only available for 64-bit Windows, Linux & macOS devices.
Links:
- Open Source Announcement
- Official Website
- Compatibility List/Wiki
- Official Subreddit
- Official Discord
- Official Matrix Server
- Setup Guide
Other relevant repositories:
Download
You can download the latest Cemu releases for Windows, Linux and Mac from the GitHub Releases. For Linux you can also find Cemu on flathub.
On Windows, Cemu is available both as an installer and in a portable format, where no installation is required besides extracting it in a safe place.
The native macOS build is currently purely experimental and should not be considered stable or ready for issue-free gameplay. There are also known issues with degraded performance due to the use of MoltenVK and Rosetta for ARM Macs. We appreciate your patience while we improve Cemu for macOS.
Pre-2.0 releases can be found on Cemu's changelog page.
Build Instructions
To compile Cemu yourself on Windows, Linux or macOS, view BUILD.md.
Issues
Issues with the emulator should be filed using GitHub Issues.
The old bug tracker can be found at bugs.cemu.info and still contains relevant issues and feature suggestions.
Contributing
Pull requests are very welcome. For easier coordination you can visit the developer discussion channel on Discord or alternatively the Matrix Server. Before submitting a pull request, please read and follow our code style guidelines listed in CODING_STYLE.md.
If coding isn't your thing, testing games and making detailed bug reports or updating the (usually outdated) compatibility wiki is also appreciated!
Questions about Cemu's software architecture can also be answered on Discord (or through the Matrix bridge).
AI generated contributions:
We ask that all code submitted is written and understood by a human. You can use AI for planning, designing, reviewing and for asking questions about the codebase, but the code itself needs to be written by you. As a small exception you can use intellisense-style AI code autocompletion for pure boilerplate code as long as it's only a small part of your submission. To further clarify, when we ask for "human written" that excludes letting an AI write the code and then paraphrasing it. In other words, we are asking for human effort.
Why this policy exists:
We have relatively low reviewing capacity and requiring human-written code increases the quality and trustworthyness of submitted pull requests. There are also general concerns with AI usage in emulation:
- LLMs tend to make up solutions that work on the surface but are generally not accurate in the emulation sense
- There is evidence that LLMs have been trained on leaked proprietary SDKs and we cannot verify the origin of the knowledge. This is especially a problem for core emulation logic
Please keep these points in mind when contributing to Cemu. Contributions that do not follow this policy may be rejected.
License
Cemu is licensed under Mozilla Public License 2.0. Exempt from this are all files in the dependencies directory for which the licenses of the original code apply as well as some individual files in the src folder, as specified in those file headers respectively.