Row Modifier
12-06-2013, 02:38 AM
I'm looking to change the Row Modifier as I find it actively discourages use of the Fight command in favour of Magic or other abilities (especially if the enemies are adjusted to hit harder). The idea is to decrease the damage reduction both dealt and taken in the Back Row from 50% to 25%, which as I understand can be apparently be accomplished with the following Hex alterations (graciously provided by Assassin):
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
So I overwrite the bytes from C2/0D11 to C2/0D14 and C2/339D to C2/33A0 (or rather C2/319D to C2/31A0 and C2/0B11 to C2/0B14, as the data has been shifted by any of the myriad patches and adjustments that have been made to the ROM), with a JSR/JSL (I've been trying both) instruction to the formulae listed above, which were created in what appears to be free space (as I said things are moved around somewhat but rows of FF values in close proximity to what is listed as free space in the Assembly documentation would surely give that indication). As of yet I've been unsuccessful, the Target Row Modifier change is negating the Row Modifier entirely as opposed to lowering the damage reduction, and the Attacker Row Modifier change is causing the game to crash. I've also tried implementing this on an untouched US FFIII 1.1 ROM, in which case the Target Row Modifier alteration seemed to work correctly though the Attacker Row Modifier caused the game to crash when a character used the Battle ability.
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
So I overwrite the bytes from C2/0D11 to C2/0D14 and C2/339D to C2/33A0 (or rather C2/319D to C2/31A0 and C2/0B11 to C2/0B14, as the data has been shifted by any of the myriad patches and adjustments that have been made to the ROM), with a JSR/JSL (I've been trying both) instruction to the formulae listed above, which were created in what appears to be free space (as I said things are moved around somewhat but rows of FF values in close proximity to what is listed as free space in the Assembly documentation would surely give that indication). As of yet I've been unsuccessful, the Target Row Modifier change is negating the Row Modifier entirely as opposed to lowering the damage reduction, and the Attacker Row Modifier change is causing the game to crash. I've also tried implementing this on an untouched US FFIII 1.1 ROM, in which case the Target Row Modifier alteration seemed to work correctly though the Attacker Row Modifier caused the game to crash when a character used the Battle ability.
12-07-2013, 03:35 AM
For the English language, there is two versions of the game: 1.0 and 1.1. For the player, they may look identical but their code have smaller differences. My first thought is that the patch is aimed for version 1.0 but you are using version 1.1 instead. My recommendation is to test the patch in an unmodified version 1.0 (not the 1.1 version) to check if it works correctly.
I don't see anything wrong with it at a glance, but it's hard to say since you've applied other patches as well. You may be able to get more concrete answers through a debugger.
http://geigercount.net/crypt/
Pick up the SNES9x debugger and set a breakpoint at one of your jumps. Then just run it step by step and see where it craps out.
http://geigercount.net/crypt/
Pick up the SNES9x debugger and set a breakpoint at one of your jumps. Then just run it step by step and see where it craps out.
12-09-2013, 04:45 AM
I'll have a look for an unmodified 1.0 US ROM and give the debugger a shot, thanks.
12-11-2013, 11:53 AM
Quote:C2/339D: 20 ?? ?? JSR extra2 (damage = damage * 3/4)If this is all you changed at this address, then it would most definitely crash. Try putting two more EA instructions:
C2/33A0: EA NOP
Code:
C2/339D: 20 ?? ?? JSR extra2 (damage = damage * 3/4)
C2/33A0: EA NOP
C2/33A1: EA NOP
C2/33A2: EA NOP
12-24-2013, 08:05 PM
The Attacker Row Modifier routine crashes even with the added NOP instructions. Had it worked, would the additional NOPs apply for the Target Row Modifier routine as well?
Also, I'm using Translhextion, which seems to include a header (512 bytes, the first address being 00BFFE00) when I open the ROM file, though FF3usME designates the ROM as headerless (and expanded), I'm not sure what's up with that.
Thanks for the replies, I've been trying to get this working for awhile now (in my own clumsy, floundering way) and I must admit I find the whole business to be dreadfully confusing.
Also, I'm using Translhextion, which seems to include a header (512 bytes, the first address being 00BFFE00) when I open the ROM file, though FF3usME designates the ROM as headerless (and expanded), I'm not sure what's up with that.
Thanks for the replies, I've been trying to get this working for awhile now (in my own clumsy, floundering way) and I must admit I find the whole business to be dreadfully confusing.
12-25-2013, 07:47 AM
I think your best bet is to set a breakpoint at the jump to your modified code and run it through the debugger to see where and why it's crashing.
Barring that, if you want to send me a patch or something with what you've done so far I can take a look at it (probably not today for obvious reasons, but in the next day or two), though it's generally much more satisfying to figure it out.
Barring that, if you want to send me a patch or something with what you've done so far I can take a look at it (probably not today for obvious reasons, but in the next day or two), though it's generally much more satisfying to figure it out.
Okay, so I designated the breakpoint at C20D011 (the jump to the first or Target Row Modifier Routine) with "Exec", "Read", and "Write" all checked, placed the character in the back row, encountered an enemy, took a hit and crashed the game, producing this line in the read-out:
$C2/0D11 20 B0 64 JSR $64B0 [$C2:64B0] A:0021 X:0010 Y:0000 P:envMXdIzC
C264B0 was of course the location of this routine.
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
The JSR instruction at C20D11 is 20 B0 64 EA EA EA. I removed the header for this, as to align the bytes with the addresses listed in the Disassembly document.
$C2/0D11 20 B0 64 JSR $64B0 [$C2:64B0] A:0021 X:0010 Y:0000 P:envMXdIzC
C264B0 was of course the location of this routine.
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
The JSR instruction at C20D11 is 20 B0 64 EA EA EA. I removed the header for this, as to align the bytes with the addresses listed in the Disassembly document.
For that sort of thing you really only need Exec ticked. Read and Write are more useful for testing RAM addresses.
Nothing in what you pasted looks troublesome, which indicates to me that you may have stopped early. Try again, but keep stepping (Step Into; it should work beyond the RTS) until you come across a mismatched command.
Nothing in what you pasted looks troublesome, which indicates to me that you may have stopped early. Try again, but keep stepping (Step Into; it should work beyond the RTS) until you come across a mismatched command.
12-26-2013, 08:22 PM
Right, so this is the read out of the routine using the Skip Into function:
I must admit that I don't know what I'd be looking for here, would you say this checks out?
Code:
$C2/0D11 20 B0 64 JSR $64B0 [$C2:64B0] A:0020 X:000E Y:0000 P:envMXdIzC
$C2/64B0 08 PHP A:0020 X:000E Y:0000 P:envMXdIzC
$C2/64B1 C2 20 REP #$20 A:0020 X:000E Y:0000 P:envMXdIzC
$C2/64B3 A5 F0 LDA $F0 [$00:00F0] A:0020 X:000E Y:0000 P:envmXdIzC
$C2/64B5 4A LSR A A:0011 X:000E Y:0000 P:envmXdIzC
$C2/64B6 4A LSR A A:0008 X:000E Y:0000 P:envmXdIzC
$C2/64B7 49 FF FF EOR #$FFFF A:0004 X:000E Y:0000 P:envmXdIzc
$C2/64BA 38 SEC A:FFFB X:000E Y:0000 P:eNvmXdIzc
$C2/64BB 65 F0 ADC $F0 [$00:00F0] A:FFFB X:000E Y:0000 P:eNvmXdIzC
$C2/64BD 85 F0 STA $F0 [$00:00F0] A:000D X:000E Y:0000 P:envmXdIzC
$C2/64BF 28 PLP A:000D X:000E Y:0000 P:envmXdIzC
$C2/64C0 60 RTS A:000D X:000E Y:0000 P:envMXdIzC
$C2/0D14 EA NOP A:000D X:000E Y:0000 P:envMXdIzC
$C2/0D15 EA NOP A:000D X:000E Y:0000 P:envMXdIzC
$C2/0D16 EA NOP A:000D X:000E Y:0000 P:envMXdIzC
I must admit that I don't know what I'd be looking for here, would you say this checks out?
« Next Oldest | Next Newest »
Users browsing this thread: 1 Guest(s)