Dolphin, the GameCube and Wii emulator - Forums

Full Version: Somewhat crazy porting project
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Hello all! I'm currently reading through the Dolphin codebase to see how feasible it would be to port Dolphin to another platform, as has already been done with Android. My ultimate end-goal: running Wii games on Wii U, but using the more powerful (and PC-like) GX2 GPU instead of the legacy Wii GX GPU. (Sounds crazy, but hear me out for a second, haha) The overall large-scale timeline would look something like this:
  1. Make a version of Dolphin with as few desktop-specific requirements as possible
  2. Retarget this version to Wii U hardware with completely CPU-based emulation
  3. Either...
    • modify the OpenGL backend for GX2 compatibility (GX2's API is quite OpenGL-like), or
    • write a GX2 backend from scratch (not fun, but might take advantage of the Wii U's Wii-like featureset more efficiently)
  4. (hopefully) since the Wii U's PPC cores are backwards-compatible with the Wii's PPC cores, directly run Wii PPC code on hardware without interpretation
As of now, this is mostly just a concept; I have enough programming experience to tackle this but not enough experience with Dolphin's architecture to really know what I'm doing. My question: knowing that Dolphin has already been ported to ARM, how would I begin porting parts of this massive codebase to PPC? Thanks so much!
You should join the IRC channel #dolphin-emu on Freenode if you want to discuss this in detail.
The very first big hurdle you would need to do is port Dolphin to big endian on PC hardware to make sure that works, which is a massive undertaking by itself.
Should be possible to get some desktop hardware running Linux with a semi-recent GPU to test against.
I'll do that as soon as I can, thanks! How would a big-endian version of Dolphin work at all on PC, considering PC is natively little-endian? I'm somewhat confused as to how this would be implemented.
(12-04-2017, 09:54 AM)compucat Wrote: [ -> ]I'll do that as soon as I can, thanks! How would a big-endian version of Dolphin work at all on PC, considering PC is natively little-endian? I'm somewhat confused as to how this would be implemented.

Though "PC" is often taken to mean "intel x86" - which is little endian - you can get desktop-class hardware with big-endian support (such as powerpc Smile and run linux on that. That may be a decent intermediate step, as it will likely be /much/ easier to develop and debug than charging straight onto console hardware.

As for the general goal - I fear that it'll be much more difficult than "just" running the code on the wii-u powerpc cores - much of the complexity comes with how that interacts with the other hardware (such as the gpu fico being mapped in the cpu memory, plus other hardware that's also directly accessed), which may mean it's not as much of an advantage as first thought.

Remember - the Wii doesn't have an operating system, so there's no interface you can use to re-implement the hardware at a high level.
(12-04-2017, 10:36 AM)JonnyH Wrote: [ -> ]Though "PC" is often taken to mean "intel x86" - which is little endian - you can get desktop-class hardware with big-endian support (such as powerpc Smile and run linux on that. That may be a decent intermediate step, as it will likely be /much/ easier to develop and debug than charging straight onto console hardware.

As for the general goal - I fear that it'll be much more difficult than "just" running the code on the wii-u powerpc cores - much of the complexity comes with how that interacts with the other hardware (such as the gpu fico being mapped in the cpu memory, plus other hardware that's also directly accessed), which may mean it's not as much of an advantage as first thought.

Remember - the Wii doesn't have an operating system, so there's no interface you can use to re-implement the hardware at a high level.
Yeah, I suspected hardware interfacing would be a major hurdle. The only big-endian desktop hardware I have access to is a cranky old iMac G3. 
An iMac G3 is actually probably the best thing to use for this, assuming it has on of the PowerPC 750 processors. Install Linux on that beast.
In a nutshell, the GC/Wii/Wii U are based on the PowerPC 750CXe: The GameCube CPU, the Gecko, is based on the PowerPC 750CXe. The Wii is further derived version of this ("Broadway"). The Wii U ("Espresso") is basically 3 Wii CPUs with some more stuff added on top.

You'll probably want to start with Wii U homebrew as well: https://wiiu.guide/
(12-05-2017, 05:46 AM)KHg8m3r Wrote: [ -> ]An iMac G3 is actually probably the best thing to use for this, assuming it has on of the PowerPC 750 processors. Install Linux on that beast.
In a nutshell, the GC/Wii/Wii U are based on the PowerPC 750CXe: The GameCube CPU, the Gecko, is based on the PowerPC 750CXe. The Wii is further derived version of this ("Broadway"). The Wii U ("Espresso") is basically 3 Wii CPUs with some more stuff added on top.

You'll probably want to start with Wii U homebrew as well: https://wiiu.guide/

Hm, interesting. I've had CBHC installed on my Wii U for a while and have a working toolchain for it ready to go. AFAIK all the iMac G3's had some sort of PowerPC 750 in them. 

...shoot, just realized that all of this is 32-bit. Patching Dolphin to work with 32-bit again will be *fun*
The interpreter should technically still work if you managed to force the existing code to compile for a 32-bit architecture. You wouldn't need a JIT if you had a 'real' CPU to work with, so that wouldn't be a problem. I can't remember if there's any reason any of the video backends wouldn't work under a 32-bit environment, but the software renderer would.
(12-05-2017, 12:38 PM)AnyOldName3 Wrote: [ -> ]The interpreter should technically still work if you managed to force the existing code to compile for a 32-bit architecture. You wouldn't need a JIT if you had a 'real' CPU to work with, so that wouldn't be a problem. I can't remember if there's any reason any of the video backends wouldn't work under a 32-bit environment, but the software renderer would.

I'm planning on just getting the interpreter and software renderer working for now-they'll be stupidly slow on a 400 MHz processor, but they should be able to run. The video card in this machine is so old that none of the video backends would be useful anyway-it's an ATI Rage 128.

Sidebar: getting Linux installed on a cranky old iMac G3 is more painful than it looks. Working on that right now. Also, is there any efficient way to cross-compile Linux PPC executables on Windows x64? I'd imagine build times would be horrendous on a 400 MHz G3.

Also, KHg8m3r: turns out my machine has a PowerPC 750CX, which is basically a slower Gekko minus the modified FPU and extra instructions.
I'm very interested in seeing this happen... so http://ellcc.org/ might have the compiler to crosscompile Linux PPC binaries on a Windows x64 machine...
Pages: 1 2 3