2023-10-04 20:32:13 +00:00
|
|
|
%import monogfx
|
2020-12-27 22:57:13 +00:00
|
|
|
%import floats
|
|
|
|
%import textio
|
2022-10-22 14:35:57 +00:00
|
|
|
%import math
|
2021-04-05 19:45:39 +00:00
|
|
|
%zeropage dontuse
|
2020-12-27 22:57:13 +00:00
|
|
|
|
|
|
|
main {
|
|
|
|
|
|
|
|
sub start () {
|
2023-10-04 20:32:13 +00:00
|
|
|
monogfx.text_charset(3)
|
2020-12-27 22:57:13 +00:00
|
|
|
|
|
|
|
test_monochrome()
|
|
|
|
|
2023-10-04 20:32:13 +00:00
|
|
|
monogfx.textmode()
|
2020-12-27 22:57:13 +00:00
|
|
|
txt.print("done!\n")
|
|
|
|
}
|
|
|
|
|
|
|
|
sub test_monochrome() {
|
2023-10-04 20:32:13 +00:00
|
|
|
monogfx.hires()
|
2020-12-27 22:57:13 +00:00
|
|
|
uword yy
|
|
|
|
uword xx
|
|
|
|
word ww
|
|
|
|
|
|
|
|
yy = 20
|
|
|
|
xx = 20
|
2023-10-04 20:32:13 +00:00
|
|
|
monogfx.stipple(false)
|
2024-02-04 22:18:11 +00:00
|
|
|
monogfx.rect(xx, yy, 250, 80, true)
|
2023-10-04 20:32:13 +00:00
|
|
|
monogfx.stipple(true)
|
2024-02-04 22:18:11 +00:00
|
|
|
monogfx.fillrect(xx+2, yy+2, 250-4, 80-4, true)
|
2023-10-04 20:32:13 +00:00
|
|
|
monogfx.stipple(false)
|
2024-02-04 22:18:11 +00:00
|
|
|
monogfx.fillrect(xx+20, yy+20, 200, 30, true)
|
|
|
|
monogfx.rect(xx+21, yy+21, 200-2, 30-2, false)
|
2020-12-27 22:57:13 +00:00
|
|
|
|
2024-02-04 22:18:11 +00:00
|
|
|
monogfx.text(xx+30, yy+32, false, sc:"High Res Bitmap Example")
|
2020-12-27 22:57:13 +00:00
|
|
|
|
2023-10-04 20:32:13 +00:00
|
|
|
; monogfx.stipple(true)
|
2024-02-04 22:18:11 +00:00
|
|
|
monogfx.horizontal_line(10, 240, 620, true)
|
|
|
|
monogfx.vertical_line(320, 10, 460, true)
|
|
|
|
monogfx.text(320, 242, true, sc:"0,0")
|
|
|
|
monogfx.text(322, 10, true, sc:"Y-axis")
|
|
|
|
monogfx.text(590, 242, true, sc:"X-axis")
|
2020-12-27 22:57:13 +00:00
|
|
|
for ww in -10 to 10 {
|
|
|
|
xx = (ww*30) + 320 as uword
|
2024-02-04 22:18:11 +00:00
|
|
|
monogfx.vertical_line(xx, 239, 3, true)
|
2020-12-27 22:57:13 +00:00
|
|
|
}
|
|
|
|
for ww in -7 to 7 {
|
|
|
|
yy = (ww*30) + 240 as uword
|
2024-02-04 22:18:11 +00:00
|
|
|
monogfx.horizontal_line(319, yy, 3, true)
|
2020-12-27 22:57:13 +00:00
|
|
|
}
|
|
|
|
|
2023-10-04 20:32:13 +00:00
|
|
|
monogfx.stipple(false)
|
2020-12-27 22:57:13 +00:00
|
|
|
float y_f
|
|
|
|
for ww in -600 to 600 {
|
2022-04-21 22:45:54 +00:00
|
|
|
y_f = floats.sin(ww as float / 60.0)*150
|
2024-02-04 22:18:11 +00:00
|
|
|
monogfx.plot(ww/2 + 320 as uword, (y_f + 240) as uword, true)
|
2020-12-27 22:57:13 +00:00
|
|
|
}
|
2024-02-04 22:18:11 +00:00
|
|
|
monogfx.text(480, 100, true, sc:"sin(x)")
|
2020-12-27 22:57:13 +00:00
|
|
|
|
|
|
|
for ww in -300 to 300 {
|
2022-04-21 22:45:54 +00:00
|
|
|
y_f = floats.cos(ww as float/30.0)*60 - (ww as float)/1.7
|
2024-02-04 22:18:11 +00:00
|
|
|
monogfx.plot(ww + 320 as uword, (y_f + 240) as uword, true)
|
2020-12-27 22:57:13 +00:00
|
|
|
}
|
2024-02-04 22:18:11 +00:00
|
|
|
monogfx.text(80, 420, true, sc:"cos(x)+x")
|
2020-12-27 22:57:13 +00:00
|
|
|
|
2021-01-03 01:36:45 +00:00
|
|
|
sys.wait(3*60)
|
2020-12-27 22:57:13 +00:00
|
|
|
|
2024-02-04 22:18:11 +00:00
|
|
|
monogfx.circle(320, 240, 220, true)
|
|
|
|
monogfx.circle(320, 240, 210, true)
|
|
|
|
monogfx.circle(320, 240, 200, true)
|
|
|
|
monogfx.circle(320, 240, 190, true)
|
2023-10-04 20:32:13 +00:00
|
|
|
monogfx.stipple(true)
|
2024-02-04 22:18:11 +00:00
|
|
|
monogfx.disc(320, 240, 140, true)
|
2023-10-04 20:32:13 +00:00
|
|
|
monogfx.stipple(false)
|
2024-02-04 22:18:11 +00:00
|
|
|
monogfx.disc(320, 240, 90, true)
|
|
|
|
monogfx.disc(320, 240, 40, false)
|
2020-12-27 22:57:13 +00:00
|
|
|
|
2021-01-03 01:36:45 +00:00
|
|
|
sys.wait(2*60)
|
2020-12-27 22:57:13 +00:00
|
|
|
|
2020-12-27 23:08:22 +00:00
|
|
|
repeat 255
|
2024-02-04 22:18:11 +00:00
|
|
|
monogfx.line(math.rndw() % 640, math.rndw() % 480, math.rndw() % 640, math.rndw() % 480, true)
|
2020-12-27 22:57:13 +00:00
|
|
|
|
2021-01-03 01:36:45 +00:00
|
|
|
sys.wait(1*60)
|
2020-12-27 22:57:13 +00:00
|
|
|
}
|
|
|
|
}
|