2020-12-25 16:00:11 +00:00
|
|
|
%import gfx2
|
|
|
|
%import textio
|
2022-04-12 21:58:19 +00:00
|
|
|
%import math
|
|
|
|
|
2022-11-20 18:19:01 +00:00
|
|
|
%option no_sysinit
|
|
|
|
%zeropage basicsafe
|
|
|
|
|
2020-12-25 16:00:11 +00:00
|
|
|
|
|
|
|
main {
|
|
|
|
|
2020-12-28 21:15:16 +00:00
|
|
|
sub start() {
|
2021-01-26 17:17:20 +00:00
|
|
|
gfx2.screen_mode(5)
|
2020-12-28 21:15:16 +00:00
|
|
|
|
2022-11-20 18:19:01 +00:00
|
|
|
demo1()
|
|
|
|
sys.wait(2*60)
|
2021-01-26 17:17:20 +00:00
|
|
|
demo2()
|
|
|
|
|
|
|
|
gfx2.screen_mode(0)
|
|
|
|
txt.print("done!\n")
|
|
|
|
}
|
|
|
|
|
|
|
|
sub demo1() {
|
2020-12-28 21:15:16 +00:00
|
|
|
uword yy = 10
|
2020-12-29 21:53:53 +00:00
|
|
|
uword xx
|
2020-12-28 21:15:16 +00:00
|
|
|
uword cnt
|
|
|
|
|
2020-12-29 01:13:38 +00:00
|
|
|
gfx2.monochrome_stipple(true)
|
|
|
|
gfx2.disc(320,240,200,1)
|
2020-12-29 00:36:08 +00:00
|
|
|
for xx in 0 to 639 {
|
|
|
|
gfx2.vertical_line(xx, 0, 480, 1)
|
2020-12-28 21:15:16 +00:00
|
|
|
}
|
2020-12-29 01:13:38 +00:00
|
|
|
for xx in 0 to 639 {
|
|
|
|
gfx2.vertical_line(xx, 0, 480, 0)
|
|
|
|
}
|
2020-12-28 21:15:16 +00:00
|
|
|
|
2020-12-29 21:53:53 +00:00
|
|
|
xx=gfx2.width/2
|
|
|
|
yy=10
|
2020-12-28 21:15:16 +00:00
|
|
|
gfx2.monochrome_stipple(false)
|
|
|
|
linesy()
|
|
|
|
linesx()
|
|
|
|
gfx2.monochrome_stipple(true)
|
|
|
|
linesy()
|
|
|
|
linesx()
|
|
|
|
|
2020-12-29 21:53:53 +00:00
|
|
|
|
|
|
|
|
2020-12-28 21:15:16 +00:00
|
|
|
sub linesx() {
|
|
|
|
repeat 8 {
|
|
|
|
gfx2.horizontal_line(10,yy,300,3)
|
|
|
|
yy++
|
|
|
|
}
|
|
|
|
yy+=4
|
|
|
|
|
|
|
|
repeat 8 {
|
|
|
|
gfx2.line(10,yy,309,yy,4)
|
|
|
|
yy++
|
|
|
|
}
|
|
|
|
yy+=4
|
|
|
|
|
|
|
|
repeat 8 {
|
|
|
|
for cnt in 10 to 309 {
|
|
|
|
gfx2.plot(cnt, yy, 1)
|
|
|
|
}
|
|
|
|
yy+=1
|
|
|
|
}
|
|
|
|
yy += 4
|
|
|
|
|
|
|
|
repeat 8 {
|
|
|
|
gfx2.horizontal_line(10,yy,100,3)
|
|
|
|
yy++
|
|
|
|
}
|
|
|
|
yy+=4
|
|
|
|
|
|
|
|
repeat 8 {
|
|
|
|
gfx2.line(10,yy,109,yy,4)
|
|
|
|
yy++
|
|
|
|
}
|
|
|
|
yy+=4
|
|
|
|
|
|
|
|
repeat 8 {
|
|
|
|
for cnt in 10 to 109 {
|
|
|
|
gfx2.plot(cnt, yy, 1)
|
|
|
|
}
|
|
|
|
yy++
|
|
|
|
}
|
|
|
|
yy+=4
|
|
|
|
}
|
|
|
|
|
|
|
|
sub linesy() {
|
|
|
|
repeat 8 {
|
|
|
|
gfx2.vertical_line(xx,10,300,3)
|
|
|
|
xx++
|
|
|
|
}
|
|
|
|
xx+=4
|
|
|
|
|
|
|
|
repeat 8 {
|
|
|
|
gfx2.line(xx,10, xx, 309, 4)
|
|
|
|
xx++
|
|
|
|
}
|
|
|
|
xx+=4
|
|
|
|
|
|
|
|
repeat 8 {
|
|
|
|
for cnt in 10 to 309 {
|
|
|
|
gfx2.plot(xx, cnt, 1)
|
|
|
|
}
|
|
|
|
xx+=1
|
|
|
|
}
|
|
|
|
xx += 4
|
|
|
|
|
|
|
|
repeat 8 {
|
|
|
|
gfx2.vertical_line(xx,10,100,3)
|
|
|
|
xx++
|
|
|
|
}
|
|
|
|
xx+=4
|
|
|
|
|
|
|
|
repeat 8 {
|
|
|
|
gfx2.line(xx,10,xx,109,4)
|
|
|
|
xx++
|
|
|
|
}
|
|
|
|
xx+=4
|
|
|
|
|
|
|
|
repeat 8 {
|
|
|
|
for cnt in 10 to 109 {
|
|
|
|
gfx2.plot(xx, cnt, 1)
|
|
|
|
}
|
|
|
|
xx++
|
|
|
|
}
|
|
|
|
xx+=4
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-31 21:13:24 +00:00
|
|
|
sub demo2 () {
|
2020-12-26 02:10:53 +00:00
|
|
|
gfx2.text_charset(3)
|
|
|
|
|
2021-01-26 17:17:20 +00:00
|
|
|
ubyte[] modes = [4, 1, 5]
|
2020-12-25 16:00:11 +00:00
|
|
|
ubyte mode
|
|
|
|
for mode in modes {
|
2020-12-26 00:25:52 +00:00
|
|
|
gfx2.screen_mode(mode)
|
2020-12-25 16:00:11 +00:00
|
|
|
draw()
|
2021-01-03 01:36:45 +00:00
|
|
|
sys.wait(200)
|
2020-12-25 16:00:11 +00:00
|
|
|
}
|
2020-12-27 14:14:44 +00:00
|
|
|
|
2020-12-25 16:00:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sub draw() {
|
2020-12-27 16:34:25 +00:00
|
|
|
|
2020-12-28 00:15:21 +00:00
|
|
|
gfx2.rect(10,10, 1, 1, 4)
|
|
|
|
gfx2.rect(20,10, 2, 1, 4)
|
|
|
|
gfx2.rect(30,10, 3, 1, 4)
|
|
|
|
gfx2.rect(40,10, 1, 2, 4)
|
|
|
|
gfx2.rect(50,10, 1, 3, 4)
|
|
|
|
gfx2.rect(60,10, 2, 2, 4)
|
|
|
|
gfx2.rect(70,10, 3, 3, 4)
|
|
|
|
gfx2.rect(80,10, 4, 4, 4)
|
|
|
|
gfx2.rect(90,10, 5, 5, 4)
|
|
|
|
gfx2.rect(100,10, 8, 8, 4)
|
|
|
|
gfx2.rect(110,10, 20, 5, 4)
|
|
|
|
gfx2.rect(80, 80, 200, 140, 4)
|
2020-12-27 16:34:25 +00:00
|
|
|
|
|
|
|
gfx2.fillrect(10,40, 1, 1, 5)
|
|
|
|
gfx2.fillrect(20,40, 2, 1, 5)
|
|
|
|
gfx2.fillrect(30,40, 3, 1, 5)
|
|
|
|
gfx2.fillrect(40,40, 1, 2, 5)
|
|
|
|
gfx2.fillrect(50,40, 1, 3, 5)
|
|
|
|
gfx2.fillrect(60,40, 2, 2, 5)
|
|
|
|
gfx2.fillrect(70,40, 3, 3, 5)
|
|
|
|
gfx2.fillrect(80,40, 4, 4, 5)
|
|
|
|
gfx2.fillrect(90,40, 5, 5, 5)
|
|
|
|
gfx2.fillrect(100,40, 8, 8, 5)
|
|
|
|
gfx2.fillrect(110,40, 20, 5, 5)
|
|
|
|
gfx2.fillrect(82, 82, 200-4, 140-4, 5)
|
|
|
|
|
|
|
|
ubyte i
|
2020-12-28 00:15:21 +00:00
|
|
|
for i in 0 to 254 step 4 {
|
2022-04-12 21:58:19 +00:00
|
|
|
uword x1 = ((gfx2.width-256)/2 as uword) + math.sin8u(i)
|
|
|
|
uword y1 = (gfx2.height-128)/2 + math.cos8u(i)/2
|
|
|
|
uword x2 = ((gfx2.width-64)/2 as uword) + math.sin8u(i)/4
|
|
|
|
uword y2 = (gfx2.height-64)/2 + math.cos8u(i)/4
|
2020-12-28 00:15:21 +00:00
|
|
|
gfx2.line(x1, y1, x2, y2, i+1)
|
2020-12-27 16:34:25 +00:00
|
|
|
}
|
|
|
|
|
2021-01-03 01:36:45 +00:00
|
|
|
sys.wait(60)
|
2020-12-27 16:34:25 +00:00
|
|
|
gfx2.clear_screen()
|
|
|
|
|
2020-12-27 14:14:44 +00:00
|
|
|
ubyte radius
|
|
|
|
|
|
|
|
for radius in 110 downto 8 step -4 {
|
|
|
|
gfx2.circle(gfx2.width/2, (gfx2.height/2 as ubyte), radius, radius)
|
2020-12-25 16:00:11 +00:00
|
|
|
}
|
2020-12-27 14:14:44 +00:00
|
|
|
|
2020-12-28 00:15:21 +00:00
|
|
|
gfx2.disc(gfx2.width/2, gfx2.height/2, 80, 2)
|
2020-12-27 14:14:44 +00:00
|
|
|
|
2020-12-27 16:34:25 +00:00
|
|
|
ubyte tp
|
|
|
|
for tp in 0 to 15 {
|
2022-11-12 20:27:50 +00:00
|
|
|
gfx2.text(19+tp,20+tp*11, 7, sc:"ScreenCODE text! 1234![]<>#$%&*()")
|
2020-12-27 16:34:25 +00:00
|
|
|
}
|
2020-12-27 14:14:44 +00:00
|
|
|
|
2020-12-27 16:34:25 +00:00
|
|
|
}
|
2020-12-27 14:14:44 +00:00
|
|
|
}
|