Jump to content

Spell Animation sounds.


BlueLeafeon
 Share

Recommended Posts

Which animations are you trying to fix?

IIRC, Fa's dragonstone, the Sword of Seals, Aircalibur and one of the other animations (Idoun's dragon stone?) kill the BGM when used. The patch I remembered finding only fixed the last three. I'd actually like to have all four fixed.

Link to comment
Share on other sites

IIRC those patches actually change like the sound data (as in, what's in the music array)

to change what sound is actually used by the game, you'd have to edit spell animation data, probably in a hex editor, which is no fun. So you're best bet is to find which sound is being used that's broken and then replace that entry with something else... or repoint it to a working sound. :\

Link to comment
Share on other sites

You could also follow the ASM.

public Spell_PC_Table spellPCtable() {
       return new Spell_PC_Table(
           0x0895D7ED, // dim_pc
           0x0895D8EF, // no_dim_pc
           this,
           r.new Pointer(0x0805B3F8), // base pointer
           r.new Pointer(0x085D4E60), // clean base address
           0x48, // clean number of entries
           1 // words per entry
       );
   }

0x085D4E60 is the base address of the spell animation PC table, which is the table with all of the function pointers to the various spells that are normally in the game (my rants should have hinted at its existence and there's clearly (above) doc (and that's not the only instance of it) on where they are).

0x14 - Fa's Holy Dragon Stone (BGM/SFX-kill)

0x085D4E60 + (0x14 * 4) = 0x085D4EB0

[0x085D4EB0] = 0x0805D389 ([Address] = Value at that address; this is usually what [] is for)

Found by going to 0x0805D388 in the Tools->Disassembly view of Visual Boy Advance and checking the "Thumb" option

push    {r4, r5, lr}        @
add    r5,    r0,    #0x0    @
bl                0x08055160
bl                0x08054FA8
bl                0x08055178
ldr    r0,    [0x0805D3C0]    (=0x085D5358)

0x085D5358 is loaded into r0 here. My notes on spell constructors show what this pointer is for; spell constructors never load any other pointers (that I can remember; in any case, the first one you see being loaded should be the one you're interested in, and if you aren't sure, well, you can see which function is called just after...if it matches the one that I call in my CSA code, then it's the relevant pointer).

So now we've found the pointer that points to

[0x085D5358] = {

00000001

080DCB38

00000003

0805D3C5

00000000

00000000

}

And why is this important? Look:

@0x01 instead of 0x19
.long                0x00000001
@Pointer to empty string (name of spell?)
.long                0x0895D780 + EmptyString
.long                0x00000003
.long                0x0895D780 + Processor + 1
EmptyString:
.long                0x00000000
.long                0x00000000

So the first pointer must be a char* to the name of the spell:

[080DCB38] = "efxIcebreath"

And it is.

So 0805D3C5 must be the function pointer to the actual spell.

Before we check the actual spell code, let's find out what we're looking for.

     COMMAND_48:
       @-------------------------------@WARNING: This might be wrong
       lsl    r0,    r0,    #0x8    @
       lsr    r0,    r0,    #0x10    @r0 = music ID to play
       mov    r1,    #0x80        @
       ldrh    r2,    [r5,    #0x2]    @
       mov    r3,    #0x2        @

       @bl                0x080729A4 - 0x0895D780

Command 48 is the one I hacked battle animations to play sound with. For spells, I programmed the entire system for displaying them myself, so I could have picked whatever the hell I wanted. I could have had commands be a different number of bytes depending on the command instead of making them all 4 bytes. I had complete control over the whole process because spells are stored as code, and I stored a single spell whose code would, instead of being the spell itself, load data from the ROM and "interpret" it. What am I doing? You can't possibly begin to understand my genius. This whole walkthrough barely touches on it.

Anyway, we can see from how I programmed the command that the sound playing function is at 0x080729A4 and accepts the ID of the sound to play in register 0. So whatever is modifying register 0 when 0x080729A4 is called is what needs to be changed.

Found by going to 0805D3C4 in the Tools->Disassembly view of Visual Boy Advance and checking the "Thumb" option

push    {r4, r5, lr}        @
add    r4,    r0,    #0x00    @
ldr    r0,    [r4,    #0x5C]    @
...etc....
.org                0x0805D3EE
mov    r0,    #0x8F        @
lsl    r0,    r0,    #0x01    @
mov    r1,    #0x80        @
lsl    r1,    r1,    #0x01    @
mov    r3,    #0x02        @
ldsh    r2,    [r5,    r3]    @
mov    r3,    #0x01        @
bl                0x080729A4

As you can see, the instruction at 0x0805D3EE is setting r0 to 0x8F, which is used for calling 0x080729A4 shortly after, which means that the byte at 0x0805D3EE is the value for which sound to play. 0x8F obviously causes problems. Why not try changing it to something else?

Edit: I just want to point out that it's depressing that all of this information is available to all of you, and that I didn't have to do any hacking here because of that.

During all that crap... basically 0x8F Logically shifted left once (use windows calculator or something) which the lsl does... is 0x011E.

From Bwdyeti's doc of GBA sounds:

Hex: 0x011E Dec: 286 Some kind of wind (Fimbulvetr without effects?)

Which you can see in Sappy. If you check in FE6, it sounds like Fa's Divine Stone Dragon Breath Spell.

And if you check in FE8, there's NOTHING there.

So basically you just need to change that... And well... That's what you have to pull off for Idoun's breath spell if you want to fix it.

As an alternative, you COULD insert the sound via Zahlman's song editor for Idoun's breath in FE8, if it's the same case as Fa's spell.

Edited by shadowofkitty
Link to comment
Share on other sites

As an alternative, you COULD insert the sound via Zahlman's song editor for Idoun's breath in FE8, if it's the same case as Fa's spell.

X_X That would probably be easier since I have no clue what the heck Xeld's talking about in that particular quote. (I always have a hard time understanding that guy but that particular quote I can't make out at all ) How would I go about inserting the sound, by the way?

Edited by MagicKitty
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...