Anonymous

Changes

From Final Fantasy Inside

FF7/Field/DialogWindow

1,598 bytes added, 05:14, 23 May 2019
m
12 revisions imported
== Functions ==
 
dialog_copy_text_from_field:
First we set reading parameters.
If 800832A2 (cbc) 0x02 bit is set then A1 = 0x100, S5 = 1. This will cause all characters show at once.
If 800832A2 (cbc) 0x02 bit is not set then we check if "OK" button (0x0020) pressed. If yes we increment 80114480 by 1 (but no more than 80), if not - decrement by 1 (no less than 1).
If 800832A2 (cbc) 0x02 bit is not set and message speed < 0x80 then we set A1 = ((80 - message speed) / 32) + 2. S5 = 1.
If 800832A2 (cbc) 0x02 bit is not set and message speed >= 0x80 then we set A1 = 2. S5 = ((message speed - 80) / 32) + 1.
Now we use A1, S5, 80114480 and 80114470 to calculate 80114470 value which will be used to calculate if we must continue reading characters or not. 80114470 = 80114470 + S5 * 80114480 / 10 + A1.
Now we will read characters until 80114470 <= S5 if so - end string copy until next call.
 
dialog_window_init:
0x57 SWCOL
[0x57][bank_for_corner/bank_for_r][bank_for_g/bank_for_b][corner][r][g][b]
[0x56][bank_for_corner/bank_for_r][bank_for_g/bank_for_b][corner][r][g][b]
Set 80049208 (red value of given corner) to bank_for_r + r.
Set 80049209 (green value of given corner) to bank_for_g + g.
F9 - usual letter.
FA - copied to string together with next byte. Increment letters data by 1 and byte data by 2. Used in the Japanese version to print special characters from the extended font. The sequence 0xFA00 translates to screen as '&#24517;'.
FB - copied to string together with next byte. Increment letters data by 1 and byte data by 2. Used in the Japanese version to print special characters from the extended font. The sequence 0xFB00 translates to screen as '&#23433;'.
FC - copied to string together with next byte. Increment letters data by 1 and byte data by 2. Used in the Japanese version to print special characters from the extended font. The sequence 0xFC00 translates to screen as '&#30001;'.
FD - copied to string together with next byte. Increment letters data by 1 and byte data by 2. Used in the Japanese version to print special characters from the extended font. The sequence 0xFD00 translates to screen as '&#21451;'.
FE - special opcode. Write FE to string. Increment byte data by 1. Read next byte and do something according to it. Case 00-D1 are used in the Japanese version to print special characters from the extended font. The sequence 0xFE00 translates to screen as '&#23403;'.
FED2 - increment byte data by 1. Write this byte to string. (colour formater: Gray)
FED3 - increment byte data by 1. Write this byte to string. (colour formater: Blue)
FED4 - increment byte data by 1. Write this byte to string. (colour formater: Red)
FED5 - increment byte data by 1. Write this byte to string. (colour formater: Purple)
FED6 - increment byte data by 1. Write this byte to string. (colour formater: Green)
FED7 - increment byte data by 1. Write this byte to string. (colour formater: Cyan)
FED8 - increment byte data by 1. Write this byte to string. (colour formater: Yellow)
FED9 - increment byte data by 1. Write this byte to string. (colour formater: White)
FEDA - increment byte data by 1. Write this byte to string. (colour formater: Flash)
FEDB - increment byte data by 1. Write this byte to string. (colour formater: Rainbow)
FEDC - remove FE from string by decrement byte data by 1. Set window state to 0xD. Write 0x0000 to 80114470 array. Write 0x0001 to 80114480 array. End string copying. Write FF to string.