Multi-System Retro Emulator Hub — C64, C128, ZX Spectrum & Amstrad CPC (WebAssembly)

100% client-side in-browser Commodore 64/128 (6510/8502), ZX Spectrum 48K/128K (Z80A/ULA), and Amstrad CPC 464/6128/Plus emulator with auto-detection, Warp mode, Drive A/B slots, Locomotive BASIC macros, IndexedDB save states, and AI 6502 Modernization Guide

Multi-System Retro Emulator Hub — C64, C128, ZX Spectrum & Amstrad CPC

100% client-side in-browser emulation powered by WebAssembly & WebAudio. Drop any Commodore 64 (.d64, .g64, .t64, .tap, .prg, .crt), Commodore 128 (.d71, .d81), ZX Spectrum 48K/128K (.tap, .tzx, .z80, .sna, .szx), or Amstrad CPC 464/6128 (.dsk, .sna, .cdt, .cpr, .voc) image — or a .zip archive — to auto-detect and boot immediately in local browser memory.

WASM + OPENROMS READY (4 CORES)
🤖 AI 6502 Modernization Guide ↓
Drop Any Disk, Tape, Cartridge, Snapshot, or .ZIP File Here — or Click to Browse
100% Client-Side Execution (Zero Server Uploads) • Auto-Detects System by Extension & Binary Magic Header
C64: .d64 .g64 .t64 .tap .prg .crt .zip C128: .d71 .d81 .d64 .prg .crt .zip Spectrum: .tap .tzx .z80 .sna .szx .zip Amstrad CPC: .dsk .sna .cdt .cpr .voc .zip
⚡ Instant Demo Payloads (1-Click Boot) READY (System ROM Boot)
COMMODORE 1702 CHROMA/LUMA MONITOR · PAL 50Hz
CPU: MOS 6510 @ 0.985 MHz • VIC-II 6569 (320×200) • 50.0 FPS
⌨ Click screen to focus keyboard • Type BASIC commands directly or use Quick Macros
DRV 8 / A: IDLE (T18:S0)

Commodore 64 / 128 Controls

IEC #8 · DB9 · Datasette
Commodore 128 Dual-Monitor & OS Mode
1541/1571 Multi-Disk Carousel (Drive 8)

Amstrad CPC Controls (464 / 664 / 6128 / Plus)

μPD765A · CTM644 / GT65
3″ Floppy Disk Drives (Drive A & Drive B)
DRIVE A (|A): SMIGGY-CPC.DSK (40T)
DRIVE B (|B): BONUS-SIDE-B.DSK (40T)
One-Click Locomotive BASIC Quick-Boot Macros

ZX Spectrum Controls (48K / 128K)

ULA · Port $FE / $7FFD

Save States & Local ROM Cache (IndexedDB)

IndexedDB Ready
Machine Snapshot States (IndexedDB + .state)
No state saved in Slot 1 yet — click Save State to store in IndexedDB.
🔒 System ROMs & Custom C64 ROM Loader (IndexedDB) OpenROMs + Redistributable

Legal Compliance: Amstrad CPC and ZX Spectrum ROMs are bundled under Amstrad's free redistribution permission. Commodore 64 & 128 boot with clean-room open-source OpenROMs by default. You may optionally supply your own dumped Commodore KERNAL (8KB), BASIC (8KB), or CHARGEN (4KB) ROMs below (cached locally in browser IndexedDB):

Verify ROM CRC32 in BIN Patcher →

⌨ Interactive Keyboard Mapping Legend & Virtual Key Matrix

Showing PC Keyboard Mappings for Commodore 64 / 128 — click any virtual key below to trigger it directly in the emulator.

Virtual Joystick & Special Keys
TECHNICAL COMPANION GUIDE · REVERSE ENGINEERING & MODERNIZATION

AI-Assisted C64 Disassembly & Modernization: From 6502 Binary to C, JS & WebAssembly

How classic 8-bit Commodore 64 (MOS 6510) and Commodore 128 (MOS 8502) binaries are reverse-engineered using Claude Code and Model Context Protocol (MCP) bridges (Ghidra, Regenerator2000, and headless VICE), translated from cycle-counted 6502 assembly and VIC-II raster logic into portable C/JavaScript/WebAssembly, and paired with upscaled 24×21 hardware sprites and MOS 6581/8580 SID audio for modern remakes.

