I’ve written a custom routine for FE8 that lets you have unlimited B-supports, but only 1 A-support. The only thing is that I don’t know the /proper/ way to insert it.
What I’ve ended up doing is repointing some graphics (triangle attack) and pasting the routine there, then going into the debugger, manually changing the bl that calls the old routine (I can’t overwrite the old routine because it’s used elsewhere) and copying the hex that it gives me back into the ROM.
My routine also uses some of the subroutines that the old one did, but I can’t use bl to call them unless I bl to some empty label and then change it manually in the debugger.
I can’t help but feel like there must be a better way to do this.
Here’s the messy but somehow functional code:
[spoiler=What the hell is FLARD]
.thumb
.org 0x00000000
@@ Only 1 A support hack (FE8)
@@ This hack checks to see if the character has an A support AND the target support is at B or higher.
@@ Make sure to repoint the PK Triangle Attack graphic that used to be at $E17C0
push {r4-r7,r14}
@@if r0 = r5 it's the first time around
@@if r0 = r4 it's checking the other character
cmp r0,r5 @First time around
beq CheckforASupport
eor r4,r5
eor r5,r4 @swap the registers around, then proceed as usual
eor r4,r5
CheckforASupport:
mov r7,r5 @r7 is now active char's data
mov r6,r4 @r6 is now target's data
bl CheckSupportNum @get number of supported characters
mov r5,r0 @store it in r5
mov r4,#0x0 @r4 is number of characters looped
Loop:
mov r0,r7
mov r1,r4 @passing in params r0:chardata, r1:support partner to check
bl CheckSupportLev @check the support with character
cmp r0,#0x3 @is it A support?
beq CheckforBSupport
add r4,#0x1 @add 1 to loop counter
cmp r4,r5 @time to end the loop?
blt Loop
False:
mov r0,#0x0 @return false
True:
pop {r4-r7}
pop {r1}
bx r1
CheckforBSupport:
@@ r5 is still number of support partners
mov r1,r6
ldr r1,[r1] @ r1 is pointer to target character data
ldrb r1,[r1,#0x4] @ r1 is now the target character ID
mov r6,r1 @ put it back in r6, r1 is about to be clobbered
ldr r2,[r7] @r2 is the pointer to the character data
ldr r2,[r2,#0x2C] @r2 is the pointer to the support data
mov r4,#0x0 @loop counter
Loop_2:
ldrb r3,[r2,r4] @nth character's id
cmp r3,r6 @is it a match?
bne NoMatch
mov r0,r7 @passing in params
mov r1,r4
bl CheckSupportLev @check the support with character
cmp r0,#0x2 @is it B support?
blt False @if not, return false
mov r0,#0x1 @if it is, then return true
b True
NoMatch:
add r4,#0x1 @add one to loop counter
cmp r4,r5 @end of loop?
blt Loop_2 @no
b False @yes
CheckSupportLev: @Routine at 0x802823C, change this in the debugger
nop
CheckSupportNum: @Routine at 0x80281C8, change in debugger
nop
[/spoiler]