A simple CHIP-8 emulator written in C# for learning and experimentation.
The CHIP-8 system consists of the following components:
-
Memory – 4 KB of memory, addressed from
0x000to0xFFF. The original CHIP-8 interpreter occupied the lower part of memory (0x000 - 0x1FF), while programs typically start at0x200. Font data is stored typically in0x050 -
Stack – stores up to 16 return addresses, allowing the emulator to handle subroutine calls.
-
Registers
- 16 general-purpose 8-bit registers, from
V0toVF - One 16-bit index register,
I - One 16-bit program counter,
PC - One stack pointer,
SP - Two 8-bit timer registers:
DT– delay timerST– sound timer
- 16 general-purpose 8-bit registers, from
-
Keyboard – 16 hexadecimal keys, from
0x0to0xF:
|
|
-
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
0x0to0xF. Each sprite is 5 bytes long.
.
├── Chip8.Core
│ └── Core CHIP-8 emulation logic
│
├── Chip8.Desktop
│ └── Desktop application and Raylib rendering
│
├── .gitignore
└── README.md
- .NET 10.0 SDK or higher
- Dependencies (restored automatically via NuGet):
Raylib-cs(v8.0.0) – graphic rendering and window, sound managementNativeFileDialogNET(v2.0.2) – native file dialog for loading ROMs
git clone https://github.com/Piesel451/chip8-emulator.git
cd chip8-emulator
dotnet restore# Run the desktop application directly using the .NET CLI:
dotnet run --project Chip8.Desktop

