Bug 257175

Summary: [NEW PORT] emulators/xenia: Xbox 360 Emulator
Product: Ports & Packages Reporter: Timothy Beyer <beyert>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Open ---    
Severity: Affects Only Me CC: beyert, pyrus, ygy
Priority: --- Keywords: patch
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
emulators_xenia.shar
none
[PATCH / NEW PORT] emulators_xenia.diff (improved patch quality, tested in poudriere) beyert: maintainer-approval+

Description Timothy Beyer 2021-07-14 07:00:58 UTC
Created attachment 226448 [details]
emulators_xenia.shar

I'm releasing my preliminary work on porting Xenia, an Xbox 360 emulator working with commercial games to FreeBSD.  It needed a lot of patches to work around threading differences between Linux and FreeBSD.  Most notably, I had to revert one file back two revisions to address C++17 compatibility (Xenia requires a C++17 compatible compiler, and clang++ is the only officially supported C++ compiler by the developers) with the LLVM include headers in /usr/src/include. 
 Prior to rolling back that file, there were notorious issues with fstream, iostream, and I ultimately brought in boost_nowide to get it to compile (I might try a simpler version later without this library since I have since resolved the standard library issues).

I will admit that while Xenia has been compiling without issues for a week or longer, I don't know if it runs, because it is so finicky on compatible hardware, and has extremely high GPU and CPU requirements to run games at full speed, even on Windows with current Direct X API support.  It is absolutely necessary to have a GPU with Vulkan API support, and further, you must enable one of the Vulkan backends for any games to work at all.  The compatibility is different between these two Vulkan backends (the legacy backend won't work with any games at all, and the other is undergoing testing) and the Direct X backend, the latter of which obviously will not work on Linux or FreeBSD.

If anyone can test this, I would appreciate if folks try building and let me know if it is working for them.  I have had limited success with the Windows version on one of my slower machines, but only with Direct X, although I am going to experiment some more and document the installation steps.

I'll be improving this port rapidly, so by the time a committer gets to this submission, it will probably be confirmed as working with some games.
Comment 1 Timothy Beyer 2021-07-14 07:05:47 UTC
Sorry, typo, I meant /usr/include in referring to the include directory.
Comment 2 Guangyuan Yang freebsd_committer freebsd_triage 2021-07-18 07:59:19 UTC
Timothy, first of all, thanks for working on this! I suggest that you create a review on https://reviews.freebsd.org/ and link it back here, so that committers can have an easier time providing feedback for lengthy patches. Thanks!
Comment 3 Timothy Beyer 2021-07-18 20:30:21 UTC
(In reply to Guangyuan Yang from comment #2)
Thank you! I will definitely create a review.
Comment 4 Timothy Beyer 2022-05-17 05:43:46 UTC
Created attachment 233994 [details]
[PATCH / NEW PORT] emulators_xenia.diff (improved patch quality, tested in poudriere)

This is a higher quality git-formatted diff that builds in poudriere.  I still am uncertain if the runtime issues that I experience are related to an inadequate GPU, but I plan to create a review as suggested.  There is one patch I wrote in files/ that I suspect needs some more work.  In either case, I fixed some minor errors in getting this to build in poudriere.