Build Log
What we built, when, and what we proved.
May 16, 2026 — Day 1
Phase 1: SIMD + Emscripten Upgrade
Forked nbarkhina/N64Wasm (MIT) → wbaxterh/n64-wasm
The big change — 3 Makefile flags:
- -DNOSSE # Was DISABLING all SIMD
- -DNO_ASM # Was disabling assembly optimizations
+ -DARCH_MIN_SSE2 # Enables SSE2 codepaths in RSP vector unit
+ -msimd128 # WASM 128-bit SIMD
+ -mrelaxed-simd # Relaxed SIMD for extra perf
+ -msse -msse2 # Emscripten SSE2 compat headers
Emscripten upgrade: 2.0.7 (2021) → 5.0.7 (2026) — required fixing:
gzFilepointer types inlibretronew.c- Implicit
intinpif.candemulate_game_controller_via_libretro.c EXTRA_EXPORTED_RUNTIME_METHODS→EXPORTED_RUNTIME_METHODS
Result: 11,979 SIMD instructions in the output binary. THPS running at 60 FPS.
N64 USB Controller Support
Discovered the upstream N64Wasm had:
- No Joypad mapping UI for C-buttons
- No remap handler for C-button joypad (cases 13-16 missing in
remapPressed()) - Default button mappings for Xbox/PS controllers (wrong for N64 USB adapters)
Fixed: Added Joypad remap UI + handler for all C-buttons. Mapped actual N64 USB adapter:
A=btn6, B=btn8, Z=btn7, Start=btn9
L=btn4, R=btn5
C-Up=btn0, C-Down=btn2, C-Left=btn3, C-Right=btn1
D-pad=btn12-15
Also added axis 2/3 C-button processing for adapters that map C-buttons as analog axes.
UI Redesign
Stripped the Bootstrap 4 generic look. New retro terminal aesthetic:
- Dark background (
#0a0a14) with CRT scanline overlay - Press Start 2P + Orbitron + JetBrains Mono typography
- N64 controller color palette (green, yellow, red, blue, purple)
- All Bootstrap components restyled (modals, forms, tables, buttons, dropdowns)
- New header: "N64.wasm — SIMD-Powered Browser Emulator"
- New footer: TrickBook + GitHub + Docs links
Gamepad Auto-Detect Wizard
Built gamepad-wizard.js — interactive controller mapping:
- Detects gamepad via Gamepad API
gamepadconnectedevent - Prompts "Controller Detected — Map Buttons / Skip"
- Walks through all 14 N64 inputs: A, B, Z, Start, L, R, C-pad, D-pad
- Prevents duplicate button assignments
- Saves to
localStoragefor persistence across sessions - Shows completion summary before saving
Phase 2: NextJS + React Component
Created wbaxterh/n64-web — NextJS 16 app:
N64EmulatorReact component (client-side only viadynamic())GamepadStatuscomponent (connection indicator)- COOP/COEP headers in
next.config.ts(SharedArrayBuffer ready) /playroute with drag-and-drop ROM loading- Keyboard controls reference (collapsible)
- Retro terminal theme matching docs site
Deployed to play.weshuber.com via AWS Amplify:
- GitHub → Amplify CI/CD (auto-builds on push to master)
- SSL certificate (Amplify managed)
- Route53 CNAME → CloudFront
Infrastructure Created
| Resource | Details |
|---|---|
wbaxterh/n64-wasm | WASM core repo (forked, SIMD-enabled) |
wbaxterh/n64-web | NextJS app repo |
wbaxterh/n64-docs | This docs site |
play.weshuber.com | Emulator app (Amplify) |
n64.weshuber.com | Documentation (Amplify) |
| Emscripten 5.0.7 | Installed at ~/emsdk |