https://github.com/bethropolis/chip8
a feature rich chip 8 emulator, written in go + svelte
https://github.com/bethropolis/chip8
chip8 chip8-emulator emulator golang svelte
Last synced: 2 months ago
JSON representation
a feature rich chip 8 emulator, written in go + svelte
- Host: GitHub
- URL: https://github.com/bethropolis/chip8
- Owner: bethropolis
- License: mit
- Created: 2025-06-30T07:51:23.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-08-12T23:05:33.000Z (10 months ago)
- Last Synced: 2025-08-13T00:28:25.511Z (10 months ago)
- Topics: chip8, chip8-emulator, emulator, golang, svelte
- Language: Svelte
- Homepage:
- Size: 756 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://github.com/bethropolis/chip8)
# CHIP-8 Emulator
[](https://github.com/bethropolis/chip8/actions/workflows/test-build.yml) [](https://go.dev/) [](https://wails.io/) [](https://github.com/bethropolis/chip8/blob/main/LICENSE)
This is a feature-rich CHIP-8 emulator built with Wails (Go backend) and Svelte (frontend) with Tailwind CSS v4 for styling.
## Download
You can download the latest releases for your operating system from the [releases page](https://github.com/bethropolis/chip8/releases).
## Features
* **Customizable Settings:** Adjust display color, enable/disable scanline effects, change CPU clock speed, and remap keyboard controls via an intuitive settings modal.
* **Enhanced Application Menu:**
* **File:** Load ROMs via file dialog, Save/Load emulator state, Quit.
* **Emulation:** Pause/Resume, Soft Reset (reload current ROM), Hard Reset (clear all state).
* **Help:** Dynamic "About" dialog displaying application version and details, and a direct link to the GitHub repository.
* **Interactive Keypad:** On-screen keypad for direct input.
* **Debug Panel:** Real-time view of CPU registers, memory, stack, and disassembly.
* **Screenshot & State Saving:** Capture screenshots and save/load emulator state to/from files.
* **Gamepad Support:** Basic gamepad input mapping.
* **Drag-and-Drop ROM Loading:** Easily load ROMs by dragging them onto the emulator window.
## Getting Started
To run the emulator, follow these steps:
1. **Navigate to the project directory:**
```bash
cd chip8
```
2. **Run in development mode:**
```bash
wails dev
```
This will compile the Go backend, install frontend dependencies, and start the development server. The emulator UI should open in a new window.
## Usage
1. **Load a ROM:** Use the "File" -> "Load ROM..." menu option or drag and drop a `.ch8` file onto the emulator window.
2. **Emulation:** The emulator will automatically start executing the loaded ROM.
3. **Controls:** Use the keyboard (remappable in settings) or the on-screen keypad.
4. **Settings:** Access settings via the gear icon in the header or the application menu.
5. **Debug:** Switch to the "Debug" tab to view internal emulator state.
## Project Structure
- `app.go`: Wails application binding, main emulator loop, and backend logic for settings, file operations, etc.
- `main.go`: Entry point for the Wails application, Wails configuration, and application menu definition.
- `wails.json`: Wails project configuration, including application metadata (version, URL).
- `chip8/`: Contains the core CHIP-8 CPU emulator logic (`chip8.go`) and unit tests (`chip8_test.go`).
- `frontend/`: Svelte frontend application.
- `src/App.svelte`: Main UI component, orchestrating other Svelte components.
- `src/lib/`: Contains reusable Svelte components (e.g., `SettingsModal.svelte`, `EmulatorView.svelte`, `DebugPanel.svelte`, `stores.js`).
- `src/stores.js`: Svelte stores for managing global application state like settings and notifications.
- `src/app.css`: Tailwind CSS imports.
- `src/main.js`: Frontend entry point.
- `tailwind.config.js`: Tailwind CSS configuration.
- `postcss.config.js`: PostCSS configuration.
- `wailsjs/`: Auto-generated Wails bindings for Go backend communication.
## Development
### Go Backend
To run Go tests for the CHIP-8 core:
```bash
cd chip8
go test -v ./chip8
```
### Frontend
To install frontend dependencies:
```bash
cd frontend
bun install
```
To build the frontend separately:
```bash
cd frontend
bun run build
```
# LICENSE
The project is licensed under the [MIT License](LICENSE).