1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2024-06-01 19:41:36 +00:00
PLASMA/src/samplesrc/rod.pla
2014-06-12 15:23:52 -07:00

89 lines
1.9 KiB
Plaintext

import STDLIB
predef call, puts
end
;
; Handy constants.
;
const FALSE=$0000
const TRUE=!FALSE
;
; CALL return register structure.
;
const acc = 0
const xreg = 1
const yreg = 2
const preg = 3
;
; Hardware constants.
;
const speaker = $C030
const showgraphics = $C050
const showtext = $C051
const showfull = $C052
const showmix = $C053
const showpage1 = $C054
const showpage2 = $C055
const showlores = $C056
const showhires = $C057
const keyboard = $C000
const keystrobe = $C010
const hgr1 = $2000
const hgr2 = $4000
const page1 = 0
const page2 = 1
;
; ROM routinse.
;
const grplot = $F800
const initmode = $FB2F
const textmode = $FB39
const grmode = $FB40
const vtab = $FB5B
const grcolor = $F864
const home = $FC58
;
; String data.
;
byte exitmsg[] = "Press any key to exit.\n"
byte goodbye[] = "That's all, folks!\n"
;
; Rod's Colors
;
def rod
byte i, j, k, w, fmi, fmk, color
while TRUE
for w = 3 to 50
for i = 1 to 19
for j = 0 to 19
k = i + j
color = (j * 3) / (i + 3) + i * w / 12
fmi = 40 - i
fmk = 40 - k
call(grcolor, color, 0, 0, 0) ;grcolor(color);
call(grplot, k, 0, i, 0) ;grplot(i, k);
call(grplot, i, 0, k, 0) ;grplot(k, i);
call(grplot, fmk, 0, fmi, 0) ;grplot(fmi, fmk);
call(grplot, fmi, 0, fmk, 0) ;grplot(fmk, fmi);
call(grplot, fmi, 0, k, 0) ;grplot(k, fmi);
call(grplot, k, 0, fmi, 0) ;grplot(fmi, k);
call(grplot, fmk, 0, i, 0) ;grplot(i, fmk);
call(grplot, i, 0, fmk, 0) ;grplot(fmk, i);
if ^keyboard >= 128
return ^keystrobe
fin
next
next
next
loop
end
call(initmode, 0, 0, 0, 0) ;initmode()
call(grmode, 0, 0, 0, 0) ;grmode()
^$24 = 10 ;gotoxy(10,22)
call(vtab, 22, 0, 0, 0)
puts(@exitmsg)
rod
call(textmode, 0, 0, 0, 0) ;textmode()
call(home, 0, 0, 0, 0) ;home()
puts(@goodbye)
done