Users browsing this thread: 1 Guest(s)
Row Modifier

#1
Posts: 14
Threads: 4
Thanks Received: 0
Thanks Given: 4
Joined: Dec 2013
Reputation: 0
Status
None
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.
  Find
Quote  

#2
Posts: 149
Threads: 21
Thanks Received: 40
Thanks Given: 3
Joined: Dec 2013
Reputation: 9
Status
Auto-life
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.
  Find
Quote  
[-] The following 1 user says Thank You to HatZen08 for this post:
  • Rainflush (12-24-2013)

#3
Posts: 290
Threads: 3
Thanks Received: 40
Thanks Given: 1
Joined: Apr 2012
Reputation: 9
Status
None
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.


GET A SILK BAG FROM THE GRAVEYARD DUCK TO LIVE LONGER.

Brave New World
  Find
Quote  
[-] The following 1 user says Thank You to Synchysi for this post:
  • Rainflush (12-24-2013)

#4
Posts: 14
Threads: 4
Thanks Received: 0
Thanks Given: 4
Joined: Dec 2013
Reputation: 0
Status
None
I'll have a look for an unmodified 1.0 US ROM and give the debugger a shot, thanks.
  Find
Quote  

#5
Posts: 52
Threads: 5
Thanks Received: 24
Thanks Given: 0
Joined: Jun 2010
Reputation: 6
Status
None
Quote:C2/339D: 20 ?? ?? JSR extra2 (damage = damage * 3/4)
C2/33A0: EA NOP
If this is all you changed at this address, then it would most definitely crash. Try putting two more EA instructions:

Code:
C2/339D: 20 ?? ?? JSR extra2 (damage = damage * 3/4)
C2/33A0: EA NOP
C2/33A1: EA NOP
C2/33A2: EA NOP
Quote  
[-] The following 1 user says Thank You to Drakkhen for this post:
  • Rainflush (12-24-2013)

#6
Posts: 14
Threads: 4
Thanks Received: 0
Thanks Given: 4
Joined: Dec 2013
Reputation: 0
Status
None
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.

Finger
  Find
Quote  

#7
Posts: 290
Threads: 3
Thanks Received: 40
Thanks Given: 1
Joined: Apr 2012
Reputation: 9
Status
None
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.


GET A SILK BAG FROM THE GRAVEYARD DUCK TO LIVE LONGER.

Brave New World
  Find
Quote  

#8
Posts: 14
Threads: 4
Thanks Received: 0
Thanks Given: 4
Joined: Dec 2013
Reputation: 0
Status
None
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.
  Find
Quote  

#9
Posts: 290
Threads: 3
Thanks Received: 40
Thanks Given: 1
Joined: Apr 2012
Reputation: 9
Status
None
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.


GET A SILK BAG FROM THE GRAVEYARD DUCK TO LIVE LONGER.

Brave New World
  Find
Quote  
[-] The following 1 user says Thank You to Synchysi for this post:
  • Rainflush (12-26-2013)

#10
Posts: 14
Threads: 4
Thanks Received: 0
Thanks Given: 4
Joined: Dec 2013
Reputation: 0
Status
None
Right, so this is the read out of the routine using the Skip Into function:

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?
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite