A Chip-8 emulator project designed to deepen my understanding of computer architecture.
This emulator uses SDL2 for graphics, sound, and key inputs.
- Build the project using the provided
Makefile
. Navigate to thesrc
directory and run:make
- Start the emulator with the following command:
./chip8 ../roms/<rom_name>
Note that this emulator was built on a linux environment, hence the Makefile provided will only work on unix environments.
You can customize the emulator's behavior with the following flags:
-
--scale <value>
- Default:
20
- Specifies the scaling factor for the window size. Actual dimensions are calculated as
WIDTH * SCALE
andHEIGHT * SCALE
.
- Default:
-
--speed <value>
- Default:
700
- Sets the number of instructions to execute per second.
- Default:
These flags enable alternate behaviors for certain instructions based on variations introduced by other interpreters like Super-Chip, Chip-48, or the original COSMAC VIP:
-
--cp_shift
- Default:
false
- Enables the alternate implementation of the
OP_8xy6
andOP_8xyE
instructions.
- Default:
-
--sc_jump
- Default:
false
- Enables the alternate implementation of the
OP_Bnnn
(Jump with offset) instruction.
- Default:
-
--cosmac_mem
- Default:
false
- Enables the original COSMAC VIP implementation of the
OP_Fx55
andOP_Fx65
(Store/Load Memory) instructions. Without this flag, the Super-Chip and Chip-48 behaviors are used.
- Default:
./chip8 ../roms/IBM_Logo.ch8 --cosmac_mem --sc_jump --scale 30 --speed 750
+---------------+ = 0xFFF (4095) End of Chip-8 RAM
| |
| |
| |
| |
| |
| 0x200 to 0xFFF| Program/Data Space
| |
| |
| |
+- - - - - - - -+ = 0x600 (1536) Start of ETI 660 Chip-8 programs
| |
| |
| |
+---------------+ = 0x200 (512) Start of most Chip-8 programs
| 0x000 to 0x1FF| Reserved for interpreter
+---------------+ = 0x000 (0) Start of Chip-8 RAM