chip-8 / extensions

CHIP-8 Extensions Reference
https://chip-8.github.io/extensions/
Creative Commons Attribution Share Alike 4.0 International
7 stars 3 forks source link
chip-8 chip8 hacktoberfest

CHIP-8 extensions and compatibility

Preamble

This document is intended as a well-sourced and exhaustive documentation of all extensions to CHIP-8. They all use the standard CHIP-8 interpreter as a base, mentioning what additions and changes they make to that common base.

This list is mostly for historical purposes; few of the extensions listed here had a considerable number of programs written for them. It could serve as a reference for CHIP-8 emulator/interpreter developers who want to support the various incompatible instructions and behaviors that have cropped up in different interpreters over the decades. Perhaps the instructions listed here can also inspire someone to make their own modern CHIP-8 extension (of which there have been a couple, see the bottom of the list).

A note on modern implementations

The only CHIP-8 extensions in active use today (beyond basic CHIP-8) are SUPER-CHIP 1.1 and the relative newcomer XO-CHIP.

When SUPER-CHIP for the HP48 calculators revived CHIP-8 in the 1990s, it introduced several incompatibilities with the original CHIP-8 interpreters from the 1970s and '80s. These incompatibilities have persisted until today, when CHIP-8 has become the de facto "Hello, world!" project for emulator developers. Even modern, basic CHIP-8 interpreters and games that do not support the SUPER-CHIP extensions will assume the "quirky" SUPER-CHIP behavior.

This means that many of the original pre-1990 CHIP-8 games do not run in modern interpreters. For an overview of CHIP-8 games and their compatibility, see the CHIP-8 database project.

A note on machine code routines

In the original CHIP-8 interpreter, instructions on the form 0NNN would execute a 1802 machine code routine located at address 0NNN. The instructions 00E0 (clear screen) and 00EE (return from CHIP-8 subroutine) are both such routines. As they were explicitly listed in the instruction table, I treat them as regular instructions here. The same goes for any such subroutines that were added in extended interpreters. After all, what is really the difference between a machine code routine and a "regular" CHIP-8 instruction, apart from how the interpreter dispatches them? If a machine code instruction was exposed to the users of the interpreters, we consider it a CHIP-8 instruction for the purpose of this document.

Some CHIP-8 interpreters for other microcomputers during the late 1970s and early '80s also supported calling machine code routines for their specific CPUs with a general 0NNN instruction, but this is not well documented and few programs took advantage of it. For this reason, this instruction is generally not listed below; more research would be needed to say conclusively what interpreters support it.

Sources

The list builds on these modern documents, in addition to historical sources:

Commonalities and notation

CHIP-8 interpreters typically (unless otherwise stated) have the following components:

All CHIP-8 instructions are two bytes long, written as a hexadecimal number. The opcode is recognized by the first hexadecimal digit (or nibble) and sometimes also additional digits. The arguments are designated as follows:

What this list does not cover

Systems inspired by, but completely incompatible with, CHIP-8 – such as CHIP-12, CHIP-16 and BytePusher - are not listed here.

CHIP-8

The original CHIP-8 interpreter created for the RCA COSMAC VIP by Joseph Weisbecker. It was first detailed in VIPER volume 1, issue 1, 1978.

The instructions 8XY3, 8XY6, 8XY7 and 8XYE were all part of the interpreter from the beginning, but they were initially undocumented. They were quickly found, however, and revealed in VIPER issue 2.

Instructions

Compatibility notes

The COSMAC VIP hexadecimal keypad had the following layout:

1 2 3 C
4 5 6 D
7 8 9 E
A 0 B F

CHIP-8 1/2

An interpreter written by Peter K. Morrison, mentioned in VIPER volume 1, issue 2, 1977. The code for this interpreter is not given. It is incompatible with CHIP-8, as it moves several instructions around in memory. Of note here is the expansion of the display instruction.

New instructions

Altered instructions

CHIP-8I

This is a modification of CHIP-8 to provide I/O instructions, by Rick Simpson. It was detailed in VIPER issue 3.

In addition to the new instructions below, it was suggested that the Q-line on the COSMAC VIP (the sound output) be connected to the add-on card you wish to interface with, and that setting the sound timer to 1 (which would not produce an audible tone on the COSMAC VIP) would signal to the card that it can consume input. Likewise, the EF4 line on the COSMAC VIP would be connected to the card and used to signal to the VIP that input should be consumed.

This could be used with an external keyboard to allow ASCII input.

New instructions

Altered instructions

CHIP-8 II aka. Keyboard Kontrol

