From c4f9f1b6e334edb10741376ae3e04a5a0dc51dea Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Tue, 14 May 2019 12:27:06 -0400 Subject: [PATCH] pt3: get early-ending of patterns working --- pt3_player/pt3_lib.s | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/pt3_player/pt3_lib.s b/pt3_player/pt3_lib.s index aa832bb0..ff855623 100644 --- a/pt3_player/pt3_lib.s +++ b/pt3_player/pt3_lib.s @@ -1701,7 +1701,7 @@ pt3_make_frame: lda current_subframe bne pattern_good - ; load a new patterh in + ; load a new pattern in jsr pt3_set_pattern lda DONE_PLAYING @@ -1718,6 +1718,19 @@ pattern_good: ; decode a new line jsr pt3_decode_line + ; check if pattern done early + lda pt3_pattern_done + bne line_good + + ;========================== + ; pattern done early! + + inc current_pattern ; increment pattern + lda #0 + sta current_line + sta current_subframe + jmp pt3_make_frame + line_good: ; Increment everything @@ -1734,9 +1747,6 @@ next_line: inc current_line ; and increment line lda current_line - lda pt3_pattern_done ; check if pattern done early - beq next_pattern - cmp #64 ; always end at 64. bne do_frame ; is this always needed? @@ -1746,18 +1756,8 @@ next_pattern: inc current_pattern ; increment pattern -; lda current_pattern -; cmp pt3_music_len ; if end of song, mark it as so -; beq done_song - jmp do_frame -;done_song: -; lda #$ff -; sta DONE_PLAYING - -; rts - do_frame: ; AY-3-8910 register summary ;