framecount as short

This commit is contained in:
sejo 2021-07-11 20:50:34 -05:00
parent d70f6a93ff
commit 14490818fc
2 changed files with 12 additions and 4 deletions

Binary file not shown.

View File

@ -131,7 +131,7 @@ BRK
;draw-bytes JSR2
( inc framecount )
.framecount LDZ #01 ADD .framecount STZ
.framecount LDZ2 #0001 ADD2 .framecount STZ2
BRK
@ -145,16 +145,24 @@ BRK
&done
RTN
&apply-period
.framecount LDZ SWP MOD ,&done JCN
#00 SWP ( build period as short )
.framecount LDZ2 SWP2 MOD2 ( apply period )
SWP POP ( remove high nibble )
,&done JCN
&check-beatcount
.dev0/beatcount ADD-OFFSET LDZ #0f AND DUP ,&apply-beatcount JCN
&no-beatcount
POP RTN
&apply-beatcount
.framecount LDZ .dev0/period ADD-OFFSET LDZ DIV ( get framecount/period )
SWP MOD ( apply mod beatcount )
#00 SWP ( build beatcount as short )
.framecount LDZ2 ( load framecount )
#00 .dev0/period ADD-OFFSET LDZ DIV2 ( get framecount/period )
SWP2 MOD2 ( apply mod beatcount )
SWP POP ( remove high nibble )
.dev0/beatcount ADD-OFFSET LDZ #04 SFT ( get beat offset )
ADD #07 AND ( apply offset and mask beat )
STHk ( stash + keep current beat ) ( PRINT-DIGIT )