Row Modifier

If it has bytes, we can change it. Talk about anything relating to hacking and emulation here.

Moderators: General Moderator, Game Moderator

Row Modifier

Postby Rainflush » Sat Nov 30, 2013 6:58 pm

It's occurred to me how much I dislike the Row feature of FF6, because it so notably discourages the use of the Fight ability, making actual weapons relatively unimportant till perhaps the latter part of the game. As such I would very much like to alter the damage reduction (given and taken) from 50% to 25%, and will in all probability require the assistance of you good people if I am to accomplish that. Now, I assume the following values are the intervals where the calculations take place:

C2/0D0B: 66 F0 ROR $F0 (Cut damage in half)

C2/0D13: 66 F0 ROR $F0 (Cut damage in half)

Could these be edited to change the damage reduction percentage? And would anything else need to be adjusted? My apologies if this should be entirely straightforward, it's been awhile since I've used a Hex editor and I was never especially skilled therewith.

If the calculations cannot be altered this way, does anyone have any other suggestions as how to address this problem? I've already increased the Battle Power on every weapon, though they simply cannot compete with Magic and/or the unique abilities of each character that are fully effective from the Back Row.

Addendum: Could "Ignore Defense" be similarly changed to "Ignore 50% Defense"? If that were possible it may address some of the issues with Ignore Defense while retaining to some degree the usefulness of piercing attacks against IID enabled enemies.

Thank you.
User avatar
Rainflush
Regular User
Regular User
 
Posts: 118
Joined: Wed Apr 28, 2010 2:54 pm

Re: Row Modifier

Postby Assassin » Sat Nov 30, 2013 8:40 pm

C2/0D11 is indeed the reduction for target row. C2/0D09 is the reduction for Defend command, but you didn't say you wanted to change that. C2/339D is the decrease for attacker row.

you wouldn't be able to fit these inline, but would need JSRs, as the calculation is more involved. C2/2C10 thru C2/2C1D shows how to do a three-quarter-ing.

Rainflush wrote:Addendum: Could "Ignore Defense" be similarly changed to "Ignore 50% Defense"?

yes, though it'd require some shuffling. and likely a little extra space usage. would you want such attacks to now be affected by Safe and Shell?
User avatar
Assassin
Moderator
Moderator
 
Posts: 1195
Joined: Tue Sep 14, 2004 5:10 am

Re: Row Modifier

Postby Rainflush » Sun Dec 01, 2013 1:22 am

Defend is fine, it's Row that I really want to change. As for the JSR, is the relevant sub-routine already present somewhere (C2/2C10 through C2/2C1D?) or would I have to create a similar routine elsewhere? By assumption I'd be changing C2/0D11 and C2/339D, might you be able to further explain what needs adjustment here? Forgive my ignorance, it's been quite some time since I used Translhextion and what little I'd learned I seem to have forgot.

As for the piercing attack adjustment, I would want Safe and Shell to be factored into the equation, yes. I've applied a patch for Safe and Shell to factored when Defense is ignored, which I suppose may complicate the process further. I may be getting ahead of myself here, my primary interest at present is mitigating the effect of Row.
User avatar
Rainflush
Regular User
Regular User
 
Posts: 118
Joined: Wed Apr 28, 2010 2:54 pm

Re: Row Modifier

Postby Assassin » Sun Dec 01, 2013 3:12 am

Rainflush wrote:Defend is fine, it's Row that I really want to change. As for the JSR, is the relevant sub-routine already present somewhere (C2/2C10 through C2/2C1D?) or would I have to create a similar routine elsewhere?


the second one, because C2/2C10 through C2/2C1D doesn't end with an RTS, so that piece of code is not callable. and you'd need two routines, since they operate on different variables ($F0 and $11B0).

so it'd look like:
Code: Select all
C2/0D11: 20 ?? ??      JSR extra1   (damage = damage * 3/4)
C2/0D14: EA            NOP

-----

C2/339D: 20 ?? ??      JSR extra2   (damage = damage * 3/4)
C2/33A0: EA            NOP

------

extra1:
(multiplies $F0 by 3/4)
C2/????: 08           PHP
C2/????: C2 20        REP #$20       (set 16-bit A)
C2/????: A5 F0        LDA $F0        (get Damage)
C2/????: 4A           LSR
C2/????: 4A           LSR
C2/????: 49 FF FF     EOR #$FFFF
C2/????: 38           SEC
C2/????: 65 F0        ADC $F0        (Subtract 1/4 from Damage)
C2/????: 85 F0        STA $F0        (save new Damage)
C2/????: 28           PLP
C2/????: 60           RTS


extra2:
(multiplies $11B0 by 3/4)
C2/????: 08           PHP
C2/????: C2 20        REP #$20       (set 16-bit A)
C2/????: AD B0 11     LDA $11B0      (get Damage)
C2/????: 4A           LSR
C2/????: 4A           LSR
C2/????: 49 FF FF     EOR #$FFFF
C2/????: 38           SEC
C2/????: 6D B0 11     ADC $11B0      (Subtract 1/4 from Damage)
C2/????: 8D B0 11     STA $11B0      (save new Damage)
C2/????: 28           PLP
C2/????: 60           RTS
User avatar
Assassin
Moderator
Moderator
 
Posts: 1195
Joined: Tue Sep 14, 2004 5:10 am

Re: Row Modifier

Postby Rainflush » Sun Dec 01, 2013 5:49 am

Thank you for the timely response, I think I've almost got it now. Could the subroutines be created outside of Bank C2? There doesn't seem to be any space left there. Also, the byte values in Translhextion vary from those listed in the Disassembly, for example C20D10 through C20D1F looks like this for me:

