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

#41
Posts: 3,966
Threads: 279
Thanks Received: 233
Thanks Given: 56
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
yeah you need to write your table entries as "db $56" instead of "56". Also you might want to change the two ".exit" to "exit" but those error might be cause by previous ones I'm not sure.
  Find
Quote  

#42
Posts: 311
Threads: 20
Thanks Received: 0
Thanks Given: 0
Joined: Dec 2017
Reputation: 2
Status
None
(12-14-2018, 03:16 PM)madsiur Wrote: yeah you need to write your table entries as "db $56" instead of "56". Also you might want to change the two ".exit" to "exit" but those error might be cause by previous ones I'm not sure.

Ok, if I change the code to the following there are no more compile errors, but now the music is just the default in-game for the 3 backgrounds I changed:

Code:
hirom
header

org $C2BDB7
JSR free_space
NOP

org $C264C9          ; change to free space
free_space:
TDC
LDA $C2BF3B,X        ; load formation song
CMP #$24             ; check if battle song
BNE exit            ; branch if not
LDA $11E2            ; load battle background byte
AND #$3F             ; isolate battle background
REP #$20
TAX                  ; set BG as index
SEP #$20
LDA table,X          ; load BG song ID
exit:
RTS

; your $37 song IDs
; this table can be anywhere in the ROM:
org $F15550 ;(uncomment and change to move table elsewhere)
table:
db $56    ; W O B Grass
db $57    ; WOR Forest
db $66    ; W O B Desert
db $00    ; song ID for 4th background
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
db $00
  Find
Quote  

#43
Posts: 3,966
Threads: 279
Thanks Received: 233
Thanks Given: 56
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
I dunno, remove the TDC and try "LDA $00, XBA" after the "BNE exit". If it still fail, set a breakpoint at your new code with bsnes+ and post the debugger trace.
  Find
Quote  

#44
Posts: 311
Threads: 20
Thanks Received: 0
Thanks Given: 0
Joined: Dec 2017
Reputation: 2
Status
None
(12-14-2018, 04:53 PM)madsiur Wrote: I dunno, remove the TDC and try "LDA $00, XBA" after the "BNE exit". If it still  fail, set a breakpoint at your new code with bsnes+ and post the debugger trace.

UGH, it was a lousy header issue.  I had forgotten that I removed the header to check for free space for the table, and didn't add it back.  Everything works fine so far, although I noticed any track set to 00 will play no music at all as opposed to the default music, so I'm guessing I should just replace all the 00's with 24 if I want the default to play with any background I don't modify.  Was this intentional?
  Find
Quote  

#45
Posts: 3,966
Threads: 279
Thanks Received: 233
Thanks Given: 56
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
Yes the $00 were just placeholders.
  Find
Quote  

#46
Posts: 311
Threads: 20
Thanks Received: 0
Thanks Given: 0
Joined: Dec 2017
Reputation: 2
Status
None
(12-14-2018, 08:10 PM)madsiur Wrote: Yes the $00 were just placeholders.

Hello 

Thanks!
  Find
Quote  

