Code Monkey home page Code Monkey logo

chip8emulator's Introduction

A simple Chip-8 Emulator for Windows written in C

Chip8 is an interpreter from the 1970s that was used to develop games like Space Invaders and Pong. This project implements the Chip-8 ISA as well as virtual hardware for the keyboard and display.

The Chip-8 features a simple ISA - originally consisting of 36 instructions. The Super Chip-48 extended this to 46. This project implements only the Chip-8 ISA and ignores the Super Chip-48 instructions.

Chip-8 Register Specifications

  • 16 8-bit data registers V0 to VF.
  • 16-bit I register to hold memory addresses. Only the least significant 12-bits are used.
  • 16-bit Program counter (PC). Only the least significant 12-bits are used.
  • Stack consisting of 16 16-bit entries to hold return addresses.
  • 8-bit Stack Pointer (SP) which points at the top of the stack.
  • An 8-bit Delay Timer (DT) and an 8-bit Sound Timer (ST).

Chip-8 Memory Specifications

  • Chip-8 uses a 4KB memory region. All addresses are 12-bits wide.
  • Chip-8 interpreter data is loaded at address 0x0.
  • Chip-8 program data is loaded from address 0x200.
  • All instructions are aligned at 2 bytes. Sprites are padded to respect this alignment criteria.

Program dependencies

  • SDL - The project depends on SDL to implement the virtual hardware, including the display and keyboard.
  • MinGW compiler - This project assumes that the compiler being used is MinGW-gcc for Windows.

Note: If you would like to use a different C/C++ compiler for Windows and/or wish to use an IDE with an automated build process, configure your IDE to look in the right directories for includes/libs/binaries and avoid using the provided Makefile.

Running the emulator

After the program has been successfully built, you can run the executable located in the bin folder. Roms for Space Invaders and Pong have also been provided, but keep in mind that Space Invaders currently has some issues with the game speed.

Useful Links:

chip8emulator's People

Contributors

shreyas42 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.