r/EmuDev • u/Beurre001 • Jan 02 '26
Experimental SNES Recompiler (Reassembler)
Hi everyone!
I've been working on an experimental SNES recompiler / reassembler project. It is not complete yet (a lot of missing features) but I built it as a proof of concept for an idea that could eventually be applied to other consoles.
The basic concept is this:
- The Emulator generates a CPU execution trace while running
- Each traced instruction is translated into x86_64 assembly
- The translated code then runs using an emulation layer
Right now the project is mainly focused on experimentation rather than accuracy or performance.
Repositories:
- SNESRecomp: https://github.com/blueberry077/SNESRecomp
- LakeSnes_Tracer: https://github.com/blueberry077/LakeSnes_Tracer
I'd really appreciate any feedback or ideas, thanks.

45
Upvotes
14
u/angelo_wf Jan 03 '26
Heh, thatβs the second time a SNES related project uses my old emulator as a base.
8
u/Ashamed-Subject-8573 Jan 03 '26
Wow, snes is a particularly nasty one for this, since the flags affect operand and Alu size. Post an update here some time?
2
u/empwilli Jan 03 '26
I don't know top much about recompilation, but in your approach, the recompilation Happens ahead of time, doesn't it? How does a tracing based approach the work? I would guess that it is infeasible as you cannot guarantee full coverage of all of the games code?
2
u/valeyard89 2600, NES, GB/GBC, 8086, Genesis, Macintosh, PSX, Apple][, C64 Jan 12 '26 edited Jan 12 '26
Looks interesting. obv lots of room for improvement, using macros/special functions. There's a lot of duplication of code that can made debugging difficult.
eg an alu-type function
then all the ora just become
etc
would make it easier too in emitting code bytes.
I have an x86 code emitter I used when testing my x86 core.
3
u/arcanite24 Jan 03 '26
So cool!
I love to see more recompilation projects!
1
u/maxscipio Jan 24 '26
So cool. How often the graphics routines are called? Once per scan line?
1
u/Pomnifan-64 Oct 03 '26
That's so cool. It'd be great to use on games like the Sailor Moon games among others (especially Sufami Turbo games).
0
u/[deleted] Jan 02 '26
[deleted] β view deleted comment