Comment by nmstoker

Comment by nmstoker 2 days ago

2 replies

Even with tooling isn't this kind of effort going to be enormously complicated, because, as I understand it, so many aspects of the behaviour of 8-bit and console games relied on all sorts of clever techniques, timing quirks and other side effects.

Won't it be very difficult for the recompilation process or the dev to recognise when these are being relied on and to match the key behaviour?

Or is the idea to pull out the basics of the game structure in a form that runs on modern hardware, then the dev fleshes out the missing parts.

Cieric 2 days ago

From the last time I looked at these recompilation projects, they take the assembly and basically convert each opcode back into an llvm instruction and then recompiled from there. This comes with a lot of caveats though, last time I looked at it we still needed a function map of some kind to tell us where all the functions are and you still needed to replace chunks of the generated code afterwards for things like rendering, sound, controller input, and just about anything that would interact with the world outside of the cpu.

Edit: After some reading on the github page, it seems they are translating it to c++ instead of using llvm directly, but the original idea still holds. They aren't decompiling it to c++ that looks like original source code, it more like they're converting it to c++ that emulates the processor and gets statically compiled.

So it's not really just a drop and go replacement like it sounds like it'd be, but it has so far enabled the recompilation of multiple n64 games. This seems like an extension into the ps2 space.

Side note: The ps2 is a 32bit console with a 64bit alu (and some 128bit simd)[1]. So a lot of the weird tricks from the 8bit days weren't really used here. Not that there aren't weird tricks, just things like using undocumented instructions and racing the beam are less prevalent. I could be wrong here, I was growing up at this time not making games. All of this is just from research I've done in the past. Someone feel free to correct me if I'm wrong.

[1] https://en.wikipedia.org/wiki/PlayStation_2_technical_specif...

aidenn0 2 days ago

I suspect many PS2 games were mostly written in C or C++, which greatly simplifies things. Games that used the interface libraries from Sony for e.g. managing input will greatly simplify things as well.

One notable exception is the Jak and Daxter games, which were written in GOAL[1], but have their own recompilation project.

1: https://en.wikipedia.org/wiki/Game_Oriented_Assembly_Lisp