2018-10-21 21:03:15 +00:00
|
|
|
%import c64utils
|
2018-09-30 23:01:39 +00:00
|
|
|
%option enable_floats
|
|
|
|
|
|
|
|
~ main {
|
|
|
|
|
2018-10-10 07:21:20 +00:00
|
|
|
const uword width = 320
|
|
|
|
const uword height = 200
|
2018-10-02 20:52:05 +00:00
|
|
|
|
2018-09-30 23:01:39 +00:00
|
|
|
sub start() {
|
|
|
|
|
2018-10-20 21:45:03 +00:00
|
|
|
vm_gfx_clearscr(0)
|
2018-09-30 23:01:39 +00:00
|
|
|
|
|
|
|
float t
|
2018-10-10 07:21:20 +00:00
|
|
|
ubyte color
|
2018-09-30 23:01:39 +00:00
|
|
|
|
|
|
|
while(1) {
|
2018-10-06 15:21:34 +00:00
|
|
|
float x = sin(t*1.01) + cos(t*1.1234)
|
|
|
|
float y = cos(t) + sin(t*0.03456)
|
2018-10-20 21:45:03 +00:00
|
|
|
vm_gfx_pixel(screenx(x), screeny(y), color//16)
|
2018-09-30 23:01:39 +00:00
|
|
|
t += 0.01
|
|
|
|
color++
|
|
|
|
}
|
|
|
|
}
|
2018-10-02 20:52:05 +00:00
|
|
|
|
2018-10-12 12:01:29 +00:00
|
|
|
sub screenx(x: float) -> word {
|
2018-10-05 22:10:30 +00:00
|
|
|
return floor(x * flt(width)/4.1) + width // 2
|
2018-10-02 20:52:05 +00:00
|
|
|
}
|
2018-10-12 12:01:29 +00:00
|
|
|
sub screeny(y: float) -> word {
|
2018-10-05 22:10:30 +00:00
|
|
|
return floor(y * flt(height)/4.1) + height // 2
|
2018-10-02 20:52:05 +00:00
|
|
|
}
|
2018-09-30 23:01:39 +00:00
|
|
|
}
|