øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=2230.msg27041e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexa759.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=2230.60e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexa759.html.zxû*h^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ0PdOKtext/htmlISO-8859-1gzip0|ÖÿÿÿÿÿÿÿÿWed, 11 Mar 2020 00:20:36 GMT0ó°° ®0®P®€§²ð®û*h^ÿÿÿÿÿÿÿÿ×& C. V. Bug-Fix Comp and C. V. Script Fix (for SNES NA 1.0 version)

Author Topic: C. V. Bug-Fix Comp and C. V. Script Fix (for SNES NA 1.0 version)  (Read 15922 times)

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: C. V. Bug-Fix Comp and C. V. Script Fix
« Reply #60 on: February 04, 2017, 03:21:29 PM »
I found the problem. Here's the subroutine added by Stuck in a Pose:

Code: [Select]
PHA  ; preserve A
LDA $087F,Y  ; direction we're facing
CMP #$01  ; right?
BNE check_left  ; branch if not
LDA #$47
BRA sprite_offset

check_left:
CMP #$03  ; left?
BNE check_forward  ; branch if not
LDA #$07
BRA sprite_offset

check_forward:
CMP #$00  ; forward?
BNE backward_sprite  ; branch if not
LDA #$04
BRA sprite_offset

backward_sprite:
LDA #$01

sprite_offset:
STA $0877,Y  ; save neutral standing sprite
PLA  ; restore A
LDY $0803  ; LDY replaced by subroutine call
RTS

This subroutine is supposed to keep the player sprite in a standing pose when the player has control, but it requires a certain value in Y, which might have changed by now. The way I found to fix this was to simply move the LDY $0803 from the end of the subroutine to the beginning.
"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: C. V. Bug-Fix Comp and C. V. Script Fix
« Reply #61 on: February 04, 2017, 04:30:31 PM »
Ah, it would seem that all those LDA index-Y commands need the new Y, not whatever garbage was in there before.
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: C. V. Bug-Fix Comp and C. V. Script Fix
« Reply #62 on: February 04, 2017, 05:38:59 PM »
nice.  i'm clueless about Bank C0, but that still should have dawned on me from staring right at the code.  "how could a write to a single, documented variable hose the game?"  :wtf:

also, i think the new function could benefit from a data table.  it'd save 20 bytes if we use the starts of the tables in the patch Readme, or 18 if we make our own 4-byte table.  the feasibility of the former depends on what "facing forward" and "facing backward" mean compared to facing "up" and "down".

C. V. Reynolds

  • Tunnel Armor
  • *
  • Posts: 153
  • RATED TEM OUTTA TEM.
    • View Profile
    • cvreynolds.net
Re: C. V. Bug-Fix Comp and C. V. Script Fix
« Reply #63 on: February 07, 2017, 11:48:38 PM »
Hoi. :3

Updated:

Dead Hare (Leet Sketcher) (now uses no free space)
Off Death Row (Leet Sketcher) (now uses no free space)
Item/Magic Counter (Leet Sketcher) (for compatibility with new Dead Hare)

I know I didn't immediately need to update the patch for these, but this will allow for better debugging. Also, I won't have to remember to do it later this way. ;P
I'm the former Hollywood Narrator from GameFAQs.

I'm a published novelist. My novels "Universe Eleven Series - Blue Ruin" Part 1, Part 2, and Part 3 are for sale on Amazon (check my website) in print and ebook formats.

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: C. V. Bug-Fix Comp and C. V. Script Fix
« Reply #64 on: February 08, 2017, 02:13:32 AM »
You're not re-adding Stuck in a Pose, even after my glorious fix?
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings

C. V. Reynolds

  • Tunnel Armor
  • *
  • Posts: 153
  • RATED TEM OUTTA TEM.
    • View Profile
    • cvreynolds.net
Re: C. V. Bug-Fix Comp and C. V. Script Fix
« Reply #65 on: February 08, 2017, 07:15:24 AM »
Sorry. I didn't see a new patch for Stuck in a Pose. Where can I get it? :3
I'm the former Hollywood Narrator from GameFAQs.

I'm a published novelist. My novels "Universe Eleven Series - Blue Ruin" Part 1, Part 2, and Part 3 are for sale on Amazon (check my website) in print and ebook formats.

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: C. V. Bug-Fix Comp and C. V. Script Fix
« Reply #66 on: February 08, 2017, 08:17:07 AM »
I've already posted the fix in this thread. If you really want me to make a fix patch for it, I can do that.
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings

C. V. Reynolds

  • Tunnel Armor
  • *
  • Posts: 153
  • RATED TEM OUTTA TEM.
    • View Profile
    • cvreynolds.net
Re: C. V. Bug-Fix Comp and C. V. Script Fix
« Reply #67 on: February 08, 2017, 09:37:30 AM »
I saw the fix you posted before, and I don't doubt that it is GLORIOUS, but... I can't read or write assembly. :sad: I'd have probably included some of Assassin's more recent fixes if I could.

