øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=2134.msg25733e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index8566.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=2134.105e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index8566.html.zxZBh^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈÀK@OKtext/htmlISO-8859-1gzip0|Ö@ÿÿÿÿÿÿÿÿWed, 11 Mar 2020 02:00:19 GMT0ó°° ®0®P®€§²ð®ZBh^ÿÿÿÿÿÿÿÿ\+@ FFV Viewer

Author Topic: FFV Viewer  (Read 20108 times)

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: FFV Viewer
« Reply #105 on: July 05, 2016, 09:55:40 AM »
Version 5.6.1 is out!!!

Now you can see ALL monster's pictures!!! Yes, finally I cracked the compression flag!

This is more of a hotfix, but since the compression part took me so much time and effort its like new version to me :D

Enjoy

P.S. If you have a FF5 ROM that has modified graphics for monsters, please share it so I can test the Viewer.

samurai goroh

  • FF5 Hacker
  • *
  • Posts: 221
  • Gender: Male
    • View Profile
    • My page
Re: FFV Viewer
« Reply #106 on: July 05, 2016, 04:56:43 PM »
FF5r has new enemies, I'll try running your program against it:
http://www.romhacking.net/hacks/1408/
I'm the best in the universe! Just remember! [F-zero X]

Jorgur

  • Moderator
  • *
  • Posts: 437
  • Gender: Male
    • View Profile
Re: FFV Viewer
« Reply #107 on: July 06, 2016, 05:25:13 AM »
- If you minimize and restore the program while looking at a monster the graphics disappear
- There is space for 384 monsters but the list ends at 367

Can something be done about this (pic attached)? Perhaps have the program look at the ASM for displaying text to find the correct location of the text.
« Last Edit: July 08, 2016, 05:33:00 AM by Jorgur »

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: FFV Viewer
« Reply #108 on: July 06, 2016, 08:55:28 AM »
Quote
If you minimize and restore the program while looking at a monster the graphics disappear
Yeah, there many things that need to be polished around graphics ... When I have the time I will make it the way it should - with memory buffer, this will avoid flickering, slow redraw ,...

Quote
There is space for 384 monsters but the list ends at 367
Yes, but the other entries are not used. I think its better to show only 367 rather having huge area of blank (empty) entries :)

Quote
Can something be done about this (pic attached)? Perhaps have the program look at the ASM for displaying text to find the correct location of the text.
All the text extraction is based on RPGe translation. If a ROM uses a different engine, most likely thing will get ugly (as in your pic). If there was a kind of master table, that hold pointers to where the text is (maybe similar to GBA)  then I can rework my code, to get the text addresses accordingly. Until then I have to use static offsets.

btw do you know anything about:
Code: [Select]
D07800-D079FF : Monster encounter (fixed)
D07A00-D07FFF : Monster encounter map
D08000-D083FF : Monster encounter map (Dungeon)
D08400-D084BF : En count increase in the number of settings (field * 3) (* 1)
D084C0-D085BF : En count increase in the number of settings (sub-map * 1024) (* 1)

Quote
FF5r has new enemies
Great, any chance you know a link where patch is applied? TBH I never apply .ips because usually the emulators include them automatically :(
« Last Edit: July 06, 2016, 09:19:32 AM by Squall »

Jorgur

  • Moderator
  • *
  • Posts: 437
  • Gender: Male
    • View Profile
Re: FFV Viewer
« Reply #109 on: July 06, 2016, 11:07:14 AM »
Quote
Yes, but the other entries are not used. I think its better to show only 367 rather having huge area of blank (empty) entries :)
Well, people might want to make hacks with more monsters added at the end.
Quote
btw do you know anything about:
Nope. All I know is already in the wiki.

samurai goroh

  • FF5 Hacker
  • *
  • Posts: 221
  • Gender: Male
    • View Profile
    • My page
Re: FFV Viewer
« Reply #110 on: July 06, 2016, 05:03:20 PM »
btw do you know anything about:
Code: [Select]
D07800-D079FF : Monster encounter (fixed)
D07A00-D07FFF : Monster encounter map
D08000-D083FF : Monster encounter map (Dungeon)
D08400-D084BF : En count increase in the number of settings (field * 3) (* 1)
D084C0-D085BF : En count increase in the number of settings (sub-map * 1024) (* 1)
The monster encounter map, or as I called in my editor, zone formation contains the data of which enemy group you can encounter. The outworld map has 4 groups which are: Plains, Forest, Desert/Swamp, Sea. Each one will throw you a Group formation (which you can also see on my program & in the algorithm FAQ).

Here's the code of my editor:
Code: [Select]
Private Sub LoadWorldMonsterGroup(pfile As String, w, z, x, y)
' -----------------------------------------------------------------------------
'
' -----------------------------------------------------------------------------
    Dim World As Integer, Zone As Integer, CoordX As Integer, CoordY As Integer

    ' The variable FF is equal to the next available file number
    FF = freefile
     
    Open pfile For Binary As #FF
   
        World = w * &H200
        Zone = z * &H2
        CoordX = x * &H8
        CoordY = y * &H40
   
        ' ==================================================
        ' Load the World Map Enemy Group
        ' ==================================================
        Get #FF, &H107A00 + 1 + World + Zone + CoordX + CoordY + Header, CurVal
        cbGroup.ListIndex = CurVal
   
    Close #FF

