øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1975.90e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index58b5.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&board=17.60e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index58b5.html.zx�9h^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ °V¡OKtext/htmlISO-8859-1gzip@øÕ¡ÿÿÿÿÿÿÿÿWed, 11 Mar 2020 01:22:45 GMT0ó°° ®0®P®€§²ð®Œ9h^ÿÿÿÿÿÿÿÿ )¡ FFV patches (and compatibility with each other)

Author Topic: FFV patches (and compatibility with each other)  (Read 31722 times)

noisecross

  • FF5 Hacker
  • *
  • Posts: 146
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #90 on: December 18, 2014, 08:55:05 AM »
Probably, forking the code to another bank and writing new functions for:
- Setting a 16 bits M to 128
- Testing if a 32 bits number is greater than 9999

Be careful in where are you locating the new code at it may overlap with another patches.
I share with you a handmade tool in Reply #74 which can help you in that. I used it to found (in a visual way) the differences between the japanese version of the game and the RPGe one.
« Last Edit: December 22, 2014, 01:34:43 AM by noisecross »

Digitsie

  • Mom Bomb
  • *
  • Posts: 105
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #91 on: December 18, 2014, 09:11:35 AM »
Ugh, that is definitely way, way beyond my current capabilities.

I need to break out my old assembly book out of the basement from 20 years ago, if I even still have it (last time I saw it, it was my second year in college)

I'm just going to double-check all the patches and mark off the bytes altered (especially on a compiled one.)

I take it we need to be able to identify unused areas or redundant areas of the roms first?

noisecross

  • FF5 Hacker
  • *
  • Posts: 146
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #92 on: December 18, 2014, 09:20:15 AM »
Don't worry. We can help you in that.
Anyway if you want to try, this is a good refference http://wiki.superfamicom.org/snes/show/65816+Reference

There is a lot of fun (and frustration) with assembly.

There are unused areas in few banks... I'd recomend you using D0 bank just after the patch H2 I am sharing in the post "FF5 Bugs & Glitches" in Reply #19.

Digitsie

  • Mom Bomb
  • *
  • Posts: 105
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #93 on: December 18, 2014, 09:27:52 AM »
Attached:

Rune + GP + Knife fix

Time to make sure all my patches I have are headerless and then start mapping.
« Last Edit: December 21, 2014, 09:56:37 AM by Digitsie »

noisecross

  • FF5 Hacker
  • *
  • Posts: 146
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #94 on: December 18, 2014, 10:42:14 AM »
First attemp to avoid overflow with a 32 bit comparator:

Code: [Select]
C2/9419: A6 2E        LDX $2E     (A is 8 bit here)
C2/941B: E0 0F 27     CPX #$270F
C2/941E: 90 03        BCC $9423
C2/9420: A2 0F 27     LDX #$270F  Max Damage = 9999
C2/9423: 8E 69 7B     STX $7B69   $7B69 = Final Damage

to

Code: [Select]
C2/9419: 22 XX XX D0  JSL $D0XXXX
C2/941D: 80 04        BRA $9423
C2/941F: EA EA EA EA  NOP NOP NOP NOP
C2/9423: 8E 69 7B     STX $7B69   $7B69 = Final Damage

------------------------------------------
32 bit ($2E > 9999) comparator
------------------------------------------
D0/xxxx: A6 30        LDX $30
D0/xxxx: D0 07        BNE $xxxx
D0/xxxx: A6 2E        LDX $2E
D0/xxxx: E0 0F 27     CPX #$270F
D0/xxxx: 90 03        BCC $xxxx   (jump to no)
D0/xxxx: A2 0F 27     LDX #$270F  (Max Damage = 9999)
D0/xxxx: 6B           RTL

In short:

Code: [Select]
C2/9419, 5C Lo Hi D0 80 04 EA EA EA EA
D0/HiLo, A6 30 D0 07 A6 2E E0 0F 27 90 03 A2 0F 27 6B
« Last Edit: December 19, 2014, 03:29:51 AM by noisecross »

