I gave the code a once over -- but didn't really debug it. It didn't really play in my emu, either. The song started, but with crackles, unwanted noise, and then silence after a second or so.
Code:
lda #$ff
txs
inx
sta $2000
sta $2001
I think you meant LDX, STX. You definately don't want to write unprepped X to the stack pointer, and certainly don't want to write $FF to $2000, $2001.
Code:
lda #$00
tax
init_sound:
lda $4000,X
inx
dey
bne init_sound
You can't read $4000 - $4014, they're write only. Did you mean STA? What are you trying to do here anyway? You also have that DEY driving the loop... but you never set Y to anything initially.
Code:
clear_oam1:
lda $200,X
lda $300,X
lda $400,X
lda $500,X
lda $600,X
lda $700,X
lda $800,X
inx
bne clear_oam1
rts
Again -- I think you meant STA. Mixing up LDA/STA is not a great mistake to make ;P. This is very possibly the major problem in your code.
Also -- $08xx isn't RAM, it's mirrored RAM (it mirrors zero page). Just seemed strange that you would write to it here.
Also, RAM is not OAM (though that's not an error in the code -- you're just calling it the wrong thing). OAM == Sprite RAM ($2004,$4014)
Lastly -- according to the NSF spec, $0F should be written to $4015 by the player before playing the tune. So I would do:
Code:
LDA #$00
STA $4015
LDA #$0F
STA $4015
Before you call the INIT_ADDR to "reset" the sound channels (that will mute them, then restart them -- so they will all be silent, but will still be enabled). I don't know whether or not this makes a difference -- I remember if making a difference in some NSFs though (Castlevania comes to mind) -- as some NSFs never write to $4015.