Rather than change your samples to avoid it, you change your joypad read subroutine to avoid it. It's a simple, one time change.
Here's the one from Indivisible (NESASM syntax rather than asm6). This is "the easy way" I described in my post.
Code: Select all
lda <p1curstate
sta <p1oldstate
lda #$01
sta <p1curstate ;initialize the buffer with a flag
sta $4016;Strobe joypads
lsr a
sta $4016
p1and2loop:
lda $4016
and #%00000011
cmp #$01
rol <p1curstate
bcc p1and2loop ;loop if the flag wasn't shifted out yet
lda #$01
sta <reserved0 ;initialize the buffer with a flag
sta $4016;Strobe joypads
lsr a
sta $4016
p1testloop:
lda $4016
and #%00000011
cmp #$01
rol <reserved0
bcc p1testloop;loop if the flag wasn't shifted out yet
lda <reserved0
cmp <p1curstate
beq joypad1matched
lda <p1oldstate
sta <p1curstate
joypad1matched:
Code: Select all
lda <p1curstate
sta <p1oldstate
joypad1didnotmatch:
lda #$01
sta <p1curstate ;initialize the buffer with a flag
sta $4016;Strobe joypads
lsr a
sta $4016
p1and2loop:
lda $4016
and #%00000011
cmp #$01
rol <p1curstate
bcc p1and2loop ;loop if the flag wasn't shifted out yet
lda #$01
sta <reserved0 ;initialize the buffer with a flag
sta $4016;Strobe joypads
lsr a
sta $4016
p1testloop:
lda $4016
and #%00000011
cmp #$01
rol <reserved0
bcc p1testloop;loop if the flag wasn't shifted out yet
lda <reserved0
cmp <p1curstate
bne joypad1didnotmatch
Code: Select all
lda <p1curstate
sta <p1oldstate
lda #$01
sta <p1curstate ;initialize the buffer with a flag
sta $4016;Strobe joypads
lsr a
sta $4016
p1and2loop:
lda $4016
and #%00000011
cmp #$01
rol <p1curstate
bcc p1and2loop ;loop if the flag wasn't shifted out yet