This is not about rumours of an Xbox360 emulator or any some such, it’s about what’s been going round in my head the past 20 minutes or so: How would it be done? Emulating a CPU takes enormous amounts of time, not to mention that Linux on the PS3 runs inside a Hyper visor, stopping it from using the RSX graphics chip. So again: how would it be done.
Ok, lets look at some facts:
- PS3 gives Linux the use of 6 SPE’s
- PS3 has 2 memory banks, where the 360 has 1
- The 360 has a 3 core CPU
- Both CPU’s are PowerPC derivatives
To sum up the way I would go about building an emulator: I wouldn’t.
- I would build a kind of cross-compiler. Dedicate one of the SPE’s to transforming opcodes from Xbox to PS3 (where needed), this SPE could also be used to optimize code for the PS3’s architecture (this sort of thing has been done before).
- I would then link the Xbox 360 code to a PS3 native library of known API’s, allowing things like the graphics and sounds API’s to be built for the PS3. More of these API’s could be developed over time, eventually taking over from large chunks of the Xbox 360 code.
- I would drop the graphics detail and screen resolution heavily, I know this is a large part of why someone would buy one of these consoles, but you simply don’t have the power without the RSX (though successfully developing this code may push Sony to open the RSX up).
Depending on the underlying architecture of the XBox 360 and in particular the way it structures it’s executables, you may well be able to simply run a compiler over the code, optimize heavily (take a few minutes if you need to), and build a native PS3 / Linux executable which you run instead.
Update: In recent months Tungsten Graphics has been developing an OpenGL driver for the Cell CPU. Although it’s very early days for the project, in the long term it would make what I talk about on this page much easier. Although the RSX is not open to Linux, the Cell is mostly. Having a graphics driver for the Cell would make a dynamic-re-compiler a lot easier to do.
Also for those that are concerned with the speed of an emulator. Don’t forget the QEMU project. Ignoring the full machine emulation side of the project, QEMU also has the ability to run executables that target one CPU on a different CPU (provided the OS libraries can be found).