Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Xenia on Linux compiles for Travis tests in order to check C++ errors, style and very basic functionality. It has some nice abstract function definition. Most of these definitions are stubs with failing asserts which mean running Xenia in debug causes
The biggest missing part is the threading. Without threading implementation, the Xenia UI can't run and wait. The emulated threads and synchronization primitives which are built on top of these cannot work properly.
There is also PPC CPU emulation discrepancies between Windows and Linux. The registers used on 64-bit Windows and 64-bit Linux are not the same, therefore proper care must be made to use the correct registers when transitioning from guest to host code and vice-versa.
Memory mapping needs a bit of work due to the differences in shared memory and explicit memory ranges having different parameters and prefixes on Linux.
The GTK windowing and its interaction with Vulkan needs to fixed for several bugs.
The use of paths and the string functions need to better specify NT-style line endings (
Linux debugging and stack walking functions need to be implemented.
Approach to Adding Support
My approach to fixing the following problem has been to first add unit tests (and to use the ones already there) to the already working Windows implementation in order to have a behavioural ground truth. Then I add implementation to Linux which satisfy these tests. Once the Linux implementation pass the tests, I activate those tests on Travis in order to prevent future regressions.
Here are the PRs that I have worked on to have native Linux working. Some of these are built on top of the work of others and I preserved the authorship in the commits.
Things left to do
If anyone feels like contributing to the port there are a few areas which have not yet been addressed:
The fixes allow for all unit tests in the project to run and pass on Linux with clang.
The Xenia UI works and can select files with the open dialog.
Loading a xex will work up until emulation.
Calling a host function works as well as host calling a guest function.
Loading a ROM will eventually crash during emulation.
To try all the changes together:
$ git remote add bwrsandman firstname.lastname@example.org:bwrsandman/xenia.git $ git fetch bwrsandman $ git merge --no-ff --no-edit bwrsandman/linux_threads $ git merge --no-ff --no-edit bwrsandman/linux_cpu $ git merge --no-ff --no-edit -X theirs bwrsandman/linux_memory $ git merge --no-ff --no-edit bwrsandman/linux_windowing $ git merge --no-ff --no-edit -X theirs bwrsandman/linux_filesystem $ git merge --no-ff --no-edit bwrsandman/linux_debug $ git merge --no-ff --no-edit bwrsandman/linux_stack_walker $ # Resolving the conflict in .gdbinit in a union-like way $ sed -i '/^<<<<<<</d;/^=======/d;/^>>>>>>>/d' .gdbinit $ git add .gdbinit $ git commit --no-edit
You can add this to the commands to auto-resolve in a union-like way:
$ sed -i '/^<<<<<<</d;/^=======/d;/^>>>>>>>/d' .gdbinit $ git add .gdbinit $ git commit --no-edit
A cross platform audio back-end is implemented in PR #1498.
This comment was edited since my previous thoughts are no longer relevant
Ok a quick static analysis on which code segments assume
What about using
in the case of 4 byte
Another way would be to use std::u16string all around - That would however introduce other problems I guess.
That happened to me too on my local branch when i did the conversion. Trying to debug this in GDB is a nightmare though.. when I try to run dolphin.xex, the stack is clobbered when it crashes, so I don't know what to look at in IDA to try and figure out the crash.
Generally speaking, a clean solution on Linux is to use
For anyone not following along on the #dev-linux channel on the discord, I've gotten the game emulation to be stable. I'm going to check to make sure the fixes don't interfere with Windows, then open a new PR to get the changes merged.
Note: Vulkan Graphics and SDL Audio do not work as of now. SDL Input may work but I have no way of testing it in a game.
There seems to be a bug in the auto reset events in the threading PR.