Skip to content

About

Simple chip8 emulator written in C#.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CHIP-8 Emulator

A simple CHIP-8 emulator written in C# for learning and experimentation.

Screenshots

Menu Preview Tetris Preview

Pong demo

Specification

The CHIP-8 system consists of the following components:

  • Memory – 4 KB of memory, addressed from 0x000 to 0xFFF. The original CHIP-8 interpreter occupied the lower part of memory (0x000 - 0x1FF), while programs typically start at 0x200. Font data is stored typically in 0x050

  • Stack – stores up to 16 return addresses, allowing the emulator to handle subroutine calls.

  • Registers

    • 16 general-purpose 8-bit registers, from V0 to VF
    • One 16-bit index register, I
    • One 16-bit program counter, PC
    • One stack pointer, SP
    • Two 8-bit timer registers:
      • DT – delay timer
      • ST – sound timer
  • Keyboard – 16 hexadecimal keys, from 0x0 to 0xF:

CHIP-8 Keyboard

1 2 3 C
4 5 6 D
7 8 9 E
A 0 B F

Interpreter Keyboard

1 2 3 4
Q W E R
A S D F
Z X C V
  • Display – a monochrome display with a resolution of 64×32 pixels. In the project I chose behaviour where sprites extending beyond the screen boundaries are clipped.

  • Instructions – the original CHIP-8 instruction set contains 35 instructions. Each instruction is 2 bytes long.

  • Font data – predefined sprites representing hexadecimal digits from 0x0 to 0xF. Each sprite is 5 bytes long.

Project Structure

.
├── Chip8.Core
│   └── Core CHIP-8 emulation logic
│
├── Chip8.Desktop
│   └── Desktop application and Raylib rendering
│
├── .gitignore
└── README.md

Requirements

  • .NET 10.0 SDK or higher
  • Dependencies (restored automatically via NuGet):
    • Raylib-cs (v8.0.0) – graphic rendering and window, sound management
    • NativeFileDialogNET (v2.0.2) – native file dialog for loading ROMs

Installation

git clone https://github.com/Piesel451/chip8-emulator.git
cd chip8-emulator
dotnet restore

Usage

# Run the desktop application directly using the .NET CLI:
dotnet run --project Chip8.Desktop

About

Simple chip8 emulator written in C#.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages