Simple Monophonic Just Intonation Engine is a music engine I have written for some of the Famicom games I am working on. It is very simple and does not even support looping (with one exception), but is sufficient for my use, mostly for sound effects. You could combine it with other music on the other square and on triangle channel. It is called "just intonation" because I used just intonation in this game, although it is not actually limited to just intonation.
Here is the code (for Unofficial MagicKit; convert to other assemblers if wanted):
Here is the code (for Unofficial MagicKit; convert to other assemblers if wanted):
Code:
lda $4015
and #$01
bne nomusic
ldx <musaddr
lda musichi,x
beq nomusic
ldy #$01
sty $4015
sta $4003
lda musiclo,x
sta $4002
inx
stx <musaddr
nomusic ;continues here
and #$01
bne nomusic
ldx <musaddr
lda musichi,x
beq nomusic
ldy #$01
sty $4015
sta $4003
lda musiclo,x
sta $4002
inx
stx <musaddr
nomusic ;continues here