Skip to content

Instantly share code, notes, and snippets.

View tomaes's full-sized avatar
💭
Programming is for AIs. Let's go shopping.

tomaes

💭
Programming is for AIs. Let's go shopping.
View GitHub Profile
@tomaes
tomaes / square_chicken
Created May 11, 2014 18:30
1/2 a frogger (c64); 165 bytes for some stylish, minimal gaming action.
0 s=53248:x=8:pokes+21,1:pokes,x:pokes+1,120:pokes+39,2
5 printspc(int(rnd(1)*5)*6+4)"{yellow}{110}{green}{109}":r=r+1
8 geta$:x=x+(a$="{left}")*8-(a$="{right}")*8:pokes,x:ifx<248and(peek(s+31)andr>20)=.goto5
9 print"score:"x*8-r*2
@tomaes
tomaes / errglich0mat
Created May 7, 2014 20:27
System messages breaking off a wall. Try to press some keys. (c64)
* = $7c
loop ldy $c5 ;interactive \o/
jsr $f12b ;errout, y offset
jsr $e965 ;pinch o' magic scrolling salt
jmp loop ;awaaay...
@tomaes
tomaes / snaaakes
Created May 7, 2014 19:57
long-winded obstacle things coming your way (c64)
* = $7c
loop tax
sta $0774,x
jsr $e965 ;\n
jmp loop
@tomaes
tomaes / raster-fari
Created March 22, 2014 18:11
16 bytes for a fairly nice looking (and flicker free) static raster effect (c64)
* = $7c ; zeropage boot-up (for VICE)
sei ; no interupts, no flickering
sty $d011 ; background frame is now everywhere
cpy $d012 ; wait for next raster line
bne *-3 ;
sty $d020 ; set fullscreen color
iny ; wait 2 lines (looks best)
iny ;
bvc *-10 ; loop quickly
@tomaes
tomaes / hrhr
Created March 19, 2014 16:45
An unlikely, but perfectly valid Commodore Basic program. :) (this works, because any non-literal (or even emptiness) after "go to" = 0 and "go to" is an alternative version of "goto", that no one ever used.)
0 GO TO INFINITY
@tomaes
tomaes / bella maze
Created March 17, 2014 11:31
Nicely colored and evolving maze-like patterns.
0 poke646,2+(peek(143)and3):printchr$(206.5+rnd(1)-(peek(161)/2and31));:run
@tomaes
tomaes / glitchshifer_code_review
Created March 15, 2014 19:15
glitchshifter by 4mat explained
; glitchshifter by 4mat explained
;
* = $7c ; starts in Zeropage. Overwrites some BASIC interpreter parts;
; faux autostart in VICE due to RUN (+return! just that would
; suffice)
SBC $a1 ; Accu minus (slowly updated) system timer byte ($A1)
SEI ; stop interrupts to halt timer temporarily and add some speed-up,
; inner loop starts
ORA $a2 ; bitwise OR'ed Accu with fresh timer data from fast sys timer ($A2)
; (but: the Accu rarely changes in this very fast inner loop)
@tomaes
tomaes / mini maze
Created March 15, 2014 15:39
shortest maze generator on the 64? (and most other Commodore machines)
0 ?spc(rnd(.)+.5)"#";:run
@tomaes
tomaes / text noise
Created March 8, 2014 18:27
19 bytes text noise effect (c64)
;
; fill screen with 'text noise' (19 bytes with SEI)
;
* = $1000
SEI
loop EOR $D012
STA $0400,y
STA $0400+256,y
@tomaes
tomaes / glitch rumba
Last active August 29, 2015 13:57
rhythmic audio / video glitching in 11 bytes (c64)
;
; glitch f-art
;
* = $1000
;
loop EOR $A2
NOP ; makes everything look much saner ;)
; AND $C5 (fake interactivity :P)
STA $D011
STA $D418