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