Search › A-Z › S › Space Invaders
Space Invaders
Space Invaders (Taito, 1978), designed by Tomohiro Nishikado, is the arcade game that launched the shoot-’em-up genre and the golden age of arcade gaming. This build runs the original Intel 8080 board in the browser, a pure-JavaScript 8080 core plus the Taito bit-shift, input and video hardware, and boots straight into the game’s attract mode. It is wired to the emulators.org in-frame debugger so you can single-step the 8080, read and write the registers and the full 64K memory (video RAM sits at 0x2400), and set execution breakpoints.
Runs on: Web browser
Space Invaders Online Emulator
Play Space Invaders using JavaScript directly in your browser.
Controls
Configurations
| Configuration | Emulator | Machine | OS | Legal | |
|---|---|---|---|---|---|
| Space Invaders | Space Invaders | Space Invaders | grey | Open ⛶ |
Machine emulated
The Space Invaders arcade board (Taito, 1978) - an Intel 8080 at 1.9968 MHz with 8 KB of ROM and 8 KB of RAM, a 16-bit bit-shift chip for sprite positioning, and a 256×224 monochrome raster rotated 90° in the upright cabinet. It is the machine that started the golden age of arcade video games.
Chips
Notes
Embedding
Space Invaders is the original 1978 Taito arcade machine: an Intel 8080 at 2 MHz driving a 256×224 monochrome raster, rotated 90° in the cabinet. This build vendors the pure-JavaScript 8080 core and Taito hardware model from chris-j-akers/i8080-javascript and drives it from a host-owned loop so the debugger can control it.
Boot. The four 2 KB game ROMs are loaded into 0x0000–0x1FFF and the 8080 starts at 0x0000, dropping straight into the game's attract mode:
const computer = new InvadersComputer();
computer.LoadProgram(); // invaders.h/g/f/e -> 0x0000..0x1FFF
computer.InputDevicePortTwo.SetNumberOfLivesDipSwitch(3);
The machine object. InvadersComputer exposes the whole cabinet as ordinary methods and fields, so the host page can render, step and inject input:
| Member | Kind | What it does |
|---|---|---|
ExecuteNextInstruction() | method | Fetch, decode and run one 8080 instruction; returns its address, disassembly, cycle count and the full CPU state. |
GenerateHalfVBlank() / GenerateVBlank() | method | Raise the mid-screen (RST 1) and end-of-frame (RST 2) interrupts the game's display code needs, once each per field. |
GetVideoBuffer() | method | The 7 KB of video RAM (0x2400–0x3FFF): 1 bit per pixel, 32 bytes per column, un-rotated by the renderer. |
Bus.ReadRAM(a) / Bus.WriteRAM(v,a) | method | Side-effect-free access to the 64 KB address space - what the debugger's memory views read and poke. |
InputDevicePortOne | field | The coin slot, 1P/2P start and player-one joystick/fire register (read on port 1). |
Reset() / LoadProgram() | method | Reset the CPU and RAM, then reload the ROMs: the cabinet's power-cycle. |
Video. Each animation frame the loop runs ~33,334 cycles, firing the two interrupts, then walks the video RAM: for every byte, eight vertical pixels are written to a 224×256 canvas with the 90° rotation the upright cabinet used.
Debugger integration
The debugger drives a host-owned run loop: because the 8080 interpreter runs one instruction at a time in JavaScript, the loop can pause, single-step and check breakpoints between any two instructions, with no changes to the CPU core needed.
window.EMU_BOOT.transport exposes the controls the shared debugger calls:
- pause / resume / isPaused - stop or restart the
requestAnimationFrameloop. - stepInsn(n) - call
ExecuteNextInstruction()exactly n times and redraw, so a single step advances the PC by one instruction. - step(n) - advance n whole 60 Hz fields (with their interrupts).
- breakpoints - a
Setof PC values. When it is non-empty the loop runs instruction-by-instruction and pauses before executing an address in the set; when empty it runs a full frame at speed, so an idle debugger costs nothing. - watchpoints -
Bus.WriteRAMis wrapped so a write to a watched address pauses the loop.
The plug-in (space-invaders-debug.js) reads these hooks and calls EmuKit.defineMachine with the 8080 register set, the 64K bus / ROM / video-RAM chips and the on-screen control panel. It reuses the shared z80 disassembler (/debugger/src/cpus/z80.js): the Z80 is a strict superset of the 8080, so it renders 8080 opcodes correctly, with the 8080 mnemonics' Z80 spellings.
Architecture
The Taito Space Invaders board is a single Intel 8080 at 1.9968 MHz with 8 KB of ROM, 8 KB of RAM and a scattering of discrete hardware, all modelled here as plain JavaScript objects hanging off InvadersComputer:
- CPU - an interpreter of the Intel 8080, with the 64 KB memory map behind a
Bus/MMUpair. - Bit-shift device - the board's signature hardware: a 16-bit shift register (write ports 2 and 4, read port 3) that lets the 8080 position sprites faster than its one-bit shifts allow.
- Input ports - port 1 (coin, 1P/2P start, player-one joystick and fire) and port 2 (dip switches for lives and bonus, player-two controls).
- Sound / watchdog - the port 3/5 sound triggers and the port-6 watchdog are present as stubs (no audio in this build).
- Video - 7 KB of 1 bpp video RAM at
0x2400. The 8080 has no video hardware to speak of; the CRT simply scans that memory, and the game splits each field with a mid-screen interrupt so it can update the top and bottom halves in step with the beam.
The two per-field interrupts (RST 1 mid-screen, RST 2 at vertical blank) are the only timing the game truly depends on, so the host loop reproduces exactly those, running roughly a 60th of the 2 MHz clock between them.