Code: Select all
05 FF 9D E9 15 0B F4 00 11 2B A2 0B 00 B5 A1 F0


I don't recognize any of the values, what am I missing here?
User avatar
Rainflush
Regular User
Regular User
 
Posts: 118
Joined: Wed Apr 28, 2010 2:54 pm

Re: Row Modifier

Postby Assassin » Mon Dec 02, 2013 7:54 am

Rainflush wrote:Could the subroutines be created outside of Bank C2? There doesn't seem to be any space left there.


yes. have them end with RTL (6Bh) instead of RTS (60h). and call them with a 4-byte JSL instruction (opcode 22h) as opposed to 3-byte JSR (opcode 20h), dropping the NOPs in the process.

that said, i think there is some space in C2.

Also, the byte values in Translhextion vary from those listed in the Disassembly, for example C20D10 through C20D1F looks like this for me:

Code: Select all
05 FF 9D E9 15 0B F4 00 11 2B A2 0B 00 B5 A1 F0


I don't recognize any of the values, what am I missing here?


no idea what else you have applied to the ROM. and i'm assuming you're correctly converting between CPU and file addresses, and adjusting for header if present.
User avatar
Assassin
Moderator
Moderator
 
Posts: 1195
Joined: Tue Sep 14, 2004 5:10 am

Re: Row Modifier

Postby Drakkhen » Mon Dec 02, 2013 2:18 pm

Looks like you're accounting for a header that isn't there. That data is from C2/0F10. Header size in Translhextion can be modified in the offset mode dialog box.(should be 0 for no header)

Also, you can save some space by using:
Code: Select all
C2/????: 4A            LSR
C2/????: 1A            INC
C2/????: 65 F0         ADC $F0/6D B0 11         ADC $11B0
C2/????: 6A            ROR

Instead of:
Code: Select all
C2/????: 4A           LSR
C2/????: 4A           LSR
C2/????: 49 FF FF     EOR #$FFFF
C2/????: 38           SEC
C2/????: 65 F0        ADC $F0/6D B0 11         ADC $11B0
Last edited by Drakkhen on Wed Dec 04, 2013 11:41 am, edited 1 time in total.
Drakkhen
Active User
Active User
 
Posts: 71
Joined: Thu Sep 09, 2004 9:06 am
Location: Dry Land, Earth

Re: Row Modifier

Postby Rainflush » Mon Dec 02, 2013 8:47 pm

All right, this all seems fairly straightforward now, though I'm encountering problems (garbled/black screen) so I've got a few more questions.

1: Should any .TBL file be open? (I assumed FF3batt.tbl would be opened for this but I'm unsure)

2: Could it be safely assumed any part of Bank C2 consisting of many rows of FF values is free space?

3: Would the JSR/JSL instruction interfere with the subsequent values (those overwritten by the JSR/JSL instruction), or are those values annulled by the delegation to the sub-routine?

4: To clarify, If I created a sub-routine in C2/62A0 (apparent vacant space, excluding Header), would I call upon that routine by replacing 46 F1 66 F0 at C2/0D11 (beginning of target row modifier, including Header) with 22 A0 62 C2?

Thanks a lot for the assistance, I really appreciate it.
Last edited by Rainflush on Fri Dec 06, 2013 3:10 am, edited 7 times in total.
User avatar
Rainflush
Regular User
Regular User
 
Posts: 118
Joined: Wed Apr 28, 2010 2:54 pm

Re: Row Modifier

Postby Assassin » Tue Dec 03, 2013 3:16 am

Drakkhen: hah, i thought your patch did that better, but didn't check it before posting for some reason.

good catch, though most of that string of bytes can not be found at C2/0F10 in the original game. they *can* be found with my Genji Glove fix applied, except that has the "A2 0B 00" as "A2 0A 00". no idea why he changed the one byte, unless he typoed in this topic.
User avatar
Assassin
Moderator
Moderator
 
Posts: 1195
Joined: Tue Sep 14, 2004 5:10 am

Re: Row Modifier

Postby Rainflush » Wed Dec 04, 2013 12:41 am

So I've been tinkering with this for the better part of the day but the game just keeps glitching out on me. Should I try adding the Header again or is that unimportant so long as I locate the relevant bytes? I'm unsure as to what I'm doing wrong at this point, but if anyone could shed some light on my questions listed above that would be great.

Thanks again.
User avatar
Rainflush
Regular User
Regular User
 
Posts: 118
Joined: Wed Apr 28, 2010 2:54 pm

Re: Row Modifier

Postby Assassin » Wed Dec 04, 2013 4:38 am

1) don't use table files for this.
2) generally, yes. Imzogelmo's Patch Allocation Guide shows the free space blocks, both overall and what's left after known patches:

http://www.angelfire.com/al2/imzogelmo/patches.html

it's 2.5+ years outdated, but still good. i have a newer one i'll post sometime.
User avatar
Assassin
Moderator
Moderator
 
Posts: 1195
Joined: Tue Sep 14, 2004 5:10 am

Re: Row Modifier

Postby Assassin » Thu Dec 12, 2013 8:49 pm

*sees ff6hacking.com post*

oops; i was missing two NOPs. sorry.
User avatar
Assassin
Moderator
Moderator
 
Posts: 1195
Joined: Tue Sep 14, 2004 5:10 am

Re: Row Modifier

Postby Assassin » Fri Dec 27, 2013 3:45 am

Drakkhen didn't tell you to add extra NOPs after the $0D11 call, just after the $339D one. what are you doing?
User avatar
Assassin
Moderator
Moderator
 
Posts: 1195
Joined: Tue Sep 14, 2004 5:10 am


Return to ROM Hacking and Emulation

Who is online

Users browsing this forum: No registered users and 2 guests

cron