øAslickproductions.org/forum/index.php?PHPSESSID=a93jpvqe9jutne9agvqo8ht1r1&topic=2134.15e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index965b-2.htmlslickproductions.org/forum/index.php?board=17.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index965b-2.html.zxÆ8h^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ °V·OKtext/htmlISO-8859-1gzip0|Ö·ÿÿÿÿÿÿÿÿWed, 11 Mar 2020 01:19:26 GMT0ó°° ®0®P®€§²ð®Å8h^ÿÿÿÿÿÿÿÿ`*· FFV Viewer

Author Topic: FFV Viewer  (Read 20098 times)

x0_000

  • Siren
  • *
  • Posts: 72
    • View Profile
Re: SNES Weapon viewer
« Reply #15 on: October 30, 2015, 06:04:55 PM »
Basically in GBA ROMs, words (4 byte entries) are written in reverse endian; for example if the game referenced a value of 0x12345678, the value would be encoded in the ROM as the bytes 78 56 34 12. For the text pointers, the first text entry starts at 0x36dd64 (the value written there is 0x5df4.) So if you go 0x36dd54 + 0x5df4, that is 0x373B48, you would find the start of the first text entry, uncompressed.

For a more concrete example, the text for the Gladiator job has ID 0xe24, so the offset is located at 0x36dd64 + 4*0xe24, which is 0x3715F4. At that offset is the word 0x3dfd8, so the text for Gladiator starts at 0x36dd54 + 0x3dfd8, which is 0x3abd2c. So if you go to that offset and translate using the text table, you get Gladiator.

If you want to find the item names, there's a good chance the names are stored in the same order as the item IDs, so if you can find one name you can reverse engineer the text IDs for each item.

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: SNES Weapon viewer
« Reply #16 on: November 02, 2015, 11:30:39 AM »
Hehe I manage to extract the names using statistical searches, but its good to know exact steps. I will not upload this version. It will simply merge with a major update that I'm working atm - adding armor data. Currently I finished most of it, however I lack some info:
- the armor info in GBA. At 1462d0 I cant find that info and any of searches that I tired didn't work.
- Elemental Defense (+A) of gear ... It seems that info is not directly includes in these 12 bytes. Is there a separate table that handle that or it is hard-coded?
- Status Defense (+B) - same as Elemental Defense.

P.S. Does somebody knows full text translation table for GBA? The one that I have only have chars till 5C. Many times I find C2 87 or C2 8E in the text ... is that a picture, new line or ...?

Jorgur

  • Moderator
  • *
  • Posts: 437
  • Gender: Male
    • View Profile
Re: SNES Weapon viewer
« Reply #17 on: November 02, 2015, 07:52:49 PM »
Quote
- Elemental Defense (+A) of gear ... It seems that info is not directly includes in these 12 bytes. Is there a separate table that handle that or it is hard-coded?
- Status Defense (+B) - same as Elemental Defense.
A separate table:
http://slickproductions.org/slickwiki/index.php/Jorgur:FF5_Item_data#Element_defense_definitions

x0_000

  • Siren
  • *
  • Posts: 72
    • View Profile
Re: SNES Weapon viewer
« Reply #18 on: November 03, 2015, 12:38:56 AM »
P.S. Does somebody knows full text translation table for GBA? The one that I have only have chars till 5C. Many times I find C2 87 or C2 8E in the text ... is that a picture, new line or ...?
They might be control codes for game events, like [Wait for player to press A] or [Load portrait X]. You'd basically have to make text with those codes to figure out what it does exactly.

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: SNES Weapon viewer
« Reply #19 on: November 03, 2015, 01:52:28 AM »
Jorgur, if I understood well the byte at +A in gear info is a simply an index into 'Element defense definitions' (D1/2580) table? Same goes for for +B but in Status table?

BTW what is the difference between:
Code: [Select]
1 [Element] evade
2 [Element] immunity
If you evade (100%) an element isnt it the same as been immune to it? Or there is a separate code that handle evasion ... in such case there should be a % to it

Jorgur

  • Moderator
  • *
  • Posts: 437
  • Gender: Male
    • View Profile
Re: SNES Weapon viewer
« Reply #20 on: November 03, 2015, 02:11:30 AM »
Jorgur, if I understood well the byte at +A in gear info is a simply an index into 'Element defense definitions' (D1/2580) table? Same goes for for +B but in Status table?
Yes.

Quote
BTW what is the difference between:
Code: [Select]
1 [Element] evade
2 [Element] immunity
If you evade (100%) an element isnt it the same as been immune to it? Or there is a separate code that handle evasion ... in such case there should be a % to it
It's been so long since I wrote the docs, I forgot. It could be just an unused byte, or maybe there is a different functionality, I don't know.

samurai goroh

  • FF5 Hacker
  • *
  • Posts: 221
  • Gender: Male
    • View Profile
    • My page
Re: SNES Weapon viewer
« Reply #21 on: November 03, 2015, 09:46:51 AM »
Elemental Evasion is not used in this game, only Elemental Immunity is used.
I'm the best in the universe! Just remember! [F-zero X]

Jorgur

  • Moderator
  • *
  • Posts: 437
  • Gender: Male
    • View Profile
Re: SNES Weapon viewer
« Reply #22 on: November 03, 2015, 07:37:25 PM »
So, there is no ASM code that uses that particular byte?

samurai goroh

  • FF5 Hacker
  • *
  • Posts: 221
  • Gender: Male
    • View Profile
    • My page
Re: SNES Weapon viewer
« Reply #23 on: November 04, 2015, 07:45:01 AM »
Quote
BTW, what's the elemental evade? is it the "Can't Evade" certain type of magic or does it really exist a space for elements always hitting?

Elemental "evade" for lack of a better term isn't to my knowledge used, but I'd have to double check my notes to be 100% sure about.  The basic premise is that when you're immune, the attack still counts as a hit even if there's no damage.  The "evade" is basically the same as immune, but counts as a miss.  It's the byte between Absorb and Immunity (7E/2031).  In theory it would be used as a better form of immunity, where immunity only prevents damage and evade prevents damage and secondary effects since it's a miss.  However, I don't believe this ever ends up getting used.

I also have in my RAM notes a space between elemental Absorb and Immunity that would seem to be reserved for that, modifying it has no effect

Code: [Select]
7E0530 XX          1st Player Elemental Absorb                      1.3a
7E0531 XX          1st Player Elemental ??? (n/u?)
7E0532 XX          1st Player Elemental Immunity                    1.3a
7E0533 XX          1st Player Elemental Half                        1.3a
7E0534 XX          1st Player Elemental Weakness                    1.3a
I'm the best in the universe! Just remember! [F-zero X]

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: SNES Weapon viewer
« Reply #24 on: November 04, 2015, 10:45:45 AM »
After couple of days of hard work a new version was released :)

- Since code became 2000+ lines and hard to read I reorganized it separate units. Now its really easy to focus on GBA or SNES only.
- New section: Armor
- New section: Text - you can play in converting PC (ANSI) text <-> GBA/SNES. If you use a regular copy a text could be truncated/transformed, so the safe way is hex.
- All text for Weapon, Armor, Description & Magic comes from ROM.
* In Text section there is a small neat feature - you may see GBA texts packed in the chunk starting of 36DD54. Now text is read not by offset but by index. I hope that will help to easy incorporate parsing of different GBA versions of the game.

 :lock: Please help me to locate Armor info in GBA!!!

Jorgur

  • Moderator
  • *
  • Posts: 437
  • Gender: Male
    • View Profile
Re: FFV Gear Viewer
« Reply #25 on: November 04, 2015, 08:55:58 PM »
I like the new features, but it looks pretty bad - at least on Windows XP. You might want to use a font where all the characters have the same length, such as Courier:

                +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B
Raw Data (hex): 08 05 11 80 00 00 14 02 00 00 00 00
Raw Data (dec): 8 5 17 128 0 0 20 2 0 0 0 0

Gear Slot:   Shield
Gear Type:   Shield
Weight:        5 ($05)
P. Defense:    2 ($02)
P. Evade:     20 ($14)
M. Defense:    0 ($00)
M. Evade:      0 ($00)
Boost: Stats -
Special:     

Elemntal Def: 00 00 00 00 00
        Absorb -
        Evade  -
        Immune -
        Half   -
        Weak   -
Status Def:   00 00 00 00 00 00 00
        Auto   -
        Immune -


Also, the text is not correct when using a ROM without header.

 :edit:
Found a typo. In the pop-up field on the right for armor it says "Phisical dodge". It should be "Physical".

 :edit:
It seems you have mixed up the Gear Types "Heavy armor" and "Light armor". Those two should be swapped.

 :edit:
For Initial Status, bit 80 in "Status 0" does not give Death status. It makes the other initial statuses last forever, i.e. "Always".
« Last Edit: November 05, 2015, 09:37:26 PM by Jorgur »

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: FFV Gear Viewer
« Reply #26 on: November 05, 2015, 10:05:05 AM »
Thank you Jorgur for your input. I was using a font that is with fixed width 'Lucidas' because its quite narrow, but maybe not all have it so I switched to 'Courier New'. Now I hope it will be ok for you too. But because of that change, many visuals needed adjustment and I had plans to redo part of it for later on ... so it seems the time came earlier :)

I was wondering myself about 'Death' property of some items, thank you for explaining its meaning in this case. BTW that 'Always' ... does it mean that come back if you get revived in a battle?

About gear type confusion ... its how the info is recorded in the ROM. They come with byte set as $16, for example Crystal Armor is:
Code: [Select]
            +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B
Data (hex): 02 08 16 80 00 00 00 14 00 02 00 00
Data (dec): 2 8 22 128 0 0 0 20 0 2 0 0

Gear Slot:   Body
Gear Type:   Light armor
Weight:        8 ($08)
and according to this table I display 'Light Armor'. I agree that Gold armor, Diamond, Crystal ... should not be light ... and vice verse for some ninja gear ($17 Heavy Armor).

BTW a new 2.1 version is posted with changes to the visuals, parsing of status 'Always', FX for Chicken Knife :D

Jorgur

  • Moderator
  • *
  • Posts: 437
  • Gender: Male
    • View Profile
Re: FFV Gear Viewer
« Reply #27 on: November 05, 2015, 09:33:52 PM »
Oh, that means there is an error in my docs. I'll change it right away.

Quote
I was wondering myself about 'Death' property of some items, thank you for explaining its meaning in this case. BTW that 'Always' ... does it mean that come back if you get revived in a battle?
Probably? I have never tested it.

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: FFV Gear Viewer
« Reply #28 on: November 06, 2015, 01:26:59 PM »
Since nobody helped me to find armor table in GBA rom, after heavy battle, today I finally manage to crack that hard nut  :laugh:

It not only starts on different address then the one @x0_000 mentioned, but the main difficulty to located it was the byte order ... its not the same as SNES or GBA Weapons. On top on that it seems that the rom I used as main (darkknight) has some difference ... so I did what usually I do when nothing helps - go as closer to the source as possible - the Japanese rom. From there after few experiment thing started to fill the puzzle.

All that I will implement in next release. I will make a post with my GBA findings (it seems you know all for SNES, so I doubt I will have a new info to write). Please advise should I do it here or different thread. It will be final release for now ... 10th is coming so in next weeks will be Fallout 4 time :)

BTW Stat Boost parsing now shows correct info in all cases. I didnt know what to do in case of '1/-1' or '5/-5'. You really should put more info what it means. Coding from description only gives result different then what it really is :) ...
Anyway, although the logic behind it is complicated, the whole routine became short and very simple. I'm sharing this because I was always wondering why Square makes such complicated logic to save a byte, yet waste many bytes with 0s ...

Jorgur

  • Moderator
  • *
  • Posts: 437
  • Gender: Male
    • View Profile
Re: FFV Gear Viewer
« Reply #29 on: November 06, 2015, 05:29:10 PM »
I will make a post with my GBA findings (it seems you know all for SNES, so I doubt I will have a new info to write). Please advise should I do it here or different thread.
That's your choice. The forum is a good place for minor things, but the wiki might be a better option.