Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //***********************************************************
- // Random FDS Battle Theme in East Hyrule (by IcePenguin)
- //***********************************************************
- // Make the FDS Battle Theme to play randomly alongside the original NES Battle Theme
- bank 0;
- org $85F0 // 0x00600
- jsr $A8F0 // Hijack
- org $A8F0 // 0x02900
- inc.w $0726 // Original hijacked code
- lda.b $12 // Load Frame Counter address
- sta.b $F2 // Store Frame value in specific address when entering battle
- rts
- org $A8D0 // 0x028E0
- ldx.b $F2 // Load stored random value from Frame counter
- cpx.b #$80 // Compare against $80 from RAM $F2
- bmi l_A8DA // Branch if it's less than $80
- sta.w $075F // If not, then store normal NES Battle Theme at Music to Play RAM address
- rts
- l_A8DA:
- lda.b #$08 // Load FDS Battle Theme ($08)
- sta.w $075F // Store song at $075F (Music to play?)
- rts
- db $FF // Leftover
- bank 6;
- org $9DC0 // 0x19DD0
- lda.b $F2 // Load stored random value from Frame counter
- cmp.b #$80 // Compare against $80 from RAM $F2
- bmi l_9DCB // Branch if it's less than $80
- lda.b #$04 // Load NES Battle Theme ($04)
- sta.b $EB // Store song at $EB (Music)
- rts
- l_9DCB:
- lda.b #$08 // Load FDS Battle Theme ($08)
- sta.b $EB // Store song at $EB (Music)
- lda.b #$00 // Load value $00
- sta.w $0702 // Store at unknown RAM address
- rts
- db $FF // Leftover
- bank 7;
- org $FEB4 // 0x1FEC4
- lda.b $F2 // Load stored random value from Frame counter
- cmp.b #$80 // Compare against $80 from RAM $F2
- bmi l_FEC0 // Branch if it's less than $80
- lda.b #$04 // Load NES Battle Theme ($04)
- sta.w $075F // Store song at $075F (Music to play?)
- rts
- l_FEC0:
- lda.b #$08 // Load FDS Battle Theme ($08)
- sta.w $075F // Store song at $075F (Music to play?)
- lda.b #$00 // Load value $00
- sta.w $0702 // Store at unknown RAM address
- rts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement