So I was curious to see if I could change the tone of the square wave by using inc and dec on $4002. I kinda expected it to either not work at all, or cycle the tone down until $4002 hit 0 then pop the tone back up as the next decrement would set it to 255 and cycle back down again. Instead it just dropped the tone once and stopped, which was not at all what I was expecting. The code is super simple, I just call this procedure when someone hits down on the gamepad:
The tone up call, which does the same thing except increments $4002 is even weirder. It pops the sound up a bit then stops playing the tone.
Anyone willing to explain to me what's going on here?
Thanks
Code:
.proc tone_down
dec $4002
rts
.endproc
dec $4002
rts
.endproc
The tone up call, which does the same thing except increments $4002 is even weirder. It pops the sound up a bit then stops playing the tone.
Anyone willing to explain to me what's going on here?
Thanks