1. Reverse-Engineering 6502 Binaries with Claude Code & MCP Bridges

Disassembling a raw 1980s Commodore 64 .PRG or .D64 image is notoriously challenging because 6502 machine code intermingles executable instructions, inline data tables, self-modifying operand bytes, and $0001 PLA bank-switching. Before loading a disk image into the emulator above, you can inspect its physical sector chains and extract individual .PRG binaries using our Rust/Wasm .D64 Disk Visualizer & BAM Parser.

By connecting Claude Code to three specialized reverse-engineering tools via Model Context Protocol (MCP) servers, an AI agent can iteratively explore, label, and verify a 64KB memory snapshot in real time:

A. Ghidra MCP Bridge (Control-Flow & Decompilation)

An MCP bridge to a headless or GUI Ghidra project exposes tool calls such as get_function_at(addr), rename_symbol(addr, name), set_data_type(addr, len), and get_xrefs_to(addr). Claude Code queries cross-references to hardware registers ($D000–$D02E VIC-II, $D400–$D418 SID, $DC00 CIA #1 Joystick) and automatically propagates semantic symbol names (e.g. renaming sub_09A4 to update_player_sprite_collision) across the entire call graph.

B. Regenerator2000 MCP Bridge (Interactive 6502 Disassembly)

Regenerator2000 excels at separating 6502 code from inline lookup tables (low/high byte split jump tables, PETSCII strings, and screen matrix pointers). Through an MCP bridge, Claude Code inspects undecoded regions, identifies paired LDA tbl_lo,X : STA $FB / LDA tbl_hi,X : STA $FC zero-page pointers, marks byte/word/petscii data blocks, and exports clean, re-assemblable 6502 source compatible with our In-Browser 6502/Z80 Cross-Assembler.

C. Headless VICE Monitor MCP Bridge (Dynamic Runtime Tracing)

Static analysis alone cannot resolve runtime decrunchers (Exomizer, PuCrunch) or self-modifying speedcode. By bridging Claude Code to VICE's binary monitor port (-binarymonitor / -remotemonitor) in headless mode, the agent sets execution breakpoints after decompression, dumps live 64KB RAM after the game loop initializes, profiles exact scanline timing on $D012, and verifies hypotheses by injecting joystick inputs and asserting zero-page state changes.

2. Translating 6502 Assembly & VIC-II Hardware Logic to Modern C, JS & WebAssembly

Once every subroutine, zero-page variable ($02–$FF), and hardware interrupt vector ($0314/$0315 or $FFFE/$FFFF) is documented, translating a 6502 game engine into idiomatic C, TypeScript/JavaScript, or Rust/WebAssembly follows four structural transformations. You can verify individual instruction flag behaviors and cycle counts during translation with our MOS 6502/6510 Opcode Lookup & Cycle Counter:

  • Zero-Page Variables → Typed State Struct: Replace raw zero-page addresses (e.g. $62 player X LSB, $63 player X MSB, $64 player Y, $65 lives) with an explicit GameState struct in C/Rust or a typed JS state object.
  • Raster IRQ Chains ($D012) → Frame-Phase State Machine: Classic C64 games multiplex sprites and split scrolling regions by chaining raster interrupts at scanlines (e.g. $D012 = $32 top HUD, $D012 = $78 playfield, $D012 = $FA bottom border). In a modern C/WASM or Canvas remake, lift each raster ISR into a deterministic per-frame update stage and render pass.
  • 6502 Decimal Mode (SED / ADC) → BCD or Integer Score Helpers: Remember that 6502 games almost universally store 6-digit high scores as packed Binary-Coded Decimal (BCD) bytes updated under SED (Set Decimal Flag) so each nybble maps directly to screen codes $30–$39.
  • Self-Modifying Code → Parameterized Pointers / Array Indexing: Where 6502 code patches the immediate or absolute address of an LDA $1000,X instruction in place to save zero-page indirect-indexed cycles (5 cycles vs. 4 cycles), replace the self-modification with a clean array slice or pointer offset.
Original Disassembled 6510 Routine (VIC-II 9-Bit Sprite X + Raster Sync)
; Update Player Sprite 0 X/Y (9-bit X across $D000 + $D010 bit 0)
update_player_vic:
    LDA zp_plr_x_lo     ; $62: Player X low byte (0..255)
    STA $D000           ; VIC-II Sprite 0 X-coord LSB
    LDA $D010           ; VIC-II Sprites 0..7 X-coord MSB
    AND #$FE            ; Clear bit 0 (Sprite 0 MSB)
    LDX zp_plr_x_hi     ; $63: Is X >= 256?
    BEQ no_msb_set
    ORA #$01            ; Set Sprite 0 X MSB ($D010 bit 0)
no_msb_set:
    STA $D010
    LDA zp_plr_y        ; $64: Player Y (0..255)
    STA $D001           ; VIC-II Sprite 0 Y-coord
    RTS
Modernized C / WebAssembly Equivalent (Clean Struct + Hardware Abstraction)
typedef struct {
    uint16_t player_x;   // Unified 9-bit X coordinate (0..511)
    uint8_t  player_y;   // Y coordinate (0..255)
    uint8_t  d010_msb;   // Shadow register for $D010
} GameState;

void update_player_vic(GameState *st, uint8_t *vic_regs) {
    vic_regs[0x00] = (uint8_t)(st->player_x & 0xFF);
    if (st->player_x >= 256) {
        st->d010_msb |= 0x01;
    } else {
        st->d010_msb &= ~0x01;
    }
    vic_regs[0x10] = st->d010_msb;
    vic_regs[0x01] = st->player_y;
}

3. Extracting & Upscaling 24×21 VIC-II Sprites and SID Audio for Modern Remakes

A faithful modern port or hybrid Wasm remake preserves the exact visual and sonic identity of the original C64 release while offering optional HD enhancements:

1. Extracting 64-Byte (24×21) VIC-II Sprite Banks

Every VIC-II hardware sprite occupies 63 bytes of pixel data (21 rows × 3 bytes/row = 24×21 pixels) plus 1 padding byte (64 bytes per block), addressed via the 8 sprite pointers at the end of Screen RAM ($07F8–$07FF in default Bank 0, where addr = ptr * 64). In Monochrome Mode, each bit is 1 pixel (24×21). In Multicolor Mode ($D01C bit set), horizontal pixels are paired into 12×21 2-bit bitpairs: 00 = transparent, 01 = shared Multicolor 0 ($D025), 10 = individual sprite colour ($D027–$D02E), and 11 = shared Multicolor 1 ($D026).

Workflow Tip: Pipe extracted 64-byte sprite blocks into our Interactive 24×21 Sprite & 8×8 Tile Converter to edit frames with the Colodore palette and export C uint8_t arrays, 6502 .byte tables, or integer-upscaled / CRT-filtered sprite sheets. For full-screen .KOA or .ART title screens, use the Retro Graphics Viewer & PNG Converter.

2. Ripping & Modernizing MOS 6581 / 8580 SID Audio

C64 game music drivers typically consist of an INIT entry point (which selects the subtune in the Accumulator) and a 50Hz PAL / 60Hz NTSC raster PLAY routine that updates the 25 write-only SID registers at $D400–$D418 once per frame. By wrapping the isolated music code and data tables with a 124-byte PSID v2 header, you can play, solo/mute individual voices, inspect live pulse-width/filter sweeps, and export 16-bit .WAV stems directly in our Commodore 64 .SID File Player & Header Editor, or recreate patches interactively in the 3-Voice WebAudio SID Chiptune Synthesizer.

4. Multi-System Hardware Reference: C64/C128, ZX Spectrum & Amstrad CPC

Whether you are testing newly assembled homebrew binaries from our 6502 & Z80 Cross-Assembler or diagnosing real vintage motherboards on the workbench, use these Machine Hub and IC Pinout references alongside the emulator:

Comments (0)

No comments yet. Be the first to share your thoughts on this tool!

Leave a Comment

Theme Palette

Default Dark
High-contrast dark
Amber Terminal
Monochrome amber
Matrix CRT
Phosphor green
Workbench Light
Clean light mode

Audio & Display

Relay Click Sounds Web Audio API — soft mechanical clicks
CRT Scanline & Flicker Pure CSS overlay effect

System Info

Customization Panel Theme preference, audio FX, and CRT overlay settings are saved to your browser's localStorage and persist between visits. No cookies or server-side storage is used.
Keyboard Shortcuts Press Esc to close this panel. Use the header moon/sun icon to cycle themes.