GithubHelp home page GithubHelp logo

chip-8's Introduction

CHIP-8

Build status

This is an interpreter implementation for CHIP-8 by me as a fun side project, and to get beginning with building emulators and other fun stuff.

This is built using rust, and gtk for gui.

Components

This emulator is full as the documentation, and that include:

  • 32x64 screen
  • Keyboard support
  • Sounds
  • Debugger (on the way).

CPU

The main part is the CPU and its where users interface with the emulator, users can run roms by making the CPU read the file containing the rom data:

let mut cpu = CPU::new();
cpu.read_file(&mut File::open("/path/to/rom.ch8").unwrap());

cpu.run_display_application();

Keyboard

Chip-8's has 16 keys in its keypad as shown:

1 2 3 C
4 5 6 D
7 8 9 E
A 0 B F

This emulator uses the left side of the keyboard as a keypad as shown:

1 2 3 4
Q W E R
A S D F
Z X C V

Sound

I used a sin wave sound signal of 300Hz frequency.

Screenshots

Some games and roms tried with this emulator

Note: Thanks to dmatlack for his great collection of roms, can be found in dmatlack's chip8 repo

Bricks

Bricks

Bricks

Space Invaders

Space Invaders

Ping Pong

Ping Pong

Maze

Maze

Keypad tester

Keypad Tester

Debugger

On the process of making a debugger for this emulator/interpreter.

The user can pause the CPU with the <SPACE> key, and unpause with the same key. And during debug, users can use the <N> key to advance one instruction at a time. (can be held).

These can be changed in cpu.rs::setup_keyboard.

TODO:

  • Show registers
  • Show stack
  • Show memory
  • Show instructions
  • Show keypad
  • Allow user to stop the CPU in the middle
  • Allow user to edit registers
  • Allow user to edit memory
  • Show which registers have changed during the last instruction (coloring or something).
  • Implement flow-oriented disassembly (Some roms, have instructions on odd addresses, like Space Invaders).
  • Breakpoints on instructions
  • Breakpoints on data

Debugger

Debugger 2

Any suggestions and edits are welcomed in the issues and pull requests.

chip-8's People

Contributors

amjad50 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.