øAslickproductions.org/forum/index.php?PHPSESSID=so1iojs5ocdn0o2vf0tti7fbu6&topic=2134.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index10ab-2.htmlslickproductions.org/forum/index.php?PHPSESSID=so1iojs5ocdn0o2vf0tti7fbu6&board=17.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index10ab-2.html.zx?õg^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿȰUÑ!OKtext/htmlISO-8859-1gzip0|ÖÑ!ÿÿÿÿÿÿÿÿTue, 10 Mar 2020 20:31:18 GMT0ó°° ®0®P®€§²ð®>õg^ÿÿÿÿÿÿÿÿº-Ñ! FFV Viewer

Author Topic: FFV Viewer  (Read 20094 times)

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
FFV Viewer
« on: October 27, 2015, 07:14:10 AM »
Hey guys,

while I was learning how the info for weapons is stored an application emerged. As a token of thanks to the great support (mainly Jorgur *respect*) I'm sharing it with you.
It was written for specific purpose - learning and export the accumulated data for my damage calculation project, but regardless I will be happy to hear from you your comments, suggestion or critics :)

Download: :edit: Images (zip)  Maps (zip)  Music (zip)  7.2 (exe-only)
You will need .smc or .gba file!
In order to see images, download both files and extract 'Images' folder where the .exe is!


 :xzone: Versions:
1.0  Can read SNES files (with headers)
1.1  Can read GBA files (tested with '2564 - Final Fantasy V Advance (U)(Independent)' )
1.2  Added all missing info. Now it read correctly all SNES files (with or without a header)

2.0 Major update. Name changed. Can read armor info (SNES only). A new Text section for GBA/SNES <-> ANSI text conversation. Fully read Weapon, Armor, Magic & Description text from ROM.
2.1 Many visual changes. Corrected SNES no header reading routines. Added missing info on ChikenKnife FX.
2.2 Can read GBA armor info, including Element/Status table. Export to CSV.

3.0 Major update. Can read Enemy/Monster info & AI script (SNES only).
3.1 Internal structure redesigned. Drop/steal info added.
3.2 Now work for GBA too.

4.0 Major update. Can read Magic info (SNES only)
4.1 Full parsing on all magic/abilities! Some minor bug fixes.
4.2 Added GBA info (big thanks to x0_000).

5.0 Name changed. Added Job/Ability tabs (SNES only).
5.1 Full parsing on all Job/Ability (SNES only).
5.2 Added GBA info (big thanks to x0_000).
5.3 Added Usable Items section. Added more filters in different tabs. Export moved in Text tab.
5.4 Many small fixes for GBA Enemy content & Display Info
5.5 Added Job Sprites & Palettes. Now you may see all frames in the battle for all characters & all jobs (SNES only!)
5.6 Added Monster Image as it is in the ROM (SNES only!, no Compression flag)
5.6.1 Now handle Compression flag  (SNES only!)

6.0 Added Encounters. You can see the battle, hear the music ^^. Added interactive WorldMap encounter selection! (SNES only!)
6.1 Added missing Encounters - Monster-in-a-box treasure, Dungeons, Event related. (SNES only!)

7.0 Added Background tab (GBA only!) Added LZ77 GBA compression. Added Monster Graphics (GBA)
7.1 Various bug fixes and small changes
7.2 Added Font (GBA only for now)

 :xzone: Credits:
Great icon artwork from Alforata
Sprites extracted from FF1&3 by The Spriters Resource
Initial 'guide' by samurai goroh
« Last Edit: January 28, 2018, 12:53:37 AM by Squall »

samurai goroh

  • FF5 Hacker
  • *
  • Posts: 221
  • Gender: Male
    • View Profile
    • My page
Re: SNES Weapon viewer
« Reply #1 on: October 27, 2015, 10:00:15 AM »
I tried downloading the file but it's a .bpl file, which I don't know which program it uses (well a search tells me is likely a Delphi file, but I was expecting an .exe so I can run it w/o needing to install anything). Also it has an odd name...

As for the data in the GBA, x0_000 posted this information on another topic

Quote
Items

Weapon Table - 0x155810
Basic stats of weapons. Each entry is 12 bytes long, and the data mostly matches the SNES notes (although the order is changed.) Weapons *must* have ID < 128. The new byte order is 8 9 A B 0 1 4 2 3 5 6 7 (See this doc for the meaning of each index.)
Accessory Table - 0x1462d0
Basic stats of any equippables that aren't weapons. Each entry is 12 bytes long, and I think (need to double check) that the order is the same as weapons. Accessories *must* have ID between 129 and 223.
Item Table - 0x148fbc
Basic stats of consumable items. Unlike the previous two, each entry is 8 bytes long. Consumables can have any ID above 224.
I'm the best in the universe! Just remember! [F-zero X]

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: SNES Weapon viewer
« Reply #2 on: October 27, 2015, 11:00:44 AM »
Sorry, my mistake - wrong link, I will fix it in a minute.

 :edit: Link is now fixed. I hope its ok now.

