Skip to content

Instantly share code, notes, and snippets.

Tobias V. Langhoff tobiasvl

Block or report user

Report or block tobiasvl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View CHIP-8 extensions.md

CHIP-8 extensions and compatibility

This document is intended as a fairly exchaustive documentation of all extensions to CHIP-8. They all use the standard CHIP-8 interpreter as a base (including undocumented instructions, but not undocumented machine code routines), mentioning what additions and changes they make to that base.

This is mostly for historic purposes; few of the extensions listed here had a considerable number of programs written for them. Personally, my plan is to write an emulator that supports all of them. Perhaps the instructions listed here can inspire someone to make their own modern CHIP-8 extension as well (of which there have been a couple, see the bottom of the list).

It should also serve as a reference for the various incompatible instructions and behaviors that have cropped up in different interpreters over the decades.

The list builds on these documents:

View lights-out.8o
:alias steps vd
: main
# set up title screen
clear
v0 := 50
# you probably want to remove the following line if you're running on something that beeps
buzzer := v0
i := logo
va := 17
View picopuzzleleague.p8
poke(24364,3)w={10,11,8,2,12}o="★●♥◆✽"b={[0]=0,0,0,0,0,0}z=56h=6::_::add(b,ceil(rnd(5)))cls()j=6*(8-flr(z/8))-6
?"██",8*(h%6),z+8*flr(h/6),5
?t(),49,58
for q=0,j+6 do
u=abs(b[q])for i in all{1,6}do
if(q<j and(i>1or q%6>1)and u==abs(b[q-i])and u==abs(b[q-i*2])and u!=0)b[q-i]=-u b[q-i*2]=-u b[q]=-u
end
?sub(o,u,u),(q%6)*8,z+flr(q/6)*8,q<j and w[u]or 1
end
for q=0,j do
View PICO-8-devkit-keyboard.kbd.json
[
{
"backcolor": "#C2C3C7",
"name": "PICO-8 devkit keyboard",
"author": "tobiasvl",
"switchMount": "cherry",
"switchBrand": "cherry",
"switchType": "MX1A-G1xx"
},
[
View neighboring_tiles.lua
-- four directions, 16 tokens
for i=0,1,0.25 do
local x,y=cos(i),sin(i)
end
-- eight directions, 24 tokens
for i=0.125,1,0.125 do
local x,y=flr(cos(i)+.5),flr(sin(i)+.5)
end
View lights-out.p8
z="lights out"poke(24364,3)::x::flip()cls()k=btnp()w={[0]="","",""}f=flr
?z,12,18,stat(95)%4
?"z: classic\nx: 2000",12,32,7
if(k<9)goto x
if(k>16)w[3]=""
b={}p=2m=0
for i=1,35 do
b[i]=i%7<2 and 0or 2
end::_::flip()cls()
?m,30,54
@tobiasvl
tobiasvl / fried_eggs.p8
Last active Nov 15, 2018 — forked from nucleartide/fried_eggs.p8
You thought you liked breakfast...
View fried_eggs.p8
u=64
x,y=u,u
es={}c=circfill
f=abs
p=cos
o=sin::_::
if(btn(0))x-=1
if(btn(1))x+=1
if(btn(2))y-=1
if(btn(3))y+=1
@tobiasvl
tobiasvl / picochallenge.p8
Last active Nov 15, 2018
Patrick's Picochallenge
View picochallenge.p8
poke(24364,3)x=""v=""h=""b={}for i=1,36 do b[i]=i%9<2 and""or""end for i in all{"⬆️","➡️",h,"⬅️","⬇️",v,x}do repeat f=1+flr(rnd(36))until b[f]!=""b[f]=i
if(i==x)p=f
end::_::t=btnp cls()for i=0,35 do
k=b[i+1]
?k,i%9*8,6*flr(i/9)+20,k==x and 11 or 7
end b[p]=""q=p
if(t(0))q-=1
if(t(1))q+=1
if(t(2))q-=9
if(t(3))q+=9
View get_map_position.asm
get_map_position:
; from a sprite's pixel position, get the BG map address.
; d: Y pixel position
; e: X pixel position
; hl: returned map address
ld h, HIGH(_SCRN0) >> 2
; Y
ld a, [rSCY] ; account for scroll
sub a, 16 ; account for base sprite offset
You can’t perform that action at this time.