I have another question regarding my quest to compose a piece of music for the NES using only 6502 assembly.
Right now, the code I have looks something like this:
Code: Select all
.inesprg 1
.ineschr 0
.inesmap 1
.inesmir 0
.bank 1
.org $FFFA
.dw 0
.dw Main
.dw 0
.bank 0
.org $C000
Main:
jsr A4_pu1
jsr D4_pu2
testMain:
ldx $4015
cpx #%00000000
beq main
jmp testMain
InfiniteLoop
jmp InfiniteLoop
A4_pu1:
lda #%00000011
sta $4015
lda #%10001111
sta $4000
lda #%11111101
sta $4002
lda #%11000000
sta $4003
rts
D4_pu2:
lda #%00000011
sta $4015
lda #%11001111
sta $4004
lda #%11111011
sta $4006
lda #%11000001
sta $4007
rts
1. Set the correct flags and write the correct data to the pulse 1 register. Then, return to main from the subroutine.
2. while that first note is still decaying, jump to subroutine two where the second note would be played. Then, return to main.
3. lastly, once the $4015 flags for pu1 and pu2 are set to 0, it will loop and repeat.
right now this is not happening, and I understand why that might be, but am lost on how I might fix this issue. any help on getting two notes (and later, two sequences of notes) to play simultaneously from code would be very helpful.
Thanks!