Skip to content

davidxbors/CHIP8

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chip8 Emulator

Yes, yet another Chip8 Emulator on the internet.(yes, I know it's actually an interpreter)

Short description

CHIP-8 was created by engineer Joe Weisbecker in 1977 for the COSMAC VIP microcomputer. It was intended as a simpler way to make small programs and games for the computer. Instead of using machine language, you could type in simple hexadecimal instructions that resembled machine code, but which was actually interpreted on the fly by a small program.

Nowadays, if you want to write your custom ROM for a CHIP-8 interpreter you can simply do it by manually writing the hex opcodes and loading the ROM into the emulator, or you can use Octo for a more user-friendly experience.

This emulator is far from perfect, and it's intended to be a very light-weight, straight-forward, easy to use and easy to learn from (I tried to keep the source code as simple as possible). It's going to run directly in your terminal so that's a nice thing too I guess.(if you see the full half of the glass, like me)

For any questions you might have feel free to contact me, or ask away on the r/EmuDev forum.

BonCode Test Compliant

Usage

# first build the executable
make
# now run the emulator with any chip8 ROM you may want
./chip8_emulator <ROM_filepath>
# by default, the instruction set will be set to follow
# SUPER-CHIP rules, if you want original COSMAC VIP rules
./chip8_emulator <ROM_filepath> NORMAL COSMAC
# if you want to delete the executable
make clean 
# building and cleaning are done in the same way
# to run the emulator with a ROM in debug mode you do:
./chip8_emulator <ROM_filepath> DEBUG SUPER
# for COSMAC VIP running
./chip8_emulator <ROM_filepath> DEBUG COSMAC

Debugger Usage

The debugger that this emulator comes with is by all means a very basic one. Here are the commands that one can use with it:

  • n -> next instruction
  • s -> stops the running of the program
  • m addr buff -> shows what's in memory starting at address $addr and continuing %buff bytes. If $addr is negative it shows all memory
  • b addr -> addr in memory at which the program should stop running (if PC == addr break)
  • w addr -> sets a watchpoint for the memory at the given address. The debugger supports up to 100 watchpoints.

References

Tehnical informations about CHIP-8 and it's opcodes

Tehnical informations about timing of instructions

test_opcodes.ch8

ibm_logo.ch8

All the other .ch8 ROMs

.c8 ROMs are written by myself

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published