Jorgur

  • Moderator
  • *
  • Posts: 437
  • Gender: Male
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #95 on: December 18, 2014, 11:42:01 AM »
I still feel like thief is underrated compared to IV and VI, and it seems odd that they get lowered so drastically for V. I wouldn't really want to play it on its own, as when I steal, I then just switch to fight the rest of the way (like with Locke)
Let me first point out that Edge is a Ninja, not a Thief.

Thieves in FF5 are actually very useful:
- They benefit greatly from the Brawl ability (I do this all the time)
- A high Agility stat means they will act sooner in battle, so they are very likely to get their turn before the monsters
- Full Moon and Rising Sun are back row weapons, which is great defense
- Innate Caution means you will never be attacked from behind
- Steal with Thief Glove
- Always dash and see hidden passages

They have so many good points it only seems fair to give them weak attacks. If you want a powerful Thief you can use the Brawl ability (double damage) and Full Moon/Rising Sun from the back row.
« Last Edit: December 18, 2014, 12:02:47 PM by Jorgur »

Digitsie

  • Mom Bomb
  • *
  • Posts: 105
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #96 on: December 18, 2014, 02:19:58 PM »
You've convinced me. Okay, rune fix, and my compilation so far is good, except for the original icons, but that only re-alters the translations' icons, so not a big deal. Doesn't appear to clash anywhere.

So far:
The translation
Spooniest's addendum
The Fractional M fix (goblin + knife + rune)
Mute
Blue Mage
Chicken Berserk
Galuf Mimic Sprite set
Kiss of Blessing
Monster Capture
Observe
Original Icons
Power Drink
Un-Berserker

Of those, only Original Icons impacts other patches, and only because the translations altered icons, if I'm not mistakened.

noisecross

  • FF5 Hacker
  • *
  • Posts: 146
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #97 on: December 18, 2014, 02:55:47 PM »
Yes. Most of the text graphics are modified by the translation (changing japanese characters into westerns).
The Original Icons patch re-modify (overlapping the translation) some icons which RPGe changed from the japanese version to take back the original ones.

Digitsie

  • Mom Bomb
  • *
  • Posts: 105
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #98 on: December 18, 2014, 04:32:32 PM »
Yeah. The total patch is a bit bigger than I can attach, or I'd offer it up here.

I'll see if I can send it.

assassin

  • Bane of Retards
  • *
  • Posts: 1,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: FFV patches (and compatibility with each other)
« Reply #99 on: December 18, 2014, 04:34:35 PM »
Code: [Select]
------------------------------------------
32 bit ($2E > 9999) comparator
------------------------------------------
D0/xxxx: A6 2F        LDX $2F
D0/xxxx: D0 07        BNE $xxxx
D0/xxxx: A6 2E        LDX $2E
D0/xxxx: E0 0F 27     CPX #$270F
D0/xxxx: 90 03        BCC $xxxx   (jump to no)
D0/xxxx: A2 0F 27     LDX #$270F  (Max Damage = 9999)
D0/xxxx: 6B           RTL

that first line should be: LDX $30

noisecross

  • FF5 Hacker
  • *
  • Posts: 146
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #100 on: December 19, 2014, 03:31:23 AM »
Yeah. The total patch is a bit bigger than I can attach, or I'd offer it up here.

Zip it and it should have a size under 100 kB, isn't it?

that first line should be: LDX $30

Right! Thanks a lot assassin.
I have fixed it in the code and in the hex.

noisecross

  • FF5 Hacker
  • *
  • Posts: 146
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #101 on: December 19, 2014, 04:57:06 AM »
Ok, here we go with a big one...

To fix Minimum M plus damage overflow we have to edit some code in the subs C2/8A05 and C2/940A. That changes overlap with the ones we did to C2/940A to avoid the damage overflow.

Code: [Select]
------------------------------------------
C2/8A05 to fix Minimum M
------------------------------------------
C2/8A11: E6 52        INC $52      (Minimum M = 1)
C2/8A13: A5 39        LDA $39

to

