Live data from Hacker News

Nearly all Nintendo 64 games can now be recompiled into native PC ports

tomshardware.com

71–80 of 182 posts

Re: Nearly all Nintendo 64 games can now be recompiled into native PC ports

#72
post #21

To operate this tool, you still need to disassemble the ROM up front and annotate it heavily before it can be recompiled. This tool is very nice, to be sure, but the hyperbole about anything close to one-click generation of standalone executables for an arbitrary ROM is getting out of hand.

I don't think that's true. The video in the post shows a no-name n64 game being recompiled and running fine. No annotation needed.

The video also makes it clear that only games using a certain microcode works for now. I imagine there are many parts of HLE emulation that gets added to the recompiled software as wrappers and compatibility code to make it all work, so in a sense this may be more akin to an embedded emulator into a native binary (recompiled code), which can overtime be worked on to add new features, fix shortcomings of the original software and make it more "ergonomic"/compatible with it's new target platform. But such work can only feasibly be achieved by reverse engineering the software and giving it human readable symbols. In a sense there is almost as much work to do as on the previous decompilation projects, but you can get results (run the game) right away (or at least much faster than traditionally), assuming of course the game uses a compatible microcode and isn't doing anything fancy that depends on the intrinsics of the n64 architecture.

Re: Nearly all Nintendo 64 games can now be recompiled into native PC ports

#73
post #72

Earlier quoted context omitted.

I don't think that's true. The video in the post shows a no-name n64 game being recompiled and running fine. No annotation needed.

The video also makes it clear that only games using a certain microcode works for now. I imagine there are many parts of HLE emulation that gets added to the recompiled software as wrappers and compatibility code to make it all work, so in a sense this may be more akin to an embedded emulator into a native binary (recompiled code), which can overtime be worked on to add new features, fix shortcomings of the original…

I’m guessing it works for the standard Nintendo provided microcodes.

Re: Nearly all Nintendo 64 games can now be recompiled into native PC ports

#74
post #72

Earlier quoted context omitted.

I don't think that's true. The video in the post shows a no-name n64 game being recompiled and running fine. No annotation needed.

The video also makes it clear that only games using a certain microcode works for now. I imagine there are many parts of HLE emulation that gets added to the recompiled software as wrappers and compatibility code to make it all work, so in a sense this may be more akin to an embedded emulator into a native binary (recompiled code), which can overtime be worked on to add new features, fix shortcomings of the original…

There’s also inevitably going to be timing/performance-related bugs - the N64’s devkit docs say it runs games under a thin OS for multi-threading[1] so that’s another opportunity for things to go wrong.

Also, after conversion these games are still designed and hardcoded for an N64 controller and 4:3 aspect-ratio - that’s hardly “native” as far as PC gamers are concerned.

[1] https://ultra64.ca/files/documentation/online-manuals/man/pr...

Re: Nearly all Nintendo 64 games can now be recompiled into native PC ports

#75

I saw this when it came out, and as someone that doesn't follow the ROM hacking scene, I'm wondering - why did this approach take so long to come up with? Translating the assembly instructions to C and then recompiling them seems like an obvious method to try early on, but I'm wondering if there was some other breakthrough that made this possible in a way it wasn't before?

Are they using self-modifying code or anything else that would make this tricky?

Really surprised this topic didn't come up anywhere. I couldn't find anything in the linked repositories either. I guess there's no self-modifying code due to it being mapped into the address space from a cartridge?

Re: Nearly all Nintendo 64 games can now be recompiled into native PC ports

#76
As an aside, the perfect dark decompile port is really nice to play on the steam deck. Not sure why, but the Linux version tends to freeze on the villa level. Switching to the windows version and using proton works great.

https://github.com/fgsfdsfgs/perfect_dark

Re: Nearly all Nintendo 64 games can now be recompiled into native PC ports

#77

I saw this when it came out, and as someone that doesn't follow the ROM hacking scene, I'm wondering - why did this approach take so long to come up with? Translating the assembly instructions to C and then recompiling them seems like an obvious method to try early on, but I'm wondering if there was some other breakthrough that made this possible in a way it wasn't before?

Other emulators want to solve the problem generically, and this solution doesn't quite.

Static recompilation from one machine language to one other language is somewhere between extremely difficult to not being generally possible in practice [1]. To make recompiling something like this properly, you need some help from the binaries that make recompilation easier [2] and on top of that you need to patch certain things to make this work [3].

Dynamic recompilation doesn't have this problem. It allows you to create software you can dump the original binaries+assets ("ROMs") in and it will generally emulate it.

There's a lot of confusion about how generic this solution it. It's extremely impressive in how much work it saves making recompilations/"ports" much easier, and it will be very valuable. But it is not able to replace the need for traditional emulators.

[1]: https://cs.stackexchange.com/questions/155511/why-is-static-...

[2]: N64 game binaries may happen to avoid a bunch of things that make general static recompilation hard that help this approach, but I don't actually know.

[3]: The Majora's Mask recompilation repository contains a lot of handcrafted patches to make it work: https://github.com/Mr-Wiseguy/Zelda64Recomp

Re: Nearly all Nintendo 64 games can now be recompiled into native PC ports

#79
I wish all game executables would be OS agnostic, something similar to WebAssembly: GameAssembly. For example you can no longer play 32-bit games on new macOS version, neither 32-bit Windows games under Wine. It's almost impossible to find 64-bit .exe files so they can run under fine under Wine/Crossover.

Re: Nearly all Nintendo 64 games can now be recompiled into native PC ports

#80

I saw this when it came out, and as someone that doesn't follow the ROM hacking scene, I'm wondering - why did this approach take so long to come up with? Translating the assembly instructions to C and then recompiling them seems like an obvious method to try early on, but I'm wondering if there was some other breakthrough that made this possible in a way it wasn't before?

The N64 has a GPU, which is not the same as modern GPUs, and you need that GPU to render graphics. Skimming the Github repo, looks like this uses rt64 under the hood for the raytracing support ( https://github.com/rt64/rt64 ), and that uses the ubershader technique to emulate the GPU. This excellent article talks about the what, why, and insanity that are ubershaders: https://dolphin-emu.org/blog/2017/07/30/ubershade…

Was raytracing support necessary to get the compilation working to circumvent "normal" GPU calls?
Post reply on HN