8000 GitHub - gabrielvictorcf/rusty-8: Just a openGL CHIP-8 emulator built with rust πŸ’Ύ
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

gabrielvictorcf/rusty-8

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

rusty-8 πŸ’Ύ

Just a GL 7F28 CHIP-8 emulator written in Rust πŸ’Ύ

rusty-8 running MAZE rom

rusty-8 running the maze ROM


Chip-8 is a virtual machine and easy-to-use interpreted programming language from the late 70's. Typically, the roms are in a compiled form - which is what this emulator executes. Since it wasn't accompanied by dedicated hardware, there are specifications on all the components a Chip-8 implementation should have.

This project was made after i had Computer Architecture and Organization classes, a pretty cool subject that made me want to get my hands dirty with emulation.

With this in mind, if you're curious about those topics take a look at this repo's resources! It's more hands-on approach, but there is definitely something to be learned, like how a computer executes instructions, branches execution, and more.

Also, the code is thoroughly commented, and should be easy to follow if you're familiar with rust. The only caveat is the fb.glutin_handle_basic_input function, at the end of main, which is heavy library code - input is just a recap of a frame's input events from OpenGL.

Here are some specs of my Chip-8 implementation:

  • 500 Hz Clock
  • 4Kb of RAM memory (512 bytes reserved to the Virtual Machine)
  • 64x32 display (resizeable with OpenGl)
  • 16 8-bit data registers, plus some other special ones
  • 60Hz playback rate

Installing / Building

You'll need cargo and libsdl2-dev to build rusty-8.

cargo install --branch main --git https://github.com/gabrielvictorcf/rusty-8 rusty-8

Usage

You can git clone https://github.com/gabrielvictorcf/rusty-8.git to get the roms, or just go to roms and download them individually. Then, all that's left is to:

rusty-8 <rom_path> # opens the emulator and executes given rom!

Some games might be buggy - this is unrelated to the emulator itself, and depends more on how the game was programmed. Also, if you find the window a bit large, it's resizeable.

Controls

Chip-8's original keyboard and this emulator's keyboards are as follows:

    Original                     Rusty-8
╔═══╦═══╦═══╦═══╗            ╔═══╦═══╦═══╦═══╗
β•‘ 1 β•‘ 2 β•‘ 3 β•‘ C β•‘            β•‘ 1 β•‘ 2 β•‘ 3 β•‘ 4 β•‘
╠═══╬═══╬═══╬═══╣            ╠═══╬═══╬═══╬═══╣
β•‘ 4 β•‘ 5 β•‘ 6 β•‘ D β•‘            β•‘ Q β•‘ W β•‘ E β•‘ R β•‘
╠═══╬═══╬═══╬═══╣     β†’      ╠═══╬═══╬═══╬═══╣
β•‘ 7 β•‘ 8 β•‘ 9 β•‘ E β•‘            β•‘ A β•‘ S β•‘ D β•‘ F β•‘
╠═══╬═══╬═══╬═══╣            ╠═══╬═══╬═══╬═══╣
β•‘ A β•‘ 0 β•‘ B β•‘ F β•‘            β•‘ Z β•‘ X β•‘ C β•‘ V β•‘
β•šβ•β•β•β•©β•β•β•β•©β•β•β•β•©β•β•β•β•            β•šβ•β•β•β•©β•β•β•β•©β•β•β•β•©β•β•β•β•

There are also some additional emulator/window controls:

  • Window close - Esc or Ctrl+W
  • Emulator reset - Ctrl+R

Credits

All of these are amazing, free, resources that make learning/implementing Chip-8 quite a pleasure. Big thanks to all of these creators!

More game roms shouldn't be hard to find around the internet.

This was built using some nice crates, so thanks to their creators as well.

License

All code in this repository is licensed under the MIT License, and thus is of free use.

About

Just a openGL CHIP-8 emulator built with rust πŸ’Ύ

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0