Aslickproductions.org/forum/index.php?PHPSESSID=1vtpnn80bl2gqhi3d36gjh8g97&topic=1704.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index05bd.htmlslickproductions.org/forum/index.php?board=21.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index05bd.html.zxtg^{OKtext/htmlISO-8859-1gzip8:{Tue, 10 Mar 2020 21:06:20 GMT0 0Ptg^{ FF4 Long Range Bit Fix

Author Topic: FF4 Long Range Bit Fix  (Read 2427 times)

Dragoon ZERO

  • Mist Dragon
  • *
  • Posts: 4
    • View Profile
FF4 Long Range Bit Fix
« on: February 12, 2012, 12:56:43 PM »
Archive

ReadMe:
Code: [Select]
SNES Final Fantasy II/IV Long Range Fix
by Dragoon ZERO 2012/2/12

Thanks to:
The community at Slick Productions/Forum Slickness (slickproductions.org)
Geiger's Snes9x debugger (geigercount.net/crypt/)
FuSoYa's Lunar Address and Lunar IPS (fusoya.eludevisibility.org/)

All the SNES versions of Final Fantasy II/IV have a bug where the long range
(or ignore row) bit is set when a charcter equips a long range weapon, but it
is not removed when switching to a weapon that is not long range.

These two patches correct this behavior in all versions of the game. Just
make sure you use the right patch for your version. Both patches are for
UNHEADERED ROMs.

lr_bit_fix_10_J_J2E.ips is for:
Final Fantasy II (U) (V1.0) [!]
Final Fantasy IV (J)
Final Fantasy IV (j2e translation)

lr_bit_fix_11_ET.ips is for:
Final Fantasy II (U) (V1.1)
Final Fantasy IV - Easy Type (J)

I have tested these fixes in both US versions and have not encountered any
problems. If you do notice any instances where the fix is not working (or if
it's screwing something else up) send me a PM at the RHDN forums:
http://www.romhacking.net/forum/index.php

$03/9D90 AD 77 39    LDA $3977  [$7E:3977]   A:001E X:0000 Y:002E P:envMxdIzc
$03/9D93 29 20       AND #$20                A:0080 X:0000 Y:002E P:eNvMxdIzc
$03/9D95 D0 07       BNE $07    [$9D9E]      A:0000 X:0000 Y:002E P:envMxdIZc
$03/9D97 AD 9C 28    LDA $289C  [$7E:289C]   A:0000 X:0000 Y:002E P:envMxdIZc
$03/9D9A 29 20       AND #$20                A:00FF X:0000 Y:002E P:eNvMxdIzc
$03/9D9C F0 09       BEQ $09    [$9DA7]      A:0020 X:0000 Y:002E P:envMxdIzc
$03/9D9E A0 01 00    LDY #$0001              A:0020 X:0000 Y:002E P:envMxdIzc
$03/9DA1 B1 80       LDA ($80),y[$7E:2001]   A:0020 X:0000 Y:0001 P:envMxdIzc
$03/9DA3 09 20       ORA #$20                A:0000 X:0000 Y:0001 P:envMxdIZc
$03/9DA5 91 80       STA ($80),y[$7E:2001]   A:0020 X:0000 Y:0001 P:envMxdIzc
$03/9DA7 60          RTS                     A:0020 X:0000 Y:0001 P:envMxdIzc

A0 01 00    LDY #$0001
B1 80       LDA ($80),y
29 DF       AND #$DF
91 80       STA ($80),y
AD 9C 28    LDA $289C
29 20       AND #$20
F0 06       BEQ $06
B1 80       LDA ($80),y
09 20       ORA #$20
91 80       STA ($80),y
60          RTS

$19D86 in unheadered US 1.0, J, and j2e translation
$19D90 in unheadered US 1.1 and Easy Type
A0 01 00 B1 80 29 DF 91 80 AD 9C 28 29 20 F0 06 B1 80 09 20 91 80 60

Deathlike2

  • FF4 R&D Master
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: FF4 Long Range Bit Fix
« Reply #1 on: February 12, 2012, 05:19:54 PM »
Has this been tested against Bows and Arrows (they operate slightly differently when I did the long range bit testing)?

The other thing that would be a special case is Edge. Putting the boomerang on the left hand has no effect, whereas putting it on the right hand does... AFAIK.
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

Dragoon ZERO

  • Mist Dragon
  • *
  • Posts: 4
    • View Profile
Re: FF4 Long Range Bit Fix
« Reply #2 on: February 12, 2012, 08:47:00 PM »
I think I remember reading something you posted about bows and arrows having their own buggery to deal with and this doesn't change their behavior at all. I also just checked Edge and it's just as you said, whether or not he ignores row is only checked against his right hand.

The only thing these patches do is unset the bit when a long range weapon is not equipped.

Deathlike2

  • FF4 R&D Master
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: FF4 Long Range Bit Fix
« Reply #3 on: February 12, 2012, 09:00:38 PM »
Well, the bit gets set during both instances... that's the reason why I mentioned it. They don't get unset in either circumstance....

 :edit:

Fixing the Bow+Arrow circumstance might be complex. Bonuses and properties are set when both bow+arrow are equipped. If either component is removed, these bonuses/properties are removed (except for the long range bit and maybe others, like the Lightning Arrow).

For the ambidextrous situation, it is arguably far more complex... I think it's supposed to be handled like the bow+arrow situation, except you just need to add back the properties of the lone weapon on either hand (bow or arrow solo = 1 attack power).
« Last Edit: February 12, 2012, 09:11:38 PM by Deathlike2 »
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3