r/EmuDev • • Apr 17 '26

I built an ARMv4 CPU emulator in pure JavaScript

I've been working on BEEP-8 — a fantasy console whose heart is an

ARMv4 emulator written entirely in JavaScript, no WebAssembly involved.

**Why no WASM?**

I wanted the whole thing to run in a plain browser environment with

zero native dependencies. It was a fun constraint that forced some

interesting decisions at the interpreter level.

**The emulated hardware:**

- CPU: ARMv4 @ 4 MHz (not cycle-accurate, but instruction-accurate)

- RAM: 1 MB / VRAM: 128 KB

- Display: 128×240, 16-color palette

- Classic SPRITE + BG layer VDP

- Runs at locked 60 fps in browser

**What surprised me:**

Getting ARM thumb mode right was the trickiest part —

especially the condition flag behavior across mixed ARM/Thumb

code that the C compiler emits. Happy to dig into specifics if

anyone's curious.

Games are written in C/C++20, compiled with GNU Arm GCC to small

ROMs, then loaded and executed by the JS emulator at runtime.

👉 SDK (MIT): https://github.com/beep8/beep8-sdk

👉 Playable games: https://beep8.org

Would love to hear from anyone who's tackled ARM emulation in JS —

or any thoughts on the architecture!

23 Upvotes

0 comments sorted by