A modification of CHIP-8 I which adds support for real-time games and two player games. It was made by Tom Swan, and detailed in VIPER volume 2, issue 4.

New instructions

The same as for CHIP-8 I above, and:

CHIP-8III

A modification of CHIP-8I, CHIP-8 II and CHIP-8 with I/O port driver routine. It was made by John Chmielewski and detailed in VIPER volume 2, issue 7.

New instructions

Compatibility notes

Two-page display for CHIP-8

A modified CHIP-8 interpreter that increases the resolution to 64 x 64, by Andy Modla and Jef Winsor. It is detailed in VIPER volume 1, issue 3. It was used in several programs presented in Tom Swan's book PIPS FOR VIPS.

New instructions

Compatibility notes

CHIP-8C

This was a color-language addition to CHIP-8, which was advertised in VIPER issue 2 as coming out in "late October" of 1978, but it was apparently never released. It would require an RCA Color Board VP-590, and support three background colors and eight foreground colors. It's likely it was supplanted by CHIP-8X.

According to Ipso Facto issue 12, it had 5 new instructions. CHIP-8X has only 4 instructions pertaining to color.

CHIP-10

This is a modification to the original CHIP-8 interpreter that expands the resolution to 128 x 64, detailed in VIPER issue 7 and Ipso Facto issue 10. It was created by Ben H. Hutchinson, Jr.

It required a hardware add-on to expand the horizontal resolution, and reduced the pixel height from four to two scanlines. It's called "CHIP-10" since it controls 10 bits worth of display memory rather than 8. The hardware requirements were outlined in Ipso Facto issue 11.

Compatibility notes

Altered instructions

CHIP-8 modification for saving and restoring variables

By John Bennett, from VIPER volume 1, issue 10.

New instructions

Altered instructions

Improved CHIP-8 modification for saving and restoring variables

By John Bennett, from VIPER volume 2, issue 2.

New instructions

Altered instructions

CHIP-8 modification with relative branching

By Wayne Smith, in VIPER volume 2, issue 1.

New instructions

Altered instructions

Another CHIP-8 modification with relative branching

By Tom Swan, in VIPER volume 2, issue 5.

New instructions

CHIP-8 modification with fast, single-dot DXYN

By Wayne Smith, in VIPER volume 2, issue 1.

Altered instructions

CHIP-8 with I/O port driver routine

By James Barnes, in VIPER volume 2, issue 2.

New instructions

CHIP-8 8-bit multiply and divide

By Wayne E. Smith, Jr. Detailed in VIPER volume 2, issue 3.

New instructions

Altered instructions

HI-RES CHIP-8 (four-page display)

Hi-res CHIP-8 increases the screen resolution from 64 x 32 to 64 x 128 by reducing each pixel's height from 4 to 2 scanlines. It was created by Tom Swan and detailed in VIPER volume 2, issue 6.

New instructions

Altered instructions

Compatibility notes

HI-RES CHIP-8 with I/O

An extension of Hi-res CHIP-8 by Tom Swan which adds some I/O instructions and the MESSAGER program from the first PIPS FOR VIPS book. It was detailed in the appendix to PIPS FOR VIPS IV, as well as VIPER volume 5, issue 3 which featured excerpts from that book.

New instructions

Altered instructions

Compatibility notes

HI-RES CHIP-8 with page switching

A modification of Hi-res CHIP-8 which adds a display buffer to memory, allowing the entire display to be flipped for smooth animation multi-sprite drawings, among other things. It was made by Tom Swan and is detailed in VIPS FOR PIPS IV and VIPER volume 5, issue 3.

New instructions

Altered instructions

Compatibility notes

CHIP-8E

This is a rewritten CHIP-8 interpreter which incorporates many additions from previous extensions. It was written by Gilles Detillieux and detailed in VIPER volume 2, issue 8/9.

New instructions

CHIP-8 with improved BNNN

A short modification by George Ziniewicz from VIPER volume 2, issue 8/9.

New instructions

Altered instructions

CHIP-8 scrolling routine

A short machine language subroutine that scrolls the display upwards by 1 pixel. Written by Tom Swan, detailed in VIPER volume 3, issue 1.

CHIP-8X

The first official CHIP-8 extension by RCA, released in 1980. It added support for the Color Card, Simple Sound and expansion hex keyboard. It was detailed in

The instruction listing for CHIP-8X still did not include the undocumented opcodes.

New instructions

Altered instructions

Compatibility notes

Two-page display for CHIP-8X

A modification of the two-page display for CHIP-8 (by Andy Modle and Jef Winsor, detailed above) which adds CHIP-8X functionality. In other words, it is a CHIP-8X with 64 x 64 resolution. It required hardware modifications. It is written by Jeff Jones and is detailed in VIPER volume 4, issue 3.

