Skip to content

Chip-8 / Chip8 HiRes / SuperChip (SCHIP) Emulator writen in GO language.

Notifications You must be signed in to change notification settings

cassianoperin/CHIP8_GO

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CHIP-8 / CHIP-8 HIRES / SCHIP Emulator

CHIP-8 / CHIP-8 HIRES / SCHIP Emulator writen in GO with simple code to be easy to be studied and understood.

CHIP-8 Space Invaders Game Superchip (SCHIP) Spacefight 2091!
invaders invaders
Blinky (Color theme) Single Dragon (Color Theme)
blinky singledragon
CHIP-8 HiRes Astro Dodge (Color theme) On-screen Debug (Color theme)
astro debug

Features

  • 100% Pause and resume emulation
  • 100% Reset emulation
  • 100% Step Forward CPU Cycles for Debug
  • 100% Step Back (Rewind) CPU Cycles for Debug (Need to be activated on command line with -Rewind)
  • 100% On-screen Debug mode
  • 100% Increase and Decrease CPU Clock Speed
  • 100% Color Themes
  • 100% Save States
  • 100% Fullscreen
  • 100% Binary and Hexadecimal rom format
  • 100% Emulation Status from all games I have to test

EMULATOR Usage

  1. Run:

    $./chip8 [options] ROM_NAME

  • Options:

    -Debug Enable Debug Mode

    -DrawFlag Enable Draw Graphics on each Drawflag instead @60Hz

    -Rewind Mode Enable Rewind Mode

    -SchipHack Enable SCHIP DelayTimer hack mode to improve speed

    -help Show Command Line Interface options

  1. Keys
  • Original COSMAC Keyboard Layout (CHIP-8):

    1 2 3 C

    4 5 6 D

    7 8 9 E

    A 0 B F

  • Original HP48SX Keyboard Layout (SuperChip):

    7 8 9 /

    4 5 6 *

    1 2 3 -

    0 . _ +

  • Keys used in this emulator:

    1 2 3 4

    Q W E R

    A S D F

    Z X C V

    P: Pause and Resume emulation

    I: Step back (rewind) one CPU cycle in Pause Mode

    O: Step forward one CPU cycle in in Pause Mode

    K: Create Save State

    L: Load Save State

    6: Change Color Themes

    7: Decrease CPU Clock Speed

    8: Increase CPU Clock Speed

    9: Enable / Disable Debug Mode

    0: Reset

    J: Show / Hide FPS Counter

    H: Switch DrawMode (@DrawFlag OR @60Hz)

    N: Enter / Exit Fullscreen mode

    M: Change resolution

    ESC: Exit emulator

EMULATOR Build Instructions

MAC

  • Install GO:

    brew install go

  • Compile:

    go build -ldflags="-s -w" chip8.go

Windows

GO allows to create a Windows executable file using a MacOS:

1. Install mingw-w64 (support the GCC compiler on Windows systems):

brew install mingw-w64

2. Compile:

  • 32 bits:

env GOOS="windows" GOARCH="386" CGO_ENABLED="1" CC="i686-w64-mingw32-gcc" go build -ldflags="-s -w"

  • 64 bits:

env GOOS="windows" GOARCH="amd64" CGO_ENABLED="1" CC="x86_64-w64-mingw32-gcc" go build -ldflags="-s -w"

  • If you receive the message when running the executable, you need to ensure that the video drivers supports OpenGL (or the virtual driver in the case of virtualization).

  • If you receive this message : "APIUnavailable: WGL: The driver does not appear to support OpenGL", please update your graphics driver os just copy the Mesa3D library from https://fdossena.com/?p=mesa/index.frag (opengl32.dll) to the executable folder (really slow).

4. Compress binaries

brew install upx

upx <binary_file>

Linux

Instructions to build using Ubuntu.

1. Install requisites:

sudo apt install pkg-config libgl1-mesa-dev licxi-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev mesa-utils build-essential xorg-dev libasound2-dev upx

2. Build:

  • 32 bits:

env GOOS="linux" GOARCH="386" CGO_ENABLED="1" go build -ldflags="-s -w"

  • 64 bits:

env GOOS="linux" GOARCH="amd64" CGO_ENABLED="1" go build -ldflags="-s -w"

3. Compress binaries:

upx <binary_file>

Documentation

Chip-8

Cowgod's Chip-8 Technical Reference

How to write an emulator (CHIP-8 interpreter) — Multigesture.net

Wikipedia - CHIP-8

trapexit chip-8 documentation

Thomas Daley Wiki (Game Compatibility)

David Winter Documentation

Chip-8 Database

Archive chip8.com

Columbia University - Columbia University

Tom Swan Documentation

Superchip (SCHIP)

HP48 Superchip

SCHIP

Chip-8 Reference Manual

Chip-8 Extensions

CHIP‐8 Extensions Reference

CHIP‐8 Extensions (Github)

Chip8 Hybrids

EMMA02 Opcodes Documentation

MegaChip