Tanuki3DS - Cross Platform 3DS Emulator in C23

20 hours ago 2
Tanuki3DS - Cross Platform 3DS Emulator in C23

Tanuki3DS is a high level emulator for the Nintendo 3DS handheld game console. It runs on Linux, Windows, and MacOS and can play many games pretty well with some enhancements. It contains:

  • A custom JIT recompiler from arm32 to x86_64 and arm64
  • OpenGL renderer emulating the PICA200 gpu, including generation of vertex and fragment shaders
  • Audio emulation
  • HLE reimplementation of parts of the 3DS's kernel relevant for games
  • Frontend with SDL3 and cimgui
  • All in C

I started this project back in August 2024 and have been working on it periodically since then. Would be interested in getting some feedback on the code.

Note that unfortunately the x86 jit backend is in C++ because I could not find a good C library for emitting x86 instructions. The arm64 emitter was written by me and it heavily abuses macros and _Generic to allow writing code that looks just like assembly language. Maybe one day I will write an x86 one too but the instruction encodings are not particularly pleasant to work with lol.

Anyways, enjoy.

submitted by /u/xborg0 to r/C_Programming
[link] [comments]
Read Entire Article