Skip to content

A CHIP-8 emulator written in Clojure

Notifications You must be signed in to change notification settings

UnsafePointer/chihaya

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chihaya (千早)

images/cover.png

“If I can be the best in the world at something, then I think it's worth a shot.” - Chihaya Ayase

Chihayafuru, by Yuki Suetsugu

A CHIP-8 emulator written in Clojure.

Progress

  • CPU
  • Display
  • Input
  • Sound
  • Timers

Known issues:

  • Sound timer is implemented but the buzzer doesn't work.
  • CPU is missing the following instructions:
    • SUBN Vx, Vy
    • JP V0, addr
    • LD Vx, K

Building

Prerequisites

Compiling

$ clj -Auberjar
[uberdeps] Packaged target/chihaya-0.1.0.jar in 2786 ms

Running

Pong: (SHA1: a60611339661e3ab2d8af024ad1da5880a6f8665)

pong.gif

$ java -cp target/chihaya-0.1.0.jar clojure.main -m com.unsafepointer.chihaya.core
Usage: chihaya [OPTION] ... <romfile>
  -i, --instructions         Output instructions to stdout
  -f, --frequency FREQ  800  CPU clock rate
  -h, --help

CPU frequency

Chip-8 has no formally defined processor speed at all. Chihaya renderer is locked at 60 Hz, running whatever number of instructions have been defined using the --frequency flag, which defaults to 800 Hz. Most games do best when you are running around 400-800Hz, but you have to check documentation per game.

CPU Tests

corax89/chip8-test-rom: test_opcode.ch8 (SHA1: f1cfcffe1937ed6dd6eeed1a7f85dfc777bda700)

cpu_tests.png

Acknowledgments

This emulator, like many others, is based on the Cowgod's Chip-8 Technical Reference v1.0. For ease of access and review purposes, relevant parts of the specification are pasted before the implementation.

About

A CHIP-8 emulator written in Clojure

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published