New instructions

Altered instructions

Hi-res CHIP-8X

A modification of Hi-res CHIP-8 (by Tom Swan, detailed above) which adds CHIP-8X functionality. In other words, it is a CHIP-8X with 64 x 128 resolution. It required hardware modifications. It is written by Jeff Jones and is detailed in VIPER volume 4, issue 3.

New instructions

Altered instructions

Compatibility notes

CHIP-8Y

Bob Casey's CHIP-8 with I/O modifications. Detailed in VIPER volume 3, issue 1. Similar to CHIP-8I and CHIP-8X, but compatible with CHIP-8.

New instructions

CHIP-8 "Copy to Screen"

By Tom Swan in VIPER volume 3, issue 4.

Altered instructions

CHIP-BETA

Ron Applebach's interpreter, mentioned in VIPER volume 3, issue 5. It features a 64 x 64 resolution, plus the I/O instructions from CHIP-8X to run Simple Sound and player 2 hexadecimal keyboard. Presumably similar to the two-page CHIP-8X interpreter.

CHIP-8M

A CHIP-8 interpreter that can send International Morse Code, written by Steven Vincent Gunhouse and detailed in VIPER volume 4, issue 5.

New instructions

Compatibility notes

Multiple Nim interpreter

Detailed in VIPER volume 4, issue 5, this is a modified CHIP-8 interpreter that is used to play the game "Multiple Nim" (a variant of the well-known mathematical strategy game Nim).

The changes in this interpreter are not specified, but the machine code for it is given, so if someone has some time to kill it should be possible to find out.

Double Array Modification

A modification to any CHIP-8 interpreter which allows easy lookup in a two-dimensional array. It was written by Ron Applebach and detailed in VIPER volume 4, issue 6.

The new instruction replaces any old instruction, but the article suggests replacing BNNN as that was not commonly used, and available in the standard CHIP-8 interpreter.

New instructions

Altered instructions

Compatibility notes

CHIP-8 for DREAM 6800 (CHIPOS)

Created by Michael Bauer. Described in Electronics Australia, May 1979. The DREAM 6800 had its own newsletter, DREAMER, which ran for 19 issues from 1980 and into 1982 and provided many CHIP-8 programs.

The interpreter is run from a monitor program called CHIPOS, sometimes used as the name for the interpreter itself.

New instructions

Altered instructions

Compatibility notes

The prototype DREAM 6800 shown in the Electronics Australia article (see Michael Bauer's DREAM 6800 Archive website) used the following keypad layout:

C D E F
8 9 A B
4 5 6 7
0 1 2 3

This is also the layout used by the CHIP-8 Classic reproduction computer (see below).

However, most DREAM computers used off-the-shelf Digitran keypads, with the following layout:

0 1 2 3
4 5 6 7
8 9 A B
C D E F

This became the "standard" layout used by all programs in the DREAMER magazine. It's also the layout used by David Fry's 40th anniversary DREAM 6800 reproduction computer.

CHIP-8 with logical operators for DREAM 6800 (CHIPOSLO)

A modified version of the DREAM 6800 interpreter, with the missing four undocumented instructions added, made by Tobias V. Langhoff. GitHub repository.

New instructions

Compatibility notes

CHIP-8 for DREAM 6800 with joystick

A modification of CHIP-8/CHIPOS for the DREAM 6800 with an added joystick, described in DREAMER #3.

2K CHIPOS for DREAM 6800

An extended version of the CHIP-8 interpreter running in CHIPOS for a modified 2K EPROM version of the DREAM 6800. Created by Keith Semrad and detailed in DREAMER issue #19, January 1982.

It has several new instructions, but their usage is not very beginner-friendly; almost all of them take a value in VX that is then looked up in one giant look-up table. Values are therefore not human-readable without a reference.

New instructions

CHIP-8 for ETI-660

A CHIP-8 interpreter for the ETI-660 Learner's Microcomputer, detailed in Electronics Today International, November 1981, page 115. This computer was an upgraded version of the HUG1802 computer from New Zealand, of which not much is known today.

Although not stated explicitly in the above source, the ETI-660 and its version of CHIP-8 in fact supported a resolution of 64 x 48.

In the "Hints for CHIP-8 Programmers" column, which started in the ETI issue of December 1982, the ETI-660 version of the CHIP-8 language is called the "CHIP 8.D3 dialect". The original COSMAC VIP version is called "CHIP 8.D1", but it's not clear what "CHIP 8.D2" refers to (although it's stated to load programs from 0200 like on the VIP); presumably the DREAM 6800 version.

