machinamentum / CTR64

N64 emulation research/development for 3DS. Hard fork of CTRX.
67 stars 3 forks source link

Something to think about. (static recompilation) #4

Open IcySon55 opened 8 years ago

IcySon55 commented 8 years ago

Considering that the end result of an N64 emulator on the N/3DS won't that amazing, a project I read about came to mind.

A guy was trying to statically recompile the original Super Mario Bros. NES to run on an x86 PC.

Instead of an emulator, what about a static recompiler? N64 to 3DS?

IIRC, something like this already exists for NES roms that can be recompiled into GBA roms.

Just some food for thought.

machinamentum commented 8 years ago

Static recompilation is generally not useful.

One of the primary problems is that it can't support self-modifying code, which for the N64 is a big deal breaker as the coprocessor is programmed through microcode that is written into memory by user code, so even a trivial program being translated this way would be a complicated problem.

I've also heard that the Corn emulator uses static recompilation, but it also only supports a very small number of games that are known to be easy to emulate (such as Mario64).

As a side note, I'm still not convinced that a JIT + dynamic recompiler or even a well-optimized multi-core interpreter would be too slow to emulate many of the simpler games.

IcySon55 commented 8 years ago

The reason that the guy trying to statically recompile SMB1 failed was precisely because of self-writing code. I was simply hoping that the N64 didn't do that. Oh well!

Good luck on this. I'd love to play N64 games in 3D as I'm sure everyone else would.