øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=2318.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexd2ff.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&board=8.80e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexd2ff.html.zx%h^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈà•¤<äOKtext/htmlISO-8859-1gzip8:Ö<äÿÿÿÿÿÿÿÿTue, 10 Mar 2020 23:55:08 GMT0ó°° ®0®P®€§²ð®%h^ÿÿÿÿÿÿÿÿT <ä New patch: Anonymous Attack Bug fix

Author Topic: New patch: Anonymous Attack Bug fix  (Read 1190 times)

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
New patch: Anonymous Attack Bug fix
« on: December 12, 2016, 02:51:39 PM »
Hey! You know that part of the game where the party fights Kefka to buy time for Terra to unleash the beast(s) open the Sealed Gate? Well, Kefka can sometimes do a Special attack against you that is messed up. Not only does it always miss, not only does it not even show any kind of animation, but it also displays a blank window at the top instead of its name. This new patch turns the ship right.

:edit: December 12, 2016
Previous version was buggy because of a neglected pointer that needed updating. This has now been fixed.

:edit: December 13, 2016
Previous version overwrite RAM addresses $322E,Y and $3C82,Y, where Y is the index of the party member receiving data. Doesn't break anything, but still preferable that those two are not overwritten because neither one is necessary. This version now does it right.

:edit: December 15, 2016
Fixed a secondary issue that causes Kefka not to step back if Hit misses.
« Last Edit: December 15, 2016, 01:59:02 PM by 13375K31C43R »
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings

assassin

  • Bane of Retards
  • *
  • Posts: 1,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: New patch: Anonymous Attack Bug fix
« Reply #1 on: December 12, 2016, 04:15:11 PM »
i can't find any vanilla usage of those two addresses either -- though your posts briefly made them a possible option before cruelly crushing them. ;)  why not move the "LDA $CF001F,X / STA $322D,Y" after the "SEP #$20"?  i see no disadvantage.

Novalia Spirit

  • Pandora's Masking Tape
  • *
  • Posts: 33
  • Gender: Male
    • View Profile
Re: New patch: Anonymous Attack Bug fix
« Reply #2 on: December 12, 2016, 06:06:27 PM »
Quote from: 13375K31C43R
Keep in mind that the RAM addresses $322E,Y and $3C82,Y, where Y is the index of the party member receiving data, are overwritten by this patch, even though in the base game they don't ever seem to be used.

You made the mistake of looking at the next byte instead of looking at the previous one. $322C,Y holds the attack delay, whereas $3C80,Y contains special properties like Scan immunity.

assassin

  • Bane of Retards
  • *
  • Posts: 1,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: New patch: Anonymous Attack Bug fix
« Reply #3 on: December 12, 2016, 07:28:49 PM »
------- KEPT FOR POSTERITY ONLY.  SKIP AHEAD 2 POSTS. ------------

argh!  dunno how i missed that.  anyway, we're resilient folks here.

in addition to my previous suggestion, let's start the function off like this:

Code: [Select]
PHX
TAX    ; transfer is 16-bit, per destination size
STX $33A8,Y
JSR $2D71   ; now clobbers top half of A, but we don't care with upcoming TXA
LDA $CF37C0,X
STA $3C81,Y
REP #$20

EDIT: goddamnit!  "STX $33A8,Y" is not a valid instruction.  good thing i made another post:
« Last Edit: December 12, 2016, 10:16:31 PM by assassin »

assassin

  • Bane of Retards
  • *
  • Posts: 1,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: New patch: Anonymous Attack Bug fix
« Reply #4 on: December 12, 2016, 09:54:30 PM »
------- KEPT FOR POSTERITY ONLY.  SKIP TO NEXT POST. ------------

another way (includes both remedies):
Code: [Select]
REP #$20
STA $33A8,Y

PHX
pha
ASL A
ASL A
ASL A
ASL A
ASL A
TAX
SEP #$20

LDA $CF001F,X
STA $322D,Y

plx
LDA $CF37C0,X
STA $3C81,Y
PLX
JMP $2D71  ; v1.0 or v1.1

it changes more than my previous post's proposal (so definitely needs scrutiny), but comes out 1 byte ahead.  you can always keep the "RTS" at the end, in case anything jumps there.

and if you wanna be a wiseass and skip that last PLX, JMP $2D72 instead.  but probably not worth the cheapness.

EDIT: crap, that clobbers the A value C2/2D71 expects.  back to the drawing board...
« Last Edit: December 12, 2016, 10:18:38 PM by assassin »

assassin

  • Bane of Retards
  • *
  • Posts: 1,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: New patch: Anonymous Attack Bug fix
« Reply #5 on: December 12, 2016, 10:14:36 PM »
third time's the charm?

Code: [Select]
REP #$20
STA $33A8,Y

PHX

JSR $2D71  ; v1.0 or v1.1
           ; preserves full A if we enter it in 16-bit mode

pha
ASL A
ASL A
ASL A
ASL A
ASL A
TAX
SEP #$20

LDA $CF001F,X
STA $322D,Y

plx
LDA $CF37C0,X
STA $3C81,Y
PLX
RTS

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: New patch: Anonymous Attack Bug fix
« Reply #6 on: December 13, 2016, 12:58:32 AM »
I despise your first two alternatives, but as for the third... I love it! :childish:
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings

Novalia Spirit

  • Pandora's Masking Tape
  • *
  • Posts: 33
  • Gender: Male
    • View Profile
Re: New patch: Anonymous Attack Bug fix
« Reply #7 on: December 13, 2016, 02:43:35 AM »
I noticed a problem with your previous version that may or may not still be present in the current version: whenever Kefka's special attack missed, he would keep his arms raised and wouldn't go back to his initial position.

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: New patch: Anonymous Attack Bug fix
« Reply #8 on: December 13, 2016, 11:27:35 AM »
That's...interesting, considering that without my patch, Kefka's attack always misses and he always goes back.

:edit:
I just did a test using the Phantom esper and Kefka missed but then went back. So it seems the problem is fixed, either by the update to my patch or by some other patch. Probably the update.
« Last Edit: December 13, 2016, 11:56:55 AM by 13375K31C43R »
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings

Novalia Spirit

  • Pandora's Masking Tape
  • *
  • Posts: 33
  • Gender: Male
    • View Profile
Re: New patch: Anonymous Attack Bug fix
« Reply #9 on: December 13, 2016, 04:14:36 PM »
Hm, looks like Clear status won't trigger the bug, but evasion does, and only with the fix applied. However, I've managed to replicate this both with and without the patch applied by getting the attack blocked by Golem, so it's possible the bug is present in the vanilla game, but that the requirements are just not met without the patch.

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: New patch: Anonymous Attack Bug fix
« Reply #10 on: December 13, 2016, 05:22:17 PM »
If you can replicate this bug without the patch, then this is really a separate issue. I'll probably end up fixing it at some point, but right now I have an exam to study for.
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: New patch: Anonymous Attack Bug fix
« Reply #11 on: December 15, 2016, 01:59:45 PM »
OK, I've fixed the issue and I decided to add the fix to this patch.
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings