mirror of https://git.sr.ht/~rabbits/uxn
(life.tal)Faster drawing routine
This commit is contained in:
parent
a5e25d905a
commit
28da4f5dfc
|
@ -104,12 +104,12 @@
|
||||||
JMP2r
|
JMP2r
|
||||||
|
|
||||||
@get-index ( x y -- index* )
|
@get-index ( x y -- index* )
|
||||||
( y ) #3f AND #00 SWP #60 SFT2
|
( y ) #3f AND #00 SWP #60 SFT2 ROT
|
||||||
( x ) ROT #3f AND #00 SWP ADD2 ;bank1 ADD2 JMP2r
|
( x ) #3f AND #00 SWP ADD2 ;bank1 ADD2 JMP2r
|
||||||
|
|
||||||
@<set-cell> ( x y -- )
|
@<set-cell> ( x y -- )
|
||||||
STH2
|
get-index STH2
|
||||||
#01 STH2r get-index STA
|
#01 STH2r STA
|
||||||
JMP2r
|
JMP2r
|
||||||
|
|
||||||
@get-neighbours ( x y -- neighbours )
|
@get-neighbours ( x y -- neighbours )
|
||||||
|
@ -139,24 +139,23 @@
|
||||||
@|drawing )
|
@|drawing )
|
||||||
|
|
||||||
@<redraw> ( -- )
|
@<redraw> ( -- )
|
||||||
|
( | draw count )
|
||||||
.anchor/x LDZ2 .Screen/x DEO2
|
.anchor/x LDZ2 .Screen/x DEO2
|
||||||
.anchor/y2 LDZ2 #0008 ADD2 .Screen/y DEO2
|
.anchor/y2 LDZ2 #0008 ADD2 .Screen/y DEO2
|
||||||
[ LIT2 01 -Screen/auto ] DEO
|
[ LIT2 01 -Screen/auto ] DEO
|
||||||
.world/count LDZ2 <draw-short>
|
.world/count LDZ2 <draw-short>
|
||||||
( | draw grid )
|
( | draw grid )
|
||||||
[ LIT2 01 -Screen/auto ] DEO
|
[ LIT2 01 -Screen/auto ] DEO
|
||||||
#4000
|
.anchor/y LDZ2 .Screen/y DEO2
|
||||||
&ver ( -- )
|
;bank2 ;bank1
|
||||||
#00 OVRk ADD2 .anchor/y LDZ2 ADD2 .Screen/y DEO2
|
&l ( -- )
|
||||||
.anchor/x LDZ2 .Screen/x DEO2
|
DUP #3f AND ?{
|
||||||
DUP ,&y STR
|
.Screen/y DEI2k INC2 INC2 ROT DEO2
|
||||||
#4000
|
.anchor/x LDZ2 .Screen/x DEO2 }
|
||||||
&hor ( -- )
|
LDAk INC .Screen/pixel DEO
|
||||||
DUP [ LIT &y $1 ] get-index LDA INC .Screen/pixel DEO
|
|
||||||
[ LIT2 00 -Screen/pixel ] DEO
|
[ LIT2 00 -Screen/pixel ] DEO
|
||||||
INC GTHk ?&hor
|
INC2 GTH2k ?&l
|
||||||
POP2 INC GTHk ?&ver
|
POP2 POP2 JMP2r
|
||||||
POP2 JMP2r
|
|
||||||
|
|
||||||
@<draw-short> ( short* -- )
|
@<draw-short> ( short* -- )
|
||||||
SWP <draw-byte>
|
SWP <draw-byte>
|
||||||
|
@ -212,7 +211,7 @@
|
||||||
(
|
(
|
||||||
@|memory )
|
@|memory )
|
||||||
|
|
||||||
@bank1 $1000
|
|8000 @bank1 $1000
|
||||||
|
|
||||||
@bank2 $1000
|
@bank2 $1000
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue