Skip to content

A go implementation of a CHIP-8 emulator (or rather interpreter).

Notifications You must be signed in to change notification settings

chran554/chip8-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chip-8 emulator

This is an implementation of a Chip-8 "emulator". (It’s not really an emulator but rather a processor like interpreter for a limited set of machine code instructions.)

Nothing remarkable but a fun amusement during a weekend.

Although the Chip-8 "machine" or processor is very limited it can produce a lot of fun, 70’s like, applications and games.

CHIP-8 is an interpreted programming language, developed by Joseph Weisbecker. It was initially used on the COSMAC VIP and Telmac 1800 8-bit microcomputers in the mid-1970s. CHIP-8 programs are run on a CHIP-8 virtual machine. It was made to allow video games to be more easily programmed for said computers.

For more information see:

Examples

Here are some examples of running games…​

(It’s not exciting game play but a rather short clip to show off the fantastic graphic abilities of a CHIP-8 virtual machine.)

Disassembler

I made a "disassembler" to be able to find out what other programs were doing, just parsing the instructions of the ROM-files and printing actions in a more natural language.

(Well, the "ROM" is not really read-only as the program can self rewrite/mutate in memory during execution).

IBM Logo disassembly (full disassembly)
Disassembly of "roms/IBM Logo.ch8":
0x200:  0x00  ░░░░░░░░    00E0    00E0: Clear screen
0x201:  0xE0  ███░░░░░
0x202:  0xA2  █░█░░░█░    A22A    ANNN: Set register I to point at address 0x22A
0x203:  0x2A  ░░█░█░█░
0x204:  0x60  ░██░░░░░    600C    6XNN: Set register V0 to value 0x0C
0x205:  0x0C  ░░░░██░░
0x206:  0x61  ░██░░░░█    6108    6XNN: Set register V1 to value 0x08
0x207:  0x08  ░░░░█░░░
0x208:  0xD0  ██░█░░░░    D01F    DXYN: Xor draw sprite of pixel size 8xF, from address pointed to by register I, at screen position (V0, V1)
0x209:  0x1F  ░░░█████
0x20A:  0x70  ░███░░░░    7009    7XNN: Add value 0x09 to register V0
0x20B:  0x09  ░░░░█░░█
0x20C:  0xA2  █░█░░░█░    A239    ANNN: Set register I to point at address 0x239
0x20D:  0x39  ░░███░░█
[...]