øAslickproductions.org/forum/index.php?PHPSESSID=so1iojs5ocdn0o2vf0tti7fbu6&topic=2210.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index1676.htmlslickproductions.org/forum/index.php?PHPSESSID=so1iojs5ocdn0o2vf0tti7fbu6&board=8.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index1676.html.zxÆôg^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ ­‚æOKtext/htmlISO-8859-1gzip@øÕ‚æÿÿÿÿÿÿÿÿTue, 10 Mar 2020 20:29:17 GMT0ó°° ®0®P®€§²ð®Åôg^ÿÿÿÿÿÿÿÿ'"‚æ New patch: Hasty T-Rex Glitch fix

Author Topic: New patch: Hasty T-Rex Glitch fix  (Read 1342 times)

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
New patch: Hasty T-Rex Glitch fix
« on: April 24, 2016, 02:46:04 PM »
Hi everyone! This will probably be my last patch for a little while, I've been running myself ragged over the last 30 hours or so. I think I've finally found the right fix for this graphical glitch that I've been dealing with for a while now. It happens when you face Tyrannosaur in the Colosseum, and Haste or Slow is cast on Tyrannosaur; he'll shift backwards during the casting of the spell. I've discovered that the problem is down to the midpoint calculation for the enemy's sprite on the battlefield; this patch makes a correction to the algorithm. I've done a bit of testing to make sure this patch doesn't mess anything up with any other enemies, and it's so far so good; however, I'll be more comfortable the more thorough the testing gets, so for now I've designated this as a beta release.

:edit: April 26, 2016
I think I'll go ahead and remove the beta designation. If anyone finds a problem, don't hesitate to let me know.

:edit: May 31, 2016
I've implemented a new fix that doesn't have the problems described in the replies below. Thank you, Assassin. :wink:

:edit: January 30, 2018
Added GBA port!
« Last Edit: February 20, 2018, 11:19:01 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

Xenovant

  • Tunnel Armor
  • *
  • Posts: 154
  • (ಠ_ಠ)
    • View Profile
Re: New patch: Hasty T-Rex Glitch fix
« Reply #1 on: May 29, 2016, 09:36:08 AM »
I have found a bug with pincer attacks. I don't know if it will happen in any pincer attack, or just some of them.


assassin

  • Bane of Retards
  • *
  • Posts: 1,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: New patch: Hasty T-Rex Glitch fix
« Reply #2 on: May 29, 2016, 04:12:10 PM »
yeah, the code change seems like it'd affect way too much.  a rather broad change to deal with a couple spells in a single venue.  perhaps give my Function C1/215F comments a look here:
http://web.archive.org/web/20140624085359/http://Home.comcast.net/~assassin17/c1bank.txt

what does a raw bitmap of the Tyranosaur look like anyway?  Haste outside of the Colosseum appears alright in vanilla.
« Last Edit: May 29, 2016, 04:56:57 PM by assassin »

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: New patch: Hasty T-Rex Glitch fix
« Reply #3 on: May 30, 2016, 10:19:04 AM »
The bitmap information for Tyrannosaur in the Colosseum is located at D2/A914 (eight bytes long). I've already tried just setting the LSB in one of the bytes, which would've fixed the problem, but it also shifted parts of the image like the feet.
"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: Hasty T-Rex Glitch fix
« Reply #4 on: May 30, 2016, 01:54:29 PM »
the game seems to handle odd-tile-width enemies just fine outside the Colosseum, perhaps because their starting X-coordinate is always on a tile boundary.  so i'd leave C1/215F alone, as it affects too many things that don't need changing.

is your concern with the Colosseum horizontal centering formula: updated X coord = ( (128 - width) / 2 ) + 24 ,
allowing for a mid-tile X-coordinate when the tile width is odd?

in that case, i'd go right at the Colosseum-specific code.  change C1/15C1 to:
Code: [Select]
LDA $812F    (adjusted tile width of enemy from slot #0)
INC
LSR
ASL          (round up to even #)
ASL
ASL
ASL
STA $10      (store width)

i'm sure you can find 3 bytes somewhere. ;)  maybe the C1/15F6 segment can be shrunk by starting with B0h?

anyway, it might still be worth dissecting these spells' animation scripts to see what it is about certain coordinates that make them choke.

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: New patch: Hasty T-Rex Glitch fix
« Reply #5 on: May 30, 2016, 10:06:41 PM »
I've only been working off of Imzogelmo's disassembly up to now, so I never knew any of the code to be "Colosseum-specific", as you seem to have figured out. I'll take a look at it.
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings

Imzogelmo

  • Ogopogo Aficianado
  • *
  • Posts: 241
  • Gender: Male
  • Ask me about my other job.
    • View Profile
    • NEPROMR
Re: New patch: Hasty T-Rex Glitch fix
« Reply #6 on: May 31, 2016, 07:04:00 PM »
That old thing? I bet every one of us has a better version of the C1 bank by now. That old thing is just one or two steps away from the raw disassembly from DisPel.

Also, I think I have a way we could recoup several bytes of RAM (not contiguous, unfortunately). If anyone can come up with a way to get hundreds of contiguous bytes without sacrificing functionality, please let me know. This thing could be broke wide open. :)
5/31/16 - I have an assembly of the battle portion of C2, relocated to the F0 bank, which has both vanilla and patch code in my dropbox. I'll be updating it with additional patches as I have time. I will *not* be releasing it publicly, but ask me for the link and I'll share.

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: New patch: Hasty T-Rex Glitch fix
« Reply #7 on: May 31, 2016, 07:06:27 PM »
Yeah, but yours was the only one I could find until Assassin showed me his, and his is only accessible via the Wayback Machine.
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings

Imzogelmo

  • Ogopogo Aficianado
  • *
  • Posts: 241
  • Gender: Male
  • Ask me about my other job.
    • View Profile
    • NEPROMR
Re: New patch: Hasty T-Rex Glitch fix
« Reply #8 on: May 31, 2016, 07:07:47 PM »
Well, admittedly, I put mine out there because there was nothing else out at the time, and I was hoping to get folks talking and figuring out more stuff.
5/31/16 - I have an assembly of the battle portion of C2, relocated to the F0 bank, which has both vanilla and patch code in my dropbox. I'll be updating it with additional patches as I have time. I will *not* be releasing it publicly, but ask me for the link and I'll share.

assassin

  • Bane of Retards
  • *
  • Posts: 1,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: New patch: Hasty T-Rex Glitch fix
« Reply #9 on: May 31, 2016, 07:40:18 PM »
Yeah, but yours was the only one I could find until Assassin showed me his, and his is only accessible via the Wayback Machine.

http://slickproductions.org/docs.php?id=FF6

:P

but no disagreement on mine.  Slick's is probably the best of the three.  it includes a majority of mine, and it was my understanding that it had most or all of Imzogelmo's.

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: New patch: Hasty T-Rex Glitch fix
« Reply #10 on: May 31, 2016, 07:43:27 PM »
Oh, right. Sorry, that is actually the one I've been using, as a matter of fact. It just includes so little explanation that it's hard to find anything in the code.

I don't mean to take anything away from you, sir.
"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: Hasty T-Rex Glitch fix
« Reply #11 on: February 20, 2018, 11:19:13 PM »
:bump: GBA port!
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings