2021-02-20 20:14:36 -05:00
|
|
|
( draw routines )
|
|
|
|
|
2021-02-26 17:36:48 -05:00
|
|
|
&Screen { y 2 x 2 color 1 }
|
2021-02-20 20:14:36 -05:00
|
|
|
|
2021-02-21 16:23:36 -05:00
|
|
|
;color 1 ;x1 2 ;x2 2 ;y1 2 ;y2 2
|
2021-02-20 20:14:36 -05:00
|
|
|
|
|
|
|
|0100 @RESET
|
|
|
|
|
2021-02-21 16:23:36 -05:00
|
|
|
#01 =color
|
2021-02-21 19:52:51 -05:00
|
|
|
#0010 #0020 #0040 #0060 ,fill-rect JSR
|
2021-02-21 16:23:36 -05:00
|
|
|
#02 =color
|
2021-02-21 19:52:51 -05:00
|
|
|
#0020 #0030 #0050 #0070 ,fill-rect JSR
|
2021-02-21 16:23:36 -05:00
|
|
|
#03 =color
|
2021-02-21 19:52:51 -05:00
|
|
|
#0030 #0040 #0060 #0080 ,fill-rect JSR
|
2021-02-21 16:23:36 -05:00
|
|
|
|
|
|
|
#01 =color
|
2021-02-21 19:52:51 -05:00
|
|
|
#0070 #0020 #00a0 #0060 ,line-rect JSR
|
2021-02-21 16:23:36 -05:00
|
|
|
#02 =color
|
2021-02-21 19:52:51 -05:00
|
|
|
#0080 #0030 #00b0 #0070 ,line-rect JSR
|
2021-02-21 16:23:36 -05:00
|
|
|
#03 =color
|
2021-02-21 19:52:51 -05:00
|
|
|
#0090 #0040 #00c0 #0080 ,line-rect JSR
|
2021-02-21 16:23:36 -05:00
|
|
|
|
2021-02-20 20:14:36 -05:00
|
|
|
BRK
|
|
|
|
|
2021-02-21 16:23:36 -05:00
|
|
|
@line-rect ( x1 y1 x2 y2 )
|
|
|
|
=y2 =x2 ( stash x1 y1 ) DUP2 WSR2 =y1 DUP2 WSR2 =x1
|
|
|
|
@line-rect-hor
|
2021-02-26 17:36:48 -05:00
|
|
|
( draw ) ~x1 ~y1 =dev/screen.y =dev/screen.x ~color =dev/screen.color
|
|
|
|
( draw ) ~x1 ~y2 =dev/screen.y =dev/screen.x ~color =dev/screen.color
|
2021-02-21 16:23:36 -05:00
|
|
|
( incr ) ~x1 #0001 ADD2 DUP2 =x1
|
|
|
|
~x2 #0001 ADD2 LTH2 ,line-rect-hor ROT JMP? POP2
|
|
|
|
( restore x1 y1 ) RSW2 =x1 RSW2 =y1
|
|
|
|
@line-rect-ver
|
|
|
|
( incr ) ~y1 #0001 ADD2 DUP2 =y1
|
2021-02-26 17:36:48 -05:00
|
|
|
( draw ) ~x1 ~y1 =dev/screen.y =dev/screen.x ~color =dev/screen.color
|
|
|
|
( draw ) ~x2 ~y1 =dev/screen.y =dev/screen.x ~color =dev/screen.color
|
2021-02-21 16:23:36 -05:00
|
|
|
~y2 #0001 SUB2 LTH2 ,line-rect-ver ROT JMP? POP2
|
|
|
|
RTS
|
|
|
|
|
|
|
|
@fill-rect ( x1 y1 x2 y2 )
|
|
|
|
=y2 =x2 ( stash x1 y1 ) =y1 DUP2 WSR2 =x1
|
|
|
|
@fill-rect-ver
|
|
|
|
RSW2 DUP2 =x1 WSR2
|
|
|
|
@fill-rect-hor
|
2021-02-26 17:36:48 -05:00
|
|
|
( draw ) ~x1 ~y1 =dev/screen.y =dev/screen.x ~color =dev/screen.color
|
2021-02-21 16:23:36 -05:00
|
|
|
( incr ) ~x1 #0001 ADD2 DUP2 =x1
|
|
|
|
~x2 LTH2 ,fill-rect-hor ROT JMP? POP2
|
|
|
|
~y1 #0001 ADD2 DUP2 =y1
|
|
|
|
~y2 LTH2 ,fill-rect-ver ROT JMP? POP2
|
|
|
|
RSW2 POP2
|
|
|
|
RTS
|
2021-02-20 20:14:36 -05:00
|
|
|
|
|
|
|
|c000 @FRAME BRK
|
|
|
|
|d000 @ERROR BRK
|
2021-02-26 17:36:48 -05:00
|
|
|
|
|
|
|
|FF08 ;dev/screen Screen
|
|
|
|
|
2021-02-21 19:52:51 -05:00
|
|
|
|FFF0 [ 0f0f 0fff 0ff0 ] ( palette )
|
2021-02-20 20:14:36 -05:00
|
|
|
|FFFA .RESET .FRAME .ERROR ( vectors )
|