jjl2357 Posted January 6, 2014 Share Posted January 6, 2014 So what I want to do is make it so that you can only select character X to be deployed in the battle prep screen if character Y is being deployed with him/her. Ex. What if Kent will only fight if he gets to fight alongside Lyn? I found Nintenlord's source ASM for a "character banner" patch for FE7, and I'm trying to modify it to fit my purposes. I'm a little bit stuck on a couple places though: .thumb @0x46 bytes @called by 0808e260 @ where the instructions are written .org 0x08dea8 @r0 = pointer to character loadPointerFromTable: ldr r2, =pointerTable+0x8000000 @pointerTable cmp r2, #0 beq false @ go to "false" label if r2 is equal to 0 @r2 is the pointer to character conditional data loadCharNumber: @loads the 4th byte of the 0th word of r0 ldr r0, [r0, #0] ldrb r0, [r0, #4] @ Here, I need something like: @ compare: @ ldrb r4, [r2, #0] @ cmp r4, #0 @ beq false @ @ ldrb r5, [r2, #1] @ cmp r5, r0 @ beq check @ @ add r2, #2 @ b compare @ check: @ @CHECK TO SEE IF CHAR4 IS NOT DEPLOYED??? @ beq true @ b return true: @turns r0's value into 1 @WHAT DOES THIS DOOO??? mov r0, #1 b return false: @ turns r0's value into 0 mov r0, #0 return: bx lr .pool .org 0xdf0000 @ tells computer that "pointerTable" refers to 0xdf0000 pointerTable: .fill 44, 4, 0 I can't figure out how to check whether you have a character selected, and I also don't see what "true" and "false" actually do, since they seem to be setting the character number to 1 or 0, respectively. Also, I'm wondering if anyone happens to know the equivalent offset for FE8... If anyone could help me I'd really appreciate it :) Quote Link to comment Share on other sites More sharing options...
CT075 Posted January 6, 2014 Share Posted January 6, 2014 (edited) the true/false labels just set the return value of the routine to 0 (false) and 1 (true); everything else is just setup to determine that if you can determine whether any given character X is deployed (based on random experimentation it appears that a value of 0x1 at index 0xC of character data means deployed, whereas 0xB means the opposite) it should be a fairly trivial modification Edited January 6, 2014 by CT075 Quote Link to comment Share on other sites More sharing options...
jjl2357 Posted January 7, 2014 Author Share Posted January 7, 2014 (edited) Okay, this still isn't working. I've managed to get it to a point where it doesn't break the ROM, but the problem is that replacing the code at the offset with this doesn't actually do anything. I tested conditionals with Sain and Kent but both of them were still selectable. .thumb @0x46 bytes @called by 0808e260 @ where the instructions are written .org 0x08dea8 @r0 = pointer to character loadPointerFromTable: ldr r2, =pointerTable+0x8000000 @pointerTable cmp r2, #0 beq false @ go to "false" label if r2 is equal to 0 @r2 is the pointer to character conditional data loadCharNumber: @loads the 4th byte of the 0th word of r0 ldr r0, [r0, #0] ldrb r0, [r0, #4] compare: ldrb r4, [r2, #0] cmp r4, #0 beq false ldrb r5, [r2, #1] cmp r5, r0 beq check add r2, #2 b compare check: ldr r6, =0x202bbf8 ldrb r7, [r0, #0xc] cmp r7, #0x1 bne true b return true: @turns r0's value into 1 mov r0, #1 b return false: @ turns r0's value into 0 mov r0, #0 return: bx lr .pool .org 0xdf0000 @ tells computer that "pointerTable" refers to 0xdf0000 pointerTable: .fill 44, 4, 0 ...maybe I should do more hacking before trying to learn the technical stuff all at once Edited January 7, 2014 by jjl2357 Quote Link to comment Share on other sites More sharing options...
CT075 Posted January 7, 2014 Share Posted January 7, 2014 i'm not convinced you know what you're doing i don't even know what you're doing with the r6 and r7 (well, i know what you want to do but it's not even close to what you want it to be doing) Quote Link to comment Share on other sites More sharing options...
jjl2357 Posted January 7, 2014 Author Share Posted January 7, 2014 ...oh. Whoops. *facepalm* Yeah, that definitely can't be right -___- forgive me I'm a n00b Quote Link to comment Share on other sites More sharing options...
CT075 Posted January 7, 2014 Share Posted January 7, 2014 you can try assembling this and patching with my assembly patcher (i didn't make a linker script because i only spent 15 minutes on this) but it should give you the general gist of what you want to do i made it so it doesn't overwrite the regular character banner hack as well Quote Link to comment Share on other sites More sharing options...
jjl2357 Posted January 9, 2014 Author Share Posted January 9, 2014 Wow, thanks for writing everything out so clearly! I think I'm starting to understand this stuff :) Quote Link to comment Share on other sites More sharing options...
CT075 Posted January 9, 2014 Share Posted January 9, 2014 (edited) it's actually incomplete but most of the logic is there (the gaps are largely structural stuff like completing the FOR loop and popping out the preserved registers from the start) keep that in mind if you write your own implementation Edited January 9, 2014 by CT075 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.