End Sub

The dungeon encounter is the group formation in all rooms, hence why it has many 0's. I used the dungeon encounter in my Lua script when TASing the game:
Code: [Select]
--------------------------------------------------------------------------------
local function battle_LUT()         -- Retrieve the LUT located @ C0/FEC0
--------------------------------------------------------------------------------
    memory.usememorydomain("CARTROM")   -- Read from ROM

    for i=0, 255 do
        battle_lut[i] = memory.read_u8( 0x00FEC0 + i)   -- Look Up Table for RNG
    end

    memory.usememorydomain("WRAM")      -- Change back to RAM
end

--------------------------------------------------------------------------------
local function predictRNGBattle()   -- Predicts random battle stuff
--------------------------------------------------------------------------------
...
    local rBattle       = memory.read_u8( 0x0B50 ) -- Random Battle index
    local rBattlesSeed  = memory.read_u8( 0x0B5F ) -- random battle seed
    local NextEncounter = (battle_lut[(rBattle+1) % 256] + rBattlesSeed ) % 256

    if NextEncounter < 90 then                      -- Common 1 (90/256)
        encounterID = 0
    elseif within( 90, NextEncounter, 179) then     -- Common 2 (90/256)
        encounterID = 1
    elseif within(180, NextEncounter, 239) then     -- Uncommon (60/256)
        encounterID = 2
    else                                            -- Rare     (16/256)
        encounterID = 3
    end

    memory.usememorydomain("CARTROM")   -- Read from ROM
    local GroupFormation = memory.read_u16_le( 0x108000 + map*2 )  -- Dungeon
    local EnemyFormation = memory.read_u16_le( 0x106800 + (8 * GroupFormation) + (2 * encounterID) )
    memory.usememorydomain("WRAM")      -- Change back to RAM

I don't know about the other 3...


