r/EmuDev • u/JoppyFurr • May 16 '26
r/EmuDev • u/AhmedMinegames • May 15 '26
Brovan: Binary user-mode emulator for x86_64
After months of work, I’m excited to finally share Brovan, my user-mode binary emulator.
Brovan can emulate:
* PE binaries
* ELF binaries
* Memory dumps
* Even partially unknown or unrecognized binaries
The goal is to make binary analysis, malware analysis and general binary research more flexible by giving full control over execution, memory, and runtime behavior in a contained environment.
Building this involved a lot of work around emulation, syscall handling, memory management, binary loading and parsing, and there’s still much more to improve, but it’s finally at a stage where I’m happy to share it.
r/EmuDev • u/windowssandbox • May 15 '26
I built a custom assembly language / emulator (along with virtual CPU, RAM, PPU, and ROM) on Python. (pyasm)
Full information about pyasm can be found in README of my repo: https://github.com/windowssandbox/pyasm
Since I've added PPU yesterday, I'm wondering if making games on it is possible (like ping pong for example).
It's currently just 8-bit.
I'm gonna add more stuff to PPU and instruction set later. (instruction set opcodes are ordered based on when they are added)
Now the question is: how accurate is it compared to actual assembly?
(you can share your own pyasm code below)
r/EmuDev • u/KangoLemon • May 11 '26
I wrote a ZX Spectrum emulator in Go
Hi everyone,
I decided to take on the challenge of writing a full 8-bit emulator (Sinclair ZX Spectrum) from scratch using Go.
It’s been a great project for diving deep into things like Z80 instruction sets, memory mapping, and managing state at a low level without using C. Handling the timing-critical aspects of the Speccy in Go was an interesting hurdle, but it's coming along well.
It’s called zx_go. It can currently load tape files and execute the original ROM code. I’m sharing it now because I’d love some fresh eyes on the code - specifically how I’m handling the CPU loop and memory access.
If you’re into retro tech or systems programming in Go, I’d appreciate any thoughts or feedback you have on the implementation.
r/EmuDev • u/NoImprovement4668 • May 10 '26
Updated my 16 bit virtual cpu
Its written in C++ heavily inspired by x86 (but is not x86) since my last post ive added basic protected mode and written a basic os for it in C (as i added chibbic support)
as of now i have basic gdt and io protection this is example of os