#47
Posts: 311
Threads: 20
Thanks Received: 0
Thanks Given: 0
Joined: Dec 2017
Reputation: 2
Status
None
Hey Madsiur, I am still using your amazing battle background hack (I have unique tracks set to nearly all backgrounds at this point). Would it be exceedingly difficult to have the Magitek facility background play different music in the WOR (Kefka's Tower) than in the WOB (Magitek facility)? I have an end-game track I would really like to use in Kefka's Tower that does not really fit in the WOB Magitek facility itself - yet they both share the same background so it's tough.

Here is the current code I'm using:

Code:
hirom
header

org $C2BDB7
JSR free_space
NOP

org $C264C9          ; change to free space
free_space:
TDC
LDA $C2BF3B,X        ; load formation song
CMP #$24             ; check if battle song
BNE exit            ; branch if not
LDA $11E2            ; load battle background byte
AND #$3F             ; isolate battle background
REP #$20
TAX                  ; set BG as index
SEP #$20
LDA table,X          ; load BG song ID
exit:
RTS

; your $37 song IDs
; this table can be anywhere in the ROM:
org $F15550 ;(change this to move table elsewhere)
table:
db $56    ; W O B Grass
db $57    ; WOR Forest
db $66    ; W O B Desert
db $5B    ; W O B Forest
db $6A    ; Building
db $6E    ; WOR Grass
db $24    ; The Veldt
db $24    ; Falling through clouds
db $24    ; Narshe Exterior
db $24    ; Narshe Cave with Mine Tracks
db $6D    ; Common Brown Cave
db $61    ; Mountain Outside
db $61    ; Mountain Cave
db $5C    ; Raft on River
db $24    ; Imperial Base
db $74    ; On top of train car
db $74    ; inside train car
db $6D    ; Blue Narshe Secret Entrance Cave and Umaro Cave
db $71    ; Icy Field
db $24    ; Bright Town
db $58    ; Vector Inside / Kefkas Tower Interior
db $62    ; Floating Continent
db $59    ; Kefka's Tower Exterior
db $24    ; Opera Stage
db $24    ; Opera House Rafters
db $5F    ; Flaming House
db $77    ; Ancient Castle interior and Figaro Castle basement
db $64    ; Magitek Research (Testing Tubes)
db $6B    ; Colosseum
db $72    ; Magitek Facility
db $24    ; Village
db $5F    ; Waterfall
db $24    ; Owzer's House
db $24    ; Running on Train Tracks
db $24    ; Bridge near Sealed Gate
db $24    ; Underwater
db $6A    ; Zozo
db $24    ; Airship, WOB, Centered
db $76    ; Tomb
db $77    ; Ancient Castle Exterior Ruins and Doma Castle
db $59    ; Kefka's Tower
db $24    ; Airship WOR Right
db $6C    ; Red Lava Cave
db $24    ; Light Building
db $24    ; Magitek Cart Ride
db $24    ; Fanatic's Tower
db $64    ; Cyan's Dream World
db $55    ; WOR Desert
db $24    ; Airship, Wob, Right
db $24    ; Unused
db $24    ; Unused
db $24    ; Statue 1 (Doom)
db $24    ; Statue 2 (Poltergeist)
db $24    ; Statue 3 (Goddess Minerva)
db $24    ; Kefka's Background
db $24    ; Tentacles
  Find
Quote  

#48
Posts: 3,966
Threads: 279
Thanks Received: 233
Thanks Given: 56
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
(07-11-2021, 03:22 PM)Lightning Wrote: Would it be exceedingly difficult to have the Magitek facility background play different music in the WOR (Kefka's Tower) than in the WOB (Magitek facility)?

You can skip ASM code for that and do it by events. There's a WoR event bit, in the entrance event of the map check if it is set and if so use a "Play song" event command with the WoR track ID. I think that would work.
  Find
Quote  

#49
Posts: 311
Threads: 20
Thanks Received: 0
Thanks Given: 0
Joined: Dec 2017
Reputation: 2
Status
None
(07-11-2021, 03:52 PM)madsiur Wrote:
(07-11-2021, 03:22 PM)Lightning Wrote: Would it be exceedingly difficult to have the Magitek facility background play different music in the WOR (Kefka's Tower) than in the WOB (Magitek facility)?

You can skip ASM code for that and do it by events. There's a WoR event bit, in the entrance event of the map check if it is set and if so use a "Play song" event command with the WoR track ID. I think that would work.

So you are saying that each map (which I'm guessing there are maps for each themed area) have a way to change the battle theme for that one area only?   I have two questions about this method though.  Will it affect the battle background code already in place by the ASM hack, and also, can I figure out where these events are by only hex editing? After all, my 1.1 rom is corrupted and event editors will not allow me to save (consequences of basing my hack on General Leo edition).

Edit: It might be easier for me to sacrifice one of my 4 boss themes in the FF3usME formation editor (the two "current" tracks, the "returners" track, and the "factory train" track), and replace one of them with the Kefka's Tower track - then modify each formation appearing there to use this track.
  Find
Quote  

#50
Posts: 3,966
Threads: 279
Thanks Received: 233
Thanks Given: 56
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
(07-11-2021, 04:11 PM)Lightning Wrote: So you are saying that each map (which I'm guessing there are maps for each themed area) have a way to change the battle theme for that one area only?   I have two questions about this method though.  Will it affect the battle background code already in place by the ASM hack, and also, can I figure out where these events are by only hex editing? After all, my 1.1 rom is corrupted and event editors will not allow me to save (consequences of basing my hack on General Leo edition).

Sorry I misread your first post. Yeah for a battle music different from one in the ASM hack, you'll need to add the same exception but by editing the ASK code I made. You'll need to check after the LDA table,x with a BEQ if it's the Magitek song ID, if so check if you are in the WoR with the WoR event bit if so set your WoR Magitek Facility song ID.
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite