mirror of
https://git.sr.ht/~rabbits/uxn
synced 2024-11-08 15:25:05 +00:00
95 lines
2 KiB
Text
95 lines
2 KiB
Text
( draw routines )
|
|
|
|
:dev/r fff8 ( std read port )
|
|
:dev/w fff9 ( std write port )
|
|
|
|
;x_ 2 ;y_ 2 ;x 2 ;y 2 ;w 2 ;h 2 ;color 1
|
|
;x0 2 ;y0 2 ;x1 2 ;y1 2 ;dx 2 ;dy 2 ;err1 2 ;err2 2 ( line )
|
|
|
|
|0100 @RESET
|
|
|
|
( set dev/write to screen )
|
|
#01 =dev/w ( set dev/write to sprite )
|
|
|
|
#01 ,color STR
|
|
( fill rect x y w h )
|
|
#0020 #0020 #0060 #0040 ,fillrect JSR
|
|
|
|
#02 ,color STR
|
|
( fill rect x y w h )
|
|
#0030 #0030 #0040 #0060 ,fillrect JSR
|
|
|
|
#03 ,color STR
|
|
( fill rect x y w h )
|
|
#0040 #0040 #0060 #0040 ,fillrect JSR
|
|
|
|
#01 ,color STR
|
|
( fill rect x y w h )
|
|
#00a0 #0010 #0020 #0020 ,fillrect JSR
|
|
|
|
#02 ,color STR
|
|
( fill rect x y w h )
|
|
#00b0 #0040 #0020 #0020 ,linerect JSR
|
|
|
|
#03 ,color STR
|
|
( fill rect x y w h )
|
|
#0058 #0028 #0050 #0050 ,linerect JSR
|
|
|
|
#01 ,color STR
|
|
( fill rect x y w h )
|
|
#0028 #0038 #0050 #0030 ,linerect JSR
|
|
|
|
,redraw JSR
|
|
|
|
BRK
|
|
|
|
@fillrect
|
|
,h STR2 ,w STR2 ,y STR2 ,x STR2
|
|
,x LDR2 ,x_ STR2 ,y LDR2 ,y_ STR2
|
|
@fillrectrow
|
|
,x LDR2 ,x_ STR2
|
|
@fillrectcol
|
|
( draw ) ,x_ LDR2 ,y_ LDR2 ,putpixel JSR
|
|
,x_ LDR2 #0001 ADD2 ,x_ STR2
|
|
,x_ LDR2 ,w LDR2 ,x LDR2 ADD2 LTH2 ,fillrectcol ROT JMP? POP2
|
|
,y_ LDR2 #0001 ADD2 ,y_ STR2
|
|
,y_ LDR2 ,h LDR2 ,y LDR2 ADD2 LTH2 ,fillrectrow ROT JMP? POP2
|
|
RTS
|
|
|
|
@linerect
|
|
,h STR2 ,w STR2 ,y STR2 ,x STR2
|
|
,x LDR2 ,x_ STR2 ,y LDR2 ,y_ STR2
|
|
@linerectcol
|
|
( draw ) ,x LDR2 ,y_ LDR2 ,putpixel JSR
|
|
( draw ) ,x LDR2 ,w LDR2 ADD2 ,y_ LDR2 ,putpixel JSR
|
|
,y_ LDR2 #0001 ADD2 ,y_ STR2
|
|
,y_ LDR2 ,h LDR2 ,y LDR2 ADD2 LTH2 ,linerectcol ROT JMP? POP2
|
|
@linerectrow
|
|
( draw ) ,x_ LDR2 ,y LDR2 ,putpixel JSR
|
|
( draw ) ,x_ LDR2 ,y LDR2 ,h LDR2 ADD2 ,putpixel JSR
|
|
,x_ LDR2 #0001 ADD2 ,x_ STR2
|
|
,x_ LDR2 ,w LDR2 ,x LDR2 ADD2 #0001 ADD2 LTH2 ,linerectrow ROT JMP? POP2
|
|
RTS
|
|
|
|
@diff16
|
|
OVR2 OVR2 GTH2 ,diff16sub ROT JMP? POP2
|
|
SWP2 @diff16sub SUB2
|
|
RTS
|
|
|
|
@redraw
|
|
#0000 IOW2
|
|
#0000 IOW2
|
|
#00 IOW
|
|
#01 IOW
|
|
RTS
|
|
|
|
@putpixel
|
|
IOW2 ( y short )
|
|
IOW2 ( x short )
|
|
,color LDR IOW ( color byte )
|
|
#00 IOW ( redraw byte )
|
|
RTS
|
|
|
|
|c000 @FRAME BRK
|
|
|d000 @ERROR BRK
|
|
|FFFA .RESET .FRAME .ERROR
|