Skip to content

Commit e59d1bc

Browse files
committed
Add opcode information for 0x00D0 to 0x00D9 (Round 1, done! :o)
1 parent 1ef1d5c commit e59d1bc

10 files changed

+500
-0
lines changed

OpCodes/0x00D0.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# OpCode: 0x00D0
2+
3+
| Information | Notes |
4+
|--- |--- |
5+
| **OpCode** | `D0 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??` |
6+
| **OpCode Size** | `17` |
7+
| **Sets `RetFlag`?** | `No` |
8+
| **Sets `ExecPointer`?** | `Yes` |
9+
10+
## Description
11+
12+
Handler that calls the same helper call as opcode `0x0045`, just with a different second argument.
13+
14+
See [OpCode `0x0045`](OpCodes/0x0045.md) for more information.
15+
16+
## Pseudo Code
17+
18+
```cpp
19+
void __thiscall FUNC_XiEvent_OpCode_0x00D0(xievent_t* this)
20+
{
21+
FUNC_XiEvent_OpCode_0x0045_(this, 70691);
22+
}
23+
```
24+
25+
---
26+
27+
_This data is current as of Feb. 28, 2022 retail client._

OpCodes/0x00D1.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# OpCode: 0x00D1
2+
3+
| Information | Notes |
4+
|--- |--- |
5+
| **OpCode** | `D1 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??` |
6+
| **OpCode Size** | `15` |
7+
| **Sets `RetFlag`?** | `Yes` |
8+
| **Sets `ExecPointer`?** | `Yes` |
9+
10+
## Description
11+
12+
Handler that calls the same helper call as opcode `0x0055`, just with a different second argument.
13+
14+
See [OpCode `0x0055`](OpCodes/0x0055.md) for more information.
15+
16+
## Pseudo Code
17+
18+
```cpp
19+
void __thiscall FUNC_XiEvent_OpCode_0x00D1(xievent_t* this)
20+
{
21+
FUNC_XiEvent_OpCode_0x0055_(this, 70691);
22+
}
23+
```
24+
25+
---
26+
27+
_This data is current as of Feb. 28, 2022 retail client._

OpCodes/0x00D2.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# OpCode: 0x00D2
2+
3+
| Information | Notes |
4+
|--- |--- |
5+
| **OpCode** | `D2 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??` |
6+
| **OpCode Size** | `15` |
7+
| **Sets `RetFlag`?** | `No` |
8+
| **Sets `ExecPointer`?** | `Yes` |
9+
10+
## Description
11+
12+
Handler that calls the same helper call as opcode `0x0052`, just with a different second argument.
13+
14+
See [OpCode `0x0052`](OpCodes/0x0052.md) for more information.
15+
16+
## Pseudo Code
17+
18+
```cpp
19+
void __thiscall FUNC_XiEvent_OpCode_0x00D2(xievent_t* this)
20+
{
21+
FUNC_XiEvent_OpCode_0x0052_(this, 70691);
22+
}
23+
```
24+
25+
---
26+
27+
_This data is current as of Feb. 28, 2022 retail client._

OpCodes/0x00D3.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# OpCode: 0x00D3
2+
3+
| Information | Notes |
4+
|--- |--- |
5+
| **OpCode** | `D3 ?? ?? ?? ?? ??` |
6+
| **OpCode Size** | `6` |
7+
| **Sets `RetFlag`?** | `No` |
8+
| **Sets `ExecPointer`?** | `Yes` |
9+
10+
## Description
11+
12+
Gets the given entity and calls a helper function that clears its motion queue lists.
13+
14+
`FUNC_XiActor_Unknown` is a wrapper that will call `KzMotionQueList::DeleteAll`.
15+
16+
## Pseudo Code
17+
18+
```cpp
19+
void __thiscall FUNC_XiEvent_OpCode_0x00D3(xievent_t* this)
20+
{
21+
uint16_t index;
22+
uint32_t serverId;
23+
24+
if (!this->EventData[this->ExecPointer + 1])
25+
{
26+
const auto val = FUNC_XiEvent_eventgetcode2(this, 2);
27+
if (FUNC_XiEvent_GetActorIndex(this, val, &serverId, &index))
28+
{
29+
const auto entity = PTR_EntityMap[index];
30+
if (entity && (entity->Render.Flags0 & 0x200) != 0)
31+
{
32+
if (FUNC_YmObject_IsKindOf(entity->WarpPointer, "CXiSkeletonActor"))
33+
FUNC_XiActor_Unknown(entity->WarpPointer);
34+
}
35+
36+
this->ExecPointer += 6;
37+
}
38+
}
39+
}
40+
```
41+
42+
---
43+
44+
_This data is current as of Feb. 28, 2022 retail client._