Code: [Select]
C2/8A11: 22 L2 Hi D0  JSL $D0HiL2
[...]
D0/HiL2: A9 80        LDA #$80     (Minimum M = 128)
D0/xxxx: 85 52        STA $52
D0/xxxx: A5 39        LDA $39
D0/xxxx: 6B           RTL

The HiL2 address is just after the new 32 bit comparator sub. That means HiL2 = HiLo + 0F

The sub C2/940A must be rewritten in order of facing both minimum M and overflow fixes

Code: [Select]
------------------------------------------
C2/940A - Edit to fix overflow + Minimum M
------------------------------------------
C2/940A: 85 2A        STA $2A
C2/940C: A5 52        LDA $52
C2/940E: D0 04        BNE $9414   (<--- First change)
C2/9410: A9 80 00     LDA #$0080  (Minimum M = 128)
C2/9413: EA           NOP
C2/9414: 85 2C        STA $2C
C2/9416: 7B           TDC
C2/9417: E2 20        SEP #$20
C2/9419: 20 D2 00     JSR $00D2   (Multiply Net Damage * M)
C2/941C: 22 Lo Hi D0  JSL $D0HiLo (32 bit comparator)
C2/9420: 8E 69 7B     STX $7B69   ($7B69 = Final Damage)
C2/9423: 60           RTS
C2/9424: EA           NOP
C2/9425: EA           NOP
C2/9426: EA           NOP

In short:

Code: [Select]
C2/8A11: 22 L2 Hi D0

C2/940E: D0 04 A9 80 00 EA 85 2C 7B E2 20 20 D2 00 22 Lo
C2/941E: Hi D0 8E 69 7B 60 EA EA EA

D0/HiLo, A6 30 D0 07 A6 2E E0 0F 27 90 03 A2 0F 27 6B
D0/HiL2, A9 80 85 52 A5 39 6B

I am assuming accumulator is set to 8 bits in C2/8A11, am I right?
« Last Edit: December 19, 2014, 12:28:12 PM by noisecross »

assassin

  • Bane of Retards
  • *
  • Posts: 1,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: FFV patches (and compatibility with each other)
« Reply #102 on: December 19, 2014, 08:18:00 AM »
Code: [Select]
C2/940C: A5 52        LDA $52
C2/940E: D0 01        BNE $9411
C2/9410: 1A           INC         (Minimum M = 1)
C2/9411: 20 B2 01     JSR $01B2   (Minimum M = 128) <--- First change
C2/9414: 85 2C        STA $2C

just replace "INC / JSR $01B2" with "LDA #$0080", and make the BNE skip 3 bytes.  you don't want to be increasing M here unless it was below the floor.

i'm debating whether the M check should be for == 0, or for < 128.  something about the latter seems like a safer catch-all, but it shouldn't be necessary unless earlier code was botched or missed.

Quote
I am assuming accumulator is set to 8 bits in C2/8A11, am I right?

yep.

noisecross

  • FF5 Hacker
  • *
  • Posts: 146
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #103 on: December 19, 2014, 12:36:55 PM »
Perfect. I have replaced the INC / JSR and fixed the BNE in the code and hex.
May a value over 0 and under 128 reach that instructions?
I agree in a < 128 is safer but it requires more instructions to code it and that means a new fork to D0... I'd prefer to avoid it if possible.

Additionally I am attaching here another patch I did based on the Menu Window Research done by LightPhoenix.
That patch edit the naming screen to hide the unuseful 'ABC' and 'abc' buttons and resizing the 'End' button window. Is not a great one and doesn't fix any bug, but maybe is interesting to keep it in mind.
« Last Edit: December 19, 2014, 01:25:21 PM by noisecross »

Jorgur

  • Moderator
  • *
  • Posts: 437
  • Gender: Male
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #104 on: December 19, 2014, 03:01:06 PM »
I hope you don't mind, but I merged the FF5 docs and patches wiki pages for simplicity. Right now there is just 1 page for everything related to FF5 hacking. Don't hesitate to add things to it!  :wink:
http://slickproductions.org/slickwiki/index.php/Final_Fantasy_V_Hacking

Since you have made so much progress on the fractional M patch, why not update its wiki page?