øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=2375.msg27504e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index12ed-2.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=profile;area=showposts;sa=topics;u=363e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index12ed-2.html.zxO–h^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈà•¤×ÙOKtext/htmlISO-8859-1gzip0|Ö×ÙÿÿÿÿÿÿÿÿWed, 11 Mar 2020 07:58:32 GMT0ó°° ®0®P®€§²ð®N–h^××Ù Restoring monster count

Author Topic: Restoring monster count  (Read 484 times)

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Restoring monster count
« on: June 25, 2017, 11:27:03 AM »
The monsters in FF2SNES have names of eight characters or less, which leaves room for a convenient count of each monster type. In FF5, translated by RPGe, the monster names are expanded to a window-filling ten characters, eliminating the monster counts. The same goes for FF3SNES, but right now I'm only interested in FF5 (and I think it'd be harder to shorten the monster names there).

Suppose I managed to shorten every monster's name in FF5 to eight characters or less. What code would I need to modify to be able to add the counts back in?
« Last Edit: June 25, 2017, 11:35:43 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

Praetarius5018

  • Vargas
  • *
  • Posts: 88
    • View Profile
Re: Restoring monster count
« Reply #1 on: June 26, 2017, 01:22:40 AM »
good question, I don't know.
but 7E4008 and following hold the monster ids (2 bytes each) for the names so that would be a start?

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: Restoring monster count
« Reply #2 on: June 26, 2017, 04:33:28 AM »
OMG I didnt even know there was counting in the original game :D
So I watched a video of gameplay on original (J) and yes, there is counting  :cycle:

noisecross

  • FF5 Hacker
  • *
  • Posts: 146
    • View Profile
Re: Restoring monster count
« Reply #3 on: June 26, 2017, 10:17:37 AM »
Suppose I managed to shorten every monster's name in FF5 to eight characters or less. What code would I need to modify to be able to add the counts back in?

The first thing you should do is read only 8 characters from the monsters name, and not 10.
Edit the byte at C1/3019 from 0A to 08 to achieve this.

To recover the counts... I am not 100% sure but check the diferences in the next ASM:

Code: [Select]
Original (j)
C1/3058: 9006    bcc $3060
C1/305A: 18      clc
C1/305B: 6953    adc #$53
C1/305D: 20EA2D  jsr $2DEA
C1/3060: 60      rts

RPGe
C1/3058: 222000E0 jsr $E00020
C1/305C: EA      nop
C1/305D: EA      nop
C1/305E: EA      nop
C1/305F: EA      nop
C1/3060: 60      rts

Check what is happening at E0/0020, but maybe taking back that Original (j) ASM will do the trick for you.

 :edit:
The sub at E0/0020 write #$05 at the addresses "sta($bc),y" and "sta($ba),y" so I guess the purpose of this sub is redraw the right border of the monster name window.
If you are displaying only 8 characters, this redraw won't be necessary.
« Last Edit: June 27, 2017, 08:19:28 AM by noisecross »

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: Restoring monster count
« Reply #4 on: June 27, 2017, 08:40:11 AM »
Thanks for the help, noisecross! I found a solution thanks to the pointers you gave me, and I have attached a patch for anyone who wants to try it out.

Note that there are some enemies, such as bosses, that still have ten-character names. One issue that I find with this is that, for whatever odd reason, a small part of the monster name window's right edge disappears, which doesn't seem to happen in the normal game.

Also, on a personal note, I think I just prefer it the way it is.
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings

noisecross

  • FF5 Hacker
  • *
  • Posts: 146
    • View Profile
Re: Restoring monster count
« Reply #5 on: June 27, 2017, 08:47:38 AM »
One issue that I find with this is that, for whatever odd reason, a small part of the monster name window's right edge disappears, which doesn't seem to happen in the normal game.
It may be the mentioned sub at E0/0020? C1/2DEA may be also involved at this.
Won't you share the asm you edited? Sure it would be interesting to see.

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: Restoring monster count
« Reply #6 on: June 28, 2017, 12:08:48 AM »
Here's a new version of the patch, with the right border issue fixed and ASM included!
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings

noisecross

  • FF5 Hacker
  • *
  • Posts: 146
    • View Profile
Re: Restoring monster count
« Reply #7 on: June 28, 2017, 04:21:00 AM »
Nice work!

By the way, I think the next line of code should replace the '#$52' with a '#$53', isn't it?
Code: [Select]
E00E8D: ADC #$52  ; otherwise, turn number into a character
The tile '0' is in the position 0x53 in the '2bpp font tilemap'.

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: Restoring monster count
« Reply #8 on: June 28, 2017, 04:50:33 AM »
Quote
By the way, I think the next line of code should replace the '#$52' with a '#$53', isn't it?
In the context of the code C = 1, so ADC #$52 is like A = A + $53

noisecross

  • FF5 Hacker
  • *
  • Posts: 146
    • View Profile
Re: Restoring monster count
« Reply #9 on: June 28, 2017, 05:10:32 AM »
In the context of the code C = 1, so ADC #$52 is like A = A + $53

After a bcc the carry flag will be set. If no clc is done, "adc #$52" will be "add #$52 + #$01". Brilliant.

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: Restoring monster count
« Reply #10 on: June 30, 2017, 02:02:30 AM »
One thing I neglected to mention: the patches I wrote were actually intended for Spooniest's "Legend of the Crystals" addendum patch, not the actual RPGe translation. Here's a new version that is intended for the original translation, but the LotC patches have been kept.
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings