Oh no, I'm a n00b again!
There's a bug that's been in my game since I first implemented the sound engine, that I've decided it's time to squash it. The bug is like this: The 'right' button of the controller is being 'pushed' by the sound engine some how. Not constantly, but for just 1 frame every few seconds or so. I've actually narrowed it down to my DMC routine.
If I comment out the below code the bug is gone:
Is this not something I should be doing every time I start a new DMC sample? I notice the $4015 is just one byte lower that the controller 1 port.
I'm really stumped, any ideas?
There's a bug that's been in my game since I first implemented the sound engine, that I've decided it's time to squash it. The bug is like this: The 'right' button of the controller is being 'pushed' by the sound engine some how. Not constantly, but for just 1 frame every few seconds or so. I've actually narrowed it down to my DMC routine.
If I comment out the below code the bug is gone:
Code:
LDA #$0F
STA $4015 ; stop DMC if it's currently playing
LDA #$1F
STA $4015 ; and restart it
STA $4015 ; stop DMC if it's currently playing
LDA #$1F
STA $4015 ; and restart it
Is this not something I should be doing every time I start a new DMC sample? I notice the $4015 is just one byte lower that the controller 1 port.
I'm really stumped, any ideas?