Skip to content

About

Modern CHIP-8 retro workstation and emulator built with pure Vanilla JS (ES6+), Clean Architecture, zero dependencies, time-travel debugging (rewind & instruction step-back), live natural-language disassembler, vintage CRT fullscreen and retro themes.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ•น๏ธ CHIP-8 Studio & Debugger Workstation

English | Espaรฑol

Vanilla JS Zero Dependencies Tests Passing 6 Retro Themes Bilingual EN/ES License: MIT

An ultra-clean, state-of-the-art CHIP-8 Virtual Machine & Interactive Debugging Workstation built with pure Vanilla JavaScript (ES6 Modules), HTML5 Canvas, and modern CSS3. Designed with Clean Code and Clean Architecture principles, featuring zero external runtime dependencies.

CHIP-8 Studio Workstation Overview


๐ŸŒŸ Key Highlights

  • Pure Architecture & Zero Dependencies: 100% standard web technologies (HTML5, CSS3, ES6 Modules, Web Audio API). No npm installs, webpack, vite, or external frameworks needed.
  • Time-Travel Debugging:
    • Continuous Rewind: Hold Backspace or Tab during gameplay to smoothly rewind time up to hundreds of frames back.
    • Single-Instruction Step-Back (F8): Step backward precisely one CPU opcode at a time to inspect previous register states and branching decisions.
  • Live Didactic Disassembler: Real-time opcode decoding accompanied by natural-language explanations explaining why the CPU is executing each operation and highlighting register value changes.
  • Immersive Retro CRT Fullscreen: A vintage 1970s curved television chassis complete with beveled bezels, phosphor glass reflections, scanlines, knurled rotary knobs, and illuminated status indicators.
  • Hardware Inspector with 7 Interactive Tools:
    1. ๐Ÿ“Š Registers & Stack: Live general-purpose registers V0-VF with delta pulsing, plus PC, I, SP, DT, ST, and 16-level call stack preview.
    2. ๐Ÿ“œ Trace Log: Detailed chronological execution log with opcode mnemonic decoding, freeze-inspection mode, and auto-scroll control.
    3. โ„น๏ธ ROM Details: Comprehensive technical metadata, release year, recommended controls, and synopsis.
    4. ๐Ÿ’ป TTY Console: Standard output stream for system messages and developer telemetry.
    5. ๐ŸŽฎ ROM Catalog: Categorized library of built-in games, graphics demos, tests, and utility programs with drag-and-drop support.
    6. ๐Ÿ—บ๏ธ RAM Heatmap (4KB): Interactive memory visualizer showing interpreter reserved regions, fontset, and live program space with mouseover address inspection.
    7. ๐Ÿ‘พ Sprite Viewer & Audio Oscilloscope: Real-time 8-pixel sprite visualizer for pattern address I and Web Audio square-wave oscilloscope.
  • Smart Floating Tooltips Engine: Zero-clipping floating tooltip overlay mounted directly on document.body that automatically clamps within viewport boundaries and flips below elements near the screen edge.
  • 6 Curated Retro Themes: Jeffrey Massung Slate, NES Classic (1983), Super Nintendo (1990), Terminal Green VT220, Amber CRT, and Game Boy DMG-01.
  • Zero-Collision Controls: Essential gameplay keys (R, S, F, Space) are 100% reserved for virtual machine execution without conflict.

๐Ÿ“บ Visual Showcase

Retro CRT TV Fullscreen Mode

Enter fullscreen (F11) to center the display inside a curved, 1970s wood-and-gold cathode-ray tube television:

Retro CRT TV Fullscreen Mode

Hardware Inspector with Tab Navigation & Tool Selector

Easily switch between all 7 diagnostic tools using the navigation arrows (โ€น / โ€บ) or the 1/7 โ–พ quick menu:

Inspector Tabs Navigation

Real-Time Disassembler & Explainer

Inspect executed instructions step-by-step with plain-English descriptions and register diff tags:

Live Disassembler and Natural Language Explainer

6 Curated Retro Color Themes

Switch visual aesthetics instantly in real time without restarting your game or losing machine state:

Terminal Green (VT220 Phosphor) Game Boy (DMG-01 1989)
Terminal Green Theme Game Boy Theme
NES Classic (1983 Nintendo) SNES Super Famicom (1990)
NES Classic Theme SNES Super Famicom Theme
Cyberpunk (Outrun Synthwave) Jeffrey Massung Slate (1977)
Cyberpunk Synthwave Theme Massung Slate Theme

๐Ÿ•น๏ธ Keyboard Controls & Shortcuts

CHIP-8 Keypad (COSMAC VIP 4ร—4 โ†” PC Keyboard)

