The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.3.33 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




Users browsing this thread: 3 Guest(s)
Random battle theme

#1
Posts: 3,969
Threads: 279
Thanks Received: 236
Thanks Given: 57
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
I've found where the song played during battle is set...

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
  Find
Quote  
[-] The following 1 user says Thank You to madsiur for this post:
  • SSJ Rick (01-14-2014)



Messages In This Thread
Random battle theme - by madsiur - 01-13-2014, 07:47 PM
RE: Random battle theme - by Lockirby2 - 01-13-2014, 09:48 PM
RE: Random battle theme - by madsiur - 01-13-2014, 10:11 PM
RE: Random battle theme - by SSJ Rick - 01-14-2014, 03:58 AM
RE: Random battle theme - by B-Run - 01-20-2014, 09:54 PM
RE: Random battle theme - by Gi Nattak - 09-02-2014, 07:19 PM
RE: Random battle theme - by emberling - 10-13-2018, 03:27 PM
RE: Random battle theme - by Lightning - 10-13-2018, 01:28 PM
RE: Random battle theme - by Gi Nattak - 10-13-2018, 01:58 PM
RE: Random battle theme - by Lightning - 10-13-2018, 02:15 PM
RE: Random battle theme - by madsiur - 10-13-2018, 02:27 PM
RE: Random battle theme - by Lightning - 10-13-2018, 02:33 PM
RE: Random battle theme - by madsiur - 10-13-2018, 02:52 PM
RE: Random battle theme - by Lightning - 10-13-2018, 03:20 PM
RE: Random battle theme - by madsiur - 10-13-2018, 03:52 PM
RE: Random battle theme - by Lightning - 12-07-2018, 03:46 AM
RE: Random battle theme - by Lightning - 10-13-2018, 05:25 PM
RE: Random battle theme - by madsiur - 10-13-2018, 10:16 PM
RE: Random battle theme - by Lightning - 10-13-2018, 11:45 PM
RE: Random battle theme - by madsiur - 10-14-2018, 12:04 AM
RE: Random battle theme - by Lightning - 10-14-2018, 02:33 PM
RE: Random battle theme - by madsiur - 10-14-2018, 03:07 PM
RE: Random battle theme - by Lightning - 10-14-2018, 03:12 PM
RE: Random battle theme - by madsiur - 10-14-2018, 03:16 PM
RE: Random battle theme - by Lightning - 10-14-2018, 04:05 PM
RE: Random battle theme - by madsiur - 10-14-2018, 07:11 PM
RE: Random battle theme - by Lightning - 10-15-2018, 04:11 AM
RE: Random battle theme - by madsiur - 10-16-2018, 11:48 AM
RE: Random battle theme - by Lightning - 10-17-2018, 04:51 PM
RE: Random battle theme - by Gi Nattak - 10-17-2018, 05:28 PM
RE: Random battle theme - by Lightning - 10-17-2018, 07:22 PM
RE: Random battle theme - by madsiur - 10-17-2018, 10:48 PM
RE: Random battle theme - by Lightning - 10-17-2018, 11:21 PM
RE: Random battle theme - by Lightning - 12-14-2018, 03:52 AM
RE: Random battle theme - by madsiur - 12-11-2018, 03:52 PM
RE: Random battle theme - by Lightning - 12-11-2018, 06:11 PM
RE: Random battle theme - by madsiur - 12-11-2018, 06:23 PM
RE: Random battle theme - by Lightning - 12-11-2018, 09:21 PM
RE: Random battle theme - by Lightning - 12-14-2018, 02:41 PM
RE: Random battle theme - by madsiur - 12-14-2018, 11:23 AM
RE: Random battle theme - by madsiur - 12-14-2018, 03:16 PM
RE: Random battle theme - by Lightning - 12-14-2018, 03:28 PM
RE: Random battle theme - by madsiur - 12-14-2018, 04:53 PM
RE: Random battle theme - by Lightning - 12-14-2018, 05:45 PM
RE: Random battle theme - by madsiur - 12-14-2018, 08:10 PM
RE: Random battle theme - by Lightning - 12-14-2018, 09:58 PM
RE: Random battle theme - by Lightning - 07-11-2021, 03:22 PM
RE: Random battle theme - by madsiur - 07-11-2021, 03:52 PM
RE: Random battle theme - by Lightning - 07-11-2021, 04:11 PM
RE: Random battle theme - by madsiur - 07-11-2021, 04:21 PM
RE: Random battle theme - by Lightning - 07-11-2021, 04:41 PM
RE: Random battle theme - by madsiur - 07-11-2021, 05:46 PM
RE: Random battle theme - by Lightning - 07-11-2021, 07:48 PM
RE: Random battle theme - by madsiur - 07-11-2021, 08:34 PM
RE: Random battle theme - by Lightning - 07-12-2021, 10:49 AM

Forum Jump:

Users browsing this thread: 3 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite