2020-09-20 21:49:36 +00:00
|
|
|
%import graphics
|
2020-11-22 17:17:43 +00:00
|
|
|
%import test_stack
|
2022-04-12 21:58:19 +00:00
|
|
|
%import math
|
2020-09-20 21:49:36 +00:00
|
|
|
|
2020-09-22 00:12:01 +00:00
|
|
|
; Note: this program is compatible with C64 and CX16.
|
2020-03-28 11:33:16 +00:00
|
|
|
|
|
|
|
main {
|
|
|
|
|
|
|
|
sub start() {
|
|
|
|
graphics.enable_bitmap_mode()
|
2020-11-22 17:17:43 +00:00
|
|
|
|
2020-03-28 11:33:16 +00:00
|
|
|
draw_lines()
|
|
|
|
draw_circles()
|
2020-12-30 22:34:00 +00:00
|
|
|
draw_rects()
|
2020-11-22 17:17:43 +00:00
|
|
|
|
|
|
|
; graphics.disable_bitmap_mode()
|
|
|
|
; test_stack.test()
|
|
|
|
|
2020-07-25 14:25:02 +00:00
|
|
|
repeat {
|
2020-03-28 11:33:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-30 22:34:00 +00:00
|
|
|
sub draw_rects() {
|
|
|
|
graphics.rect(220,10,80,10)
|
|
|
|
graphics.rect(20,180,80,10)
|
|
|
|
graphics.fillrect(220,30,80,10)
|
|
|
|
graphics.fillrect(20,160,80,10)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-03-28 11:33:16 +00:00
|
|
|
sub draw_circles() {
|
|
|
|
ubyte xx
|
|
|
|
for xx in 3 to 7 {
|
|
|
|
graphics.circle(xx*50-100, 10+xx*16, (xx+6)*4)
|
|
|
|
graphics.disc(xx*50-100, 10+xx*16, (xx+6)*2)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sub draw_lines() {
|
|
|
|
ubyte i
|
|
|
|
for i in 0 to 255 step 4 {
|
2022-04-12 21:58:19 +00:00
|
|
|
uword x1 = ((graphics.WIDTH-256)/2 as uword) + math.sin8u(i)
|
|
|
|
uword y1 = (graphics.HEIGHT-128)/2 + math.cos8u(i)/2
|
|
|
|
uword x2 = ((graphics.WIDTH-64)/2 as uword) + math.sin8u(i)/4
|
|
|
|
uword y2 = (graphics.HEIGHT-64)/2 + math.cos8u(i)/4
|
2020-03-28 11:33:16 +00:00
|
|
|
graphics.line(x1, lsb(y1), x2, lsb(y2))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|