Qhimm.com Forums
Miscellaneous Forums => Scripting and Reverse Engineering => Topic started by: Akari on 2007-07-20 13:20:17
-
I see wiki misses this two opcodes.
I disasmed them to help Synergy Blades understand it better:
////////////////////////////////////////////////////////
// 0x2E WCLS
v0 = [8009d820] = 0;
v0 = v0 & 3;
if (v0 != 0)
{
800CAF7C lui a0, $800a
800CAF80 addiu a0, a0, $0aa8
800CAF84 jal funcbead4 [$800bead4]
800CAF88 ori a1, zero, $0002
}
s0 = window_id; // window id from opcode
if ([8008326C + s0] != FF) // if window already shown
{
v0 = 0;
a0 = s0;
set_state_to_close
a0 = s0;
a1 = 0;
set_display_window
v0 = 1;
}
else
{
v0 = 0;
move script pointer by 2
}
////////////////////////////////////////////////////////
First there are standart check for all opcodes. Don't know what are they check anyway.
[8008326C + s0] - id of entity that called this window. If window is not called this is 0xFF
As I understand - this opcode set given entity to close (set WINDOW STATE = 7)
And open new window with dialog id == 0
Next:
////////////////////////////////////////////////////////
// 0x54 WCLSE
v0 = [8009d820] = 0;
v0 = v0 & 3;
if (v0 != 0)
{
800CAF7C lui a0, $800a
800CAF80 addiu a0, a0, $0aa8
800CAF84 jal funcbead4 [$800bead4]
800CAF88 ori a1, zero, $0002
}
a0 = param1;
set_state_to_close
if (v0 == 0)
{
v0 = 1;
}
else
{
v0 = 0;
move script pointer by 2
}
////////////////////////////////////////////////////////
This simply close window with given id.
And function
////////////////////////////////////////////////////////
set_state_to_close
a0 = window id
get window state
if ((window state - 1 >= D) || (window state - 1 == 0))
{
return 0;
}
if (window state - 1 == {2, 4, 6, 8, 9, B})
{
return 1;
}
if (window state - 1 == {1, 3, 5, 7, A, C})
{
set window state to 7;
return 0;
}
////////////////////////////////////////////////////////
Does this makes sence?
-
The only reason I didn't fill them in was because I could not get them to work with my own dialogs and windows, as much as I can see that they seem to close dialogs such as timer windows and so on in FF7 fields I looked at. :-( I may have a look later, see if the assembly helps any in getting it to work in a test field.
-
The only reason I didn't fill them in was because I could not get them to work with my own dialogs and windows, as much as I can see that they seem to close dialogs such as timer windows and so on in FF7 fields I looked at. :-( I may have a look later, see if the assembly helps any in getting it to work in a test field.
Please note how it close window using set_state_to_close function.
When window not opened it has state 0.
When it appears on screen (no text yet) it has state 1.
When text start appear it has state 2.
When it fully open it has state 6.
When you press OK the state set to 7.
When window dissapear state returns to 0.
I don't know much about other states.. maybe they are used for other types of windows.
MESSAGE opcode not skipped. It called each script circle untill you close dialog. And function set_display_window (this is where all state checks is.) called along with it.
Hmm I tried to close first frase that Barret says me and it closed well. I just can't see difference between this two opcodes Т_Т
-
Now I get real difference between this opcodes.
WCLS - makes sure that window will be closed because it closed it himself. Script waits until it closed and then continue works. It may be called from all entitys.
WCLSE - only set state to close but not done any real closing. Closing must be handled by MESSAGE or ASK opcodes in other entity. It may be called from all entitys.