Skip to content

NSF driver: N163 instrument load clobbering Kxx state #224

@Gumball2415

Description

@Gumball2415

@DoneParams:
lda var_NamcoInstrument - N163_OFFSET, x
cmp var_Temp2
beq :+
lda #$00 ; reset wave
sta var_ch_DutyDefault, x
sta var_ch_DutyCurrent, x
lda var_Temp2
; Load N163 wave
; jsr ft_n163_load_wave
: sta var_NamcoInstrument - N163_OFFSET, x
lda ft_channel_type, x ;;; ;; ;
cmp #CHAN_N163
bne :+ ; ;; ;;;
jsr ft_n163_load_wave2
: ldy var_Temp
rts

When a channel with a higher index than the size of var_NamcoInstrument is loaded here, it can overwrite the adjacent var_ch_Harmonic variables, causing some channels to be stuck on a note that may be either on the higest frequency (which is then typically muted) or on the lowest frequency.

module to recreate bug: dear friends.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions