CHIP-8 "Emulator"/Interpreter for Commander X16

This is a big category, which includes emulators that run on a PC and emulate the CX16, emulators that run on CX16 and simulate other computers, and tools for connecting to other computers. Data conversion tools may also fit here or in development tools, depending on the focus.
Post Reply
Enderfighter06
Posts: 1
Joined: Mon Feb 17, 2025 7:03 pm

CHIP-8 "Emulator"/Interpreter for Commander X16

Post by Enderfighter06 »

This is a "emulator" for the CHIP-8 virtual platform using PETSCII graphics.

Controls: Uses the standardized CHIP-8 controls on a keyboard (seen below, original -> keyboard). Backspace key exits the program, 0 toggles sound, -/= decrease and increase the speed of the game respectively, and enter resets the game.

123C \ 1234
456D ------\ QWER
789E ------/ ASDF
A0BF / ZXCV

How to use: CHIP8.PRG can just be loaded and ran like any other program. However, as there is no real loader yet, games should be loaded in with "BLOAD "YOURGAME.CH8",8,0,$3200".

Note: CHIP-8 has a memory range of 4 kilobytes that are mapped to $3000-$3FFF on the X16. Execution is intended to begin at $200 ($3200 on X16) as the first 512 bytes were originally used for the interpreter on 4K systems. The first 512 bytes of memory are technically available for use (With the first 80 always being overwritten for the standard font in this implementation), but are generally ignored due to this old limitation.

Compatibility/Issues: CHIP-8 does have some ambiguous instructions that can vary depending on the implementation. This implementation has the shift instructions affect use only Vx (rather than putting the shifted version of Vy into Vx), and does not have the load/save instructions affect the I register. I also opted to use the beeper sound from BSOUT for sound effects for the time being, which might cause slow gameplay on games that feature large amounts of sound effects. Games that do not utilize sound or use it occasionally should not be heavily affected.

All testing was done on #R47 and should work on both the emulator and real hardware.
Attachments
CHIP8.png
CHIP8.png (2.4 KiB) Viewed 7188 times
CHIP8X16.zip
(2.08 KiB) Downloaded 160 times
paulscottrobson
Posts: 308
Joined: Tue Sep 22, 2020 6:43 pm

Re: CHIP-8 "Emulator"/Interpreter for Commander X16

Post by paulscottrobson »

The reference version of Chip-8 is the Cosmac VIP version, there's commented source in an issue of VIPER I think.
mortarm
Posts: 342
Joined: Tue May 16, 2023 6:21 pm

Re: CHIP-8 "Emulator"/Interpreter for Commander X16

Post by mortarm »

For those not in the know, what is Chip-8?
kelli217
Posts: 550
Joined: Sun Jul 05, 2020 11:27 pm

Re: CHIP-8 "Emulator"/Interpreter for Commander X16

Post by kelli217 »

It's like Woz's Sweet16, but 8-bit-oriented rather than 16. (Thus CHIP-8.)

https://en.wikipedia.org/wiki/CHIP-8#Vi ... escription
TomXP411
Posts: 1839
Joined: Tue May 19, 2020 8:49 pm

Re: CHIP-8 "Emulator"/Interpreter for Commander X16

Post by TomXP411 »

It's a virtual machine and programming language. Since it was designed in 1977, it's pretty primitive, but that's part of the appeal.

https://en.wikipedia.org/wiki/CHIP-8
https://www.reddit.com/r/EmuDev/comment ... e_want_to/

and an online emulator/IDE: https://johnearnest.github.io/Octo/

There's a specific set of opcodes and a prescribed environment that should make it possible to run any vanilla CHIP-8 program on any system with a CHIP-8 interpreter.
Post Reply