Skip to content

Instantly share code, notes, and snippets.

💭
debugging 28 year old games. for fun.

tomaes

  • Germany
View GitHub Profile
@tomaes
tomaes / s_atan
Last active Aug 29, 2015
holy colorful patterns, batman. (c64)
View s_atan
0 s=4^5:f=55296:w=40:c=85:h=198:z=z+.05:fory=.to24:forx=.to39
1 v=abs(atn(sin(x*y*z)*.5)*3):pokes+y*w+x,c+v:pokef+y*w+x,4+v:nextx,y
3 print"{home}[key]":pokeh,.:waith,1:goto
@tomaes
tomaes / heart curve (c128)
Created May 30, 2014
Someone was asking for this. ;)
View heart curve (c128)
1 rem c128 heart curve
2 color 4,5: rem bg
4 color 0,1: rem screen
6 color 1,3: rem drawing color
8 graphic 1,1:h=200:hh=100:wh=160:cw=10:ch=6
10 forx=-.99to1step.06
20 q=sqr(1-x*x)
22 y0=sqr(x*x)-q
24 y1=sqr(x*x)+q
44 xa=int((x+1)*wh):ya=h-int((y0+1)*hh)
@tomaes
tomaes / micro note
Last active Aug 29, 2015
mini note file viewer. rev2 with multi-page support. (c64)
View micro note
;
; a minimal noter example with generated audio, BASIC header and multi-page support
;
* = $801
; 0 SYS4096
byte $0B, $08, $00, $00, $9E, '4', '0', '9', '6', $00, $00, $00
* = $1000
@tomaes
tomaes / flower tower
Last active Aug 29, 2015
54 wasteful bytes; looks kinda neat though. interactive. (c64)
View flower tower
;
; wallpaper scroll / flower tower (interactive)
;
* = 4096
lda #6
sta $d020
start ;
; user input to init field color and width
;
@tomaes
tomaes / Plop-8
Last active Aug 29, 2015
Mini step sequencer. 7 volume levels per cell. Press <1> to <8> to program some ploppy beats. 116 bytes. c64 again.
View Plop-8
0 n=54296:geti:s(i)=(s(i)+1)and7:fori=1to8:poke1024+i,s(i):next:p=(p+1)and7
2 poke1065+p,30:fori=.to99:next:poke1065+p,32:poken,s(p+1):poken,.:goto
@tomaes
tomaes / feng shui 64
Last active Aug 29, 2015
61 bytes to visually bubble sort the contents of your screen; yes, this takes a while. ("speed optimised" version (r=.:fori=4^5to2022-r:r=r+1: ...) would take 74 bytes of memory) (c64)
View feng shui 64
0 fori=4^5to2022:a=peek(i):b=peek(i+1):poke-(a>b)+i,a:pokei+1+(a>b),b:next:run
@tomaes
tomaes / brotset
Last active Aug 29, 2015
old'n'dirty PETSCII fractal experiment. ;)
View brotset
12 s = 2^10+40*3: w = 40: h = 20: mi = 10: co = 108: ti$="000000": print"{clear}"
20 fory=-1to1step.1: forx=-3to1step.1
45 xn = 0: yn = 0: i = 0
47 if (xn*xn+yn*yn)<4 then if (i<mi) then t=(xn*xn)-(yn*yn)+x: yn=2*x*y+y: xn=t: i=i+1: goto47
49 px=(x+3.)/4*w: py=(y+1.)/2*h
50 poke s + py*w + px, co+((i+x+y)and127)
58 print"{home}t:"ti$", x:"str$(px)", y:"str$(py)", i:"str$(i)"{space*9}"
60 next x,y:poke198,.:wait198,1
@tomaes
tomaes / pre-alpha-bet
Last active Aug 29, 2015
Random letters. Type in the one that precedes it in the alphabet. Better hurry. Try not to fail like a 5 year old. ;)
View pre-alpha-bet
0 c=int(rnd(1)*25)+66:printchr$(c);:fori=.toc*30:next:geta$:iflen(a$)>.thenif((c-1)=asc(a$))goto
@tomaes
tomaes / square_chicken
Created May 11, 2014
1/2 a frogger (c64); 165 bytes for some stylish, minimal gaming action.
View square_chicken
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
System messages breaking off a wall. Try to press some keys. (c64)
View errglich0mat
* = $7c
loop ldy $c5 ;interactive \o/
jsr $f12b ;errout, y offset
jsr $e965 ;pinch o' magic scrolling salt
jmp loop ;awaaay...
You can’t perform that action at this time.