emoose/xenia

XEX1/Beta Dolphin running!

emoose opened this issue · 1 comments

Was playing around and got something interesting to happen, check the title version :)

xenia_22-09-06_12-46-56-613

Normally Xenia hangs with a "Unimplemented GPU OPCODE: 0x59", but looking into the code for that in the dolphin XEX there's something I noticed comparing it with final.

Here's the 1838 XEX:
image
Compared to the final dolphin XEX:
image

Translating that, in 1838 it checks GraphicsAsicID, if lower than 0x11 it uses 0x58, but if equal to or above it uses 0x59 (unimplemented in xenia) - but in the later dolphin that check is removed, always using the 0x58 packet instead.

I guess maybe 0x11 & above are treated as beta chips, looks like Rick did mention on Discord that some games skip a bunch of Vd initialising funcs & other work if 0x11 is set which is why Xenia uses it. (E: eh, seems retail kernel always returns 0x11, weird)

Fortunately it seems changing Xenia's VdGetGraphicsAsicID to return 0x10 instead of 0x11 does give the result above, though if 0x11 does save us a lot of work maybe it'd be better to see if we can just implement the 0x59 packet the same as 0x58. (assuming the GPU code doesn't change other packet IDs based on AsicID too - the 1838 dolphin does seem to include a lot more VdGetGraphicsAsicID checks at least...)

I'm not sure if this is enough to get actual XEX1 games to boot though, pretty sure I tried this same workaround on some XEX1 betas a few years ago when XEX1 loading was added in & didn't have any luck, maybe something in Xenia changed since then which let it work though, or maybe those games were using kernel exports with different ordinals.

Unfortunately I don't have access to any XEX1 builds to test with now, just a drive/NAND dump from a beta kit, and can't really remember what XEX1 titles were out there, if anyone knows of what XEX1 builds are available please let me know!


E: looking into Xenia, seems 0x59 is defined as PM4_EVENT_WRITE_CFL, Xenia handles all the other PM4_EVENT_WRITE_* packets except for CFL, I guess it's never used in any retail games? Wonder why it got dropped.

Letting Xenia use the same code as PM4_EVENT_WRITE_SHD (0x58) seems to be enough to let it run, from the description for CFL it should probably act different to SHD though (seems SHD should "generate a cache flush done event", no idea how though)

Although thinking about it, if 0x11 is the beta chip ID maybe it'd be better for Xenia to use the actual retail ID, so it wouldn't have to deal with the CFL packet at all - seems Dolphin runs fine with it at least, maybe other games will too?

E2: ah there's a twist: seems final xboxkrnl actually returns 0x11 as the AsicID - the hell?

Would be interesting to see whether XEX1 dolphin could run on a XEX2 kernel (with file headers changed, and the asic stuff patched), maybe will have to get my box out soon (or if someone already has a box setup please contact me!)

Aha, seems some other XEX1 titles are also running with it too, such as Football Manager 2005 (2005-08-08) (beta) :)

xenia_22-09-06_15-11-02-329

(for that I also had to edit HostPathDevice to not be read-only, since game wants to write into \temp folder)