I've read careful x0_000 post and tried to extract the same info ... it didnt work, I even tried 4 bytes search, copied from SNES rom, couldnt find a match ... maybe I'm doing something wrong?
Is data crypted in the file? Is file offset the same as entry points? (because in SNES I need to subtract C00000)
« Last Edit: October 27, 2015, 11:14:39 AM by Squall »

Jorgur

  • Moderator
  • *
  • Posts: 437
  • Gender: Male
    • View Profile
Re: SNES Weapon viewer
« Reply #3 on: October 27, 2015, 06:08:04 PM »
Neat program, but it doesn't seem to display the information correctly. My ROM doesn't have a header, maybe that's why?

 :edit:
This might be relevant:
http://slickproductions.org/forum/index.php?topic=1060.0
« Last Edit: October 28, 2015, 08:18:48 PM by Jorgur »

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: SNES Weapon viewer
« Reply #4 on: October 28, 2015, 02:37:02 AM »
Neat program, but it doesn't seem to display the information correctly. My ROM doesn't have a header, maybe that's why?
Yes, the file offset is calculated with 0x200 header. I've tested with mainly with 'Dark Knight Kain' but it seems ok with RPGe, EasyType 1.1 & DeJap 1.03.

How I can check (with code ofc) for Header? Is the header size a constant?

Jorgur

  • Moderator
  • *
  • Posts: 437
  • Gender: Male
    • View Profile
Re: SNES Weapon viewer
« Reply #5 on: October 28, 2015, 08:54:15 AM »
Yes, the 0x200 header is constant. Programming isn't my strong point, though. Maybe a filesize check of some kind?

samurai goroh

  • FF5 Hacker
  • *
  • Posts: 221
  • Gender: Male
    • View Profile
    • My page
Re: SNES Weapon viewer
« Reply #6 on: October 28, 2015, 09:02:17 AM »
Headers are usually the size of 0x200, but don't assume that will always be the case. What you can assume is that a ROM file should be in chunks of size 0x8000, so doing a modulo and checking if there's a reminder that would be the size of the header (if any).

Here's what I have in my editor (in Visual Basic):

Code: [Select]
Public Sub GetHeader(freefile)
    Dim length As Long

    length = LOF(freefile)
    Header = length Mod &H8000

End Sub
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 #7 on: October 28, 2015, 09:22:48 AM »
Quote
Headers are usually the size of 0x200, but don't assume that will always be the case.
So you get the modulo remainder and assume that to be the header?

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: SNES Weapon viewer
« Reply #8 on: October 28, 2015, 11:28:14 AM »
Hey guys I uploaded a version 1.1. Now it can read .gba but it seems to work with '2564 - Final Fantasy V Advance (U)(Independent)'. There, the ROM map suggested by x0_000 is identical.
I tested it with '2727 - Final Fantasy V Advance (E)(Eternity)' but weapons data starts at 0x157700 (header again?).

O btw another interesting feature in 1.1 is that you can see the 12 bytes as they should appear in GBA file (for easy Hex search).
I added the GBA extra weapon names from here: http://www.cavesofnarshe.com/ff5/weapons.php

Thank you @samurai goroh, I will try your suggestion for headers tomorrow.

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: SNES Weapon viewer
« Reply #9 on: October 28, 2015, 11:37:28 AM »
One interesting thing was comparing extracted data for extra weapons from gba with that of 'caves of narshe' ... I have to admit I found a huge difference. The best katana Mutsunokami has clearly 30% crit, but they state 50%. I found that @Djibriel in http://www.gamefaqs.com/gba/930369-final-fantasy-v-advance/faqs/61876 states 50% too...
 :hmm: So I was wondering ... were they both using bad info (maybe same source) or had the game been 'nurfed', so there are releases with 50% (probably old) and with 30% (probably newer)

Jorgur

  • Moderator
  • *
  • Posts: 437
  • Gender: Male
    • View Profile
Re: SNES Weapon viewer
« Reply #10 on: October 28, 2015, 08:23:51 PM »
Does this program have a name? "SNESParser" is a little vague, isn't it?

 :edit:
