0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-23 06:15:10 +00:00
This commit is contained in:
neauoire 2021-02-11 13:56:27 -08:00
parent 48d4289671
commit f22e6b3837

View file

@ -3,19 +3,13 @@
:dev/r fff8 ( std read port ) :dev/r fff8 ( std read port )
:dev/w fff9 ( std write port ) :dev/w fff9 ( std write port )
;x_ 2 ;y_ 2 ;x_ 2 ;y_ 2 ;x 2 ;y 2 ;w 2 ;h 2 ;color 1
;x 2 ;y 2 ;w 2 ;h 2
;color 1
|0100 @RESET |0100 @RESET
( set dev/write to screen ) ( set dev/write to screen )
,01 ,dev/w STR ,01 ,dev/w STR
( set color 1 )
,03 ,color STR
,01 ,color STR ,01 ,color STR
( fill rect x y w h ) ( fill rect x y w h )
,0020 ,0020 ,0060 ,0040 ,fillrect JSR ,0020 ,0020 ,0060 ,0040 ,fillrect JSR
@ -28,10 +22,28 @@
( fill rect x y w h ) ( fill rect x y w h )
,0040 ,0040 ,0060 ,0040 ,fillrect JSR ,0040 ,0040 ,0060 ,0040 ,fillrect JSR
,01 ,color STR
( fill rect x y w h )
,00a0 ,0010 ,0020 ,0020 ,fillrect JSR
,redraw JSR ,redraw JSR
BRK BRK
@fillrect
,h STR^ ,w STR^ ,y STR^ ,x STR^
,x LDR^ ,x_ STR^ ,y LDR^ ,y_ STR^
@fillrectrow
,x LDR^ ,x_ STR^
@fillrectcol
,x_ LDR^ ,y_ LDR^ ,putpixel JSR
,x_ LDR^ ,0001 ADD^ ,x_ STR^
,x_ LDR^ ,w LDR^ ,x LDR^ ADD^ LTH^ ,fillrectcol ROT JMP? POP^
,y_ LDR^ ,0001 ADD^ ,y_ STR^
,y_ LDR^ ,h LDR^ ,y LDR^ ADD^ LTH^ ,fillrectrow ROT JMP? POP^
RTS
@redraw @redraw
,0000 IOW^ ,0000 IOW^
,0000 IOW^ ,0000 IOW^
@ -46,34 +58,6 @@ BRK
,00 IOW ( redraw byte ) ,00 IOW ( redraw byte )
RTS RTS
@fillrect
( store shape )
,h STR^ ,w STR^ ,y STR^ ,x STR^
( set head )
,x LDR^ ,x_ STR^ ,y LDR^ ,y_ STR^
( paint row )
,fillrectrow JSR
RTS
@fillrectcol
,x_ LDR^ ,y_ LDR^ ,putpixel JSR
( incr x )
,x_ LDR^ ,0001 ADD^ ,x_ STR^
( check if greater than w )
,x_ LDR^ ,w LDR^ ,x LDR^ ADD^ GTH^ RTS?
,fillrectcol JMP
RTS
@fillrectrow
,x LDR^ ,x_ STR^
,fillrectcol JSR
( incr x )
,y_ LDR^ ,0001 ADD^ ,y_ STR^
( check if greater than w )
,y_ LDR^ ,h LDR^ ,y LDR^ ADD^ GTH^ RTS?
,fillrectrow JMP
RTS
|c000 @FRAME BRK |c000 @FRAME BRK
|d000 @ERROR BRK |d000 @ERROR BRK
|FFFA .RESET .FRAME .ERROR |FFFA .RESET .FRAME .ERROR