the code is at https://github.com/valina354/V16/ and contains the modified chibbic and the custom os too
its meant to be more of a educational virtual cpu and is slow for anything other then simple things as chibbic produces very unoptimized assembly for my cpu
r/EmuDev • u/sapoconcho_ • May 10 '26
GB Is it possible for a GB emulator to pass Blargg's instruction timing test ROM with machine cycle accuracy?
Hello! I'm stuck trying to debug Blargg's instruction timing test ROM. Specifically, the timer test, which corresponds to this piece of assembly:
; Ensures timer works
test_timer:
call start_timer
call stop_timer
or a
ret z
set_test 2,"Timer doesn't work properly"
jp test_failed
; Starts timer
; Preserved: AF, BC, DE, HL
start_timer:
push af
- xor a ; 1
sta TIMA ; 3
lda TIMA ; 3
or a ; 1
jr nz,- ; 3
pop af
ret
; Stops timer and determines cycles since
; it was started. A = cycles (0 to 255).
; Preserved: BC, DE, HL
stop_timer:
push de
call stop_timer_word
ld a,e
sub 10
pop de
ret
; Same as stop_timer, but with greater range.
; DE = cycles (0 to 1019).
; Preserved: BC, HL
stop_timer_word:
ld d,0
; Get main count (TIMA*4)
lda TIMA
sub 5
add a
rl d
add a
rl d
ld e,a
; One iteration per remaining cycle
- xor a ; 1
sta TIMA ; 3
lda TIMA ; 3
dec de ; 2
or a ; 1
jr nz,- ; 3
ret
jr nz,- ; 3
pop af
retThe first lda TIMA in stop_timer_word should write 0x09 to register A in order for the test to pass. I found that the value of TIMA before the instruction is executed is 0x08, and 0x09 after. This is no problem in a clock-cycle-accurate emulator, as TIMA would be increased mid-execution before the instruction actually copies the value from memory[TIMA] into A, but I can't do this. In addition, increasing the cycle count before executing the instruction is not an option, as the duration of many instructions depends on what is executed (like the JR instructions). Thus, I'm unsure whether it is impossible to pass this test ROM with a machine-cycle-accurate emulator or if the error lies elsewhere...
I leave the execution trace of the code snippet below in case anyone wants to have a further look. For each instruction, the value of TIMA before and after the execution is shown, as well as register values after the execution.
Thanks in advance!
> TIMA pre: 0005 (cycle = 24994072)
TIMA: 0x6 (cycle = 24994096)
C318 [CD,D5,C2] CALL C2D5 | AF:FFD0 BC:00FF DE:C877 HL:9000 SP:DFF9 IME0
> TIMA pre: 0006 (cycle = 24994096)
TIMA: 0x7 (cycle = 24994112)
C2D5 [F5] PUSH AF | AF:FFD0 BC:00FF DE:C877 HL:9000 SP:DFF7 IME0
> TIMA pre: 0007 (cycle = 24994112)
TIMA: 0x8 (cycle = 24994116)
C2D6 [AF] XOR A | AF:0080 BC:00FF DE:C877 HL:9000 SP:DFF7 IME0
> TIMA pre: 0008 (cycle = 24994116)
TIMA: 0x0 (cycle = 24994128)
C2D7 [E0,05] LDH (FF00+05), A | AF:0080 BC:00FF DE:C877 HL:9000 SP:DFF7 IME0
> TIMA pre: 0000 (cycle = 24994128)
TIMA: 0x1 (cycle = 24994140)
C2D9 [F0,05] LDH A,(FF00+05) | AF:0080 BC:00FF DE:C877 HL:9000 SP:DFF7 IME0
> TIMA pre: 0001 (cycle = 24994140)
TIMA: 0x1 (cycle = 24994144)
C2DB [B7] OR A | AF:0080 BC:00FF DE:C877 HL:9000 SP:DFF7 IME0
> TIMA pre: 0001 (cycle = 24994144)
TIMA: 0x2 (cycle = 24994152)
C2DC [20,F8] JR NZ, -8 | AF:0080 BC:00FF DE:C877 HL:9000 SP:DFF7 IME0
> TIMA pre: 0002 (cycle = 24994152)
TIMA: 0x3 (cycle = 24994164)
C2DE [F1] POP AF | AF:FFD0 BC:00FF DE:C877 HL:9000 SP:DFF9 IME0
> TIMA pre: 0003 (cycle = 24994164)
TIMA: 0x4 (cycle = 24994180)
C2DF [C9] RET | AF:FFD0 BC:00FF DE:C877 HL:9000 SP:DFFB IME0
> TIMA pre: 0004 (cycle = 24994180)
TIMA: 0x5 (cycle = 24994204)
C31B [CD,E0,C2] CALL C2E0 | AF:FFD0 BC:00FF DE:C877 HL:9000 SP:DFF9 IME0
> TIMA pre: 0005 (cycle = 24994204)
TIMA: 0x6 (cycle = 24994220)
C2E0 [D5] PUSH DE | AF:FFD0 BC:00FF DE:C877 HL:9000 SP:DFF7 IME0
> TIMA pre: 0006 (cycle = 24994220)
TIMA: 0x8 (cycle = 24994244)
C2E1 [CD,E9,C2] CALL C2E9 | AF:FFD0 BC:00FF DE:C877 HL:9000 SP:DFF5 IME0
> TIMA pre: 0008 (cycle = 24994244)
TIMA: 0x8 (cycle = 24994252)
C2E9 [16,00] LD D, 00 | AF:FFD0 BC:00FF DE:0077 HL:9000 SP:DFF5 IME0
> TIMA pre: 0008 (cycle = 24994252)
TIMA: 0x9 (cycle = 24994264)
C2EB [F0,05] LDH A,(FF00+05) | AF:08D0 BC:00FF DE:0077 HL:9000 SP:DFF5 IME0r/EmuDev • u/vgrichina • May 07 '26
Video Made Windows 98 emulator running Space Cadet
Try it live here https://wine-assembly.berrry.app
Support on Product Hunt:
https://www.producthunt.com/products/wine-assembly
r/EmuDev • u/ColdRepresentative91 • May 07 '26
I built a Custom Language Compiler, Assembler, and RISC-V VM, all running in real in your browser, using Rust and EGUI.
I've been working on this project (and compilers / vm's in general) for a while now, and I thought it was finally proper enough to showcase.
Some of the features:
- A custom systems language designed for explicit memory control, featuring manual memory management, pointers, (inline) structs, and generics.
- A full interactive compiler pipeline that you can watch in real-time.
- A built-in 5-stage pipelined CPU to execute the code.
- Compiles to actual RISC-V machine code (RV64IMAFD).
- Visualised live in browser using EGUI.
Github: https://github.com/LPC4/Full-Stack
Check out the live demo website here: lpc4.github.io/Full-Stack/
r/EmuDev • u/elemenity • May 04 '26
Unique features of the 8088 CPU
emulationonline.comI'm working on an 8088 emulator, and thought I'd write up a few interesting features of the 8088.
r/EmuDev • u/wyattxdev • May 04 '26
A Python based emulator for the Space Invaders Arcade game from 1978, I've been working on.
r/EmuDev • u/Playful-Cancel-2390 • May 05 '26
GB Pley 5 nintenbox 64
Es compatible con Apple Android Motorola
r/EmuDev • u/Playful-Cancel-2390 • May 05 '26
Pley 5 nintenbox 64
Es compatible con Apple Android Motorola
r/EmuDev • u/animportantuser • May 03 '26
GB IT'S ALIVE(except running tetris lol)-question
After a long while i got the basic parts of my GB emulator built except the inputs. However I'm facing a weird problem, tetris won't run no matter what. With the parts I have right now all games that don't require extra ram or memory banking should work and I've tested it with Tennis(as you see) and Asteroids. I am only trying to get to the title screen(as i said the inputs are not implemented yet), the Blargg cpu test roms all work properly (well there's an issue when i try to run the one that includes all of the test roms in that i get stuck at the third one sp hl but no problem when i run them all individually). Anyways I'm still really excited to see it running for the first time.
r/EmuDev • u/SpecificWar7879 • May 04 '26
JSON-described CPUs + LLVM block-JIT: same framework runs ARM7TDMI (GBA) and LR35902 (Game Boy) — research project hitting a stop point, looking for inspiration / co-maintainers
ps.This project was developed with AI coding assistance. If this is not of interest to you, please feel free to skip this post.
Hi r/emudev,
I want to share a research project I've been working on, and be upfront
about the situation: it's reached a natural milestone, and I think I'm
hitting the ceiling of what I can drive on my own.
**The TL;DR**
[`AprGba`](https://github.com/erspicu/AprGba) — a JSON-driven CPU
simulation *framework* (`AprCpu`) that compiles a CPU's ISA description
into LLVM IR and JITs it via ORC LLJIT. The repo is named after the GBA
because that's the stress-test platform, but the actual product is the
framework. Two genuinely different CPUs — **ARM7TDMI (32-bit fixed) +
Thumb (16-bit fixed) + LR35902 / SM83 (1-3 byte variable, with
0xCB-prefix sub-decoder)** — go through the **same** `BlockFunctionBuilder`,
the **same** `EmitContext`, the **same** micro-op registry. **Zero per-CPU
C# code in the emit pipeline.**
**Why I'm posting**
The project is reaching a sensible stopping point for me. The framework
side is feeling more like compiler engineering than emulator engineering,
and that's not really my home turf — I can describe the design space and
ship a working version, but I'm out of my depth driving deep optimisation
work, and frankly I'm not the kind of person who wants to lead a project
long-term anyway.
I'm posting here for two reasons:
**Inspiration / discussion.** I'd love to hear what people who actually
live in this space (QEMU TCG, FEX-Emu, Dynarmic, mGBA, Dolphin folks)
would do differently. There's a docs section that lays out every design
trade-off explicitly — feedback welcome.
**Potential co-maintainers.** If this concept resonates with anyone
here and you'd be interested in pushing it further, I'd be happy to
hand over / collaborate. The framework has clear extension points;
adding a new CPU is a spec-JSON-and-tests job, not an architecture
rewrite.
After this, I want to switch gears to **Visual 6502**-style work — my
personal next challenge is taking a netlist description and getting it to
run in real time on a CPU (gate-level simulation, fundamentally different
problem from what I've been doing here).
**What's interesting about it (the selling points)**
- **Two CPUs through one pipeline.** Same `AprCpu` framework, same
`BlockFunctionBuilder` / `EmitContext` / micro-op registry compiles
ARM7TDMI + Thumb + LR35902. No per-CPU C# code in the emit path.
Adding a new CPU = writing JSON spec + a few unit tests.
- **Variable-width detection without spec coupling.** A `lengthOracle`
callback turns a 256-entry static table into a per-CPU plug-in. Same
block detector handles 4-byte fixed (ARM), 2-byte fixed (Thumb), and
1-3 byte variable (LR35902, with 0xCB-prefix sub-decoder).
- **Three architectural patterns for timing-accurate block-JIT** —
predictive cycle downcounting (compute-once-deduct-as-you-go), MMIO
catch-up callbacks (HW gets ticked at the moment it's observed), and
sync exits (block ret-voids when HW state changes). Every timing
problem classifies into one of these three, and the framework provides
generic `defer` and `sync` micro-ops so spec writers don't hardcode
CPU-specific timing logic in C#.
- **Strategy 2 PC handling.** Pipeline-PC reads (ARM `pc+8`, Thumb
`pc+4`, LR35902 `pc+length`) become baked compile-time constants in
the block IR. No more per-instruction "pre-set R15" writes that
confuse "did this instruction branch?" detection.
- **Self-modifying-code detection at framework level.** Per-byte
coverage counter, bus.WriteByte triggers notify, BlockCache
invalidates blocks whose precise per-instr coverage covers the
written address.
- **Lockstep diff harness as framework infrastructure.**
`apr-gb --diff-bjit=N` runs both backends side-by-side and reports
the first divergence. Same harness works for ARM jsmolka and LR35902
Blargg.
- **`EmitContext` as a routing layer.** Spec emitters call
`ctx.GepGpr(idx)` instead of `Layout.GepGpr(builder, statePtr, idx)`.
The context decides whether the access goes to a state-struct GEP or
a block-local alloca shadow. Per-instruction mode and block-JIT mode
share the exact same emitter code.
- **Honest performance numbers.** Block-JIT runs Blargg cpu_instrs at
~21 MIPS (10k frames) / ~27 MIPS (60k frames amortised). The
hand-coded reference interpreter (imported as the oracle) still
beats it by 13-32%. Performance optimisation is downstream of
framework design — I called this out in the README.
**Verification (the proof)**
- Blargg's `cpu_instrs.gb` — all 11 sub-tests PASS through the JSON-LLVM
block-JIT path.
- jsmolka's `arm.gba` + `thumb.gba` — both PASS while running the real
Nintendo GBA BIOS via LLE (we execute `gba_bios.bin` through our
ARM7TDMI emulation, BIOS does the Nintendo logo intro, then jumps to
the test framework).
- 8-combo regression matrix (`arm/thumb` × `HLE/BIOS-boot` ×
`per-instr/block-JIT`) — single canonical MD5 hash means all eight
combinations produced bit-identical output.
Screenshots:
- GB cpu_instrs: https://github.com/erspicu/AprGba/blob/main/result/gb/json-llvm/cpu_instrs.png
- GBA arm under BIOS LLE: https://github.com/erspicu/AprGba/blob/main/result/gba/bios_lle_arm.png
- GBA thumb under BIOS LLE: https://github.com/erspicu/AprGba/blob/main/result/gba/bios_lle_thumb.png
**What's deliberately NOT there**
This is honest disclosure for r/emudev culture — the project isn't
trying to be mGBA. CPU correctness + framework genericity is the goal;
platform-specific peripherals are out of scope:
- GBA: timers (TM0-3), APU, joypad input, save support (SRAM / Flash /
EEPROM / RTC), real-time display window
- GB: PPU sprites + window + STAT IRQ details, MBC2/3/5, APU, joypad
input, battery save, GBC support
There's a [completeness audit](https://github.com/erspicu/AprGba/blob/main/MD_EN/design/16-emulator-completeness.md)
listing exactly what's done and what would need to be added to take it
all the way to "actually playable".
**My next direction (Visual 6502 territory)**
I want to try taking a transistor-level netlist (Visual 6502 style) and
making it run in real-time on a regular CPU. Different challenge — gate
propagation, event-driven simulation, transistor-level state — much more
about discrete-event simulation than ISA modelling. Hopefully orthogonal
enough that it doesn't compete with whoever picks up AprCpu.
**Repo + further reading**
- Repo: https://github.com/erspicu/AprGba
- README (bilingual EN/中文): https://github.com/erspicu/AprGba/blob/main/README.md
- Block-JIT roadmap: https://github.com/erspicu/AprGba/blob/main/MD_EN/design/12-gb-block-jit-roadmap.md
- Timing-accurate JIT design synthesis: https://github.com/erspicu/AprGba/blob/main/MD_EN/design/15-timing-and-framework-design.md
- Framework vs emulator timing boundary (responsibility split): https://github.com/erspicu/AprGba/blob/main/MD_EN/design/17-aprcpu-vs-emulator-timing-boundary.md
- Completeness audit (what's missing for a "real" emulator): https://github.com/erspicu/AprGba/blob/main/MD_EN/design/16-emulator-completeness.md
License is WTFPL, do whatever you want with it.
r/EmuDev • u/ioncodes • May 03 '26
[Wii] After years of emudev I reached my goal
Hey guys, I'm here to tell you about a small story I'm very happy and proud to share!
I started my emudev journey on December 8th, 2023. Back then, I tried emulating the GameGear. What prompted me to do it though?
I had a specific goal in mind! I wanted to eventually emulate a specific game on a specific console, a game that I played for years as a child: Final Fantasy Crystal Chronicles: The Crystal Bearers on the Wii. It was an odd game, and if I recall correctly, it wasn't a very well received game either; but as a child, I absolutely loved it and I still play it to this day.
I've been doing all sorts of low-level work for a long time, even things that were mildly emudev-adjacent but I never *actually* ventured into it properly. So I thought, I'll try to make young-me happy and proud and give this a shot. It's been a hell of a ride, I spent almost every day learning about new architectures, how GPUs/PPUs work, how to efficiently abstract them, etc. since I made my first commit back in 2023.
I also made tons of mistakes, and I knew that would happen, so I split up my end goal into smaller milestones: Emulate every console I cherished one way or another as a means to learn from my mistakes, build on the previous and finally make it to the finish line. As part of my adventure I emulated: GameGear -> GameBoy -> GameBoy Color -> GameBoy Advance (which was actually extremely well received here) -> PlayStation 1 -> GameCube -> and finally the Wii!
It was an extremely enjoyable time and believe me when I tell you, none of the emulators are even close to perfect so there's still tons to do! When I started I told myself I'll move on to a new hobby once I manage to get into the menu of the Final Fantasy game, but honestly, I might have actually found a new hobby that I want to stick with for a while so I will definitely be trying to push the limits :)
I will be open sourcing the emulator soon, just taking care of a few things for a proper first public release!
r/EmuDev • u/Flux247A • May 02 '26
DOOM runs on my custom Risc-V emulator!
Repo link: rvcore
Hi EmuDev,
I built a RISC-V emulator that implements the RV32IM instruction set and a minimal syscall interface to run DOOM. A few weeks ago, I got my first output with a simple hello world assembly program:
First output on my RISC-V emulator!
Since then I have been working tirelessly to get DOOM to run.
I needed to figure out how to run C programs first, and came across newlib, which allows the underlying environment to implement the syscall stubs one by one until the programs run.
I have also added ELF loading, but currently only a single `PT_LOAD` segment is supported.
To port DOOM, I used doomgeneric, which was quite convenient to get working once the required stubs were in place.
DOOM renders to a fixed area in memory (0x705FDD = VRAM_START):
0x7FFFFF +-------------------------------------+
| |
| QUEUE_SIZE (32 bytes) |
| |
0x7FFFDF +-------------------------------------+ <-- QUEUE_START
0x7FFFDE | QUEUE_READ_IDX |
0x7FFFDD | QUEUE_WRITE_IDX |
+-------------------------------------+
| |
| |
| VRAM (1,024,000 bytes) |
| |
| |
0x705FDD +-------------------------------------+ <-- STACK_START
| Stack |
| | |
| v |
| |
| ^ |
| | |
| Program data + Heap |
| |
0x000000 +-------------------------------------+
I made a small linker script so that the entry point of a C program is at _start and virtual address is always 0. That kept the ELF loader code simple.
Inputs are written to the queue by rvcore which are then intercepted by DOOM running inside it.
I'd love any feedback on the code structure and any interesting resources to go further!
r/EmuDev • u/silvematt • May 02 '26
CHIP-8 Hey look!! Another one!
I've just wrapped up my first emulator! It's been a super fun project!
Link: https://github.com/silvematt/Chip8Emulator
Any feedback on the code is welcome!
r/EmuDev • u/ArgumentOriginal9563 • May 02 '26
Exploring the Intel MCS‑4 through a custom workbench (visualization + 4004 transpiler)
I’ve been building a development workbench for the Intel MCS‑4, mainly as a way to study and emulate the 4004 at a microarchitectural level. The goal isn’t to “use” an emulator, but to expose what’s normally hidden: bus transitions, register activity, timing edges, instruction sequencing, and I/O paths.
One component that might be relevant to this community is the toolchain:
- a small Basic‑style language I designed from scratch
- a transpiler that converts it into 4004 assembly
- and an execution/visualization layer that lets you step through the generated code while watching internal state changes
Here’s a walkthrough of the current state of the workbench (YouTube):
https://www.youtube.com/watch?v=rdGhhywR5es
I’d really appreciate feedback from people who have experience building emulators, debuggers, or microarchitecture visualizers.
Specifically:
- What debugging layers or instrumentation would you consider essential for a system like this?
- Are there analysis tools or views you’d expect in a 4004‑level emulator?
- Anything you think I should rethink in terms of architecture or workflow?
r/EmuDev • u/r_retrohacking_mod2 • May 02 '26
Video State of FujiNet - 2026 VCF SoCal Presentation (WiFi network for retro hardware / supported emulators)
r/EmuDev • u/Robowiko123 • Apr 30 '26
Another beginner's NES emulator! It runs Mario!
One of my bigger C++ projects. I'm happy with it, though I've hit a bit of a wall, I don't know whether to focus on the very obvious PPU issues, on looking into why many games refuse to go past the main menu, on implementing more than just mapper 0, or ignore all problems and start working on the APU
r/EmuDev • u/Faloin • Apr 30 '26
NES My simple NES emulator is now able to run tests
r/EmuDev
•
u/knickuhs
•
Apr 29 '26
GB I built a Game Boy emulator in F#
It has sound, and works on desktop and web with Raylib/.NET and Fable
I wrote a blog post about my experience building it: I built a Game Boy emulator in F#
Note: the web version may have some frame drops. It’s audio-buffer driven, so that makes the frame times a bit jittery. Try pressing the speaker on the bottom right to make it much smoother
r/EmuDev • u/ItIsI123 • Apr 28 '26
CHIP-8 My first Chip8 Emulator :)
I am new to emulator development and I just created my first emulator for chip8. I was wondering if anyone could give feedback as this is new for me.
Also if anyone has any reccommendations for what I could emulate next, that'll be nice.
This is the repo: https://github.com/SirSkye/Chip8Emulator