So a patch file would be wonderful, yes. :3
I'm the former Hollywood Narrator from GameFAQs.

I'm a published novelist. My novels "Universe Eleven Series - Blue Ruin" Part 1, Part 2, and Part 3 are for sale on Amazon (check my website) in print and ebook formats.

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: C. V. Bug-Fix Comp and C. V. Script Fix
« Reply #68 on: February 08, 2017, 10:01:02 AM »
Here you go. This is the only patch you need to apply.
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings

C. V. Reynolds

  • Tunnel Armor
  • *
  • Posts: 153
  • RATED TEM OUTTA TEM.
    • View Profile
    • cvreynolds.net
Re: C. V. Bug-Fix Comp and C. V. Script Fix
« Reply #69 on: February 08, 2017, 02:31:01 PM »
Thank you. :childish:

Is it for headered or non-headered though? Don't want to blow everything up again. :3
I'm the former Hollywood Narrator from GameFAQs.

I'm a published novelist. My novels "Universe Eleven Series - Blue Ruin" Part 1, Part 2, and Part 3 are for sale on Amazon (check my website) in print and ebook formats.

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: C. V. Bug-Fix Comp and C. V. Script Fix
« Reply #70 on: February 09, 2017, 01:53:27 AM »
Headered.
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings

C. V. Reynolds

  • Tunnel Armor
  • *
  • Posts: 153
  • RATED TEM OUTTA TEM.
    • View Profile
    • cvreynolds.net
Re: C. V. Bug-Fix Comp and C. V. Script Fix
« Reply #71 on: February 11, 2017, 12:02:32 PM »
Hoi. :3

Re-added:

Stuck in a Pose (SilentEnigma) (newly edited by Leet Sketcher to remove the bug)

Updated:

Menu Malarky (Leet Sketcher) (new version that properly fixes the skipping Celes and/or other stuff in South Figaro thing)
I'm the former Hollywood Narrator from GameFAQs.

I'm a published novelist. My novels "Universe Eleven Series - Blue Ruin" Part 1, Part 2, and Part 3 are for sale on Amazon (check my website) in print and ebook formats.

SedrynTyros

  • Wing Raptor
  • *
  • Posts: 6
    • View Profile
Re: C. V. Bug-Fix Comp and C. V. Script Fix
« Reply #72 on: February 11, 2017, 02:46:15 PM »
Hey, I decided to try applying Yahoo's Titlescreen Mod after applying both the Bug Fix and Script patches:

http://www.romhacking.net/hacks/600/

It seems to work okay.  I played through the opening sequence up until the point when TERRA gets the crown removed and enters the mines and I didn't see any problems so far.  Is there any reason that anyone knows of why this patch could cause problems later on?

silentenigma

  • Ymir
  • *
  • Posts: 15
    • View Profile
    • SilentEnigma's Cool Things
Re: C. V. Bug-Fix Comp and C. V. Script Fix
« Reply #73 on: February 14, 2017, 10:24:29 AM »
Hi folks. Thanks C.V. Reynolds for giving my patch a whirl, thanks to Leet Sketcher for finding a solution, and thanks to seibaby at ff6hacking for notifying me about this.

Ah, it would seem that all those LDA index-Y commands need the new Y, not whatever garbage was in there before.

I must not have realized that $0803 (from the instruction I delayed) holds "the most up-to-date offset for where to find the current direction". I do want to be a bit more confident that this is always the case, though I don't know if I'll have time right now to look very deep. So unless Leet Sketcher already did that digging to arrive at his solution, the confidence may just have to come over time through testing.

In the meantime, this weekend I will be posting updates to the patch (here and across the pond) to include Leet Sketcher's fix.

also, i think the new function could benefit from a data table.  it'd save 20 bytes if we use the starts of the tables in the patch Readme, or 18 if we make our own 4-byte table.

I agree, and yes, the table in the Readme (every fourth byte starting with C0/581D) can be used. I will make that a part of the update.

wow, walking toward him? even this one is due to "stuck in a pose" patch?
Ouch, have I been making headaches all over the place with this thing? Sorry about that.

I'll post again soon.
« Last Edit: February 15, 2017, 06:23:28 AM by silentenigma »

silentenigma

  • Ymir
  • *
  • Posts: 15
    • View Profile
    • SilentEnigma's Cool Things
Re: C. V. Bug-Fix Comp and C. V. Script Fix
« Reply #74 on: February 18, 2017, 08:37:40 PM »
Stuck-in-a-Pose has now been updated to address the bug. C.V., if you are interested for your project, you can find it here.
The new version uses 21 fewer bytes of free space than the original (I found a better candidate for the data table than what was in the readme.) Thanks to Assassin for the suggestion to optimize.

Again, 100% confidence will come with time, but I do feel optimistic that we'll find Leet Sketcher's solution to be robust.

C.V., I look forward to giving your megapatch a spin soon! (and...competing with it  :laugh: ...sort of... )