OpCodes/0x00D4.md

+159
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
# OpCode: 0x00D4
2+
3+
| Information | Notes |
4+
|--- |--- |
5+
| **OpCode** | `D4 ??` <br> `D4 ?? ?? ?? ?? ??` <br> `D4 ?? ?? ?? ?? ?? ?? ??` <br> `D4 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??` |
6+
| **OpCode Size** | `2`, `6`, `8`, `12` |
7+
| **Sets `RetFlag`?** | `No` |
8+
| **Sets `ExecPointer`?** | `Yes` |
9+
10+
## Description
11+
12+
Handles multiple sub-opcodes. These appear to be related to opening the map and querying the user for input.
13+
14+
## Pseudo Code
15+
16+
```cpp
17+
void __thiscall FUNC_XiEvent_OpCode_0x00D4(xievent_t* this)
18+
{
19+
const auto ptr = this->ExecPointer;
20+
21+
switch (this->EventData[this->ExecPointer + 1])
22+
{
23+
case 0x00:
24+
{
25+
this->ExecPointer++;
26+
27+
// Tests if the PTR_g_pYkWndMapMain window is created, if it is, tests if it was created with type '6'..
28+
// Function returns true if the window is not created, or is not type 6..
29+
if (FUNC_TestWndMapMain(6))
30+
{
31+
// Calls the opcode 0x0024 helper to open the query window..
32+
if (FUNC_XiEvent_OpCode_0x0024_(this))
33+
{
34+
FUNC_OpenMap2(6, PTR_pGlobalNowZone->UnknownValue, -1, 1, 1);
35+
36+
// Allocates and prepares the PTR_TalkpQW object..
37+
PTR_TalkpQW = FUNC_CreateTalkpQWObject(PTR_g_TkMenuMng);
38+
39+
if (PTR_TalkpQW)
40+
PTR_TalkpQW->UnknownCallback = FUNC_UnknownCallback;
41+
}
42+
else
43+
{
44+
this->ExecPointer = ptr;
45+
this->RetFlag = 1;
46+
}
47+
}
48+
else
49+
{
50+
this->ExecPointer = ptr;
51+
this->RetFlag = 1;
52+
}
53+
54+
return;
55+
}
56+
57+
case 0x01:
58+
{
59+
int32_t buff[8]{};
60+
std::memset(&buff, 0xFF, sizeof(buff));
61+
62+
const auto val1 = FUNC_XiEvent_getworkofs_(this, 2);
63+
LOWORD(buff[0]) = FUNC_XiEvent_getworkofs_(this, 4);
64+
HIWORD(buff[0]) = FUNC_XiEvent_getworkofs_(this, 6);
65+
66+
// Allocates and prepares the PTR_TalkpQW object..
67+
PTR_TalkpQW = FUNC_CreateTalkpQWObject(PTR_g_TkMenuMng);
68+
69+
// Copies the buff data into the PTR_TalkpQW memory..
70+
if (PTR_TalkpQW)
71+
FUNC_TalkpQW_CopyData(PTR_TalkpQW, val1, buff);
72+
73+
this->ExecPointer += 8;
74+
return;
75+
}
76+
77+
case 0x02:
78+
{
79+
this->ExecPointer++;
80+
81+
// Calls the opcode 0x0024 helper to open the query window..
82+
if (FUNC_XiEvent_OpCode_0x0024_(this))
83+
{
84+
// Allocates and prepares the PTR_TalkpQW object..
85+
PTR_TalkpQW = FUNC_CreateTalkpQWObject(PTR_g_TkMenuMng);
86+
87+
if (PTR_TalkpQW)
88+
PTR_TalkpQW->UnknownCallback = FUNC_UnknownCallback;
89+
}
90+
else
91+
{
92+
this->ExecPointer = ptr;
93+
this->RetFlag = 1;
94+
}
95+
96+
return;
97+
}
98+
99+
case 0x03:
100+
{
101+
int32_t buff[8]{};
102+
std::memset(&buff, 0xFF, sizeof(buff));
103+
std::memset(&buff[1], 0x00, 0x1C);
104+
105+
const auto val1 = FUNC_XiEvent_getworkofs_(this, 2);
106+
107+
BYTE2(buff[0]) = 0;
108+
LOWORD(buff[0]) = FUNC_XiEvent_getworkofs_(this, 4);
109+
HIBYTE(buff[0]) = 0;
110+
111+
// Allocates and prepares the PTR_TalkpQW object..
112+
PTR_TalkpQW = FUNC_CreateTalkpQWObject(PTR_g_TkMenuMng);
113+
114+
// Copies the buff data into the PTR_TalkpQW memory..
115+
if (PTR_TalkpQW)
116+
FUNC_TalkpQW_CopyData(PTR_TalkpQW, val1, buff);
117+
118+
this->ExecPointer += 6;
119+
return;
120+
}
121+
122+
case 0x04:
123+
case 0x05:
124+
{
125+
int32_t buff[8]{};
126+
std::memset(&buff, 0xFF, sizeof(buff));
127+
std::memset(&buff[1], 0x00, 0x1C);
128+
129+
const auto val1 = FUNC_XiEvent_getworkofs_(this, 2);
130+
131+
BYTE2(buff[0]) = 1;
132+
LOWORD(buff[0]) = FUNC_XiEvent_getworkofs_(this, 4);
133+
HIBYTE(buff[0]) = this->EventData[this->ExecPointer + 1] != 5 ? 0 : 2;
134+
135+
buff[1] = FUNC_XiEvent_getworkofs_(this, 6);
136+
buff[2] = FUNC_XiEvent_getworkofs_(this, 8);
137+
buff[3] = FUNC_XiEvent_getworkofs_(this, 10);
138+
139+
// Allocates and prepares the PTR_TalkpQW object..
140+
PTR_TalkpQW = FUNC_CreateTalkpQWObject(PTR_g_TkMenuMng);
141+
142+
// Copies the buff data into the PTR_TalkpQW memory..
143+
if (PTR_TalkpQW)
144+
FUNC_TalkpQW_CopyData(PTR_TalkpQW, val1, buff);
145+
146+
this->ExecPointer += 12;
147+
return;
148+
}
149+
150+
default:
151+
this->ExecPointer = ptr;
152+
return;
153+
}
154+
}
155+
```
156+
157+
---
158+
159+
_This data is current as of Feb. 28, 2022 retail client._