New instructions

Compatibility notes

The ETI-660 had a "standard" keyboard with the following layout:

0 1 2 3 4 5 6 7
8 9 A B C D E F

But many used off-the-shelf hexadecimal keypads instead, with the same layout as the Digitran keypad:

0 1 2 3
4 5 6 7
8 9 A B
C D E F

CHIP-8 with color support for ETI-660

This adds color support to the CHIP-8 interpreter for ETI-660, which required hardware modifications. It was detailed in Electronics Today International, April 1982, page 88, and was in principle very similar to CHIP-8X (and presumably CHIP-8C) for the COSMAC VIP although its instruction structure was different.

New instructions

Compatibility notes

CHIP-8 for ETI-660 with high resolution

A version of the CHIP-8 for ETI-660 with color, this interpreter added support for a 64 x 64 resolution and required hardware modifications. It was detailed in Electronics Today International, February 1984 and written by Bill Kreykes.

It moves the color instructions around in memory, so they have new opcodes. They also use different registers.

New instructions

Altered instructions

Compatibility notes

CHIP-8 for COSMAC ELF

Described in Programs for the COSMAC ELF – Interpreters, by Paul C. Moews.

New instructions

Altered instructions

CHIP-VDU / CHIP-8 for the ACE VDU

A port of the CHIP-8 interpreter to the ACE VDU board, by Tony Hill. It added two long branch instructions to get input from the ACE keyboard, and provided a resolution of 128 x 64. Described in Ipso Facto, issue 35, June 1983.

Issue 36 provides some modifications to old games that don't work with the new resolution; these modifications could be used for other extensions that provide higher resolution but lack instructions to support more standard lower resolutions, such as CHIP-10.

New instructions

These are not instructions per se, but jumps, but since the interpreter is located at address 1000 on the ACE they work as machine code instructions.

Compability notes

The interpreter is located at address 1000 to 12EE. Execution starts at 1000. The CHIP-8 program is still loaded at 0200.

CHIP-8 AE (ACE Extended)

CHIP-8 AE was a major extension for the ACE by Larry Owen, Tony Hill and Mike E. Franklin. It is described in the newsletter Ipso Facto, issue #40, May 1984, with a disassembler provided in issue #41 of July 1984. There was one version for the 1861 Pixie chip, and one for the ACE VDU. It provides the following features:

New instructions

Altered instructions

Compatibility notes

The major issue of compatibility is the keyboard. CHIP-8 AE is written for an ASCII keyboard, not a hexadecimal keyboard, and it provides no mapping. The numerical keys all map to the same value, but in order to use the A-F hexadecimal key inputs that some games might expect, the user would have to either use the keys that had ASCII values that corresponded to those hexadecimal values (J, K, L, M, N and O), or patch the CHIP-8 programs to use different keys.

Dreamcards Extended CHIP-8 V2.0

Introduced by Lindsay R. Ford of Dreamcards for the Microbee computer in Electronics Today International, October 1984, page 122, this was a major extension based on CHIP-8 for the ETI-660.

The Microbee was a computer supporting a screen resolution of 512 x 256 pixels. In order to utilize this larger resolution, each individual CHIP-8 pixel was drawn as a character using the Microbee's hardware cursor in the PCG (Synartek 6545 Programmable Character Generator), an 8 x 16 bitmap/sprite. This cursor could be custom, and an ASCII character could also be printed that didn't adhere to the actual pixel grid of the game. There was also an instruction for drawing a dithered checkerboard-patterned cursor, called the "half-tone cursor".

In addition, it supported advanced sound generation, and joysticks. It was also specifically made to support CHIP-8 programs written for the different popular interpreters of the day, with an instruction to switch resolutions.

Finally, there was also a CHIP-8/BASIC integration, with a "compiler"/"decompiler", which converted a CHIP-8 binary program to REM comments in a BASIC program. This meant that BASIC programs could have CHIP-8 "subroutines"; the BASIC interpreter could run the CHIP-8 interpreter for embedded code, and the two could exchange data with each other. Therefore, CHIP-8 programs for this interpreter were often given as BASIC code listings.

New instructions

Altered instructions

Compatibility notes

Amiga CHIP-8 interpreter

The CHIP-8 interpreter for the Commodore Amiga was first released in 1990 by Paul Hayter. It was inspired by the DREAM 6800 interpreter, and also included a similar monitor program (called "DREAM Mon") to input and run programs.

This was perhaps the first "emulator"-like interpreter. It ran the CHIP-8 environment in a virtual machine, simulating the memory instead of using actual, mapped memory.