It would be neat if it used the weapon names from the ROM, so I could check out the weapons from FF5 Ancient Cave.  :tongue:
« Last Edit: October 28, 2015, 08:32:41 PM by Jorgur »

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: SNES Weapon viewer
« Reply #11 on: October 29, 2015, 03:08:45 AM »
Quote
Does this program have a name? "SNESParser" is a little vague, isn't it?
Hehe I think I state it clear enough that this program emerged, and wasn't intended. So I just named it to have a project name (in Delphi) but didn't really put some thinking in it :D Anyway if you guys have a suggestion - I will gladly change it.

Quote
It would be neat if it used the weapon names from the ROM, so I could check out the weapons from FF5 Ancient Cave
I like to 'drink from the source' ... meaning I prefer to get my data from a ROM rather then somewhere else. That include the names. But to do so I will need more info on how to extract names and to be honest I have no time do it on my own.
So far I know the entry point of texts and from your last link that they are 'crypted' using 'letter-frequency based table'. If this data is not compressed in a rom (GBA) it should be a simple table based transformation to ASCII. If it is compressed ... this will stay on hold :D

P.S. Nobody said something about the huge difference in stats from a gba rom and couple internet places that I mention ... and while Crit is a hidden stat so its hard to 'prove', Apocalypse has Boost: Stats - Strength+3 Stamina+3 in the ROM, but no such things mentioned in the caves.

x0_000

  • Siren
  • *
  • Posts: 72
    • View Profile
Re: SNES Weapon viewer
« Reply #12 on: October 29, 2015, 04:21:35 PM »
(E) and (U) is referring to the region; U is american and E is european so they are in fact different ROMs. All my notes are for the (U) ROMs.The text table is uncompressed data, I don't know the full conversion table, but I've done some text editing in the GBA ROM and have a partial reference: http://pastebin.com/mPJv1LUZ
Quote
Text Pointer Table - 0x36DD54
Points to text data in the ROM. This table is formatted unusually, each entry is a word long which indicates how far (relative to the offset 36dd54) the text begins. Note that the word at 36dd60 is the size of the combined text data. Editing text is very annoying; the next entry indicates when the first entry ends, so editing a text to be longer than the original entry would require repointing everything after, and then fixing all the offsets.

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: SNES Weapon viewer
« Reply #13 on: October 30, 2015, 03:43:09 AM »
Hey guys, a new version 1.2 was released:
- added 'back row' info
- added all missing info in Action:
* status inflicting info (darkness/killer bow)
* Rune info
* 'const dmg' info (Excalipoor)
* parsing of formula: 8E (Demon's Rod - GBA+)
- SNES header info, now it can read roms without headers, also roms with 'non-traditional' length ('Final Fantasy V - EasyType 1.1 by jce3000gt [h1].smc' & Final Fantasy V - Expert 0.947 by jce3000gt [h1].smc)

Let me share a little bit more about the last point ... initially I tried @samurai goroh suggestion to detect headers in SNES ROMs. It worked fine for most files, except jce3000gt ones. FileLength mod $8000 returns 513/544, but header itself is 512($200). So I corrected the routine:
Code: [Select]
    n := GetFileSize(f, nil);
    n := n mod $8000;
    n := $200 * ord (n > 0);
n is the size of the header, in other-words correction for the offset to weapon info.

P.S. Finally I understood how to extract/parse 'Back Row' info without hard-coding it  :laugh:
« Last Edit: October 30, 2015, 03:51:48 AM by Squall »

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: SNES Weapon viewer
« Reply #14 on: October 30, 2015, 04:19:08 AM »
Hey @x0_000 welcome back. I hopped that you will see these posts, because I use your GBA notes as reference :)

Please, help me understand this dump from '2564 - Final Fantasy V Advance (U)(Independent).gba', starting with offset 0x36DD54:
Code: [Select]
Offset      0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F

0036DD50               00 00 00 00  54 45 58 54 01 79 17 00           TEXT y 
0036DD60   1D 83 04 00 F4 5D 00 00  F6 5D 00 00 F8 5D 00 00    ?  ?]  ?]  ?] 
0036DD70   FA 5D 00 00 FC 5D 00 00  FE 5D 00 00 00 5E 00 00   ?]  ?]  ?]   ^ 
0036DD80   02 5E 00 00 04 5E 00 00  06 5E 00 00 08 5E 00 00    ^   ^   ^   ^ 
0036DD90   0A 5E 00 00 0C 5E 00 00  0E 5E 00 00 10 5E 00 00    ^   ^   ^   ^