Author Topic: FF8 - Location of menu text and dims  (Read 7309 times)

Sebanisu

  • *
  • Posts: 171
    • View Profile
FF8 - Location of menu text and dims
« on: 2019-04-17 20:28:04 »
I was going to draw menus by hand but thought the dims and text are probably in a file somewhere. Anyone know where?

Maki

  • 0xBAADF00D
  • *
  • Posts: 621
  • 0xCCCCCCCC
    • View Profile
Re: FF8 - Location of menu text and dims
« Reply #1 on: 2019-04-18 12:00:53 »
menu translations are here:
tkmnmes1.bin
tkmnmes2.bin
tkmnmes3.bin

example tkmnmes1.bin text dump:
Code: [Select]
JunctiontJunction MenutItemtItem MenutMagictMagic MenutGFtGuardian Force MenutStatustStatus MenutCardtLook at cardstRearrangetRearrange party ordertSavetSave MenutConfigtConfiguration Menut????tPast party memberstPLAYtGt:tCurrent EXPtNext LEVELt/tHPtLVt-t%tFiretIcetThundertEarthtPoisontWindtWatertHolytDeathtPoisontPetrifytDarknesstSilencetBerserktZombietSleeptSlowtStoptCursetConfusetAbsorbtCan`t selecttMakingtShoptLoadtMoteltMoteltYestNotJunk Shopt(t)tAbilitytUse GF abilitytSwitchtSelect party memberstHaven`t been to a shop!tTutorialtExplanationtS.LVtSeeD ranktAtAcetChanges current HP
OK?t????tInformationtFFⅥⅡ Info CornertTESTtTake Written Test to raise SeeD ranktReviewtReview SeeD Written TesttNothing happenedtTIMEtTIMERtt


Quick reverse engineering shows this structure:
Code: [Select]
ushort unk;
ushort paddingSize?;
byte[paddingSize] NULL; //usually 36
ushort[x] pointersToText //this+36(paddingSize) [256 buffer size in case of tkmnmes1.bin]
string text //null terminated

right now I don't know where's the pointers count. Distance between first pointer to first text is 256 ((unk*paddingSize)/2)?
tkmnmes3.bin shows that there might be more pointers/data inside one file?
« Last Edit: 2019-04-18 13:06:27 by Maki »

Sebanisu

  • *
  • Posts: 171
    • View Profile
