User:Pkmnfrk/Textbox.stb

From OHRRPGCE-Wiki

Jump to: navigation, search
This article discusses a brand new feature which is not included in the latest stable version, and may not even be in the next stable version. It can, however, be found in a nightly build, which can be found on the Downloads page. If you wish to discuss this feature, feel free to use the talk page.

This lump contains all the text for the text boxes. It is a variable width string table with a header. Text boxes should point to the header, which will then point you into the soup of text in the body.

[edit] Formal Specs

About Formal Specs - Note: This table uses byte-offsets, not word offsets

OffsetDataMeaning
0-3STR(4)ID code (should always be "OSTB")
4INTVersion (currently 1)
6LONGNumber of entries in the table
10LONGOffset to beginning of string data (including this header, and the actual table)
Note that the offsets listed in the table are offset from the beginning of the string data, not the beginning of the file.

Next is the table portion of the header. It is 13 bytes long, and repeats for as many as there are entries.

OffsetDataMeaning
0BYTEUsed or free (0 is free, 1 is used. Anything else is reserved, but should be interpreted as used)
1LONGPointer to string data
5LONGLength of string data (actual usage)
9LONGAllocated space (how much room the string data has to grow)

Finally, after the table, is the string data. A given string is padded out to its "Allocated" length with nulls. This does not mean that it is null terminated, however. When reading the string, always use the "Used" length to read the string. This is because if the string is exactly big enough to fill the space, it will not have any nulls at all. Further, if a string has an embedded null (i.e. 0x0 in the middle), you cannot assume it marks the end of the string.

ARCHINYM.LMP . BROWSE.TXT . ATTACK.BIN . BINSIZE.BIN . DEFPAL#.BIN . DEFPASS.BIN . FIXBITS.BIN . LOOKUP.BIN . MENUS.BIN . MENUITEM.BIN . PALETTES.BIN . PLOTSCR.LST . SFXDATA.BIN . SONGDATA.BIN . UICOLORS.BIN . GEN . BAM . Map Format . T . P . E . D . L . N . DOR . DOX . DT0 . DT1 . DT6 . EFS . FOR . FNT . HSP . HSZ . ITM . MAP . MAS . MN . MXS . PAL . PT0 . PT1 . PT2 . PT3 . PT4 . PT5 . PT6 . SAY . SHO . SNG . STF . STT . TAP . TIL . TMN . VEH

Personal tools