CHIP-8 Hex Key PC Keyboard Key CHIP-8 Hex Key PC Keyboard Key
1 1 C 4
2 2 D R
3 3 E F
4 Q A Z
5 W (or Space) 0 X
6 E B C
7 A F V
8 S 9 D

Workstation Hotkeys

Action Primary Shortcut Alternative
Play / Pause P Escape
Step Back 1 Instruction F8 Shift + F10
Step Forward 1 Instruction F10 โ€”
Step Forward 1 Frame (1/60s) F9 โ€”
Continuous Rewind (Hold) Backspace Tab
Reset Virtual Machine Alt + R โ€”
Fullscreen Mode (CRT TV) F11 Alt + Enter
Quick Save State F1 Alt + S
Quick Load State F5 Alt + L
Take Screenshot (PNG) F12 โ€”
Keyboard Shortcuts Modal ? Toolbar Button

๐Ÿ›๏ธ Architecture & Clean Code

The application follows strict modular decoupling with separation of concerns:

CHIP-8-Studio-Debugger/
โ”œโ”€โ”€ index.html              # Semantic HTML5 layout with resizable workstation panels
โ”œโ”€โ”€ css/
โ”‚   โ””โ”€โ”€ styles.css          # CSS3 with themes, responsive layout, CRT shaders & smart tooltips
โ”œโ”€โ”€ js/
โ”‚   โ”œโ”€โ”€ chip8.js            # Pure Virtual Machine core: CPU, registers, memory, opcode decoding
โ”‚   โ”œโ”€โ”€ disassembler.js     # Opcode decoder with natural-language didactical explanations
โ”‚   โ”œโ”€โ”€ time-travel.js      # Circular buffer snapshot engine (rewind & instruction step-back)
โ”‚   โ”œโ”€โ”€ audio.js            # Web Audio API square-wave synthesizer & oscilloscope
โ”‚   โ”œโ”€โ”€ keypad.js           # 16-key hex keypad state manager & default key mappings
โ”‚   โ”œโ”€โ”€ themes.js           # 6 CSS theme profiles with dynamic token application
โ”‚   โ”œโ”€โ”€ i18n.js             # Bilingual dictionary (English / Spanish) & DOM reactive translator
โ”‚   โ”œโ”€โ”€ ui.js               # UI controller, floating tooltips, panel resizers, and event glue
โ”‚   โ””โ”€โ”€ app.js              # Application orchestrator, game loop (requestAnimationFrame), and ROM loader
โ”œโ”€โ”€ roms/
โ”‚   โ”œโ”€โ”€ games/              # Classic ROMs: Space Invaders, Pong, Tetris, Pacman, etc.
โ”‚   โ”œโ”€โ”€ demos/              # Graphic & audio demos: Stars, Sierpinski, Maze, etc.
โ”‚   โ”œโ”€โ”€ programs/           # Clock, Keypad Test, Life, etc.
โ”‚   โ””โ”€โ”€ manifest.json       # Structured ROM catalog metadata
โ”œโ”€โ”€ docs/
โ”‚   โ””โ”€โ”€ assets/             # High-resolution screenshots and showcase images
โ””โ”€โ”€ tests/
    โ”œโ”€โ”€ chip8.test.js       # Complete unit test suite for CPU opcodes & edge cases
    โ”œโ”€โ”€ disassembler.test.js# Validation for disassembler accuracy
    โ”œโ”€โ”€ shortcuts.test.js   # Automated collision & separation audit for all keyboard keys
    โ”œโ”€โ”€ themes.test.js      # Verification of all 6 theme CSS tokens
    โ””โ”€โ”€ trace.test.js       # Trace log & circular buffer limit testing

๐Ÿš€ Getting Started

Since this project uses native ES6 modules without compilation or build steps, run it using any local static web server:

Option 1: Python 3

python3 -m http.server 8080

Open http://localhost:8080 in your browser.

Option 2: Node.js (npx)

npx serve .

Option 3: VS Code Live Server

Right-click on index.html and select "Open with Live Server".


๐Ÿงช Running Automated Tests

Run the built-in Node.js native test runner (zero external testing libraries required):

node --test tests/*.test.js

All 24 test suites validate:

  • Fontset & memory layout (0x000 - 0x1FF and 0x200 start)
  • Arithmetic, bitwise shifts, and carry/borrow flags (VF)
  • Subroutine jumps, returns, and stack overflow/underflow safeguards
  • XOR sprite blitting and collision detection
  • Save state serialization and deserialization
  • Keyboard shortcuts zero-collision matrix
  • Theme registry token completeness

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Modern CHIP-8 retro workstation and emulator built with pure Vanilla JS (ES6+), Clean Architecture, zero dependencies, time-travel debugging (rewind & instruction step-back), live natural-language disassembler, vintage CRT fullscreen and retro themes.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages