Skip to content

gabrielelana/chip8.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Open Source Saturday

Emacs CHIP-8 Emulator

What

From Wikipedia: "CHIP-8 is an interpreted programming language, developed by Joseph Weisbecker made on his 1802 Microprocessor. 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. It was made to allow video games to be more easily programmed for these computers. The simplicity of CHIP-8, and its long history and popularity, has ensured that CHIP-8 emulators and programs are still being made to this day."

This is an attempt to write a full emulator able to run in Emacs.

chip8-001 chip8-002 chip8-003 chip8-004

How to install

Install the stable version using straight from MELPA

(straight-use-package chip8)

Install the development version using straight

(straight-use-package
'(chip8 :type git :host github :repo "gabrielelana/chip8.el"))

Manually

  • Clone this repository
    $ git clone https://github.com/gabrielelana/chip8.el
  • Inside of Emacs open chip8.el file, evaluate buffer with M-x eval-buffer or better, if you have native compilation available, M-x emacs-lisp-native-compile-and-load

Requirements

  • Emacs >= 28.1
  • Emacs running in a graphical environment (not in a terminal).
  • Emacs with native compilation support.
  • You need to have installed on your system Kreative Square SM font.

How to use

To play games you need ROMs, you can find some of them in this repository

After chip8.el is loaded (see How to install) you run M-x chip8 then Emacs will ask you the file of the ROM to run.

Chip-8 has many extensions and quirks mode, if the ROM doesn't run correctly, then you can choose to run a specific version of the emulator with the following commands.

  • M-x chip8-original
  • M-x chip8-modern
  • M-x chip8-superchip
  • M-x chip8-xo-chip

Why

Because Emacs can do anything, so why not.

How

I've experimented for a while on how to do retro graphic in Emacs to implement simple games, this led to a library capable to implement 2D retro games with decent frame rate and resolution.

Since the library is not ready to be released, I've vendored only the necessary code in the emulator.

In the future, when (if?) the library will be release I will remove the code and have the library as requirement for the emulator.

Known limitations

Need to implement some XO-Chip features

License

MIT

About

A CHIP-8 emulator written in EmacsLisp running in Emacs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published