From 34dc987eaafd0321c2501189438821e36e1ccbf6 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Mon, 13 May 2019 13:30:57 -0400 Subject: [PATCH] pt3: embarassing cut and paste bug was resetting sample when ornament overflowed --- pt3_player/pt3_lib.s | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/pt3_player/pt3_lib.s b/pt3_player/pt3_lib.s index d55ca175..3759441e 100644 --- a/pt3_player/pt3_lib.s +++ b/pt3_player/pt3_lib.s @@ -556,14 +556,11 @@ note_not_too_high: lda note_a+NOTE_SIMPLE_GLISS,X bne no_tone_sliding ; if (!a->simplegliss) { + ; FIXME: do these need to be signed compares? + check1: lda note_a+NOTE_TONE_SLIDE_STEP_H,X bpl check2 ; if ( ((a->tone_slide_step < 0) && -; lda note_a+NOTE_TONE_SLIDING,X -; cmp note_a+NOTE_TONE_DELTA,X -; bcc slide_to_note ; (a->tone_sliding <= a->tone_delta)) || -; beq slide_to_note - lda note_a+NOTE_TONE_SLIDING_H,X ; compare high bytes cmp note_a+NOTE_TONE_DELTA_H,X @@ -578,11 +575,6 @@ check2: lda note_a+NOTE_TONE_SLIDE_STEP_H,X bmi no_tone_sliding ; ((a->tone_slide_step >= 0) && -; lda note_a+NOTE_TONE_SLIDING,X -; cmp note_a+NOTE_TONE_DELTA,X -; bcc no_tone_sliding ; blt (a->tone_sliding >= a->tone_delta)) { - - lda note_a+NOTE_TONE_SLIDING_H,X ; compare high bytes cmp note_a+NOTE_TONE_DELTA_H,X bcc no_tone_sliding ; if NUM1H < NUM2H then NUM1 < NUM2 @@ -772,6 +764,7 @@ noise_slide_done: ; increment sample position inc note_a+NOTE_SAMPLE_POSITION,X ; a->sample_position++; + lda note_a+NOTE_SAMPLE_POSITION,X cmp note_a+NOTE_SAMPLE_LENGTH,X @@ -792,7 +785,7 @@ sample_pos_ok: bcc ornament_pos_ok ; blt lda note_a+NOTE_ORNAMENT_LOOP,X - sta note_a+NOTE_SAMPLE_POSITION,X + sta note_a+NOTE_ORNAMENT_POSITION,X ornament_pos_ok: