-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
The speed of the song changes when it loops and the Y register has garbage.
And easy way to reproduce the bug is:
play_music:
ldy #$28
jsr $1003
rtsand play the attached .sid.
There is a path in the play code that it seems that Y is being used without being initialized.
The code that seems to have the bug is this one:
j104D LDA a1704 ; play routine
BEQ b1088 ; if this condition is triggered...
LDA #$02
STA a171A
LDX #$8C
LDA #$00
b105B DEX
STA f1724,X
BNE b105B
LDX #$02
b1063 LDA #$02
STA f1736,X
LDA #$FE
STA f1733,X
DEX
BPL b1063
LDA #$0F
STA a1720
LDA #$00
STA a176D
STA a176C
LDA #$F0
STA $D417
LDA #$00
STA a1704
RTS
b1088 DEC a171A
BPL b10B2
LDA a1719
CMP #$02
BPL b10A3 ; ... and if this condition is triggered...
LDY a171C
LDA f1E95,Y
STA a171B
CMP #$02
BPL b10A3
LDA #$02
b10A3 STA a171A ; then Y is being used without being initialized
INY
LDA f1E95,YAlthough it seems this commit fixes it, but I haven't tried. It seems that that commit is not present on the latest release:
e1267c8
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels