added line numbers, compact rendering

This commit is contained in:
Nico 2021-06-05 13:20:48 +01:00
parent 9e48f3d71d
commit 44314f248b
2 changed files with 10 additions and 1 deletions

View File

@ -4,3 +4,6 @@ run: rom.bin
rom.bin: $(SRC)
uxnasm $(SRC) rom.bin
clean:
rm rom.bin

View File

@ -305,6 +305,10 @@ RTN
( draw-pattern-line draws a single line in a pattern )
@draw-pattern-line ( addr )
.Draw/row LDZ ;draw-byte JSR2 ( draw the row number )
;line .Screen/addr DEO2
#21 .Screen/color DEO
.Screen/x DEI2 #0008 ADD2 .Screen/x DEO2 ( move right a sprite )
#00 .Draw/col STZ
&loop
#00 .Draw/col LDZ NEQ ,&else JCN ( if it's not the note value, draw a byte )
@ -326,7 +330,7 @@ RTN
&loop
.Draw/pattern-y LDZ2 .Screen/x DEO2
DUP2 ;draw-pattern-line JSR2
.Screen/y DEI2 #0008 .Draw/pattern-vspacing LDZ2 ADD2 ADD2 .Screen/y DEO2 ( add spacing between rows )
.Screen/y DEI2 #0008 ( .Draw/pattern-vspacing LDZ2 ADD2 ) ADD2 .Screen/y DEO2 ( add spacing between rows )
PTN_WIDTH ADD2 ( get the next byte in the pattern )
#01 .Draw/row LDZ ADD .Draw/row STZ
.Draw/row LDZ PTN_LEN LOB NEQ ,&loop JCN
@ -402,6 +406,8 @@ BRK
@hex-chars [ 10 11 12 13 14 15 16 17 18 19 21 22 23 24 25 26 ] ( adding a hex digit to this address and loading will be that hex digit's code for the font )
]
@line [ 1818 1818 1818 1818 ] ( 8 pixel vertical bar )
@font ( specter8-frag font )
[
0000 0000 0000 0000 0008 0808 0800 0800