Advanced Configuration

Deep dive into shaders, recording, controls, and performance.

CRT Shader Pipeline

The player includes 10 curated shaders from the libretro glsl-shaders collection. Pass the shader ID to the shader prop or let users change it at runtime.

IDNameDescriptionBest For
""NoneSharp pixels, no effectsPixel art purists
crt/crt-lottesCRT LottesHigh-quality shadow mask, phosphor glowArcade/CRT authenticity
crt/crt-easymodeCRT EasyBalanced performance and looksDefault recommendation
crt/crt-geomCRT GeomCurved screen geometryClassic TV feel
crt/crt-hyllianCRT HyllianSharp with subtle scanlinesClean CRT look
crt/crt-nes-miniNES MiniSimple scanlines like NES Classic8-bit games
crt/zfast-crtzFast CRTExtremely lightweightMobile devices
crt/crt-potato-coolCRT PotatoMinimal GPU usageWeak devices
handheld/lcd-grid-v2LCD GridGame Boy style LCD effectGB, GBC, GBA, Game Gear
scanlinesScanlinesSimple horizontal linesLight enhancement
Shader usage
<GamePlayer
  shader="crt/crt-lottes"
  onShaderChange={(newShader, requiresRestart) => {
    // Some shaders require restart to take effect
    if (requiresRestart) {
      showToast('Shader will apply on restart');
    }
  }}
/>

Gameplay Recording

The player uses the MediaRecorder API to capture canvas gameplay as WebM video. Recording works automatically — users press F5 to toggle.

Specs

  • Format: WebM (VP9 or VP8)
  • Frame Rate: 30 FPS
  • Bitrate: 5 Mbps
  • Features: Pause/resume, duration tracking

Browser Support

  • • Chrome, Edge: ✅ VP9
  • • Firefox: ✅ VP8
  • • Safari: ⚠️ Limited (no VP9)
  • • iOS Safari: ❌ Not supported

How It Works

  1. 1. User presses F5 → Red recording indicator appears
  2. 2. Canvas stream captured at 30fps via MediaRecorder
  3. 3. User presses F5 again → File downloads as gameplay-[timestamp].webm

Keyboard Shortcuts

Player shortcuts (separate from game controls). Users can press F1 to see these in-game.

F1
Help / Shortcuts
F3
FPS Overlay
F4
Input Display
F5
Record Toggle
F9
Mute / Unmute
ESC
Close Modal

Control System

The player includes a sophisticated control system with per-console presets, keyboard remapping, and gamepad support.

Default Keyboard Layout

D-Pad

Up:Arrow UpDown:Arrow DownLeft:Arrow LeftRight:Arrow Right

Face Buttons

A / Cross:XB / Circle:ZX / Square:AY / Triangle:S

Shoulders

L / L1:QR / R1:WL2:1R2:2

System

Start:EnterSelect:ShiftCoin (Arcade):Shift

Gamepad Detection

The player automatically detects and themes connected controllers:

Xbox Controllers
PlayStation Controllers
Nintendo Controllers
Generic / Other

Note on Browser Security

Browsers require a button press before reporting gamepads (security feature). The player uses requestAnimationFrame polling to detect connections.

Emergency Save System

To prevent progress loss, the player automatically saves when:

Tab Hidden

When user switches tabs or minimizes browser, the visibilitychangeevent triggers an immediate save via your onAutoSave handler.

Page Unload

The beforeunload event attempts a final save when the user navigates away or closes the tab.

Important: Emergency saves are only attempted if onAutoSaveis provided. Without this handler, no emergency saves occur.

Performance Tips

Use CHD for CD Games

CHD format is compressed and much faster to load than BIN/CUE pairs.

Match Shader to Device

Use crt/zfast-crt on mobile, crt/crt-lottes on desktop.

Host ROMs on Same Origin

Avoids CORS overhead and ensures COEP compliance.

Pre-warm the Emulator

Call Nostalgist.configure early to cache WASM modules before the user opens the player.