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.
.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
Commodore 64 / 128 Controls
IEC #8 · DB9 · DatasetteAmstrad CPC Controls (464 / 664 / 6128 / Plus)
μPD765A · CTM644 / GT65|A):
SMIGGY-CPC.DSK (40T)
|B):
BONUS-SIDE-B.DSK (40T)
ZX Spectrum Controls (48K / 128K)
ULA · Port $FE / $7FFDSave States & Local ROM Cache (IndexedDB)
IndexedDB Ready.state)
🔒 System ROMs & Custom C64 ROM Loader (IndexedDB) OpenROMs + Redistributable
⌨ 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.
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.
$62player X LSB,$63player X MSB,$64player Y,$65lives) with an explicitGameStatestruct 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 = $32top HUD,$D012 = $78playfield,$D012 = $FAbottom 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 underSED(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,Xinstruction 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.
; 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
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:
- Commodore 64 & 128: Explore the Commodore 64 Machine Hub (ASSY 250407–250469 recap lists, 6510 CPU, VIC-II, 82S100 PLA, DB9 Joystick) and the Commodore 128 Machine Hub (dual 8502/Z80A boot sequence, 8563 VDC 80-column RGBI, and 1571 drive mechanics).
- Sinclair ZX Spectrum (48K / 128K): Visit the ZX Spectrum Machine Hub for the 4116 DRAM triple-rail voltage trap warning, Ferranti ULA diagnostics, keyboard membrane matrix tables, and composite video buffer mod schematics.
- Amstrad CPC (464 / 664 / 6128 / Plus): Consult the Amstrad CPC 464 Hub and Amstrad CPC 6128 Hub for 40010 Gate Array modes, 6845 CRTC Types 0–4, EME-156 3″ floppy belt replacement, reversed Molex power warnings, and 6-Pin DIN RGB SCART wiring.
Comments (0)
No comments yet. Be the first to share your thoughts on this tool!
Leave a Comment