Users browsing this thread: 3 Guest(s)
Random battle theme
01-13-2014, 07:47 PM
I've found where the song played during battle is set...
... and decided to put some randomness in the music selection:
With a similiar approach, you could have a selection of 3 or 4 battle theme and random boss themes as well. Quick demonstration: http://www.youtube.com/watch?v=lHPjHzJ_rFc
Code:
$C2/BD95: AD 4B 2F LDA $2F4B (Monster Aux. Byte 4)
$C2/BD98: 30 36 BMI $BDCD (Branch if "No music" bit is set)
$C2/BD9A: EE ED E9 INC $E9ED
$C2/BD9D: A9 10 LDA #$10
$C2/BD9F: 8D 00 13 STA $1300
$C2/BDA2: A9 FF LDA #$FF (Volume)
$C2/BDA4: 8D 02 13 STA $1302 (Save volume)
$C2/BDA7: AD 9D 62 LDA $629D
$C2/BDAA: C9 FF CMP #$FF
$C2/BDAC: D0 11 BNE $BDBF
$C2/BDAE: AD 4B 2F LDA $2F4B (Monster Aux. Byte 4)
$C2/BDB1: 29 38 AND #$38 (Isolate song)
$C2/BDB3: 4A LSR A
$C2/BDB4: 4A LSR A
$C2/BDB5: 4A LSR A (Get an index from 0 to 7)
$C2/BDB6: AA TAX
$C2/BDB7: BF 3B BF C2 LDA $C2BF3B,X (Load song ID)
$C2/BDBB: C9 FF CMP #$FF
$C2/BDBD: F0 0E BEQ $BDCD (branch if we keep the current music playing)
$C2/BDBF: 8D 01 13 STA $1301 (save song ID)
$C2/BDC2: AD E4 11 LDA $11E4
$C2/BDC5: 29 08 AND #$08
$C2/BDC7: D0 04 BNE $04
$C2/BDC9: 22 04 00 C5 JSL $C50004 (Play song)
Song index table
C2/BF3B: 24 (Battle Theme)
C2/BF3C: 14 (Boss Theme)
C2/BF3D: 33 (Atma Weapon)
C2/BF3E: 2E (Returner)
C2/BF3F: 1A (Factory)
C2/BF40: 3B (Final)
C2/BF41: FF (current 1)
C2/BF42: FF (current 2)
... and decided to put some randomness in the music selection:
Code:
$C2/BDBB: 20 69 64 JSR $6469
$C2/BDBE: EA NOP
$C2/6469: C9 FF CMP #$FF
$C2/646B: F0 14 BEQ $6481 (branch if we keep the current music playing)
$C2/646D: C9 24 CMP #$24
$C2/646F: F0 02 BEQ $6473
$C2/6471: 80 0D BRA $6480 (Exit if not battle theme)
$C2/6473: 20 5A 4B JSR $4B5A (Random Number 0 to 255)
$C2/6476: C9 80 CMP #$80 (1 in 2 chance)
$C2/6478: B0 04 BCS $647E
$C2/647A: A9 13 LDA #$13 (Techno de Chocobo song ID)
$C2/647C: 80 02 BRA $6480 (Exit)
$C2/647E: A9 15 LDA #$15 (Johnny C. Bad song ID)
$C2/6480: 60 RTS
$C2/6481: 8B PHB
$C2/6482: 4C CD BD JMP $BDCD
With a similiar approach, you could have a selection of 3 or 4 battle theme and random boss themes as well. Quick demonstration: http://www.youtube.com/watch?v=lHPjHzJ_rFc
« Next Oldest | Next Newest »
|
||||
Users browsing this thread: 3 Guest(s)