Re: FF8 - Location of menu text and dims
« Reply #2 on: 2019-04-18 15:36:33 »
I was just reading about this in http://forums.qhimm.com/index.php?topic=17120.0 seems like some if not all of the smaller bin files are duplicate data pulled out of mngrp.bin. I made a spreadsheet to translate the hex into something readable. Though it's has limits. I cannot copy and paste the whole file or it'll get truncated.
I did discover [{0x03,0x40} = Angelo's name] if you see that in a string.

http://forums.qhimm.com/index.php?topic=17099.0 has alot of info on that. first 3 things in mngrp.bin are tkmnmes1.bin, tkmnmes2.bin, and tkmnmes3.bin.

alot of good info on m001-m004 files in http://forums.qhimm.com/index.php?topic=17120.0
« Last Edit: 2019-04-22 01:53:06 by Sebanisu »

Sebanisu

  • *
  • Posts: 171
    • View Profile
Re: FF8 - Location of menu text and dims
« Reply #3 on: 2019-04-20 01:36:19 »
First ushort seems to be a number of padding values. it's always 16 it seams. Where there can be a padding value of 0 and we would just skip that. Then some files only have one padding value and some have multiple. At the padding location is the count of the following locations to strings that are the location plus the current padding value. I'm still working on it. I got it to read the first two files without using the other padding values because the locations and strings were back to back in file 2 and I just computed the new padding value based on where I was in the file.
« Last Edit: 2019-04-20 02:59:21 by Sebanisu »

Sebanisu

  • *
  • Posts: 171
    • View Profile
Re: FF8 - Location of menu text and dims
« Reply #4 on: 2019-04-20 02:17:12 »
https://pastebin.com/P8dEJWeR <-- link to the string dump so far. I'm assuming there is more in mngrp. That's all I can do today though :P maybe more after work tomorrow.

Sebanisu

  • *
  • Posts: 171
    • View Profile
Re: FF8 - Location of menu text and dims
« Reply #5 on: 2019-04-20 09:21:36 »
mngrphd.bin seems to be the map of mngrp.bin

uint32 {0x01,0x800} seems to be loc and length. though loc is seems to be 1 instead of being 0 for start. So would probably need to subtract 1 to get correct locations.

some locations are {0xFFFFFFFF.0x00000000} i think these are skippable

i tweaked my code to read the next group of strings. rest of strings don't seem to have 16 padding values they just have string locations.

we are up to 5 special characters. These combine with 1 or 2 bytes to specify a value to insert or a change to formatting.

0x03 = names
0x05 = buttons/icons
0x06 = color, got green and blue and white. Based on pallet there is probably at least 8 colors.
0x0A = stings or number values. Or a noting beginning and end of things that may not be unlocked.
0x0B = cursor location. Sometimes followed by another byte. Like Yes No End Do not use an extra byte but most everything else does. I think because it's going to something specific.

Updated to add more things discovered.

Some for 0x0A and 0x0B values are used in multiple ways depending on location.
« Last Edit: 2019-04-22 00:38:42 by Sebanisu »

Maki

  • 0xBAADF00D
  • *
  • Posts: 621
  • 0xCCCCCCCC
    • View Profile
Re: FF8 - Location of menu text and dims
« Reply #6 on: 2019-04-20 10:50:36 »
To add to this I'm attaching a pseudocode of what  actually get's loaded by the engine:
Code: [Select]
FILE *MenuReadFiles()
{
  Menu_GetFile(&mngrphd_binBuffer, aMngrphd_bin);
  Menu_GetFile(&facesp2_buffer, aFace_sp2);
  dword_1D2BB78 = AllocateMemory(0x800u, aCFf8MenuKata_1, 143);
  Menu_GetFile(&magsortbuffer, aMagsort_bin);
  Menu_GetFile(&mweaponbuffer, aMwepon_bin);
  Menu_GetFile(&mmagbuffer, aMmag_bin);
  Menu_GetFile(&mthomasbuffer, aMthomas_bin);
  Menu_GetFile(&areamesdc2buffer, aAreames_dc2);
  Menu_GetFile(&mmagicbinbuffer, aMmagic_bin);
  Menu_GetFile(&mitembuffer, aMitem_bin);
  Menu_GetFile(&areamesbuffer, aAreames_dc1);
  Menu_GetFile(&mmag2bin, aMmag2_bin);
  Menu_GetFile(&cyocobobinbuffer, aCyocobo_bin);
  Menu_GetFile(&m000binbuffer, aM000_bin);
  Menu_GetFile(&m001binbuffer, aM001_bin);
  Menu_GetFile(&m002buffer, aM002_bin);
  Menu_GetFile(&m003buffer, aM003_bin);
  Menu_GetFile(&m004buffer, aM004_bin);
  Menu_GetFile(&m000msgbuffer, aM000_msg);
  Menu_GetFile(&m001msgbuffer, aM001_msg);
  Menu_GetFile(&m002msgbuffer, aM002_msg);
  Menu_GetFile(&m0003msgbuffer, aM003_msg);
  Menu_GetFile(&m004msgbuffer, aM004_msg);
  Menu_GetFile(&mitembinbuffer, aMitem_bin_0);
  Menu_GetFile(&petexpbinbuffer, aPet_exp_bin);
  Menu_GetFile(&petexpmsgbuffer, aPet_exp_msg);
  Menu_GetFile(&shopbinbuffer, aShop_bin);
  Menu_GetFile(&pricebinbuffer, aPrice_bin);
  Menu_GetFile(&mitembinbuffer_0, aMitem_bin_1);
  Menu_GetFile(&mweaponbinbuffer, aMwepon_bin_0);
  Menu_GetFile(&mweaponmsgbuffer, aMwepon_msg);
  Menu_GetFile(&mmagbinbuffer, aMmag_bin_0);
  Menu_GetFile(&cardanmsp2buffer, aCardanm_sp2);
  return Menu_GetFile(&mtmagbinbuffer, aMtmag_bin);
}

Sebanisu

  • *
  • Posts: 171
    • View Profile
Re: FF8 - Location of menu text and dims
« Reply #7 on: 2019-04-21 02:39:06 »
Is that from disassembling it?

Maki

  • 0xBAADF00D
  • *
  • Posts: 621
  • 0xCCCCCCCC
    • View Profile
Re: FF8 - Location of menu text and dims
« Reply #8 on: 2019-04-21 10:37:17 »
Is that from disassembling it?
Yep, real vanilla game code

Sebanisu

  • *
  • Posts: 171
    • View Profile
Re: FF8 - Location of menu text and dims
« Reply #9 on: 2019-04-21 18:07:04 »
Do you have a recommendation on a good program for that?

Sent from my Pixel XL using Tapatalk


Sebanisu

  • *
  • Posts: 171
    • View Profile
Re: FF8 - Location of menu text and dims
« Reply #10 on: 2019-04-22 16:28:26 »
http://wiki.ffrtt.ru/index.php/FF8/Menu_mngrp_bin added a bunch of info that I found on this file to the wiki. Still a lot of holes. Where I'm not sure anyone had discovered what is there.

I named the strings I'm having trouble reading "Complex Strings" mostly because the distance between the entries is 0-3 bytes so when I jump to the next offset i might be inside a string instead of the 6 bytes in front of the next entry.

I think the offsets might be in another section but I haven't figured it out yet.

I might take a break from this and integrate the ones I can read as it'll cover most of what I need to do.

I probably also should update the wiki with what is in the string data instead of just putting "strings here". Not that big of a deal. :P

Sebanisu

  • *
  • Posts: 171
    • View Profile
Re: FF8 - Location of menu text and dims
« Reply #11 on: 2019-04-25 08:03:40 »
http://forums.qhimm.com/index.php?topic=2459.0 has some useful info related

Sent from my Pixel XL using Tapatalk


Colly

  • *
  • Posts: 148
    • View Profile
    • Final Fantasy VIII PL
Re: FF8 - Location of menu text and dims
« Reply #12 on: 2019-04-25 19:04:49 »

Sebanisu

  • *
  • Posts: 171
    • View Profile
Re: FF8 - Location of menu text and dims
« Reply #13 on: 2019-04-30 01:41:34 »
areames.dc1 has the suffix of the location strings in it.
i'm not sure if they are all there.

"<special character 2 bytes ex. 0xE21>- Cactuar Island"

I think namedic.bin has the prefix. (region names)
Noticed that some languages move the special character to flip the order.

To get the offset it seems we take the 0xE## and subtract 0xE20. like 0xE20 becomes 0 and the string at location 0 in namedic.bin is Galbadia.

kernel.bin has the non customizable character names all in a row. So I think that's where those are. Customizable name defaults are stored in mngrp and the customized name is stored in the save file.
« Last Edit: 2019-04-30 13:25:22 by Sebanisu »

gledson999

  • *
  • Posts: 71
  • Listem to my Story, this maybe our last chance ♪
    • View Profile
Re: FF8 - Location of menu text and dims
« Reply #14 on: 2019-05-15 19:04:00 »
http://wiki.ffrtt.ru/index.php/FF8/Menu_mngrp_bin added a bunch of info that I found on this file to the wiki. Still a lot of holes. Where I'm not sure anyone had discovered what is there.

I named the strings I'm having trouble reading "Complex Strings" mostly because the distance between the entries is 0-3 bytes so when I jump to the next offset i might be inside a string instead of the 6 bytes in front of the next entry.

I think the offsets might be in another section but I haven't figured it out yet.

I might take a break from this and integrate the ones I can read as it'll cover most of what I need to do.

I probably also should update the wiki with what is in the string data instead of just putting "strings here". Not that big of a deal. :P

The link about mngrphd.bin, mngrp.bin, tkmnmes files, and mngrp complex string was removed from wiki yesterday, can anyone update?

The following link off are:

http://wiki.ffrtt.ru/index.php/FF8/Menu_tkmnmes
http://wiki.ffrtt.ru/index.php/FF8/Menu_mngrphd_bin
http://wiki.ffrtt.ru/index.php/FF8/Menu_mngrp_bin
http://wiki.ffrtt.ru/index.php/FF8/Menu_mngrp_complex_strings

Sebanisu

  • *
  • Posts: 171
    • View Profile
Re: FF8 - Location of menu text and dims
« Reply #15 on: 2019-05-15 19:13:49 »
Someone or something rolled back the wiki to february 2019. So everything I edited or changed is gone.

You can see the code on https://github.com/MaKiPL/OpenVIII

Maybe if I get motivated to redo everything I'll put it on a wiki on github where I have control over it.

gledson999

  • *
  • Posts: 71
  • Listem to my Story, this maybe our last chance ♪
    • View Profile
Re: FF8 - Location of menu text and dims
« Reply #16 on: 2019-05-15 20:28:56 »
Someone or something rolled back the wiki to february 2019. So everything I edited or changed is gone.

You can see the code on https://github.com/MaKiPL/OpenVIII

Maybe if I get motivated to redo everything I'll put it on a wiki on github where I have control over it.

All the work is gone? It's sad to know that.

I was trying to discover how to enable minimog and ChocoBuckle in FF8 but withowt success, do you know any method or opcode that do this?

I made a thread here about my project
http://forums.qhimm.com/index.php?topic=18873.msg264217#msg264217

Sebanisu

  • *
  • Posts: 171
    • View Profile
Re: FF8 - Location of menu text and dims
« Reply #17 on: 2019-05-15 22:01:14 »
I'll move data to your post.
« Last Edit: 2019-05-15 22:12:54 by Sebanisu »

gledson999

  • *
  • Posts: 71
  • Listem to my Story, this maybe our last chance ♪
    • View Profile
Re: FF8 - Location of menu text and dims
« Reply #18 on: 2019-05-15 22:29:08 »
I'll move data to your post.


Thanks, it will be helpfull buddy.

about mngrp.bin at offset 0x1BD808 this text are buggy when I using this tool Translator Tool - MnGrpEditor (v1.6) from http://forums.qhimm.com/index.php?topic=15967.0

What another way to edit this?

Note: This text are from Information tutorial

Sebanisu

  • *
  • Posts: 171
    • View Profile
Re: FF8 - Location of menu text and dims
« Reply #19 on: 2019-05-15 23:04:59 »
Thanks, it will be helpfull buddy.

about mngrp.bin at offset 0x1BD808 this text are buggy when I using this tool Translator Tool - MnGrpEditor (v1.6) from http://forums.qhimm.com/index.php?topic=15967.0

What another way to edit this?

Note: This text are from Information tutorial
Could use a hex editor. Colly's post above has a lot of info.
« Last Edit: 2019-05-15 23:07:52 by Sebanisu »