ChaosDrive is a virtual circuit-bending playground for the Sega Genesis. It runs a full Genesis emulator (Genesis-Plus-GX compiled to WebAssembly) in your browser, then lets you jam a virtual screwdriver into its internals in real time.
The emulator’s video, audio, and CPU memory are all exposed to JavaScript through the WASM heap. Each chaos key directly mutates the emulator’s internal state — the same bytes a real chip would read — so every glitch you see is the hardware faithfully rendering corrupted data.
VRAM Shifts — Tile and sprite graphics live in Video RAM as 8×8 pixel patterns. Shifting VRAM by a few bytes scrambles which tile maps to which pattern, smearing the whole scene like a broken CRT.
CRAM Corruption — The Genesis stores its 64-color palette in Color RAM (CRAM). Randomizing or rotating these entries swaps every on-screen color at once, creating psychedelic palette cycling.
VSRAM / Column Melt — Vertical Scroll RAM controls how far each 2-tile column is scrolled. Corrupting it makes columns slide independently, giving the classic “melting screen” look.
H-Scroll Waviness — The VDP supports per-scanline horizontal scroll offsets. Writing random values here warps each line left or right, producing a wavy, heat-shimmer distortion.
FM Corruption & Bitcrush — The YM2612 FM synth chip has operator registers controlling frequency, feedback, and envelope. Corrupting these detunes notes and creates harsh metallic timbres. Bitcrushing zeroes out low bits of the audio buffer for lo-fi distortion.
CPU Mayhem — Incrementing the 68000’s program counter or flipping its registers makes the CPU execute from the wrong address, often causing the game to spiral into uncharted code paths.
Emulation: C → Emscripten → WebAssembly
Rendering: Canvas 2D (raw VRAM → ImageData @ 60 fps)
Audio: Web Audio API (44.1 kHz, stereo)
You need a Sega Genesis/Mega Drive ROM file (.bin, .md, .smd, .gen) to use ChaosDrive. Here are some examples:
Sonic the Hedgehog