started sprite output debugging
This commit is contained in:
@@ -56,9 +56,11 @@
|
|||||||
( decrement )
|
( decrement )
|
||||||
%DEC { #01 SUB }
|
%DEC { #01 SUB }
|
||||||
|
|
||||||
( get the bit of a specific number )
|
( get the bit or the nibble of a specific number )
|
||||||
( val bitnum -- bit )
|
( val bitnum -- bit )
|
||||||
%GETBIT { SFT #01 AND }
|
%GETBIT { SFT #01 AND }
|
||||||
( val* bitnum -- bit )
|
( val* bitnum -- bit )
|
||||||
%GETBIT2 { SFT2 #0001 AND2 NIP }
|
%GETBIT2 { SFT2 #0001 AND2 NIP }
|
||||||
|
( val* nibnum -- nibble )
|
||||||
|
%GETNIBBLE { #20 SFT SFT2 #000f AND2 NIP }
|
||||||
|
|
||||||
|
|||||||
+29
-7
@@ -6,7 +6,7 @@
|
|||||||
BRK
|
BRK
|
||||||
|
|
||||||
@on-frame
|
@on-frame
|
||||||
#0b ;line4 JSR2
|
LIT 'O ;drawc JSR2
|
||||||
;&adv KP-A JMPKEY
|
;&adv KP-A JMPKEY
|
||||||
;&back KP-B JMPKEY
|
;&back KP-B JMPKEY
|
||||||
BRK
|
BRK
|
||||||
@@ -21,8 +21,8 @@ BRK
|
|||||||
|
|
||||||
( sprite and text drawing routines )
|
( sprite and text drawing routines )
|
||||||
|
|
||||||
( subtract #20 from the ASCII code and you get the offset from the nanofont label )
|
( subtract #20 from the ASCII code and get the absolute offset from the nanofont label )
|
||||||
%CHAR-TO-NF { #20 SUB ;nanofont ADD }
|
%CHAR-TO-NF { #20 SUB BTS ;nanofont ADD2 }
|
||||||
|
|
||||||
( 4x1 scanline output from the nibble )
|
( 4x1 scanline output from the nibble )
|
||||||
( x y nibble -- x y )
|
( x y nibble -- x y )
|
||||||
@@ -46,15 +46,37 @@ BRK
|
|||||||
JMP2r
|
JMP2r
|
||||||
|
|
||||||
( 4x4 sprite output from the memory )
|
( 4x4 sprite output from the memory )
|
||||||
( addr* x y -- )
|
( x y addr* -- x y )
|
||||||
@sprite4
|
@sprite4
|
||||||
( get sprite contents )
|
( get sprite contents )
|
||||||
SWP2 LDA2 ( x y sprval* -- )
|
LDA2 ( x y sprval* -- )
|
||||||
|
SWP2 OVR2 ( sprval* x y sprval* -- )
|
||||||
|
#04 ( sprval* x y sprval* counter -- )
|
||||||
|
&lp
|
||||||
|
DEC ( first effective counter value is 3 )
|
||||||
|
DUP SWP2 ROT ( sprval* x y counter sprval* counter -- )
|
||||||
|
GETNIBBLE ( sprval* x y counter nibble -- )
|
||||||
|
SWP ( sprval* x y nibble counter -- )
|
||||||
|
DBGBYTE
|
||||||
|
STH ( sprval* x y nibble -- ) ( stash counter into return stack )
|
||||||
|
;line4 JSR2 ( sprval* x y -- )
|
||||||
|
INC ( increment y coord )
|
||||||
|
STHr ( sprval* x y counter -- ) ( restore counter from return stack )
|
||||||
|
DBGBYTE
|
||||||
|
DUP ,&lp JCN
|
||||||
|
POP SWP2 POP2 ( sprval* x y counter -- x y )
|
||||||
|
#04 SUB ( restore y coord )
|
||||||
JMP2r
|
JMP2r
|
||||||
|
|
||||||
|
( nanofont character sprite output )
|
||||||
|
( x y char -- x y )
|
||||||
|
@drawc
|
||||||
|
CHAR-TO-NF DBGSHORT ;sprite4 JSR2
|
||||||
|
JMP2r
|
||||||
|
( same as drawc but auto increment x coord )
|
||||||
@putc
|
@putc
|
||||||
|
;drawc JSR2
|
||||||
|
SWP #04 ADD SWP
|
||||||
JMP2r
|
JMP2r
|
||||||
|
|
||||||
@draw-str ( s* -> )
|
@draw-str ( s* -> )
|
||||||
|
|||||||
Reference in New Issue
Block a user