diff --git a/main.usm b/main.usm index 402262c..369d26f 100644 --- a/main.usm +++ b/main.usm @@ -330,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 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 @@ -344,7 +344,7 @@ RTN #20 .Screen/color DEO .Playback/position LDZ2 #0000 EQU2 ,&end JCN ( draw new playhead ) - .Draw/pattern-y LDZ2 .Playback/position LDZ2 #0004 MUL2 ADD2 #000b SUB2 DUP2 .Draw/playhead-y STZ2 + .Draw/pattern-y LDZ2 .Playback/position LDZ2 #0008 MUL2 ADD2 #0008 SUB2 DUP2 .Draw/playhead-y STZ2 .Screen/y DEO2 ;playhead_icon .Screen/addr DEO2 #21 .Screen/color DEO @@ -363,10 +363,10 @@ RTN @on-step ( whenever a pattern step should be played ) - PTN_WIDTH PTN_LEN MUL2 .Playback/position LDZ2 NEQ2 ,&continue JCN ( if we're at the end of the pattern, reset the counter ) + PTN_LEN .Playback/position LDZ2 NEQ2 ,&continue JCN ( if we're at the end of the pattern, reset the counter ) #0000 .Playback/position STZ2 &continue - .Playback/position LDZ2 .Playback/pattern-addr LDZ2 ADD2 ( put pattern line address on the stack ) + .Playback/position LDZ2 PTN_WIDTH MUL2 .Playback/pattern-addr LDZ2 ADD2 ( put pattern line address on the stack ) DUP2 VOL LDA .Audio0/volume DEO ( ln -- ) ( put the address of the pattern line on the stack ) NOTE LDA ( get the current note ) DUP #00 EQU ,&rest JCN ( if the note is 00, aka empty, skip playing it ) @@ -375,7 +375,7 @@ RTN &rest POP ( if the note is a 00, jump here. POP to clean up the stack ) &end - PTN_WIDTH .Playback/position LDZ2 ADD2 .Playback/position STZ2 + #0001 .Playback/position LDZ2 ADD2 .Playback/position STZ2 ;draw-playhead JSR2 ( update the playhead position ) RTN