2024-09-11 01:15:38 +00:00
|
|
|
%import textio
|
2024-09-14 12:27:45 +00:00
|
|
|
%import gfx_lores
|
|
|
|
%import emudbg
|
2024-07-15 22:25:29 +00:00
|
|
|
%zeropage basicsafe
|
2024-09-06 15:00:24 +00:00
|
|
|
%option no_sysinit
|
2023-12-31 00:02:33 +00:00
|
|
|
|
2024-01-07 17:48:18 +00:00
|
|
|
main {
|
2024-09-14 12:27:45 +00:00
|
|
|
const uword WIDTH = 320
|
|
|
|
const ubyte HEIGHT = 240
|
|
|
|
|
2024-08-24 12:34:23 +00:00
|
|
|
sub start() {
|
2024-09-14 12:27:45 +00:00
|
|
|
uword clo, chi
|
|
|
|
|
|
|
|
void cx16.set_screen_mode(128)
|
|
|
|
|
|
|
|
word x1, y1, x2, y2
|
|
|
|
ubyte i
|
|
|
|
ubyte color = 2
|
2024-09-11 01:15:38 +00:00
|
|
|
|
2024-09-14 12:27:45 +00:00
|
|
|
sys.set_irqd()
|
|
|
|
emudbg.reset_cpu_cycles()
|
|
|
|
for i in 0 to 254 step 4 {
|
|
|
|
x1 = ((WIDTH-256)/2 as word) + math.sin8u(i) as word
|
|
|
|
y1 = (HEIGHT-128)/2 + math.cos8u(i)/2
|
|
|
|
x2 = ((WIDTH-64)/2 as word) + math.sin8u(i)/4 as word
|
|
|
|
y2 = (HEIGHT-64)/2 + math.cos8u(i)/4
|
|
|
|
cx16.GRAPH_set_colors(color, 0, 1)
|
|
|
|
cx16.GRAPH_draw_line(x1 as uword, y1 as uword, x2 as uword, y2 as uword)
|
|
|
|
}
|
|
|
|
clo, chi = emudbg.cpu_cycles()
|
|
|
|
sys.clear_irqd()
|
2024-09-11 01:15:38 +00:00
|
|
|
|
2024-09-14 12:27:45 +00:00
|
|
|
txt.print_uwhex(chi, true)
|
|
|
|
txt.print_uwhex(clo, false)
|
|
|
|
txt.nl()
|
2024-09-11 01:15:38 +00:00
|
|
|
|
2024-09-14 12:27:45 +00:00
|
|
|
sys.wait(50)
|
|
|
|
cx16.GRAPH_clear()
|
|
|
|
sys.wait(50)
|
2024-09-10 18:35:43 +00:00
|
|
|
|
2024-09-14 12:27:45 +00:00
|
|
|
sys.set_irqd()
|
|
|
|
emudbg.reset_cpu_cycles()
|
|
|
|
color = 5
|
|
|
|
for i in 0 to 254 step 4 {
|
|
|
|
x1 = ((WIDTH-256)/2 as word) + math.sin8u(i) as word
|
|
|
|
y1 = (HEIGHT-128)/2 + math.cos8u(i)/2
|
|
|
|
x2 = ((WIDTH-64)/2 as word) + math.sin8u(i)/4 as word
|
|
|
|
y2 = (HEIGHT-64)/2 + math.cos8u(i)/4
|
|
|
|
gfx_lores.line(x1 as uword, y1 as ubyte, x2 as uword, y2 as ubyte, color)
|
|
|
|
}
|
|
|
|
clo, chi = emudbg.cpu_cycles()
|
|
|
|
sys.clear_irqd()
|
|
|
|
|
|
|
|
txt.print_uwhex(chi, true)
|
|
|
|
txt.print_uwhex(clo, false)
|
|
|
|
txt.nl()
|
2024-09-10 18:35:43 +00:00
|
|
|
|
2024-09-12 22:02:26 +00:00
|
|
|
|
2024-07-21 11:35:28 +00:00
|
|
|
}
|
|
|
|
}
|
2024-09-14 12:27:45 +00:00
|
|
|
|