Quote
FF5r has new enemies
Great, any chance you know a link where patch is applied? TBH I never apply .ips because usually the emulators include them automatically :(
You can use Lunar IPS to patch:
http://www.romhacking.net/utilities/240/

I tried it out and while some images did load, some others where garbled. And also, the program crashed too in other occasions (when it just couldn't load the image, I guess)...
I'm the best in the universe! Just remember! [F-zero X]

samurai goroh

  • FF5 Hacker
  • *
  • Posts: 221
  • Gender: Male
    • View Profile
    • My page
Re: FFV Viewer
« Reply #111 on: July 06, 2016, 11:50:29 PM »
btw do you know anything about:
Code: [Select]
D07800-D079FF : Monster encounter (fixed)
D07A00-D07FFF : Monster encounter map
D08000-D083FF : Monster encounter map (Dungeon)
D08400-D084BF : En count increase in the number of settings (field * 3) (* 1)
D084C0-D085BF : En count increase in the number of settings (sub-map * 1024) (* 1)

BTW, that's not what it says in the wiki
Code: [Select]
D0/7800-D0/797F Data Event encounters
D0/7980-D0/79FF Data Monster-in-a-box encounters
D0/7A00-D0/7BFF Data Monster zones in World 1 (4*2 * 8*8)
D0/7C00-D0/7DFF Data Monster zones in World 2 (4*2 * 8*8)
D0/7E00-D0/7FFF Data Monster zones in World 3 (4*2 * 8*8)
D0/8000-D0/83FF Data Monster zones in dungeons (512*2)
D0/8400-D0/85FF ???? (fragmented data)

I'm the best in the universe! Just remember! [F-zero X]

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: FFV Viewer
« Reply #112 on: July 07, 2016, 02:25:54 AM »
Quote
You can use Lunar IPS to patch:
Thank you. I used 'FF5r140.ips' with 'Final Fantasy V (J).smc'. It didn't ask to make a copy :((
Anyway, in my Viewer it showed just garbage. Then I used an emulator on patched file - broken, only black screen. I'm I doing something wrong?

Quote
BTW, that's not what it says in the wiki
Yeah I took them from Japanese cite and saw that Jorgur lack any info for them in 'Monster data' thats why I decided to bring it in :D

My next version will be for Formation/Encounters, so I try to comprehend all possibilities and make a plan :)
But first I will be on vacation for next 10 days, so after I come back I might do monster graphic for GBA first.

 :edit:
Quote
local NextEncounter = (battle_lut[(rBattle+1) % 256] + rBattlesSeed ) % 256
So random part is a myth :D

P.S. samurai goroh what emulator you use for Lua scripts? I have Snes9X 1.53, but I cant find LUA in menu...
« Last Edit: July 07, 2016, 02:53:39 AM by Squall »

Jorgur

  • Moderator
  • *
  • Posts: 437
  • Gender: Male
    • View Profile
Re: FFV Viewer
« Reply #113 on: July 07, 2016, 05:11:04 AM »
If IPS patching fails, try adding/removing header first. You can use TUSH:
http://www.romhacking.net/utilities/608/

noisecross

  • FF5 Hacker
  • *
  • Posts: 146
    • View Profile
Re: FFV Viewer
« Reply #114 on: July 07, 2016, 06:49:04 AM »
BTW, that's not what it says in the wiki

Feel free to edit that. I am only certain there about the D0/7A00-D0/7BFF addresses.
You can read the explanation in the wiki entry  Treasures.

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: FFV Viewer
« Reply #115 on: July 07, 2016, 03:31:56 PM »
Thank you Jorgur, I used a ROM without a header and patching worked.

Interesting, reading what  samurai goroh & noisecross said that mean we have couple of tables with encounters:
 - D0/7800-D0/797F - Event encounters (I guess thats connected with the story, that triggers when you enter a specific map-tile)
 - D0/7980-D0/79BF - Monster-in-a-box encounters
 - D0/7A00-D0/7FFF - World map encounters (with zones as samurai goroh explained)
 - D0/8000-D0/83FF - Monster in dungeons encounters(512*2)
and there is something in D08400-D085BF ...

P.S. noisecross I saw that some 1bpp fonts are 8x12 pixels. How that could be visualized in SNES? I thought that only tiles could be shown (8x8 pixels).
« Last Edit: July 07, 2016, 03:57:06 PM by Squall »

samurai goroh

  • FF5 Hacker
  • *
  • Posts: 221
  • Gender: Male
    • View Profile
    • My page
Re: FFV Viewer
« Reply #116 on: July 07, 2016, 05:07:24 PM »
I saw that some 1bpp fonts are 8x12 pixels. How that could be visualized in SNES? I thought that only tiles could be shown (8x8 pixels).
Don't quote me but IF 1BPP is of the size of 4x4 (just a guess), then you could have one 8x8 tile + two 4x4 tiles to form a 8x12 image...

Interesting, reading what  samurai goroh & noisecross said that mean we have couple of tables with encounters:
 - D0/7800-D0/797F - Event encounters (I guess thats connected with the story, that triggers when you enter a specific map-tile)
Looking at the monster formations, it's certainly is the 1-time only battles, like bosses, etc.
« Last Edit: July 07, 2016, 05:34:10 PM by samurai goroh »
I'm the best in the universe! Just remember! [F-zero X]

noisecross

  • FF5 Hacker
  • *
  • Posts: 146
    • View Profile
Re: FFV Viewer
« Reply #117 on: July 08, 2016, 06:06:20 AM »
P.S. noisecross I saw that some 1bpp fonts are 8x12 pixels. How that could be visualized in SNES? I thought that only tiles could be shown (8x8 pixels).

Indeed, the 1bpp font is stored as 8x12 in the rom, but every character have a size of 16x12 (2 blocks per character)
However, the font set is not written to VRAM as a tileset and after that displayed in screen using a tilemap. Instead, there is a loop which reads the game speech and write the graphics of each character, one by one into a buffer. After that, the buffer is written to VRAM.

The loop (hacked by RPGe) transform the 8x12 rom data into 8x8 tiles and also manage the VWF effect using shifts and masks.

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: FFV Viewer
« Reply #118 on: July 19, 2016, 07:43:11 AM »
Hey guys, I'm back from vacation :)

Quote
However, the font set is not written to VRAM as a tileset and after that displayed in screen using a tilemap. Instead, there is a loop which reads the game speech and write the graphics of each character, one by one into a buffer. After that, the buffer is written to VRAM.

The loop (hacked by RPGe) transform the 8x12 rom data into 8x8 tiles and also manage the VWF effect using shifts and masks.
Interesting. That explain how they can use 'half tile'. So this is pretty much as 'compression' method with graphics - to save space and then rely on asm to add what is necessary. I was wonder, isn't these going to use too much tiles (since each letter will require like 2x2 tiles to be rendered) ...

Anyway, I decided to add new feature to the Viewer - Encounters. While most things are straightforward, there are couple of questions:
- Do you know what exactly Visual FX byte control? I know only about '40 Underwater' - it discard monster palette and uses one of the predefined ones with ID from encounter palette. (I stumble on this searching for 'compression' routine)
- What Music FX byte control? I understand track part, but not the first 2 bits
- What '01 Alternate death' mean?

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: FFV Viewer
« Reply #119 on: July 20, 2016, 07:13:48 AM »
Another question about Music Control:

Can you help me identify track names in http://www.ffextreme.com/ff5/music.html
Code: [Select]
0 Battle
1 Boss
2 Neo-Exdeath
3 Gilgamesh
4 Exdeath
5 Exdeath battle
6 Gogo
7 Exdeath destroyed

They are ordered and numbered according the OST. So far I have:
Code: [Select]
0 - CD1: 07 - The Battle
1 - CD1: 19 - The Fierce Battle OR CD2: 16 - The Decisive Battle
3 - CD2: 03 - Death Battle in the Big Bridge

P.S. noisecross, I found FF5_Table:BGM very useful in your Maps document. Is this only accessible trough Map doc?