Hi,
I have to a nes file, wherein i have 3 different games and they re kept in switch bank. So now i want to include different kind of music for all 3 games. So how to do it ?
I tried this ->
i made music.nsf from famitracker and loaded the code at the desired address. So in my main code, i put these lines..
.base $8000
.include quiz_level1.asm
LoadAddy = $AB23
InitAddy = $AB23
PlayAddy = $AB26
.org LoadAddy
.incbin "quiz.nsf"
.org $c000
.base $8000
.include malaria.asm
LoadAddy = $9200
InitAddy = $9200
PlayAddy = $9203
.org LoadAddy
.incbin "malaria.nsf"
.org $c000
.base $8000
.include typing.asm
LoadAddy = $A200
InitAddy = $A200
PlayAddy = $A203
.org LoadAddy
.incbin "typing.nsf"
.org $c000
So, here is this the correct method. The sound is not playing in the 3rd game and distortion happens and after sometime, CPU JAM occurs.
Also are the 3 addresses needed to be the some ?
and where i have to put
InitMusic:
lda #$00
ldx #$00
Clear_Sound:
sta $4000,x
inx
cpx #$0F
bne Clear_Sound
lda #%00001111
STA $4015
lda #$C0
STA $4017
LDA SongNumber ; song number
ldx #$0 ; 00 for NTSC or $01 for PAL
jsr InitAddy ; init address
rts
That is for three different games i put in the main code or in their individual codes ?
thanks
I have to a nes file, wherein i have 3 different games and they re kept in switch bank. So now i want to include different kind of music for all 3 games. So how to do it ?
I tried this ->
i made music.nsf from famitracker and loaded the code at the desired address. So in my main code, i put these lines..
.base $8000
.include quiz_level1.asm
LoadAddy = $AB23
InitAddy = $AB23
PlayAddy = $AB26
.org LoadAddy
.incbin "quiz.nsf"
.org $c000
.base $8000
.include malaria.asm
LoadAddy = $9200
InitAddy = $9200
PlayAddy = $9203
.org LoadAddy
.incbin "malaria.nsf"
.org $c000
.base $8000
.include typing.asm
LoadAddy = $A200
InitAddy = $A200
PlayAddy = $A203
.org LoadAddy
.incbin "typing.nsf"
.org $c000
So, here is this the correct method. The sound is not playing in the 3rd game and distortion happens and after sometime, CPU JAM occurs.
Also are the 3 addresses needed to be the some ?
and where i have to put
InitMusic:
lda #$00
ldx #$00
Clear_Sound:
sta $4000,x
inx
cpx #$0F
bne Clear_Sound
lda #%00001111
STA $4015
lda #$C0
STA $4017
LDA SongNumber ; song number
ldx #$0 ; 00 for NTSC or $01 for PAL
jsr InitAddy ; init address
rts
That is for three different games i put in the main code or in their individual codes ?
thanks