New instructions

Altered instructions

Compatibility notes

CHIP-48

Created by Andreas Gustafsson for the HP48 graphing calculators. Posted on comp.sys.handhelds in September 1990, source code here.

This is mostly a re-implementation of CHIP-8, but contains a crucial difference in the bit shifting instructions' semantics, as well as a bug in FX55/FX65.

New instructions

Altered instructions

Compatibility notes

SUPER-CHIP 1.0

Created by Erik Bryntse in 1991 for the HP 48S and HP 48SX graphing calculators, based on CHIP-48. It was announced on comp.sci.handhelds May 16, 1991 (with an errata). Also known as SCHIP and S-CHIP.

Adds a high-resolution mode of 128 x 64 as well as persistent memory in the HP48's "RPL" memory.

New instructions

Altered instructions

Same as CHIP-48, plus:

Compatibility notes

SUPER-CHIP 1.1

An extension to SUPER-CHIP, which adds scrolling instructions. It was announced by Erik Bryntse on May 24, 1991 on comp.sys.handhelds.

New instructions

Altered instructions

Same as SUPER-CHIP 1.0, but:

Compatibility notes

GCHIP

S-CHIP (SUPER-CHIP) ported to the HP 48G and HP 48GX calculator. It functions like S-CHIP, except that two S-CHIP instructions don't work due to an oversight.

Altered instructions

FX75 and FX85 (save and load RPL user flags) crash the interpreter.

SCHIP Compatibility (SCHPC) and GCHIP Compatibility (GCHPC)

A modified version of SUPER-CHIP 1.1 that attempts to fix all the incompatibilities listed above. Repository here, with detailed research and patches.

New instructions

Same as SCHIP 1.1.

Compatibility notes

Unlike SCHIP 1.1, all instructions behave as they did in CHIP-8.

For GHCPC: FX75 and FX85 now work correctly (like they did in SCHIP, and unlike GCHIP).

VIP2K CHIP-8

A CHIP-8 interpreter for the VIP2K, a 40th anniversary reproduction of the COSMAC VIP computer. Manual for the VIP2K CHIP-8 interpreter.

New instructions

Altered instructions

Compatibility notes

SUPER-CHIP with scroll up

In massung's CHIP-8 emulator, which in fact is a SUPER-CHIP 1.1-compatible interpreter, there is support for the extra instruction 00BN, which scrolls up (as a mirror of the standard SCHIP 00CN instruction for scrolling down).

This instruction, which never existed in SUPER-CHIP, has been tracked to trapexit's CHIP-8 documentation. The author does not remember where it originally came from.

See also XO-CHIP below, which adds this same instruction with the opcode 00DN instead.

New instructions

chip8run

A Linux interpreter by Peter Miller, created as part of the chip8 package. It supports both CHIP-8 and SCHIP games, and includes an instruction to toggle one incompatibility between the versions.

New instructions

Mega-Chip

A superset of SCHIP created by Revival Studios in 2007.

New instructions

Altered instructions

Same as SCHIP except BNNN jumps properly, and:

Compatibility notes

XO-CHIP

An extension for SCHIP created by John Earnest in 2014.

XO-CHIP supports audio and 64 kb of memory, which is usable mainly for graphics and audio (addressable only by I). It also has one extra buffer ("plane") of display memory, which works identical to the regular one. Both planes are displayed "on top" of each other, and they can be drawn in different colors. Pixels that are turned on in both planes can be drawn in another color. Clear, draw and scroll instructions will only affect the currently selected plane(s).

Note that XO-CHIP is mainly supported by John Earnest's own Octo assembler, which supports "macros" for comparison operators (less than (or equal), greater than (or equal)) but which assemble down to regular CHIP-8 bytecode instead of dedicated instructions.

New instructions

Altered instructions

Compatibility notes

Octo

Octo is a CHIP-8 interpreter that supports regular CHIP-8, SUPER-CHIP and XO-CHIP. For the most part it is compatible with those implementations.

New instructions

Altered instructions

Compatibility notes

CHIP-8 Classic / Color

The CHIP-8 Classic and CHIP-8 Color is a microcontroller computer created by StandAloneComputers in 2019. It's inspired by the DREAM 6800 interpreter, and includes a similar monitor program, also called CHIPOS. It also adds an ASCII character set, I/O, and color support. See https://chip-8.com.

New instructions

Altered instructions

Compatibility notes

The hexadecimal keypad uses the prototype DREAM 6800 layout:

C D E F
8 9 A B
4 5 6 7
0 1 2 3