OpCodes/0x00D5.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# OpCode: 0x00D5
2+
3+
| Information | Notes |
4+
|--- |--- |
5+
| **OpCode** | `D5 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??` |
6+
| **OpCode Size** | `17` |
7+
| **Sets `RetFlag`?** | `No` |
8+
| **Sets `ExecPointer`?** | `Yes` |
9+
10+
## Description
11+
12+
Handler that calls the same helper call as opcode `0x0045`, just with a different second argument.
13+
14+
See [OpCode `0x0045`](OpCodes/0x0045.md) for more information.
15+
16+
## Pseudo Code
17+
18+
```cpp
19+
void __thiscall FUNC_XiEvent_OpCode_0x00D5(xievent_t* this)
20+
{
21+
FUNC_XiEvent_OpCode_0x0045_(this, 102449);
22+
}
23+
```
24+
25+
---
26+
27+
_This data is current as of Feb. 28, 2022 retail client._

OpCodes/0x00D6.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# OpCode: 0x00D6
2+
3+
| Information | Notes |
4+
|--- |--- |
5+
| **OpCode** | `D6 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??` |
6+
| **OpCode Size** | `15` |
7+
| **Sets `RetFlag`?** | `Yes` |
8+
| **Sets `ExecPointer`?** | `Yes` |
9+
10+
## Description
11+
12+
Handler that calls the same helper call as opcode `0x0055`, just with a different second argument.
13+
14+
See [OpCode `0x0055`](OpCodes/0x0055.md) for more information.
15+
16+
## Pseudo Code
17+
18+
```cpp
19+
void __thiscall FUNC_XiEvent_OpCode_0x00D6(xievent_t* this)
20+
{
21+
FUNC_XiEvent_OpCode_0x0055_(this, 102449);
22+
}
23+
```
24+
25+
---
26+
27+
_This data is current as of Feb. 28, 2022 retail client._

OpCodes/0x00D7.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# OpCode: 0x00D7
2+
3+
| Information | Notes |
4+
|--- |--- |
5+
| **OpCode** | `D7 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??` |
6+
| **OpCode Size** | `15` |
7+
| **Sets `RetFlag`?** | `No` |
8+
| **Sets `ExecPointer`?** | `Yes` |
9+
10+
## Description
11+
12+
Handler that calls the same helper call as opcode `0x0052`, just with a different second argument.
13+
14+
See [OpCode `0x0052`](OpCodes/0x0052.md) for more information.
15+
16+
## Pseudo Code
17+
18+
```cpp
19+
void __thiscall FUNC_XiEvent_OpCode_0x00D7(xievent_t* this)
20+
{
21+
FUNC_XiEvent_OpCode_0x0052_(this, 102449);
22+
}
23+
```
24+
25+
---
26+
27+
_This data is current as of Feb. 28, 2022 retail client._

0 commit comments

Comments
 (0)