Skip to main content

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:

  • gzFile pointer types in libretronew.c
  • Implicit int in pif.c and emulate_game_controller_via_libretro.c
  • EXTRA_EXPORTED_RUNTIME_METHODSEXPORTED_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:

  1. Detects gamepad via Gamepad API gamepadconnected event
  2. Prompts "Controller Detected — Map Buttons / Skip"
  3. Walks through all 14 N64 inputs: A, B, Z, Start, L, R, C-pad, D-pad
  4. Prevents duplicate button assignments
  5. Saves to localStorage for persistence across sessions
  6. Shows completion summary before saving

Phase 2: NextJS + React Component

Created wbaxterh/n64-web — NextJS 16 app:

  • N64Emulator React component (client-side only via dynamic())
  • GamepadStatus component (connection indicator)
  • COOP/COEP headers in next.config.ts (SharedArrayBuffer ready)
  • /play route 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

ResourceDetails
wbaxterh/n64-wasmWASM core repo (forked, SIMD-enabled)
wbaxterh/n64-webNextJS app repo
wbaxterh/n64-docsThis docs site
play.weshuber.comEmulator app (Amplify)
n64.weshuber.comDocumentation (Amplify)
Emscripten 5.0.7Installed at ~/emsdk