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 / 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 / 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 / senso.bas
Last active April 4, 2021 12:44
Senso's Telephone for the BBC Micro. BASIC 10 liner contest entry: https://gkanold.wixsite.com/homeputerium/rules2021
0REM "MR.SENSO IS A PECULIAR MAN. HIS PHONE NUMBER IS MADE OF"
1REM "1S AND 0S ONLY. PLEASE MEMORIZE HIS NUMBER. HE WOULD APPRECIATE IT."
2DIMA(19):L=0:E=0:BRK=0:MODE7:PRINTTAB(0,12)"SENSO'S TELEPH0NE":H$=INKEY$(249)
3K=48:REPEAT:L=L+1:A(L)=K+(RND(2)-1):IFL>1THENPRINT" NICE!":H$=INKEY$(89)
4CLS:PRINTTAB(0,12)"LISTEN "CHR$(93);:FORI=1TOL:PRINTCHR$(A(I));:T0M=&2A
5SOUND1,-9,129+(A(I)-K)*K,4:H$=INKEY$(89):NEXT:H$=INKEY$(99):PRINTTAB(0,12);
6PRINTSPC(35)TAB(0,12)"NOW, REPEAT ";CHR$(93);:FORI=1TOL:A$=GET$:PRINTA$;
7IFA$<>CHR$(A(I))THENBRK=1:E=E+1:SOUND1,-9,5,6ELSESOUND1,-9,109+(A(I)-K)*K,4
8NEXT:H$=INKEY$(89):UNTILBRK OR L=19:PRINT:PRINTTAB(0,12)"ROUNDS:";L;"/19 ";
9PRINT"TYPOS:";E;SPC(15):IFL<19THENPRINT"GO AGAIN!"ELSEPRINT"MR.SENSO APPR0VES"
@tomaes
tomaes / m-thh-ste.bas
Last active March 25, 2021 08:21
BBC micro test game; random 2nd grader arithmetic at devilish velocity.
AUTO 10, 10
REM MICRO GAME FOR THE BBC MICRO
MODE 7
PRINT CHR$(141); CHR$(134); "MATH HASTE": REM 2X HEIGHT (top), cyan
PRINT CHR$(141); CHR$(130); "METH HESTE": REM 2X HEIGHT (bottom), green
DIM Q(6): DIM Q$(6): D = 2: R = 0
@tomaes
tomaes / drumbit.json
Last active March 9, 2021 17:56
drumbit.app pattern and beat collection
{"name":"drumbit","metadata":{"author":"tomaes","title":"hectic","remarks":""},"options":{"tempo":160,"swing":0,"kit":"11","effect":{"id":"6","level":0.5},"compressor":{"bypass":1,"threshold":-20,"ratio":4,"attack":0.0010000000474974513,"release":0.25,"knee":5},"lowpass":{"bypass":1,"frequency":800,"q":1},"highpass":{"bypass":1,"frequency":800,"q":1}},"pattern1":{"track1":{"vol":1,"pan":1,"pitch":2,"steps":[0,1,0,0,0,0,1,0,0,1,0,0,0,1,0,0]},"track2":{"vol":0.9,"pan":1,"pitch":2,"steps":[0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0]},"track3":{"vol":0.7,"pan":1,"pitch":0.8,"steps":[0,0,0,1,0,0,0,0,0,0,0,1,1,1,0,0]},"track4":{"vol":1,"pan":1,"pitch":2,"steps":[0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1]},"track5":{"vol":1,"pan":1,"pitch":1.9,"steps":[0,0,0,0,0,1,0,0,0,1,1,1,0,0,0,0]},"track6":{"vol":1,"pan":1,"pitch":1,"steps":[1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0]},"track7":{"vol":1,"pan":1,"pitch":0.7,"steps":[0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,0]},"track8":{"vol":1,"pan":1,"pitch":1.4,"steps":[0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0]}},"pattern2":{"
@tomaes
tomaes / jenbeats.txt
Last active March 6, 2021 10:30
"Spinning Jenny" Jams (c64 drum computer tool tabs)
Kit #1 (standard), tempo E000
F1 C-761-AAC-7-1-A-C-761-AAC-7-1-A-
: : : : : : : :
F3 12118-19-CC-1-B-9---4--21-B2C---
: : : : : : : :
F5 7-CB2-1-7-B-2-1-7-B-2---7-B-2---
: : : : : : : :
F7 1AB21-454-1-5-1-1-5B1-454-1-5B1-
10 REM フワフワ GW-BASIC port /w sound
11 CLS: RANDOMIZE TIMER
12 XM=80: YM=24: X=XM/2: Y=1: OC=239: L=30
14 B=INT(RND*(XM-L*2))+L: SOUND 200,.5
15 UP=0: L=30-S/10: IF L<1 THEN L=1
16 LOCATE YM,B: PRINT CHR$(OC)
17 A$=INKEY$: X=X+(A$="a")-(A$="s")
18 IF SCREEN(Y+1,X)=OC THEN Y=Y+1: SOUND 800,1
19 IF SCREEN(Y,X)=OC THEN GOSUB 40 ELSE Y=Y+1
20 IF X<1 OR X>XM OR Y<1 OR Y>YM THEN 30
@tomaes
tomaes / countrypop.plus4.bas
Last active December 4, 2020 10:26
A population quiz game in moreorless.io style (Commodore Plus/4 version)
0 rem _,/'%%&&&&&&&&&&&&&&&&&%%'\__
1 rem ((_country pop plus/4 version_))
2 rem \_\%%%%%%%%%%%%%%%%%%%%%%%/_/
7 : :
8 : v$ = "v1.2f, May/June 2020" :
9 : :
10 rem init '''''''''''''''''''''';
11 vol 5: n=20
12 dim c$(n),c(n),hi$(6),di(6)
13 dim ac$(n),ao$(n),ap(n),aa(n)
@tomaes
tomaes / whatletteristhateven.bas
Last active June 26, 2020 17:59
Decipher the mangled multicolor mode letters and react quickly. 50+ rounds for the ending. Part memory game, part reaction game in 3 lines of CBM Basic v3.5+ (Commodore 128/+4)
0 graphic3,1:m=999:do:c$=chr$(rnd(1)*26+65):char,rnd(1)*40,rnd(1)*25,c$:s=s+t*r
1 r=r+1:t=400-r*5:do:geta$:t=t-1:s=s+(a$<>c$)*m-(a$="")*m:loopwhilea$<>c$andt>.
2 loopwhilea$=c$:graphic.,1:print"#"r"score:"s"letter:"c$:ifr>49thenprint"wow!"
@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