CHIP-8 interpreter written in Python

Overview

chip8py

GitHub GitHub repo size Lines of code

CHIP-8 interpreter written in Python

Contents

About

CHIP-8 is an interpreted language developed during the 1970s.

chip8py is an interpreter that can run any program originally designed for the CHIP-8 platform.

Installation

The project uses pygame to render the window:

python -m pip install pygame

Clone this repository into a folder:

git clone https://github.com/robertolaru/chip8py.git

Usage

Running python main.py --help will provide the list of arguments the program supports:

usage: main.py [-h] [--cps CPS] [--fps FPS] [-c] [-m] program

positional arguments:
  program            path to the program to load

optional arguments:
  -h, --help         show this help message and exit
  --cps CPS          cycles per second. Default is 500 cps
  --fps FPS          window rendering framerate. Default is 30 fps
  -c, --cpu-view     enable visualization of CPU registers, stack, opcodes
  -m, --memory-view  enable memory visualization. Also enables CPU visualization (like --cpu-view)

To run the program, you need to provide the path to the rom file (program) to load in the interpreter:

python main.py program

Using the keyboard

Originally, user input on CHIP-8 was done through a 16-key hex keyboard.

The interpreter maps the original keys to the leftmost portion of QWERTY keyboards:

 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

(original)              (interpreter)

License

chip8py is licensed under the MIT license.

You might also like...
Simple, high-school-leveled sequence library written in Python / 간단한 고등학교 수준 수열 라이브러리 (Python)
Msgpack serialization/deserialization library for Python, written in Rust using PyO3 and rust-msgpack. Reboot of orjson. msgpack.org[Python]

ormsgpack ormsgpack is a fast msgpack library for Python. It is a fork/reboot of orjson It serializes faster than msgpack-python and deserializes a bi

Synthetik Python Mod - A save editor tool for the game Synthetik written in python

Synthetik_Python_Mod A save editor tool for the game Synthetik written in python

MiniJVM is simple java virtual machine written by python language, it can load class file from file system and run it.

MiniJVM MiniJVM是一款使用python编写的简易JVM,能够从本地加载class文件并且执行绝大多数指令。 支持的功能 1.从本地磁盘加载class并解析 2.支持绝大多数指令集的执行 3.支持虚拟机内存分区以及对象的创建 4.支持方法的调用和参数传递 5.支持静态代码块的初始化 不支

Pygments is a generic syntax highlighter written in Python

Welcome to Pygments This is the source of Pygments. It is a generic syntax highlighter written in Python that supports over 500 languages and text for

Retrying is an Apache 2.0 licensed general-purpose retrying library, written in Python, to simplify the task of adding retry behavior to just about anything.

Retrying Retrying is an Apache 2.0 licensed general-purpose retrying library, written in Python, to simplify the task of adding retry behavior to just

A full-featured, hackable tiling window manager written and configured in Python
A full-featured, hackable tiling window manager written and configured in Python

A full-featured, hackable tiling window manager written and configured in Python Features Simple, small and extensible. It's easy to write your own la

This is the code of Python enthusiasts collection and written.

I am Python's enthusiast, like to collect Python's programs and code.

Reactjs web app written entirely in python, using transcrypt compiler.

Reactjs web app written entirely in python, using transcrypt compiler.

Owner
Robert Olaru
Robert Olaru
sawa (ꦱꦮ) is an open source programming language, an interpreter to be precise, where you can write python code using javanese character.

ꦱꦮ sawa (ꦱꦮ) is an open source programming language, an interpreter to be precise, where you can write python code using javanese character. sawa iku

Rony Lantip 307 Jan 7, 2023
One line Brainfuck interpreter in Python

One line Brainfuck interpreter in Python

null 16 Dec 21, 2022
Recreate the joys of Office Assistant from the comfort of the Python interpreter

Recreate the joys of Office Assistant from the comfort of the Python interpreter.

Louis Sven Goulet 3 May 21, 2022
Ked interpreter built with Lex, Yacc and Python

Ked Ked is the first programming language known to hail from The People's Republic of Cork. It was first discovered and partially described by Adam Ly

Eoin O'Brien 1 Feb 8, 2022
An implementation of an interpreter for the Brainfuck esoteric language in Python

Brainfuck Interpreter in Python An implementation of an interpreter for the Brainfuck esoteric language in Python. ?? The Brainfuck Language Created i

Carlos Santos 0 Feb 1, 2022
Learning with Peter Norvig's lis.py interpreter

Learning with lis.py This repository contains variations of Peter Norvig's lis.py interpreter for a subset of Scheme, described in (How to Write a (Li

Fluent Python 170 Dec 15, 2022
The Official interpreter for the Pix programming language.

The official interpreter for the Pix programming language. Pix Pix is a programming language dedicated to readable syntax and usability Q) Is Pix the

Pix 6 Sep 25, 2022
A subleq VM/interpreter created by me for no reason

What is Dumbleq? Dumbleq is a dumb Subleq VM/interpreter implementation created by me for absolutely no reason at all. What is Subleq? If you haven't

Phu Minh 2 Nov 13, 2022
Compiler Final Project - Lisp Interpreter

Compiler Final Project - Lisp Interpreter

null 2 Jan 23, 2022
PyDy, short for Python Dynamics, is a tool kit written in the Python

PyDy, short for Python Dynamics, is a tool kit written in the Python programming language that utilizes an array of scientific programs to enable the study of multibody dynamics. The goal is to have a modular framework and eventually a physics abstraction layer which utilizes a variety of backends that can provide the user with their desired workflow

PyDy 307 Jan 1, 2023