SearchA-ZC › ColecoVision

ColecoVision

2026 Open source · MIT Online

The ColecoVision (1982) is a Zilog Z80, a Texas Instruments TMS9918A video chip and an SN76489 sound chip, the same trio as the SG-1000, with a boot ROM at address 0, work RAM at 0x6000 and the cartridge at 0x8000, and the VDP wired to the Z80's non-maskable interrupt.

This is a purpose-built pure-JavaScript machine sharing the SG-1000 build's parts (the MIT-licensed DrGoldfire Z80 interpreter, a TMS9918A VDP and the machine glue), so the whole Z80 is single-steppable in the shared in-page debugger. Rather than ship the copyrighted Coleco BIOS, it uses an original open mini boot-ROM that launches a homebrew cartridge, so nothing copyrighted is bundled.

Visit the project ↗

Visit the official site ↗

Runs on: Web browser

ColecoVision Online Emulator

Play ColecoVision using JavaScript directly in your browser.

Configurations

ConfigurationEmulatorMachineOSLegal
Colour Block demoColecoVisioncolecovisionopenOpen ⛶

Chips

Notes

Embedding

The ColecoVision (1982) is a Zilog Z80, a Texas Instruments TMS9918A video chip and an SN76489 sound chip - the same trio as the Sega SG-1000. It differs only in the memory map and the interrupt wiring: an 8 KB boot ROM sits at 0x0000, 1 KB of work RAM at 0x6000, and the cartridge is mapped at 0x8000; the VDP's vertical-blank drives the Z80's non-maskable interrupt rather than the maskable one. So we reuse the exact parts built for the SG-1000, switched to kind:'coleco':

  • Z80.js - Molly Howell's MIT-licensed Z80 interpreter (getState/setState/run_instruction/interrupt).
  • tms9918.js - our TMS9918A VDP (16 KB VRAM, all four background modes and sprites, rendered a frame at a time).
  • sega8.js - the machine glue. In Coleco mode it maps the boot ROM / RAM / cartridge, decodes the ColecoVision I/O ports (VDP at 0xA0-0xBF, controllers at 0xFC/0xFF with the 0x80/0xC0 keypad-vs-joystick select), and routes the VDP interrupt to the Z80 NMI.
var machine = new Sega8Machine({ kind: 'coleco', bios: biosBytes, rom: cartBytes });
(function loop(){
  machine.runFrameFast();          // one frame of Z80 + VDP + NMI
  machine.render(img.data); ctx.putImageData(img, 0, 0);
  requestAnimationFrame(loop);
})();

Open content, no grey ROM. A real ColecoVision needs its copyrighted 8 KB BIOS. Rather than ship that, we wrote an open mini boot-ROM (public domain) that does what the BIOS does at the seams: set the stack, check the cartridge magic bytes (0x55,0xAA) at 0x8000 and jump to the cold-start address in the cartridge header at 0x800A. It launches an original homebrew cartridge, so the whole machine is legal:'open' with nothing copyrighted bundled.

The machine is plain objects - machine.cpu.getState() / setState() expose the whole Z80; machine.readMem/writeMem the 64K bus; machine.vdp.vram/reg/status the video chip; machine.press/release the joystick latch. Everything the debugger needs is reachable without touching the core.

Debugger integration

The debugger plug-in (coleco-debug.js) reads the live machine from window.EMU_BOOT and calls EmuKit.defineMachine. The Z80 is disassembled by the shared z80 decoder (/debugger/src/cpus/z80.js).

Owning the loop. The boot shim owns the frame loop, so pause, resume and frame-step are ours. With no breakpoints set we run machine.runFrameFast(); with any set we run machine.runFrameStep(bps), checking the program counter before every instruction. Single-step calls cpu.run_instruction(). Write watchpoints wrap machine.writeMem.

Registers. The Z80 state comes from cpu.getState(); the plug-in presents AF BC DE HL IX IY SP PC and the individual, writable flag chips, writing back through setState().

Architecture

The ColecoVision built on the TMS9918A's strong sprite hardware to become one of the most capable of the second-generation consoles. Its parts:

  • Z80 - the CPU at 3.58 MHz. Boot ROM at 0x0000, work RAM at 0x6000, cartridge at 0x8000.
  • TMS9918A - the video chip: 256×192, 16 colours, 32 sprites, Graphics I / Graphics II / Multicolor / Text. Its vertical-blank drives the Z80's NMI.
  • SN76489 - the PSG; silent here for headless use.
  • Controllers, a joystick + two fire buttons + a 12-key keypad, read at ports 0xFC/0xFF after selecting joystick (0xC0) or keypad (0x80) mode.

Because the whole machine is ordinary JavaScript and the CPU is a straight interpreter, the entire state is inspectable and pokeable at runtime.