2018-12-18 14:12:56 +00:00
|
|
|
%import c64utils
|
|
|
|
%option enable_floats
|
|
|
|
|
|
|
|
~ main {
|
|
|
|
|
|
|
|
const uword width = 40
|
|
|
|
const uword height = 25
|
|
|
|
|
|
|
|
sub start() {
|
|
|
|
|
|
|
|
float t
|
|
|
|
ubyte color
|
|
|
|
|
2018-12-19 01:51:22 +00:00
|
|
|
while true {
|
|
|
|
float x = sin(t)
|
|
|
|
float y = cos(t*1.1356)
|
|
|
|
ubyte xx=screenx(x)
|
|
|
|
ubyte yy=screeny(y)
|
|
|
|
|
2018-12-26 16:43:20 +00:00
|
|
|
;c64.COLOR = color
|
|
|
|
;c64scr.PLOT(xx,yy)
|
|
|
|
;c64.CHROUT('Q') ; shift-q = filled circle
|
|
|
|
c64scr.setchrclr(xx, yy, 81, color)
|
2018-12-19 01:51:22 +00:00
|
|
|
|
|
|
|
t += 0.08
|
2018-12-18 14:12:56 +00:00
|
|
|
color++
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-19 01:51:22 +00:00
|
|
|
sub screenx(float x) -> ubyte {
|
2018-12-24 23:33:04 +00:00
|
|
|
return (x * width/2.2) + width/2.0 as ubyte
|
2018-12-18 14:12:56 +00:00
|
|
|
}
|
2018-12-19 01:51:22 +00:00
|
|
|
sub screeny(float y) -> ubyte {
|
2018-12-24 23:33:04 +00:00
|
|
|
return (y * height/2.2) + height/2.0 as ubyte
|
2018-12-18 14:12:56 +00:00
|
|
|
}
|
|
|
|
}
|