Giter VIP home page Giter VIP logo

rusty-chip8's Introduction

A Rusty CHIP-8 Emulator

tetris in chip8

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.

โ€” Wikipedia on CHIP-8

I first wanted to build a GBA emulator, since I've grown up on those (Pokemon ROM hacks made up my childhood), but it seemed like a lot for a first time emulator. Honestly, implementing every single instruction would have taken forever. I'm also new to Rust, so building a CHIP-8 emulator is a good place to start. Overall, this is a fantastic systems project to learn a new language and have something to show at the end of it all.

I primarily tested this emulator on TETRIS and PONG. Note that it seems like the key debouncer within minifb is not the best, so sometimes keys may not be received properly. This is a first time Rust and "building an emulator" project I've done, so expect some quirks. The TEST ROM (listed below) was also used in debugging the emulator.

Some interesting extensions would be to build an interactive debugger (which would involve the user being able to step through opcode instructions and visually look under the hood to examine registers and the stack) and replacing minifb with sdl2 for better abstractions and proper device periphery separation.

๐ŸŽฎ Advice for Building a Emulator

Instead of writing the emulator and testing it afterwards (as I did in this project), it is best to initially write a minimal amount of code. First, load a ROM. When the interpreter gets to an unimplemented opcode, crash/panic and print the opcode. At that point, write the code to parse the opcode and make sure it gets appropriately handled. This build-test loop chunks this larger project into much smaller pieces and makes sure every opcode gets the attention it needs.

๐Ÿ•น Resources Used:

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.