pt3: some more cycle counts

This commit is contained in:
Vince Weaver 2019-06-05 17:00:47 -04:00
parent 6802663554
commit 0cf9c5aaf6

View File

@ -1423,76 +1423,79 @@ handle_effects:
; Effect #1 -- Tone Down ; Effect #1 -- Tone Down
;============================== ;==============================
effect_1: effect_1:
cmp #$1 cmp #$1 ; 2
bne effect_2 bne effect_2 ; 3
; -1
sta note_a+NOTE_SIMPLE_GLISS,X ; 5
lsr ; 2
sta note_a+NOTE_ONOFF,X ; 5
sta note_a+NOTE_SIMPLE_GLISS,X lda (PATTERN_L),Y ; load byte, set as slide delay ; 5
lsr iny ; 2
sta note_a+NOTE_ONOFF,X
lda (PATTERN_L),Y ; load byte, set as slide delay sta note_a+NOTE_TONE_SLIDE_DELAY,X ; 5
iny sta note_a+NOTE_TONE_SLIDE_COUNT,X ; 5
sta note_a+NOTE_TONE_SLIDE_DELAY,X lda (PATTERN_L),Y ; load byte, set as slide step low ; 5
sta note_a+NOTE_TONE_SLIDE_COUNT,X iny ; 2
sta note_a+NOTE_TONE_SLIDE_STEP_L,X ; 5
lda (PATTERN_L),Y ; load byte, set as slide step low lda (PATTERN_L),Y ; load byte, set as slide step high ; 5
iny iny ; 2
sta note_a+NOTE_TONE_SLIDE_STEP_L,X sta note_a+NOTE_TONE_SLIDE_STEP_H,X ; 5
lda (PATTERN_L),Y ; load byte, set as slide step high jmp no_effect ; 3
iny
sta note_a+NOTE_TONE_SLIDE_STEP_H,X
jmp no_effect
;============================== ;==============================
; Effect #2 -- Portamento ; Effect #2 -- Portamento
;============================== ;==============================
effect_2: effect_2:
cmp #$2 cmp #$2 ; 2
beq effect_2_small beq effect_2_small ; 3
jmp effect_3 ; -1
jmp effect_3 ; 3
effect_2_small: ; FIXME: make smaller effect_2_small: ; FIXME: make smaller
lda #0 lda #0 ; 2
sta note_a+NOTE_SIMPLE_GLISS,X sta note_a+NOTE_SIMPLE_GLISS,X ; 5
sta note_a+NOTE_ONOFF,X sta note_a+NOTE_ONOFF,X ; 5
lda (PATTERN_L),Y ; load byte, set as delay lda (PATTERN_L),Y ; load byte, set as delay ; 5
iny iny ; 2
sta note_a+NOTE_TONE_SLIDE_DELAY,X sta note_a+NOTE_TONE_SLIDE_DELAY,X ; 5
sta note_a+NOTE_TONE_SLIDE_COUNT,X sta note_a+NOTE_TONE_SLIDE_COUNT,X ; 5
iny iny ; 2
iny iny ; 2
iny iny ; 2
lda (PATTERN_L),Y ; load byte, set as slide_step high lda (PATTERN_L),Y ; load byte, set as slide_step high ; 5
php php ; 3
; 16-bit absolute value ; 16-bit absolute value
bpl slide_step_positive1 bpl slide_step_positive1 ; 3
eor #$ff ;-1
eor #$ff ; 2
slide_step_positive1: slide_step_positive1:
sta note_a+NOTE_TONE_SLIDE_STEP_H,X sta note_a+NOTE_TONE_SLIDE_STEP_H,X ; 5
dey dey ; 2
lda (PATTERN_L),Y ; load byte, set as slide_step low lda (PATTERN_L),Y ; load byte, set as slide_step low ; 5
plp plp ; 4
bpl slide_step_positive2 bpl slide_step_positive2 ; 3
eor #$ff ;-1
adc #$0 ;+carry set by earlier CMP eor #$ff ; 2
adc #$0 ;+carry set by earlier CMP ; 2
slide_step_positive2: slide_step_positive2:
sta note_a+NOTE_TONE_SLIDE_STEP_L,X sta note_a+NOTE_TONE_SLIDE_STEP_L,X ; 5
bcc skip_step_inc1 bcc skip_step_inc1 ; 3
inc note_a+NOTE_TONE_SLIDE_STEP_H,X inc note_a+NOTE_TONE_SLIDE_STEP_H,X ; 7
skip_step_inc1: skip_step_inc1:
iny ; moved here as it messed with flags iny ; moved here as it messed with flags ; 2
iny iny ; 2
; a->tone_delta=GetNoteFreq(a->note,pt3)- ; a->tone_delta=GetNoteFreq(a->note,pt3)-