A
Akari
Guest
How square set up coords for the tiles in window.bin interface elements? It's hardcoded in the exe or they have some sort of description for it?
Hmm... then why last part of window.bin looks so like the tile size? Can someone with knowledge of disasm check out for what this file used and what are exact coords for first archive in window.binIt's hardcoded. At least for items I looked at.
Can you describe the format?Last part is font's size (for each char).
It will be very helpfull. And I need to know which palette use for each part of window.bin. Because I need to create usual textures, but dont want create 17 copies of the same texture with different palettes.I may put my fieldscript opcodes to the side and knock that out real quick.
Full versionFF7 uses an array to see how much pixels each letter has. The address in memory (after loading ff7.exe EN v1.0):
- 0x0098F458
In that array, each byte corresponds to a single character. To decode the data stored, all you have to do is get the byte for a character, and look for the corresponding data in the array. After that:
- to get a character's width, AND a just-found-byte with 0x1F (00011111b)
- to get a character's padding (well I don't know if that's what it's called, but it's just a number of pixels before the character), SHR just-found-byte by 5
Example:
To get a quotation mark "values", we:
- get the byte for that character - it's stored in address 0x0098F458 (base address) + 0x1F (the hex value for quotation mark). It should be 0x27 (or 00100111b or 39);
- AND it with 1F, or modulo it by 0x20 (32) - we get 7
- SHR it (the byte read 0x27) by 5 (or divide by 32) - we get 1
And... that's it. Remeber that these values are in 320x240 resolution mode (not really sure about that), to get the size in the 640x480 mode multiply the results by 1.666667, and truncate the non-integer part (even if it's 4.9998, we get 4).
Have fun ^_^Hi there,
The following files here are to help you plot the window.bin graphics. I have
mapped the borders of all the graphics and placed them in the following
non-lossy .png files
The files are as follows.
winwithtex.png - this shows the texture boundries superimposed over the
textures themselves.
windowbin8x8.png - This is just the boundries overlaied on a 8x8 grid so you
can easily figure out the coordinates.
windowbin_transwhite.png - This is a transparent png that has just the borders
in white so you can overlay them yourself.
windowbin_transblack.png - This is a transparent png that has just the borders
in black this time so you can overlay them yourself.
################################
# Notes on window.bin textures #
################################
There are a few things to note. First all texture borders stop on a mutiple of
8 pixels, execpt for the words and numbers that "bounce" during a battle
attack. These are 10 pixels high. This has to do with the fact that these
textures are copied elsewhere during the "bounce" and not taken directly from
window.bin. The "bounce numbers" are actually 16 pixels high, but the bottom 6
pixels are transparent and don't matter.(The origin of the textures are the
upper left hand corner)
The three blank "x" textures are for the chataracter avatars. These are at a
different colordepth so the space for them is wider. (The PSX could hold
mutiple color depths on the same video surface)
#####################################
# Notes on the Color Look Up Tables #
#####################################
window.bin has 16 CLUTs, the first color of all CLUTs are always transparent.
The different colors are allocated for the following textures
Clut 1
Window borders in lower left hand corner.
Clut 2
Battle menu words (HP, NAME, BARRIER, etc) , selector finger, scollbar widgets,
materia slots and links, sleaping Zzz and Silence bobbles, equip weapon icons,
shop weapon and item icons, "here" pointing finger (comes on when you press
"select" Pretty much all greyscale items. Blue text.
Clut 3
Purple ATB bar, red text
Clut 4
Blue ATB bar, pink text
Clut 5
Green text, green materia, green filled and unfilled master ranking stars
Clut 6
Cyan text, blue materia, blue filled and unfilled master ranking stars
Clut 7
Yellow text
Clut 8
White text, Battle target arrow, selecter finger with red "X" over the top, PSX
R1,R2,L1,L2, start, and select buttons
Clut 9
Coin attack "throw" colors for texture, yellow materia, yellow filled and
unfilled master ranking stars.
Clut 10
Arrows that show exits (when select is pushed), purple materia, filled and
unfilled purple master ranking stars.
Clut 11
Red materia, red filled and unfilled master ranking stars PSX "shape" buttons
Clut 12
Tifa limit slots
Clut 13
Countdown clock
Clut 14
Colors for Cloud? (not avatar)
Clut 15
Unknown, possably a limit
Clut 16
Unknown, possably a limit
####################################################
# Notes on dialog font (second file in window.bin) #
####################################################
These are 12x12 caracters arranged in FFText order.
Hmm... the color of those are transparent. So we cant see the font... although it works on window borders. Any comments?Clut 3
Purple ATB bar, red text
Clut 4
Blue ATB bar, pink text
Clut 5
Green text
Clut 7
Yellow text
Clut 8
White text
u16 col = GetU16LE(sizeof(timHeader) + clut_number * tim_header->number_of_colors * 2 + i * 2);clut[i].b = ((col ) & 31) * 8;clut[i].g = ((col >> 5) & 31) * 8;clut[i].r = ((col >> 10) & 31) * 8;clut[i].a = ((col & 0x8000) || (col == 0x0000)) ? 0 : 255;
I was under the impression that index #0 in the CLUT was transparent, no matter what CLUT was loaded. I'll peek at it when I get home.Hmm... the color of those are transparent. So we cant see the font... although it works on window borders. Any comments?Clut 3
Purple ATB bar, red text
Clut 4
Blue ATB bar, pink text
Clut 5
Green text
Clut 7
Yellow text
Clut 8
White text
unsigned char conv5to8[32] = {0, 8, 16, 24, 32, 41, 49, 57, 65, 74, 82, 90, 98, 106, 115, 123, 131, 139, 148,156, 164, 172, 180, 189, 197, 205, 213, 222, 230, 238, 246, 255};