Perhaps someone can explain this concept to me, I'm fairly new to the sound part of the NES.
I'm following this guide:
http://patater.com/gbaguy/day14n.htm
I'm trying to generate a looping sweep wave on Square Wave Channel 1. I can do it with a loop, but I am experiencing an odditiy. Wheras in my loop, this code should work:
I'm finding I have to do this:
I basically have to repeat the writing to the registers thing 3 times. Why is this? Sure I could tidy it up with a loop, but I just don't understand. If someone could enlighten me as to what's going on "inside the machine" I'd be most greatful.
Thanks.
I'm following this guide:
http://patater.com/gbaguy/day14n.htm
I'm trying to generate a looping sweep wave on Square Wave Channel 1. I can do it with a loop, but I am experiencing an odditiy. Wheras in my loop, this code should work:
Code:
PlaySound:
lda #$FF
sta $4000
lda #%11001101
sta $4001
lda #$10
sta $4002
lda #$6A
sta $4003
lda #%00000001
sta $4015
lda #$FF
sta $4000
lda #%11001101
sta $4001
lda #$10
sta $4002
lda #$6A
sta $4003
lda #%00000001
sta $4015
I'm finding I have to do this:
Code:
PlaySound:
lda #$FF
sta $4000
lda #%11001101
sta $4001
lda #$10
sta $4002
lda #$6A
sta $4003
lda #%00000001
sta $4015
lda #$FF
sta $4000
lda #%11001101
sta $4001
lda #$10
sta $4002
lda #$6A
sta $4003
lda #%00000001
sta $4015
lda #$FF
sta $4000
lda #%11001101
sta $4001
lda #$10
sta $4002
lda #$6A
sta $4003
lda #%00000001
sta $4015
lda #$FF
sta $4000
lda #%11001101
sta $4001
lda #$10
sta $4002
lda #$6A
sta $4003
lda #%00000001
sta $4015
lda #$FF
sta $4000
lda #%11001101
sta $4001
lda #$10
sta $4002
lda #$6A
sta $4003
lda #%00000001
sta $4015
lda #$FF
sta $4000
lda #%11001101
sta $4001
lda #$10
sta $4002
lda #$6A
sta $4003
lda #%00000001
sta $4015
I basically have to repeat the writing to the registers thing 3 times. Why is this? Sure I could tidy it up with a loop, but I just don't understand. If someone could enlighten me as to what's going on "inside the machine" I'd be most greatful.
Thanks.