annotate Arcomage.cpp @ 1045:d3f4c6584ada

Intersect_Ray_Face clean
author Ritor1
date Tue, 21 May 2013 16:13:43 +0600
parents c45d51b3f4f4
children 3a5c8df8381d
rev   line source
0
Ritor1
parents:
diff changeset
1 #include <string>
Ritor1
parents:
diff changeset
2
1016
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 949
diff changeset
3 #include "LightmapBuilder.h"
0
Ritor1
parents:
diff changeset
4 #include "Arcomage.h"
Ritor1
parents:
diff changeset
5 #include "VideoPlayer.h"
Ritor1
parents:
diff changeset
6 #include "AudioPlayer.h"
Ritor1
parents:
diff changeset
7 #include "Mouse.h"
Ritor1
parents:
diff changeset
8 #include "Game.h"
Ritor1
parents:
diff changeset
9 #include "Viewport.h"
Ritor1
parents:
diff changeset
10 #include "Time.h"
Ritor1
parents:
diff changeset
11 #include "GUIFont.h"
Ritor1
parents:
diff changeset
12 #include "Party.h"
Ritor1
parents:
diff changeset
13 #include "GUIWindow.h"
Ritor1
parents:
diff changeset
14 #include "Events2D.h"
Ritor1
parents:
diff changeset
15 #include "VectorTypes.h"
189
038a4d09406f new texts file, fix text rendender error
Gloval
parents: 0
diff changeset
16 #include "texts.h"
0
Ritor1
parents:
diff changeset
17
Ritor1
parents:
diff changeset
18
Ritor1
parents:
diff changeset
19
938
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
20 void sub_409BE8();
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
21
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
22
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
23
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
24
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
25 /* 388 */
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
26 #pragma pack(push, 1)
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
27 struct stru348
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
28 {
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
29 __int16 field_0;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
30 __int16 field_2;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
31 __int16 field_4;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
32 __int16 field_6;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
33 __int16 field_8;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
34 __int16 field_A;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
35 __int16 field_C;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
36 __int16 field_E;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
37 __int16 field_10;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
38 __int16 field_12;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
39 int field_14;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
40 };
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
41 #pragma pack(pop)
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
42 stru348 stru_4E1890[13] =
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
43 {
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
44 { 30, 100, 15, 5, 2, 2, 2, 10, 10, 10, 0},
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
45 { 50, 150, 20, 5, 2, 2, 2, 5, 5, 5, 1},
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
46 { 50, 150, 20, 5, 2, 2, 2, 5, 5, 5, 2},
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
47 { 75, 200, 25, 10, 3, 3, 3, 5, 5, 5, 2},
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
48 { 75, 200, 20, 10, 3, 3, 3, 5, 5, 5, 1},
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
49 {100, 300, 30, 15, 4, 4, 4, 10, 10, 10, 1},
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
50 {100, 300, 30, 15, 4, 4, 4, 10, 10, 10, 2},
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
51 {150, 400, 20, 10, 5, 5, 5, 25, 25, 25, 0},
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
52 {200, 500, 20, 10, 1, 1, 1, 15, 15, 15, 2},
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
53 {100, 300, 20, 50, 1, 1, 5, 5, 5, 25, 0},
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
54 {125, 350, 10, 20, 3, 1, 2, 15, 5, 10, 2},
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
55 {125, 350, 10, 20, 3, 1, 2, 15, 5, 10, 1},
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
56 {100, 300, 50, 50, 5, 3, 5, 20, 10, 20, 0}
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
57 };
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
58
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
59
0
Ritor1
parents:
diff changeset
60
Ritor1
parents:
diff changeset
61
Ritor1
parents:
diff changeset
62 ArcomageGame *pArcomageGame = new ArcomageGame;
Ritor1
parents:
diff changeset
63 ArcomageCard pCards[87];
Ritor1
parents:
diff changeset
64 ArcomageGame_stru0 stru_505708[2];
Ritor1
parents:
diff changeset
65
Ritor1
parents:
diff changeset
66
Ritor1
parents:
diff changeset
67
935
b462b598b97a stru272.h removed, stuff moved to arcomage
Nomad
parents: 856
diff changeset
68 stru272 array_4FAC10[10];
b462b598b97a stru272.h removed, stuff moved to arcomage
Nomad
parents: 856
diff changeset
69
0
Ritor1
parents:
diff changeset
70
Ritor1
parents:
diff changeset
71
Ritor1
parents:
diff changeset
72 /* 267 */
Ritor1
parents:
diff changeset
73 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
74 struct stru273
Ritor1
parents:
diff changeset
75 {
Ritor1
parents:
diff changeset
76 bool _40DD2F();
Ritor1
parents:
diff changeset
77 bool Inside(Vec4_int_ *pXYZW);
Ritor1
parents:
diff changeset
78
Ritor1
parents:
diff changeset
79 int x;
Ritor1
parents:
diff changeset
80 int y;
Ritor1
parents:
diff changeset
81 char field_8;
Ritor1
parents:
diff changeset
82 char field_9;
Ritor1
parents:
diff changeset
83 char field_A;
Ritor1
parents:
diff changeset
84 char field_B;
Ritor1
parents:
diff changeset
85 };
Ritor1
parents:
diff changeset
86 #pragma pack(pop)
Ritor1
parents:
diff changeset
87
Ritor1
parents:
diff changeset
88
Ritor1
parents:
diff changeset
89
Ritor1
parents:
diff changeset
90
Ritor1
parents:
diff changeset
91
Ritor1
parents:
diff changeset
92
Ritor1
parents:
diff changeset
93
Ritor1
parents:
diff changeset
94
Ritor1
parents:
diff changeset
95 //----- (0040DD2F) --------------------------------------------------------
Ritor1
parents:
diff changeset
96 bool stru273::_40DD2F()
Ritor1
parents:
diff changeset
97 {
Ritor1
parents:
diff changeset
98 bool result; // eax@1
Ritor1
parents:
diff changeset
99
Ritor1
parents:
diff changeset
100 this->x = pArcomageGame->mouse_x;
Ritor1
parents:
diff changeset
101 result = pArcomageGame->mouse_y;
Ritor1
parents:
diff changeset
102 this->y = pArcomageGame->mouse_y;
Ritor1
parents:
diff changeset
103 this->field_8 = pArcomageGame->mouse_left;
Ritor1
parents:
diff changeset
104 this->field_9 = pArcomageGame->mouse_left == pArcomageGame->field_F7;
Ritor1
parents:
diff changeset
105 this->field_8 = pArcomageGame->mouse_left;
Ritor1
parents:
diff changeset
106 this->field_B = pArcomageGame->mouse_right == pArcomageGame->field_F8;
Ritor1
parents:
diff changeset
107 pArcomageGame->field_F7 = pArcomageGame->mouse_left;
Ritor1
parents:
diff changeset
108 pArcomageGame->field_F8 = pArcomageGame->mouse_right;
Ritor1
parents:
diff changeset
109 LOBYTE(result) = 1;
Ritor1
parents:
diff changeset
110 return result;
Ritor1
parents:
diff changeset
111 }
Ritor1
parents:
diff changeset
112
Ritor1
parents:
diff changeset
113 //----- (0040DD93) --------------------------------------------------------
Ritor1
parents:
diff changeset
114 bool stru273::Inside(Vec4_int_ *pXYZW)
Ritor1
parents:
diff changeset
115 {
Ritor1
parents:
diff changeset
116 int v2; // eax@3
Ritor1
parents:
diff changeset
117
Ritor1
parents:
diff changeset
118 auto a1 = this;
Ritor1
parents:
diff changeset
119 return a1->x >= pXYZW->x && a1->x <= pXYZW->z && (v2 = a1->y, v2 >= pXYZW->y) && v2 <= pXYZW->w;
Ritor1
parents:
diff changeset
120 }
Ritor1
parents:
diff changeset
121
Ritor1
parents:
diff changeset
122
Ritor1
parents:
diff changeset
123
Ritor1
parents:
diff changeset
124
Ritor1
parents:
diff changeset
125 //----- (0040DFAF) --------------------------------------------------------
Ritor1
parents:
diff changeset
126 void ArcomageGame::OnMouseClick(char right_left, bool bDown)
Ritor1
parents:
diff changeset
127 {
Ritor1
parents:
diff changeset
128 if ( right_left )
Ritor1
parents:
diff changeset
129 pArcomageGame->mouse_right = bDown;
Ritor1
parents:
diff changeset
130 else
Ritor1
parents:
diff changeset
131 pArcomageGame->mouse_left = bDown;
Ritor1
parents:
diff changeset
132 }
Ritor1
parents:
diff changeset
133
Ritor1
parents:
diff changeset
134 //----- (0040DFC1) --------------------------------------------------------
Ritor1
parents:
diff changeset
135 void ArcomageGame::OnMouseMove(POINT *pXY)
Ritor1
parents:
diff changeset
136 {
Ritor1
parents:
diff changeset
137 pArcomageGame->mouse_x = pXY->x;
Ritor1
parents:
diff changeset
138 pArcomageGame->mouse_y = pXY->y;
Ritor1
parents:
diff changeset
139 }
Ritor1
parents:
diff changeset
140
Ritor1
parents:
diff changeset
141
Ritor1
parents:
diff changeset
142 //----- (0040DF47) --------------------------------------------------------
Ritor1
parents:
diff changeset
143 void DoBlt_Copy(unsigned __int16 *pPixels)
Ritor1
parents:
diff changeset
144 {
Ritor1
parents:
diff changeset
145 unsigned __int16 *v1; // ebx@1
Ritor1
parents:
diff changeset
146 ArcomageRect rect; // [sp+Ch] [bp-18h]@1
Ritor1
parents:
diff changeset
147 int pTargetXY[2]; // [sp+1Ch] [bp-8h]@1
Ritor1
parents:
diff changeset
148
Ritor1
parents:
diff changeset
149 v1 = pPixels;
Ritor1
parents:
diff changeset
150 pRenderer->Present();
Ritor1
parents:
diff changeset
151 pTargetXY[0] = 0;
Ritor1
parents:
diff changeset
152 pTargetXY[1] = 0;
Ritor1
parents:
diff changeset
153 rect.x = 0;
Ritor1
parents:
diff changeset
154 rect.z = 640;
Ritor1
parents:
diff changeset
155 rect.y = 0;
Ritor1
parents:
diff changeset
156 rect.w = 480;
Ritor1
parents:
diff changeset
157 pRenderer->BeginScene();
Ritor1
parents:
diff changeset
158 pArcomageGame->pBlit_Copy_pixels = v1;
Ritor1
parents:
diff changeset
159 Blt_Copy(&rect, pTargetXY, 2);
Ritor1
parents:
diff changeset
160 pRenderer->EndScene();
Ritor1
parents:
diff changeset
161 pArcomageGame->pBlit_Copy_pixels = 0;
Ritor1
parents:
diff changeset
162 }
Ritor1
parents:
diff changeset
163
Ritor1
parents:
diff changeset
164 //----- (0040DDC9) --------------------------------------------------------
Ritor1
parents:
diff changeset
165 void __thiscall ArcomageGame::PlaySound(unsigned int a1)
Ritor1
parents:
diff changeset
166 {
Ritor1
parents:
diff changeset
167 SoundID v1; // eax@10
Ritor1
parents:
diff changeset
168 signed int v2; // [sp-4h] [bp-4h]@2
Ritor1
parents:
diff changeset
169
Ritor1
parents:
diff changeset
170 switch ( a1 )
Ritor1
parents:
diff changeset
171 {
Ritor1
parents:
diff changeset
172 case 0x28u:
Ritor1
parents:
diff changeset
173 case 0x2Bu:
Ritor1
parents:
diff changeset
174 case 0x2Eu:
Ritor1
parents:
diff changeset
175 v2 = SOUND_Arcomage_LoseResources;
Ritor1
parents:
diff changeset
176 goto LABEL_10;
Ritor1
parents:
diff changeset
177 case 0x27u:
Ritor1
parents:
diff changeset
178 case 0x29u:
Ritor1
parents:
diff changeset
179 case 0x2Au:
Ritor1
parents:
diff changeset
180 case 0x2Cu:
Ritor1
parents:
diff changeset
181 case 0x2Du:
Ritor1
parents:
diff changeset
182 case 0x2Fu:
Ritor1
parents:
diff changeset
183 v2 = SOUND_Arcomage_AddResources;
Ritor1
parents:
diff changeset
184 goto LABEL_10;
Ritor1
parents:
diff changeset
185 case 0u:
Ritor1
parents:
diff changeset
186 case 0xCu:
Ritor1
parents:
diff changeset
187 case 0xEu:
Ritor1
parents:
diff changeset
188 case 0xFu:
Ritor1
parents:
diff changeset
189 case 0x10u:
Ritor1
parents:
diff changeset
190 case 0x30u:
Ritor1
parents:
diff changeset
191 case 0x32u:
Ritor1
parents:
diff changeset
192 case 0x35u:
Ritor1
parents:
diff changeset
193 v2 = SOUND_Arcomage_TowerWallDamage;
Ritor1
parents:
diff changeset
194 goto LABEL_10;
Ritor1
parents:
diff changeset
195 case 0x15u:
Ritor1
parents:
diff changeset
196 case 0x16u:
Ritor1
parents:
diff changeset
197 case 0x17u:
Ritor1
parents:
diff changeset
198 v2 = SOUND_Arcomage_DrawCard;
Ritor1
parents:
diff changeset
199 goto LABEL_10;
Ritor1
parents:
diff changeset
200 case 0x38u:
Ritor1
parents:
diff changeset
201 v2 = 124;
Ritor1
parents:
diff changeset
202 goto LABEL_10;
Ritor1
parents:
diff changeset
203 case 0x1Fu:
Ritor1
parents:
diff changeset
204 case 0x22u:
Ritor1
parents:
diff changeset
205 case 0x25u:
Ritor1
parents:
diff changeset
206 v2 = SOUND_Arcomage_ProductionDamage;
Ritor1
parents:
diff changeset
207 goto LABEL_10;
Ritor1
parents:
diff changeset
208 case 1u:
Ritor1
parents:
diff changeset
209 case 0x1Eu:
Ritor1
parents:
diff changeset
210 case 0x20u:
Ritor1
parents:
diff changeset
211 case 0x21u:
Ritor1
parents:
diff changeset
212 case 0x23u:
Ritor1
parents:
diff changeset
213 case 0x24u:
Ritor1
parents:
diff changeset
214 case 0x26u:
Ritor1
parents:
diff changeset
215 v2 = SOUND_Arcomage_ProductionUpgrade;
Ritor1
parents:
diff changeset
216 goto LABEL_10;
Ritor1
parents:
diff changeset
217 case 0x14u:
Ritor1
parents:
diff changeset
218 v2 = SOUND_Arcomage_127;
Ritor1
parents:
diff changeset
219 LABEL_10:
Ritor1
parents:
diff changeset
220 v1 = (SoundID)v2;
Ritor1
parents:
diff changeset
221 goto LABEL_16;
Ritor1
parents:
diff changeset
222 case 3u:
Ritor1
parents:
diff changeset
223 v1 = SOUND_Arcomage_128;
Ritor1
parents:
diff changeset
224 goto LABEL_16;
Ritor1
parents:
diff changeset
225 case 0x34u:
Ritor1
parents:
diff changeset
226 case 0x36u:
Ritor1
parents:
diff changeset
227 v1 = SOUND_Arcomage_TowerUpgrade;
Ritor1
parents:
diff changeset
228 goto LABEL_16;
Ritor1
parents:
diff changeset
229 case 0xAu:
Ritor1
parents:
diff changeset
230 case 0xBu:
Ritor1
parents:
diff changeset
231 case 0xDu:
Ritor1
parents:
diff changeset
232 v1 = (SoundID)130;
Ritor1
parents:
diff changeset
233 goto LABEL_16;
Ritor1
parents:
diff changeset
234 case 0x37u:
Ritor1
parents:
diff changeset
235 v1 = (SoundID)131;
Ritor1
parents:
diff changeset
236 goto LABEL_16;
Ritor1
parents:
diff changeset
237 case 0x31u:
Ritor1
parents:
diff changeset
238 case 0x33u:
Ritor1
parents:
diff changeset
239 v1 = SOUND_Arcomage_WallUpgrade;
Ritor1
parents:
diff changeset
240 LABEL_16:
Ritor1
parents:
diff changeset
241 pAudioPlayer->PlaySound(v1, 0, 0, -1, 0, 0, 0, 0);
Ritor1
parents:
diff changeset
242 break;
Ritor1
parents:
diff changeset
243 default:
Ritor1
parents:
diff changeset
244 return;
Ritor1
parents:
diff changeset
245 }
Ritor1
parents:
diff changeset
246 }
Ritor1
parents:
diff changeset
247
Ritor1
parents:
diff changeset
248 //----- (0040DC2D) --------------------------------------------------------
Ritor1
parents:
diff changeset
249 bool ArcomageGame::MsgLoop(int a1, ArcomageGame_stru1 *a2)
Ritor1
parents:
diff changeset
250 {
Ritor1
parents:
diff changeset
251 void *v2; // ebp@1
Ritor1
parents:
diff changeset
252 BOOL v3; // eax@1
Ritor1
parents:
diff changeset
253 int v4; // edx@6
Ritor1
parents:
diff changeset
254 int v5; // edx@6
Ritor1
parents:
diff changeset
255 int v6; // eax@6
Ritor1
parents:
diff changeset
256 int v7; // edx@7
Ritor1
parents:
diff changeset
257
Ritor1
parents:
diff changeset
258 v2 = a2;
Ritor1
parents:
diff changeset
259 pArcomageGame->field_0 = 0;
Ritor1
parents:
diff changeset
260 pArcomageGame->stru1.field_0 = 0;
Ritor1
parents:
diff changeset
261 v3 = PeekMessageA(&pArcomageGame->msg, 0, 0, 0, PM_REMOVE);
Ritor1
parents:
diff changeset
262 if ( pArcomageGame->msg.message == WM_QUIT )
Ritor1
parents:
diff changeset
263 Game_DeinitializeAndTerminate(0);
Ritor1
parents:
diff changeset
264 if ( v3 > 0 )
Ritor1
parents:
diff changeset
265 {
Ritor1
parents:
diff changeset
266 TranslateMessage(&pArcomageGame->msg);
Ritor1
parents:
diff changeset
267 DispatchMessageA(&pArcomageGame->msg);
Ritor1
parents:
diff changeset
268 }
Ritor1
parents:
diff changeset
269 if (pAsyncMouse)
Ritor1
parents:
diff changeset
270 {
Ritor1
parents:
diff changeset
271 EnterCriticalSection(&pGame->pThreadWardInstance->csAsyncMouse);
Ritor1
parents:
diff changeset
272 v4 = *((unsigned int *)pAsyncMouse + 7);
Ritor1
parents:
diff changeset
273 pArcomageGame->mouse_x = *((unsigned int *)pAsyncMouse + 6);
Ritor1
parents:
diff changeset
274 pArcomageGame->mouse_y = v4;
Ritor1
parents:
diff changeset
275 v5 = *((unsigned int *)pAsyncMouse + 27);
Ritor1
parents:
diff changeset
276 v6 = *(unsigned int *)v5;
Ritor1
parents:
diff changeset
277 if ( *(unsigned int *)v5 != v5 )
Ritor1
parents:
diff changeset
278 {
Ritor1
parents:
diff changeset
279 do
Ritor1
parents:
diff changeset
280 {
Ritor1
parents:
diff changeset
281 v7 = *(unsigned int *)(v6 + 20);
Ritor1
parents:
diff changeset
282 if ( v7 & 1 )
Ritor1
parents:
diff changeset
283 {
Ritor1
parents:
diff changeset
284 pArcomageGame->stru1.field_0 = 7;
Ritor1
parents:
diff changeset
285 }
Ritor1
parents:
diff changeset
286 else
Ritor1
parents:
diff changeset
287 {
Ritor1
parents:
diff changeset
288 if ( v7 & 2 )
Ritor1
parents:
diff changeset
289 pArcomageGame->stru1.field_0 = 8;
Ritor1
parents:
diff changeset
290 }
Ritor1
parents:
diff changeset
291 v6 = *(unsigned int *)v6;
Ritor1
parents:
diff changeset
292 }
Ritor1
parents:
diff changeset
293 while ( v6 != *((unsigned int *)pAsyncMouse + 27) );
Ritor1
parents:
diff changeset
294 }
Ritor1
parents:
diff changeset
295 pAsyncMouse->_46B944();
Ritor1
parents:
diff changeset
296 if ( !*((unsigned char *)pAsyncMouse + 90) )
Ritor1
parents:
diff changeset
297 pArcomageGame->field_F6 = 1;
Ritor1
parents:
diff changeset
298 LeaveCriticalSection(&pGame->pThreadWardInstance->csAsyncMouse);
Ritor1
parents:
diff changeset
299 }
Ritor1
parents:
diff changeset
300 memcpy(v2, &pArcomageGame->stru1, 0xCu);
Ritor1
parents:
diff changeset
301 return pArcomageGame->stru1.field_0 != 0;
Ritor1
parents:
diff changeset
302 }
Ritor1
parents:
diff changeset
303
Ritor1
parents:
diff changeset
304
Ritor1
parents:
diff changeset
305 //----- (0040D7D5) --------------------------------------------------------
Ritor1
parents:
diff changeset
306 void am_BeginScene(unsigned __int16 *pPcxPixels, int a2, int a3)
Ritor1
parents:
diff changeset
307 {
Ritor1
parents:
diff changeset
308 unsigned __int16 *v3; // esi@1
Ritor1
parents:
diff changeset
309
Ritor1
parents:
diff changeset
310 v3 = pPcxPixels;
Ritor1
parents:
diff changeset
311 pRenderer->BeginScene();
Ritor1
parents:
diff changeset
312 pArcomageGame->pBlit_Copy_pixels = v3;
Ritor1
parents:
diff changeset
313 }
Ritor1
parents:
diff changeset
314
Ritor1
parents:
diff changeset
315 //----- (0040D7EC) --------------------------------------------------------
Ritor1
parents:
diff changeset
316 void __fastcall Blt_Chroma(ArcomageRect *pSrcXYZW, int *pTargetXY, int a3, int a4)
Ritor1
parents:
diff changeset
317 {
Ritor1
parents:
diff changeset
318 ArcomageRect *pSrcXYZW_; // esi@1
Ritor1
parents:
diff changeset
319 int x; // ecx@1
Ritor1
parents:
diff changeset
320 int y; // edx@1
Ritor1
parents:
diff changeset
321 unsigned __int16 *pSrc; // eax@2
Ritor1
parents:
diff changeset
322 unsigned __int16 *v8; // edi@3
Ritor1
parents:
diff changeset
323 int uSrcTotalWidth; // ecx@4
Ritor1
parents:
diff changeset
324 unsigned int v10; // esi@9
Ritor1
parents:
diff changeset
325 int v11; // ebx@11
Ritor1
parents:
diff changeset
326 unsigned __int16 *v12; // edx@11
Ritor1
parents:
diff changeset
327 char v13; // zf@17
Ritor1
parents:
diff changeset
328 unsigned __int16 *v14; // ebx@20
Ritor1
parents:
diff changeset
329 int v15; // eax@20
Ritor1
parents:
diff changeset
330 unsigned __int16 *v16; // ecx@20
Ritor1
parents:
diff changeset
331 unsigned int v17; // eax@23
Ritor1
parents:
diff changeset
332 std::string v18; // [sp-18h] [bp-3Ch]@8
Ritor1
parents:
diff changeset
333 const char *v19; // [sp-8h] [bp-2Ch]@8
Ritor1
parents:
diff changeset
334 int v20; // [sp-4h] [bp-28h]@8
Ritor1
parents:
diff changeset
335 std::string *v21; // [sp+Ch] [bp-18h]@8
Ritor1
parents:
diff changeset
336 unsigned __int16 *v22; // [sp+10h] [bp-14h]@9
Ritor1
parents:
diff changeset
337 int v23; // [sp+14h] [bp-10h]@3
Ritor1
parents:
diff changeset
338 int v24; // [sp+18h] [bp-Ch]@3
Ritor1
parents:
diff changeset
339 int uSrcPitch; // [sp+1Ch] [bp-8h]@5
Ritor1
parents:
diff changeset
340 int a3a; // [sp+23h] [bp-1h]@8
Ritor1
parents:
diff changeset
341 int v27; // [sp+30h] [bp+Ch]@13
Ritor1
parents:
diff changeset
342
Ritor1
parents:
diff changeset
343 pSrcXYZW_ = pSrcXYZW;
Ritor1
parents:
diff changeset
344 x = *pTargetXY;
Ritor1
parents:
diff changeset
345 y = pTargetXY[1];
Ritor1
parents:
diff changeset
346 if ( !pRenderer->uNumSceneBegins || (pSrc = pArcomageGame->pBlit_Copy_pixels) == 0 )
Ritor1
parents:
diff changeset
347 return;
Ritor1
parents:
diff changeset
348 v8 = &pRenderer->pTargetSurface[x + y * pRenderer->uTargetSurfacePitch];
Ritor1
parents:
diff changeset
349 v23 = pSrcXYZW_->z - pSrcXYZW_->x;
Ritor1
parents:
diff changeset
350 v24 = pSrcXYZW_->w - pSrcXYZW_->y;
Ritor1
parents:
diff changeset
351 if ( pArcomageGame->pBlit_Copy_pixels == pArcomageGame->pBackgroundPixels )
Ritor1
parents:
diff changeset
352 {
Ritor1
parents:
diff changeset
353 uSrcTotalWidth = (signed __int16)pArcomageGame->pGameBackground.uWidth;
Ritor1
parents:
diff changeset
354 LABEL_5:
Ritor1
parents:
diff changeset
355 uSrcPitch = uSrcTotalWidth;
Ritor1
parents:
diff changeset
356 goto LABEL_9;
Ritor1
parents:
diff changeset
357 }
Ritor1
parents:
diff changeset
358 if ( pArcomageGame->pBlit_Copy_pixels == pArcomageGame->pSpritesPixels )
Ritor1
parents:
diff changeset
359 {
Ritor1
parents:
diff changeset
360 uSrcTotalWidth = (signed __int16)pArcomageGame->pSprites.uWidth;
Ritor1
parents:
diff changeset
361 goto LABEL_5;
Ritor1
parents:
diff changeset
362 }
Ritor1
parents:
diff changeset
363 MessageBoxW(nullptr, L"Problem in Blit_Chroma", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\am_nw.cpp:157", 0);
Ritor1
parents:
diff changeset
364 pSrc = pArcomageGame->pBlit_Copy_pixels;
Ritor1
parents:
diff changeset
365 LABEL_9:
Ritor1
parents:
diff changeset
366 v22 = &pSrc[pSrcXYZW_->x + uSrcPitch * pSrcXYZW_->y];
Ritor1
parents:
diff changeset
367 v10 = 0xFFu >> (8 - LOBYTE(pRenderer->uTargetBBits));
Ritor1
parents:
diff changeset
368 v21 = (std::string *)((((pRenderer->uTargetGBits != 6) - 1) & 0x4A00) + 12783);
Ritor1
parents:
diff changeset
369 if ( a4 == 2 )
Ritor1
parents:
diff changeset
370 {
Ritor1
parents:
diff changeset
371 if ( v24 > 0 )
Ritor1
parents:
diff changeset
372 {
Ritor1
parents:
diff changeset
373 v11 = v23;
Ritor1
parents:
diff changeset
374 v12 = v22;
Ritor1
parents:
diff changeset
375 uSrcPitch = 2 * (uSrcPitch - v23);
Ritor1
parents:
diff changeset
376 do
Ritor1
parents:
diff changeset
377 {
Ritor1
parents:
diff changeset
378 if ( v11 > 0 )
Ritor1
parents:
diff changeset
379 {
Ritor1
parents:
diff changeset
380 v27 = v11;
Ritor1
parents:
diff changeset
381 do
Ritor1
parents:
diff changeset
382 {
Ritor1
parents:
diff changeset
383 if ( *v12 != v10 )
Ritor1
parents:
diff changeset
384 *v8 = *v12;
Ritor1
parents:
diff changeset
385 ++v8;
Ritor1
parents:
diff changeset
386 ++v12;
Ritor1
parents:
diff changeset
387 --v27;
Ritor1
parents:
diff changeset
388 }
Ritor1
parents:
diff changeset
389 while ( v27 );
Ritor1
parents:
diff changeset
390 }
Ritor1
parents:
diff changeset
391 v12 = (unsigned __int16 *)((char *)v12 + uSrcPitch);
Ritor1
parents:
diff changeset
392 v13 = v24-- == 1;
Ritor1
parents:
diff changeset
393 v8 += pRenderer->uTargetSurfacePitch - v11;
Ritor1
parents:
diff changeset
394 }
Ritor1
parents:
diff changeset
395 while ( !v13 );
Ritor1
parents:
diff changeset
396 }
Ritor1
parents:
diff changeset
397 }
Ritor1
parents:
diff changeset
398 else
Ritor1
parents:
diff changeset
399 {
Ritor1
parents:
diff changeset
400 if ( v24 > 0 )
Ritor1
parents:
diff changeset
401 {
Ritor1
parents:
diff changeset
402 v14 = (unsigned __int16 *)v23;
Ritor1
parents:
diff changeset
403 v15 = uSrcPitch - v23;
Ritor1
parents:
diff changeset
404 v23 = v24;
Ritor1
parents:
diff changeset
405 v16 = v22;
Ritor1
parents:
diff changeset
406 uSrcPitch = 2 * v15;
Ritor1
parents:
diff changeset
407 do
Ritor1
parents:
diff changeset
408 {
Ritor1
parents:
diff changeset
409 if ( (signed int)v14 > 0 )
Ritor1
parents:
diff changeset
410 {
Ritor1
parents:
diff changeset
411 v22 = v14;
Ritor1
parents:
diff changeset
412 do
Ritor1
parents:
diff changeset
413 {
Ritor1
parents:
diff changeset
414 v17 = *v16;
Ritor1
parents:
diff changeset
415 if ( v17 != v10 )
Ritor1
parents:
diff changeset
416 {
Ritor1
parents:
diff changeset
417 v24 = *v8;
Ritor1
parents:
diff changeset
418 *v8 = ((unsigned __int16)v21 & ((unsigned int)v24 >> 1)) + ((unsigned __int16)v21 & (v17 >> 1));
Ritor1
parents:
diff changeset
419 }
Ritor1
parents:
diff changeset
420 ++v8;
Ritor1
parents:
diff changeset
421 ++v16;
Ritor1
parents:
diff changeset
422 v22 = (unsigned __int16 *)((char *)v22 - 1);
Ritor1
parents:
diff changeset
423 }
Ritor1
parents:
diff changeset
424 while ( v22 );
Ritor1
parents:
diff changeset
425 }
Ritor1
parents:
diff changeset
426 v16 = (unsigned __int16 *)((char *)v16 + uSrcPitch);
Ritor1
parents:
diff changeset
427 v13 = v23-- == 1;
Ritor1
parents:
diff changeset
428 v8 += pRenderer->uTargetSurfacePitch - (uint)v14;
Ritor1
parents:
diff changeset
429 }
Ritor1
parents:
diff changeset
430 while ( !v13 );
Ritor1
parents:
diff changeset
431 }
Ritor1
parents:
diff changeset
432 }
Ritor1
parents:
diff changeset
433 }
Ritor1
parents:
diff changeset
434
Ritor1
parents:
diff changeset
435 //----- (0040D9B1) --------------------------------------------------------
Ritor1
parents:
diff changeset
436 void __fastcall Blt_Copy(ArcomageRect *pSrcXYZW, int *pTargetXY, int a3)
Ritor1
parents:
diff changeset
437 {
Ritor1
parents:
diff changeset
438 ArcomageRect *pSrcXYZW_; // esi@1
Ritor1
parents:
diff changeset
439 int x; // ecx@1
Ritor1
parents:
diff changeset
440 int y; // edx@1
Ritor1
parents:
diff changeset
441 unsigned __int16 *v6; // eax@2
Ritor1
parents:
diff changeset
442 unsigned __int16 *v7; // edi@3
Ritor1
parents:
diff changeset
443 int uSrcRegionWidth; // ebx@3
Ritor1
parents:
diff changeset
444 int uSrcTotalWidth; // ecx@4
Ritor1
parents:
diff changeset
445 unsigned __int16 *pSrc; // esi@8
Ritor1
parents:
diff changeset
446 int v11; // edx@9
Ritor1
parents:
diff changeset
447 int v12; // eax@12
Ritor1
parents:
diff changeset
448 int v13; // ecx@19
Ritor1
parents:
diff changeset
449 char v14; // zf@21
Ritor1
parents:
diff changeset
450 std::string v15; // [sp-18h] [bp-38h]@7
Ritor1
parents:
diff changeset
451 const char *v16; // [sp-8h] [bp-28h]@7
Ritor1
parents:
diff changeset
452 int v17; // [sp-4h] [bp-24h]@7
Ritor1
parents:
diff changeset
453 unsigned int v18; // [sp+Ch] [bp-14h]@7
Ritor1
parents:
diff changeset
454 int v19; // [sp+10h] [bp-10h]@8
Ritor1
parents:
diff changeset
455 int v20; // [sp+14h] [bp-Ch]@17
Ritor1
parents:
diff changeset
456 int uSrcRegionHeight; // [sp+18h] [bp-8h]@3
Ritor1
parents:
diff changeset
457 int a3a; // [sp+1Fh] [bp-1h]@7
Ritor1
parents:
diff changeset
458
Ritor1
parents:
diff changeset
459 pSrcXYZW_ = pSrcXYZW;
Ritor1
parents:
diff changeset
460 x = *pTargetXY;
Ritor1
parents:
diff changeset
461 y = pTargetXY[1];
Ritor1
parents:
diff changeset
462 if ( pRenderer->uNumSceneBegins )
Ritor1
parents:
diff changeset
463 {
Ritor1
parents:
diff changeset
464 v6 = pArcomageGame->pBlit_Copy_pixels;
Ritor1
parents:
diff changeset
465 if ( pArcomageGame->pBlit_Copy_pixels )
Ritor1
parents:
diff changeset
466 {
Ritor1
parents:
diff changeset
467 v7 = &pRenderer->pTargetSurface[x + y * pRenderer->uTargetSurfacePitch];
Ritor1
parents:
diff changeset
468 uSrcRegionWidth = pSrcXYZW_->z - pSrcXYZW_->x;
Ritor1
parents:
diff changeset
469 uSrcRegionHeight = pSrcXYZW_->w - pSrcXYZW_->y;
Ritor1
parents:
diff changeset
470 if ( pArcomageGame->pBlit_Copy_pixels == pArcomageGame->pBackgroundPixels )
Ritor1
parents:
diff changeset
471 {
Ritor1
parents:
diff changeset
472 uSrcTotalWidth = (signed __int16)pArcomageGame->pGameBackground.uWidth;
Ritor1
parents:
diff changeset
473 }
Ritor1
parents:
diff changeset
474 else
Ritor1
parents:
diff changeset
475 {
Ritor1
parents:
diff changeset
476 if ( pArcomageGame->pBlit_Copy_pixels == pArcomageGame->pSpritesPixels )
Ritor1
parents:
diff changeset
477 {
Ritor1
parents:
diff changeset
478 uSrcTotalWidth = (signed __int16)pArcomageGame->pSprites.uWidth;
Ritor1
parents:
diff changeset
479 }
Ritor1
parents:
diff changeset
480 else
Ritor1
parents:
diff changeset
481 {
Ritor1
parents:
diff changeset
482 MessageBoxW(nullptr, L"Problem in Blit_Copy", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\am_nw.cpp:246", 0);
Ritor1
parents:
diff changeset
483 uSrcTotalWidth = a3;
Ritor1
parents:
diff changeset
484 v6 = pArcomageGame->pBlit_Copy_pixels;
Ritor1
parents:
diff changeset
485 }
Ritor1
parents:
diff changeset
486 }
Ritor1
parents:
diff changeset
487 pSrc = &v6[pSrcXYZW_->x + uSrcTotalWidth * pSrcXYZW_->y];
Ritor1
parents:
diff changeset
488 v19 = (((pRenderer->uTargetGBits != 6) - 1) & 0x4A00) + 0x31EF;
Ritor1
parents:
diff changeset
489 if ( a3 == 2 )
Ritor1
parents:
diff changeset
490 {
Ritor1
parents:
diff changeset
491 v11 = uSrcRegionHeight;
Ritor1
parents:
diff changeset
492 if ( uSrcRegionHeight > 0 )
Ritor1
parents:
diff changeset
493 {
Ritor1
parents:
diff changeset
494 uSrcRegionHeight = 2 * (uSrcTotalWidth - uSrcRegionWidth);
Ritor1
parents:
diff changeset
495 do
Ritor1
parents:
diff changeset
496 {
Ritor1
parents:
diff changeset
497 if ( uSrcRegionWidth > 0 )
Ritor1
parents:
diff changeset
498 {
Ritor1
parents:
diff changeset
499 v12 = uSrcRegionWidth;
Ritor1
parents:
diff changeset
500 do
Ritor1
parents:
diff changeset
501 {
Ritor1
parents:
diff changeset
502 *v7 = *pSrc;
Ritor1
parents:
diff changeset
503 ++v7;
Ritor1
parents:
diff changeset
504 ++pSrc;
Ritor1
parents:
diff changeset
505 --v12;
Ritor1
parents:
diff changeset
506 }
Ritor1
parents:
diff changeset
507 while ( v12 );
Ritor1
parents:
diff changeset
508 }
Ritor1
parents:
diff changeset
509 pSrc = (unsigned __int16 *)((char *)pSrc + uSrcRegionHeight);
Ritor1
parents:
diff changeset
510 --v11;
Ritor1
parents:
diff changeset
511 v7 += pRenderer->uTargetSurfacePitch - uSrcRegionWidth;
Ritor1
parents:
diff changeset
512 }
Ritor1
parents:
diff changeset
513 while ( v11 );
Ritor1
parents:
diff changeset
514 }
Ritor1
parents:
diff changeset
515 }
Ritor1
parents:
diff changeset
516 else
Ritor1
parents:
diff changeset
517 {
Ritor1
parents:
diff changeset
518 if ( uSrcRegionHeight > 0 )
Ritor1
parents:
diff changeset
519 {
Ritor1
parents:
diff changeset
520 v20 = uSrcRegionHeight;
Ritor1
parents:
diff changeset
521 uSrcRegionHeight = 2 * (uSrcTotalWidth - uSrcRegionWidth);
Ritor1
parents:
diff changeset
522 do
Ritor1
parents:
diff changeset
523 {
Ritor1
parents:
diff changeset
524 if ( uSrcRegionWidth > 0 )
Ritor1
parents:
diff changeset
525 {
Ritor1
parents:
diff changeset
526 v13 = uSrcRegionWidth;
Ritor1
parents:
diff changeset
527 do
Ritor1
parents:
diff changeset
528 {
Ritor1
parents:
diff changeset
529 v18 = *v7;
Ritor1
parents:
diff changeset
530 *v7 = (v19 & (v18 >> 1)) + (v19 & ((unsigned int)*pSrc >> 1));
Ritor1
parents:
diff changeset
531 ++v7;
Ritor1
parents:
diff changeset
532 ++pSrc;
Ritor1
parents:
diff changeset
533 --v13;
Ritor1
parents:
diff changeset
534 }
Ritor1
parents:
diff changeset
535 while ( v13 );
Ritor1
parents:
diff changeset
536 }
Ritor1
parents:
diff changeset
537 pSrc = (unsigned __int16 *)((char *)pSrc + uSrcRegionHeight);
Ritor1
parents:
diff changeset
538 v14 = v20-- == 1;
Ritor1
parents:
diff changeset
539 v7 += pRenderer->uTargetSurfacePitch - uSrcRegionWidth;
Ritor1
parents:
diff changeset
540 }
Ritor1
parents:
diff changeset
541 while ( !v14 );
Ritor1
parents:
diff changeset
542 }
Ritor1
parents:
diff changeset
543 }
Ritor1
parents:
diff changeset
544 }
Ritor1
parents:
diff changeset
545 }
Ritor1
parents:
diff changeset
546 }
Ritor1
parents:
diff changeset
547
Ritor1
parents:
diff changeset
548 //----- (0040DB10) --------------------------------------------------------
Ritor1
parents:
diff changeset
549 void __cdecl am_EndScene()
Ritor1
parents:
diff changeset
550 {
Ritor1
parents:
diff changeset
551 pRenderer->EndScene();
Ritor1
parents:
diff changeset
552 pArcomageGame->pBlit_Copy_pixels = 0;
Ritor1
parents:
diff changeset
553 }
Ritor1
parents:
diff changeset
554
Ritor1
parents:
diff changeset
555 //----- (0040D7B7) --------------------------------------------------------
Ritor1
parents:
diff changeset
556 bool ArcomageGame::LoadSprites()
Ritor1
parents:
diff changeset
557 {
Ritor1
parents:
diff changeset
558 bool result; // eax@1
Ritor1
parents:
diff changeset
559
Ritor1
parents:
diff changeset
560 pArcomageGame->pSprites.Load("sprites.pcx", 2);
Ritor1
parents:
diff changeset
561 result = (bool)pArcomageGame->pSprites.pPixels;
Ritor1
parents:
diff changeset
562 pArcomageGame->pSpritesPixels = pArcomageGame->pSprites.pPixels;
Ritor1
parents:
diff changeset
563 LOBYTE(result) = 1;
Ritor1
parents:
diff changeset
564 return result;
Ritor1
parents:
diff changeset
565 }
Ritor1
parents:
diff changeset
566
Ritor1
parents:
diff changeset
567 //----- (0040D799) --------------------------------------------------------
Ritor1
parents:
diff changeset
568 bool ArcomageGame::LoadBackground()
Ritor1
parents:
diff changeset
569 {
Ritor1
parents:
diff changeset
570 bool result; // eax@1
Ritor1
parents:
diff changeset
571
Ritor1
parents:
diff changeset
572 pArcomageGame->pGameBackground.Load("layout.pcx", 2);
Ritor1
parents:
diff changeset
573 result = (bool)pArcomageGame->pGameBackground.pPixels;
Ritor1
parents:
diff changeset
574 pArcomageGame->pBackgroundPixels = pArcomageGame->pGameBackground.pPixels;
Ritor1
parents:
diff changeset
575 LOBYTE(result) = 1;
Ritor1
parents:
diff changeset
576 return result;
Ritor1
parents:
diff changeset
577 }
Ritor1
parents:
diff changeset
578
Ritor1
parents:
diff changeset
579 //----- (00408BB4) --------------------------------------------------------
Ritor1
parents:
diff changeset
580 bool __fastcall am_408BB4(int a1)
Ritor1
parents:
diff changeset
581 {
Ritor1
parents:
diff changeset
582 char result; // al@3
Ritor1
parents:
diff changeset
583 signed int v3; // ebx@8
Ritor1
parents:
diff changeset
584 int v4; // esi@8
Ritor1
parents:
diff changeset
585 int v5; // eax@9
Ritor1
parents:
diff changeset
586 int v6; // edi@9
Ritor1
parents:
diff changeset
587 int v7; // eax@11
Ritor1
parents:
diff changeset
588 signed int v8; // eax@11
Ritor1
parents:
diff changeset
589 int v9; // ebx@5
Ritor1
parents:
diff changeset
590 int v10; // eax@5
Ritor1
parents:
diff changeset
591 int v11; // ecx@18
Ritor1
parents:
diff changeset
592 char v12; // bl@20
Ritor1
parents:
diff changeset
593 int v13; // eax@20
Ritor1
parents:
diff changeset
594 ArcomageCard *v14; // ecx@20
Ritor1
parents:
diff changeset
595 char v15; // dl@20
Ritor1
parents:
diff changeset
596 char v16; // dl@24
Ritor1
parents:
diff changeset
597 int v17; // edx@25
Ritor1
parents:
diff changeset
598 int v18; // edx@27
Ritor1
parents:
diff changeset
599 char v19; // dl@31
Ritor1
parents:
diff changeset
600 int v20; // edx@32
Ritor1
parents:
diff changeset
601 char v21; // dl@35
Ritor1
parents:
diff changeset
602 char v22; // dl@39
Ritor1
parents:
diff changeset
603 int v23; // edx@40
Ritor1
parents:
diff changeset
604 char v24; // dl@45
Ritor1
parents:
diff changeset
605 int v25; // edx@46
Ritor1
parents:
diff changeset
606 char v26; // dl@52
Ritor1
parents:
diff changeset
607 int v27; // edx@53
Ritor1
parents:
diff changeset
608 char v28; // dl@58
Ritor1
parents:
diff changeset
609 int v29; // edx@59
Ritor1
parents:
diff changeset
610 char v30; // dl@64
Ritor1
parents:
diff changeset
611 int v31; // edx@65
Ritor1
parents:
diff changeset
612 char v32; // dl@70
Ritor1
parents:
diff changeset
613 int v33; // edx@71
Ritor1
parents:
diff changeset
614 char v34; // dl@76
Ritor1
parents:
diff changeset
615 int v35; // edx@77
Ritor1
parents:
diff changeset
616 char v36; // dl@82
Ritor1
parents:
diff changeset
617 int v37; // edx@83
Ritor1
parents:
diff changeset
618 char v38; // dl@86
Ritor1
parents:
diff changeset
619 char v39; // dl@90
Ritor1
parents:
diff changeset
620 int v40; // edi@93
Ritor1
parents:
diff changeset
621 char v41; // dl@93
Ritor1
parents:
diff changeset
622 int v42; // esi@93
Ritor1
parents:
diff changeset
623 char v43; // bl@94
Ritor1
parents:
diff changeset
624 int v44; // esi@95
Ritor1
parents:
diff changeset
625 char v45; // dl@99
Ritor1
parents:
diff changeset
626 char v46; // dl@103
Ritor1
parents:
diff changeset
627 char v47; // dl@107
Ritor1
parents:
diff changeset
628 char v48; // dl@111
Ritor1
parents:
diff changeset
629 char v49; // dl@115
Ritor1
parents:
diff changeset
630 ArcomageGame_stru0 *v50; // ebx@116
Ritor1
parents:
diff changeset
631 ArcomageGame_stru0 *v51; // edx@116
Ritor1
parents:
diff changeset
632 int v52; // esi@124
Ritor1
parents:
diff changeset
633 int v53; // edx@124
Ritor1
parents:
diff changeset
634 int v54; // edx@127
Ritor1
parents:
diff changeset
635 int v55; // esi@130
Ritor1
parents:
diff changeset
636 int v56; // edi@138
Ritor1
parents:
diff changeset
637 int l; // esi@138
Ritor1
parents:
diff changeset
638 int v58; // eax@140
Ritor1
parents:
diff changeset
639 int v59; // ecx@142
Ritor1
parents:
diff changeset
640 int v60; // edx@142
Ritor1
parents:
diff changeset
641 int v61; // ebx@142
Ritor1
parents:
diff changeset
642 int v62; // eax@145
Ritor1
parents:
diff changeset
643 int v63; // esi@146
Ritor1
parents:
diff changeset
644 int v64; // ebx@4
Ritor1
parents:
diff changeset
645 int v65; // eax@4
Ritor1
parents:
diff changeset
646 int v66; // ecx@168
Ritor1
parents:
diff changeset
647 char v67; // bl@170
Ritor1
parents:
diff changeset
648 int v68; // eax@170
Ritor1
parents:
diff changeset
649 ArcomageCard *v69; // ecx@170
Ritor1
parents:
diff changeset
650 char v70; // dl@170
Ritor1
parents:
diff changeset
651 char v71; // dl@174
Ritor1
parents:
diff changeset
652 int v72; // edx@175
Ritor1
parents:
diff changeset
653 int v73; // edx@177
Ritor1
parents:
diff changeset
654 char v74; // dl@181
Ritor1
parents:
diff changeset
655 char v75; // dl@184
Ritor1
parents:
diff changeset
656 char v76; // dl@188
Ritor1
parents:
diff changeset
657 int v77; // edx@189
Ritor1
parents:
diff changeset
658 char v78; // dl@194
Ritor1
parents:
diff changeset
659 char v79; // dl@200
Ritor1
parents:
diff changeset
660 int v80; // edx@201
Ritor1
parents:
diff changeset
661 char v81; // dl@206
Ritor1
parents:
diff changeset
662 int v82; // edx@207
Ritor1
parents:
diff changeset
663 char v83; // dl@212
Ritor1
parents:
diff changeset
664 int v84; // edx@213
Ritor1
parents:
diff changeset
665 char v85; // dl@218
Ritor1
parents:
diff changeset
666 int v86; // edx@219
Ritor1
parents:
diff changeset
667 char v87; // dl@224
Ritor1
parents:
diff changeset
668 int v88; // edx@225
Ritor1
parents:
diff changeset
669 char v89; // dl@230
Ritor1
parents:
diff changeset
670 int v90; // edx@231
Ritor1
parents:
diff changeset
671 char v91; // dl@234
Ritor1
parents:
diff changeset
672 int v92; // edx@235
Ritor1
parents:
diff changeset
673 char v93; // dl@238
Ritor1
parents:
diff changeset
674 int v94; // edx@239
Ritor1
parents:
diff changeset
675 int v95; // esi@241
Ritor1
parents:
diff changeset
676 char v96; // dl@241
Ritor1
parents:
diff changeset
677 int v97; // esi@241
Ritor1
parents:
diff changeset
678 char v98; // bl@242
Ritor1
parents:
diff changeset
679 int v99; // edi@243
Ritor1
parents:
diff changeset
680 int v100; // edx@245
Ritor1
parents:
diff changeset
681 int v101; // edi@246
Ritor1
parents:
diff changeset
682 char v102; // dl@247
Ritor1
parents:
diff changeset
683 int v103; // edx@248
Ritor1
parents:
diff changeset
684 char v104; // dl@251
Ritor1
parents:
diff changeset
685 int v105; // edx@252
Ritor1
parents:
diff changeset
686 char v106; // dl@255
Ritor1
parents:
diff changeset
687 int v107; // edx@256
Ritor1
parents:
diff changeset
688 char v108; // dl@259
Ritor1
parents:
diff changeset
689 int v109; // edx@260
Ritor1
parents:
diff changeset
690 char v110; // dl@263
Ritor1
parents:
diff changeset
691 ArcomageGame_stru0 *v111; // ebx@264
Ritor1
parents:
diff changeset
692 ArcomageGame_stru0 *v112; // edx@264
Ritor1
parents:
diff changeset
693 int v113; // esi@272
Ritor1
parents:
diff changeset
694 int v114; // edx@272
Ritor1
parents:
diff changeset
695 int v115; // edx@275
Ritor1
parents:
diff changeset
696 int v116; // esi@278
Ritor1
parents:
diff changeset
697 int v117; // edi@286
Ritor1
parents:
diff changeset
698 int j; // esi@286
Ritor1
parents:
diff changeset
699 int v119; // eax@288
Ritor1
parents:
diff changeset
700 int v120; // ecx@290
Ritor1
parents:
diff changeset
701 int v121; // edx@290
Ritor1
parents:
diff changeset
702 int v122; // ebx@290
Ritor1
parents:
diff changeset
703 int v123; // eax@293
Ritor1
parents:
diff changeset
704 int v124; // esi@294
Ritor1
parents:
diff changeset
705 int v125; // [sp-28h] [bp-28h]@130
Ritor1
parents:
diff changeset
706 int v126; // [sp-28h] [bp-28h]@278
Ritor1
parents:
diff changeset
707 int k; // [sp-24h] [bp-24h]@18
Ritor1
parents:
diff changeset
708 int i; // [sp-24h] [bp-24h]@168
Ritor1
parents:
diff changeset
709 int v129; // [sp-20h] [bp-20h]@5
Ritor1
parents:
diff changeset
710 int v130; // [sp-20h] [bp-20h]@4
Ritor1
parents:
diff changeset
711 int v131; // [sp-1Ch] [bp-1Ch]@17
Ritor1
parents:
diff changeset
712 int v132; // [sp-1Ch] [bp-1Ch]@140
Ritor1
parents:
diff changeset
713 int v133; // [sp-1Ch] [bp-1Ch]@167
Ritor1
parents:
diff changeset
714 int v134; // [sp-1Ch] [bp-1Ch]@288
Ritor1
parents:
diff changeset
715 int v135; // [sp-18h] [bp-18h]@5
Ritor1
parents:
diff changeset
716 int v136; // [sp-18h] [bp-18h]@4
Ritor1
parents:
diff changeset
717 signed int v137; // [sp-14h] [bp-14h]@0
Ritor1
parents:
diff changeset
718 int v138; // [sp-14h] [bp-14h]@93
Ritor1
parents:
diff changeset
719 int v139; // [sp-14h] [bp-14h]@130
Ritor1
parents:
diff changeset
720 int v140; // [sp-14h] [bp-14h]@241
Ritor1
parents:
diff changeset
721 int v141; // [sp-14h] [bp-14h]@278
Ritor1
parents:
diff changeset
722 ArcomageGame_stru0 *v142; // [sp-10h] [bp-10h]@5
Ritor1
parents:
diff changeset
723 ArcomageGame_stru0 *v143; // [sp-10h] [bp-10h]@4
Ritor1
parents:
diff changeset
724 ArcomageGame_stru0 *v144; // [sp-Ch] [bp-Ch]@5
Ritor1
parents:
diff changeset
725 ArcomageGame_stru0 *v145; // [sp-Ch] [bp-Ch]@4
Ritor1
parents:
diff changeset
726 char v146; // [sp-8h] [bp-8h]@35
Ritor1
parents:
diff changeset
727 char v147; // [sp-8h] [bp-8h]@184
Ritor1
parents:
diff changeset
728 char v148; // [sp-5h] [bp-5h]@20
Ritor1
parents:
diff changeset
729 char v149; // [sp-5h] [bp-5h]@170
Ritor1
parents:
diff changeset
730
Ritor1
parents:
diff changeset
731 byte_4FAA00 = 1;
Ritor1
parents:
diff changeset
732 if ( dword_4DF3A4 )
Ritor1
parents:
diff changeset
733 {
Ritor1
parents:
diff changeset
734 if ( dword_4DF3A4 != 1 )
Ritor1
parents:
diff changeset
735 {
Ritor1
parents:
diff changeset
736 result = dword_4DF3A4 - 2;
Ritor1
parents:
diff changeset
737 if ( dword_4DF3A4 != 2 )
Ritor1
parents:
diff changeset
738 return result;
Ritor1
parents:
diff changeset
739 v64 = a1;
Ritor1
parents:
diff changeset
740 v145 = &stru_505708[a1];
Ritor1
parents:
diff changeset
741 v130 = a1;
Ritor1
parents:
diff changeset
742 v143 = &stru_505708[(a1 + 1) % 2];
Ritor1
parents:
diff changeset
743 v136 = am_40BB49(a1);
Ritor1
parents:
diff changeset
744 v65 = 0;
Ritor1
parents:
diff changeset
745 do
Ritor1
parents:
diff changeset
746 {
Ritor1
parents:
diff changeset
747 if ( v65 >= v136 )
Ritor1
parents:
diff changeset
748 {
Ritor1
parents:
diff changeset
749 dword_4FA9B0[2 * v65] = -1;
Ritor1
parents:
diff changeset
750 dword_4FA9B4[2 * v65] = -9999;
Ritor1
parents:
diff changeset
751 }
Ritor1
parents:
diff changeset
752 else
Ritor1
parents:
diff changeset
753 {
Ritor1
parents:
diff changeset
754 dword_4FA9B0[2 * v65] = v65;
Ritor1
parents:
diff changeset
755 dword_4FA9B4[2 * v65] = 0;
Ritor1
parents:
diff changeset
756 }
Ritor1
parents:
diff changeset
757 ++v65;
Ritor1
parents:
diff changeset
758 }
Ritor1
parents:
diff changeset
759 while ( v65 < 10 );
Ritor1
parents:
diff changeset
760 v133 = 0;
Ritor1
parents:
diff changeset
761 if ( v136 > 0 )
Ritor1
parents:
diff changeset
762 {
Ritor1
parents:
diff changeset
763 v66 = 47 * v64;
Ritor1
parents:
diff changeset
764 for ( i = 47 * v64; ; v66 = i )
Ritor1
parents:
diff changeset
765 {
Ritor1
parents:
diff changeset
766 v67 = 99;
Ritor1
parents:
diff changeset
767 v68 = 2 * v133;
Ritor1
parents:
diff changeset
768 v69 = &pCards[stru_505708[0].arr_44[v66 + dword_4FA9B0[2 * v133]]];
Ritor1
parents:
diff changeset
769 v70 = v69->field_38[2];
Ritor1
parents:
diff changeset
770 v149 = v69->field_38[2];
Ritor1
parents:
diff changeset
771 if ( v145->field_24 >= 10 )
Ritor1
parents:
diff changeset
772 {
Ritor1
parents:
diff changeset
773 if ( v70 == 99
Ritor1
parents:
diff changeset
774 || v69->field_48[4] == 99
Ritor1
parents:
diff changeset
775 || v69->field_48[15] == 99
Ritor1
parents:
diff changeset
776 || (v74 = BYTE1(v69->field_68), v74 == 99) )
Ritor1
parents:
diff changeset
777 v73 = 5 * (v143->field_24 - v145->field_24);
Ritor1
parents:
diff changeset
778 else
Ritor1
parents:
diff changeset
779 v73 = 5 * (v149 + v69->field_48[4] + v69->field_48[15] + v74);
Ritor1
parents:
diff changeset
780 }
Ritor1
parents:
diff changeset
781 else
Ritor1
parents:
diff changeset
782 {
Ritor1
parents:
diff changeset
783 if ( v70 == 99
Ritor1
parents:
diff changeset
784 || v69->field_48[4] == 99
Ritor1
parents:
diff changeset
785 || v69->field_48[15] == 99
Ritor1
parents:
diff changeset
786 || (v71 = BYTE1(v69->field_68), v71 == 99) )
Ritor1
parents:
diff changeset
787 v72 = 5 * (v143->field_24 - v145->field_24);
Ritor1
parents:
diff changeset
788 else
Ritor1
parents:
diff changeset
789 v72 = 5 * (v149 + v69->field_48[4] + v69->field_48[15] + v71);
Ritor1
parents:
diff changeset
790 v73 = 4 * v72;
Ritor1
parents:
diff changeset
791 }
Ritor1
parents:
diff changeset
792 dword_4FA9B4[v68] += v73;
Ritor1
parents:
diff changeset
793 v75 = v69->field_38[1];
Ritor1
parents:
diff changeset
794 v147 = v69->field_38[1];
Ritor1
parents:
diff changeset
795 if ( v145->field_28 >= 10 )
Ritor1
parents:
diff changeset
796 {
Ritor1
parents:
diff changeset
797 if ( v75 == 99
Ritor1
parents:
diff changeset
798 || v69->field_48[3] == 99
Ritor1
parents:
diff changeset
799 || v69->field_48[14] == 99
Ritor1
parents:
diff changeset
800 || (v78 = LOBYTE(v69->field_68), v78 == 99) )
Ritor1
parents:
diff changeset
801 v77 = v143->field_28 - v145->field_28;
Ritor1
parents:
diff changeset
802 else
Ritor1
parents:
diff changeset
803 v77 = v147 + v69->field_48[3] + v69->field_48[14] + v78;
Ritor1
parents:
diff changeset
804 }
Ritor1
parents:
diff changeset
805 else
Ritor1
parents:
diff changeset
806 {
Ritor1
parents:
diff changeset
807 if ( v75 == 99
Ritor1
parents:
diff changeset
808 || v69->field_48[3] == 99
Ritor1
parents:
diff changeset
809 || v69->field_48[14] == 99
Ritor1
parents:
diff changeset
810 || (v76 = LOBYTE(v69->field_68), v76 == 99) )
Ritor1
parents:
diff changeset
811 v77 = 5 * (v143->field_28 - v145->field_28);
Ritor1
parents:
diff changeset
812 else
Ritor1
parents:
diff changeset
813 v77 = 5 * (v147 + v69->field_48[3] + v69->field_48[14] + v76);
Ritor1
parents:
diff changeset
814 }
Ritor1
parents:
diff changeset
815 dword_4FA9B4[v68] += v77;
Ritor1
parents:
diff changeset
816 dword_4FA9B4[v68] += 7 * (v69->field_38[0] + v69->field_48[2] + v69->field_48[13] + v69->field_58[15]);
Ritor1
parents:
diff changeset
817 if ( BYTE2(v69->field_30) == 99
Ritor1
parents:
diff changeset
818 || v69->field_38[12] == 99
Ritor1
parents:
diff changeset
819 || v69->field_48[7] == 99
Ritor1
parents:
diff changeset
820 || (v79 = v69->field_58[9], v79 == 99) )
Ritor1
parents:
diff changeset
821 v80 = 5 * (v143->field_2C - v145->field_2C);
Ritor1
parents:
diff changeset
822 else
Ritor1
parents:
diff changeset
823 v80 = 5 * (BYTE2(v69->field_30) + v69->field_38[12] + v69->field_48[7] + v79);
Ritor1
parents:
diff changeset
824 dword_4FA9B4[v68] += 8 * v80;
Ritor1
parents:
diff changeset
825 if ( BYTE3(v69->field_30) == 99
Ritor1
parents:
diff changeset
826 || v69->field_38[13] == 99
Ritor1
parents:
diff changeset
827 || v69->field_48[8] == 99
Ritor1
parents:
diff changeset
828 || (v81 = v69->field_58[10], v81 == 99) )
Ritor1
parents:
diff changeset
829 v82 = 5 * (v143->field_30 - v145->field_30);
Ritor1
parents:
diff changeset
830 else
Ritor1
parents:
diff changeset
831 v82 = 5 * (BYTE3(v69->field_30) + v69->field_38[13] + v69->field_48[8] + v81);
Ritor1
parents:
diff changeset
832 dword_4FA9B4[v68] += 8 * v82;
Ritor1
parents:
diff changeset
833 if ( LOBYTE(v69->field_34) == 99
Ritor1
parents:
diff changeset
834 || v69->field_38[14] == 99
Ritor1
parents:
diff changeset
835 || v69->field_48[9] == 99
Ritor1
parents:
diff changeset
836 || (v83 = v69->field_58[11], v83 == 99) )
Ritor1
parents:
diff changeset
837 v84 = 5 * (v143->field_34 - v145->field_34);
Ritor1
parents:
diff changeset
838 else
Ritor1
parents:
diff changeset
839 v84 = 5 * (LOBYTE(v69->field_34) + v69->field_38[14] + v69->field_48[9] + v83);
Ritor1
parents:
diff changeset
840 dword_4FA9B4[v68] += 8 * v84;
Ritor1
parents:
diff changeset
841 if ( BYTE1(v69->field_34) == 99
Ritor1
parents:
diff changeset
842 || v69->field_38[15] == 99
Ritor1
parents:
diff changeset
843 || v69->field_48[10] == 99
Ritor1
parents:
diff changeset
844 || (v85 = v69->field_58[12], v85 == 99) )
Ritor1
parents:
diff changeset
845 v86 = v143->field_38 - v145->field_38;
Ritor1
parents:
diff changeset
846 else
Ritor1
parents:
diff changeset
847 v86 = BYTE1(v69->field_34) + v69->field_38[15] + v69->field_48[10] + v85;
Ritor1
parents:
diff changeset
848 dword_4FA9B4[v68] += 2 * v86;
Ritor1
parents:
diff changeset
849 if ( BYTE2(v69->field_34) == 99
Ritor1
parents:
diff changeset
850 || v69->field_48[0] == 99
Ritor1
parents:
diff changeset
851 || v69->field_48[11] == 99
Ritor1
parents:
diff changeset
852 || (v87 = v69->field_58[13], v87 == 99) )
Ritor1
parents:
diff changeset
853 v88 = v143->field_3C - v145->field_3C;
Ritor1
parents:
diff changeset
854 else
Ritor1
parents:
diff changeset
855 v88 = BYTE2(v69->field_34) + v69->field_48[0] + v69->field_48[11] + v87;
Ritor1
parents:
diff changeset
856 dword_4FA9B4[v68] += 2 * v88;
Ritor1
parents:
diff changeset
857 if ( BYTE3(v69->field_34) == 99
Ritor1
parents:
diff changeset
858 || v69->field_48[1] == 99
Ritor1
parents:
diff changeset
859 || v69->field_48[12] == 99
Ritor1
parents:
diff changeset
860 || (v89 = v69->field_58[14], v89 == 99) )
Ritor1
parents:
diff changeset
861 v90 = v143->field_40 - v145->field_40;
Ritor1
parents:
diff changeset
862 else
Ritor1
parents:
diff changeset
863 v90 = BYTE3(v69->field_34) + v69->field_48[1] + v69->field_48[12] + v89;
Ritor1
parents:
diff changeset
864 dword_4FA9B4[v68] += 2 * v90;
Ritor1
parents:
diff changeset
865 if ( v69->field_38[11] == 99 || (v91 = v69->field_58[8], v91 == 99) )
Ritor1
parents:
diff changeset
866 v92 = 10 * (v145->field_24 - v143->field_24);
Ritor1
parents:
diff changeset
867 else
Ritor1
parents:
diff changeset
868 v92 = -10 * (v69->field_38[11] + v91);
Ritor1
parents:
diff changeset
869 dword_4FA9B4[v68] += v92;
Ritor1
parents:
diff changeset
870 if ( v69->field_38[10] == 99 || (v93 = v69->field_58[7], v93 == 99) )
Ritor1
parents:
diff changeset
871 v94 = 3 * (v145->field_28 - v143->field_28);
Ritor1
parents:
diff changeset
872 else
Ritor1
parents:
diff changeset
873 v94 = -3 * (v69->field_38[10] + v93);
Ritor1
parents:
diff changeset
874 dword_4FA9B4[v68] += v94;
Ritor1
parents:
diff changeset
875 v95 = v69->field_38[9];
Ritor1
parents:
diff changeset
876 v140 = v95;
Ritor1
parents:
diff changeset
877 v96 = v69->field_38[3];
Ritor1
parents:
diff changeset
878 dword_4FA9B4[v68] += -7 * (v69->field_58[6] + v95);
Ritor1
parents:
diff changeset
879 v97 = dword_4FA9B4[v68];
Ritor1
parents:
diff changeset
880 if ( v96 == 99 )
Ritor1
parents:
diff changeset
881 goto LABEL_245;
Ritor1
parents:
diff changeset
882 v98 = v69->field_58[0];
Ritor1
parents:
diff changeset
883 if ( v98 == 99 )
Ritor1
parents:
diff changeset
884 break;
Ritor1
parents:
diff changeset
885 v99 = v96 + v98;
Ritor1
parents:
diff changeset
886 v67 = 99;
Ritor1
parents:
diff changeset
887 dword_4FA9B4[v68] = v97 - 5 * v99;
Ritor1
parents:
diff changeset
888 LABEL_246:
Ritor1
parents:
diff changeset
889 v101 = v140;
Ritor1
parents:
diff changeset
890 if ( v69->field_38[4] == v67 || (v102 = v69->field_58[1], v102 == v67) )
Ritor1
parents:
diff changeset
891 v103 = 5 * (v145->field_30 - v143->field_30);
Ritor1
parents:
diff changeset
892 else
Ritor1
parents:
diff changeset
893 v103 = -5 * (v69->field_38[4] + v102);
Ritor1
parents:
diff changeset
894 dword_4FA9B4[v68] += v103;
Ritor1
parents:
diff changeset
895 if ( v69->field_38[5] == v67 || (v104 = v69->field_58[2], v104 == v67) )
Ritor1
parents:
diff changeset
896 v105 = 5 * (v145->field_34 - v143->field_34);
Ritor1
parents:
diff changeset
897 else
Ritor1
parents:
diff changeset
898 v105 = -5 * (v69->field_38[5] + v104);
Ritor1
parents:
diff changeset
899 dword_4FA9B4[v68] += v105;
Ritor1
parents:
diff changeset
900 if ( v69->field_38[6] == v67 || (v106 = v69->field_58[3], v106 == v67) )
Ritor1
parents:
diff changeset
901 v107 = v145->field_38 - v143->field_38;
Ritor1
parents:
diff changeset
902 else
Ritor1
parents:
diff changeset
903 v107 = -(v69->field_38[6] + v106);
Ritor1
parents:
diff changeset
904 dword_4FA9B4[v68] += 2 * v107;
Ritor1
parents:
diff changeset
905 if ( v69->field_38[7] == v67 || (v108 = v69->field_58[4], v108 == v67) )
Ritor1
parents:
diff changeset
906 v109 = v145->field_3C - v143->field_3C;
Ritor1
parents:
diff changeset
907 else
Ritor1
parents:
diff changeset
908 v109 = -(v69->field_38[7] + v108);
Ritor1
parents:
diff changeset
909 dword_4FA9B4[v68] += 2 * v109;
Ritor1
parents:
diff changeset
910 if ( v69->field_38[8] == v67 || (v110 = v69->field_58[5], v110 == v67) )
Ritor1
parents:
diff changeset
911 {
Ritor1
parents:
diff changeset
912 v112 = v145;
Ritor1
parents:
diff changeset
913 v111 = v143;
Ritor1
parents:
diff changeset
914 dword_4FA9B4[v68] += 2 * (v145->field_40 - v143->field_40);
Ritor1
parents:
diff changeset
915 }
Ritor1
parents:
diff changeset
916 else
Ritor1
parents:
diff changeset
917 {
Ritor1
parents:
diff changeset
918 v111 = v143;
Ritor1
parents:
diff changeset
919 dword_4FA9B4[v68] += -2 * (v69->field_38[8] + v110);
Ritor1
parents:
diff changeset
920 v112 = v145;
Ritor1
parents:
diff changeset
921 }
Ritor1
parents:
diff changeset
922 if ( LOBYTE(v69->field_30) || v69->field_48[5] )
Ritor1
parents:
diff changeset
923 dword_4FA9B4[v68] *= 10;
Ritor1
parents:
diff changeset
924 if ( LOBYTE(v69->field_24) == 1 )
Ritor1
parents:
diff changeset
925 {
Ritor1
parents:
diff changeset
926 v113 = LOBYTE(v69->field_28);
Ritor1
parents:
diff changeset
927 v114 = v112->field_38;
Ritor1
parents:
diff changeset
928 }
Ritor1
parents:
diff changeset
929 else
Ritor1
parents:
diff changeset
930 {
Ritor1
parents:
diff changeset
931 if ( LOBYTE(v69->field_24) == 2 )
Ritor1
parents:
diff changeset
932 {
Ritor1
parents:
diff changeset
933 v113 = BYTE1(v69->field_28);
Ritor1
parents:
diff changeset
934 v114 = v112->field_3C;
Ritor1
parents:
diff changeset
935 }
Ritor1
parents:
diff changeset
936 else
Ritor1
parents:
diff changeset
937 {
Ritor1
parents:
diff changeset
938 if ( LOBYTE(v69->field_24) != 3 )
Ritor1
parents:
diff changeset
939 goto LABEL_278;
Ritor1
parents:
diff changeset
940 v113 = BYTE2(v69->field_28);
Ritor1
parents:
diff changeset
941 v114 = v112->field_40;
Ritor1
parents:
diff changeset
942 }
Ritor1
parents:
diff changeset
943 }
Ritor1
parents:
diff changeset
944 v115 = v114 - v113;
Ritor1
parents:
diff changeset
945 if ( v115 > 3 )
Ritor1
parents:
diff changeset
946 v115 = 3;
Ritor1
parents:
diff changeset
947 dword_4FA9B4[v68] += 5 * v115;
Ritor1
parents:
diff changeset
948 LABEL_278:
Ritor1
parents:
diff changeset
949 v116 = v69->field_58[8];
Ritor1
parents:
diff changeset
950 v141 = v111->field_24;
Ritor1
parents:
diff changeset
951 v126 = v69->field_38[11];
Ritor1
parents:
diff changeset
952 if ( v141 <= v116 + v126 )
Ritor1
parents:
diff changeset
953 dword_4FA9B4[v68] += 9999;
Ritor1
parents:
diff changeset
954 v137 = v111->field_28 + v141;
Ritor1
parents:
diff changeset
955 if ( v137 <= v116 + v126 + v69->field_58[6] + v69->field_58[7] + v101 + v69->field_38[10] )
Ritor1
parents:
diff changeset
956 dword_4FA9B4[v68] += 9999;
Ritor1
parents:
diff changeset
957 if ( v69->field_48[15] + (signed int)BYTE1(v69->field_68) + v145->field_24 + v69->field_48[4] + v149 >= dword_4E1884 )
Ritor1
parents:
diff changeset
958 dword_4FA9B4[v68] += 9999;
Ritor1
parents:
diff changeset
959 ++v133;
Ritor1
parents:
diff changeset
960 if ( v133 >= v136 )
Ritor1
parents:
diff changeset
961 {
Ritor1
parents:
diff changeset
962 v64 = v130;
Ritor1
parents:
diff changeset
963 goto LABEL_286;
Ritor1
parents:
diff changeset
964 }
Ritor1
parents:
diff changeset
965 }
Ritor1
parents:
diff changeset
966 v67 = 99;
Ritor1
parents:
diff changeset
967 LABEL_245:
Ritor1
parents:
diff changeset
968 v100 = v145->field_2C - v143->field_2C;
Ritor1
parents:
diff changeset
969 dword_4FA9B4[v68] = v97 + 4 * v100 + v100;
Ritor1
parents:
diff changeset
970 goto LABEL_246;
Ritor1
parents:
diff changeset
971 }
Ritor1
parents:
diff changeset
972 LABEL_286:
Ritor1
parents:
diff changeset
973 v117 = v136 - 1;
Ritor1
parents:
diff changeset
974 for ( j = v136 - 1; j >= 0; --j )
Ritor1
parents:
diff changeset
975 {
Ritor1
parents:
diff changeset
976 v137 = 0;
Ritor1
parents:
diff changeset
977 if ( j > 0 )
Ritor1
parents:
diff changeset
978 {
Ritor1
parents:
diff changeset
979 v119 = (int)dword_4FA9B0;
Ritor1
parents:
diff changeset
980 v134 = j;
Ritor1
parents:
diff changeset
981 v137 = j;
Ritor1
parents:
diff changeset
982 do
Ritor1
parents:
diff changeset
983 {
Ritor1
parents:
diff changeset
984 if ( *(unsigned int *)(v119 + 4) < *(unsigned int *)(v119 + 12) )
Ritor1
parents:
diff changeset
985 {
Ritor1
parents:
diff changeset
986 v120 = *(unsigned int *)v119;
Ritor1
parents:
diff changeset
987 v121 = *(unsigned int *)(v119 + 4);
Ritor1
parents:
diff changeset
988 *(unsigned int *)v119 = *(unsigned int *)(v119 + 8);
Ritor1
parents:
diff changeset
989 v122 = *(unsigned int *)(v119 + 12);
Ritor1
parents:
diff changeset
990 *(unsigned int *)(v119 + 8) = v120;
Ritor1
parents:
diff changeset
991 *(unsigned int *)(v119 + 4) = v122;
Ritor1
parents:
diff changeset
992 v64 = v130;
Ritor1
parents:
diff changeset
993 *(unsigned int *)(v119 + 12) = v121;
Ritor1
parents:
diff changeset
994 }
Ritor1
parents:
diff changeset
995 v119 += 8;
Ritor1
parents:
diff changeset
996 --v134;
Ritor1
parents:
diff changeset
997 }
Ritor1
parents:
diff changeset
998 while ( v134 );
Ritor1
parents:
diff changeset
999 }
Ritor1
parents:
diff changeset
1000 }
Ritor1
parents:
diff changeset
1001 v123 = v136 - 1;
Ritor1
parents:
diff changeset
1002 if ( am_byte_4FAA77 )
Ritor1
parents:
diff changeset
1003 {
Ritor1
parents:
diff changeset
1004 if ( v117 >= 0 )
Ritor1
parents:
diff changeset
1005 {
Ritor1
parents:
diff changeset
1006 while ( !BYTE3(pCards[stru_505708[0].arr_44[47 * v64 + dword_4FA9B0[2 * v123]]].field_28) )
Ritor1
parents:
diff changeset
1007 {
Ritor1
parents:
diff changeset
1008 --v123;
Ritor1
parents:
diff changeset
1009 if ( v123 < 0 )
Ritor1
parents:
diff changeset
1010 return am_40BCFB(v64, v137);
Ritor1
parents:
diff changeset
1011 }
Ritor1
parents:
diff changeset
1012 v137 = dword_4FA9B0[2 * v123];
Ritor1
parents:
diff changeset
1013 }
Ritor1
parents:
diff changeset
1014 }
Ritor1
parents:
diff changeset
1015 else
Ritor1
parents:
diff changeset
1016 {
Ritor1
parents:
diff changeset
1017 v124 = 0;
Ritor1
parents:
diff changeset
1018 if ( v117 >= 0 )
Ritor1
parents:
diff changeset
1019 {
Ritor1
parents:
diff changeset
1020 while ( !BYTE3(pCards[stru_505708[0].arr_44[47 * v64 + dword_4FA9B0[2 * v123]]].field_28) )
Ritor1
parents:
diff changeset
1021 {
Ritor1
parents:
diff changeset
1022 --v123;
Ritor1
parents:
diff changeset
1023 if ( v123 < 0 )
Ritor1
parents:
diff changeset
1024 goto LABEL_299;
Ritor1
parents:
diff changeset
1025 }
Ritor1
parents:
diff changeset
1026 v137 = dword_4FA9B0[2 * v123];
Ritor1
parents:
diff changeset
1027 }
Ritor1
parents:
diff changeset
1028 LABEL_299:
Ritor1
parents:
diff changeset
1029 if ( v136 > 0 )
Ritor1
parents:
diff changeset
1030 {
Ritor1
parents:
diff changeset
1031 while ( !am_40BF15(v64, dword_4FA9B0[2 * v124]) || dword_4FA9B4[2 * v124] < 0 )
Ritor1
parents:
diff changeset
1032 {
Ritor1
parents:
diff changeset
1033 ++v124;
Ritor1
parents:
diff changeset
1034 if ( v124 >= v136 )
Ritor1
parents:
diff changeset
1035 return am_40BCFB(v64, v137);
Ritor1
parents:
diff changeset
1036 }
Ritor1
parents:
diff changeset
1037 return am_40BE0E(v64, dword_4FA9B0[2 * v124]);
Ritor1
parents:
diff changeset
1038 }
Ritor1
parents:
diff changeset
1039 }
Ritor1
parents:
diff changeset
1040 return am_40BCFB(v64, v137);
Ritor1
parents:
diff changeset
1041 }
Ritor1
parents:
diff changeset
1042 v9 = a1;
Ritor1
parents:
diff changeset
1043 v144 = &stru_505708[a1];
Ritor1
parents:
diff changeset
1044 v129 = a1;
Ritor1
parents:
diff changeset
1045 v142 = &stru_505708[(a1 + 1) % 2];
Ritor1
parents:
diff changeset
1046 v135 = am_40BB49(a1);
Ritor1
parents:
diff changeset
1047 v10 = 0;
Ritor1
parents:
diff changeset
1048 do
Ritor1
parents:
diff changeset
1049 {
Ritor1
parents:
diff changeset
1050 if ( v10 >= v135 )
Ritor1
parents:
diff changeset
1051 {
Ritor1
parents:
diff changeset
1052 dword_4FA9B0[2 * v10] = -1;
Ritor1
parents:
diff changeset
1053 dword_4FA9B4[2 * v10] = -9999;
Ritor1
parents:
diff changeset
1054 }
Ritor1
parents:
diff changeset
1055 else
Ritor1
parents:
diff changeset
1056 {
Ritor1
parents:
diff changeset
1057 dword_4FA9B0[2 * v10] = v10;
Ritor1
parents:
diff changeset
1058 dword_4FA9B4[2 * v10] = 0;
Ritor1
parents:
diff changeset
1059 }
Ritor1
parents:
diff changeset
1060 ++v10;
Ritor1
parents:
diff changeset
1061 }
Ritor1
parents:
diff changeset
1062 while ( v10 < 10 );
Ritor1
parents:
diff changeset
1063 v131 = 0;
Ritor1
parents:
diff changeset
1064 if ( v135 > 0 )
Ritor1
parents:
diff changeset
1065 {
Ritor1
parents:
diff changeset
1066 v11 = 47 * v9;
Ritor1
parents:
diff changeset
1067 for ( k = 47 * v9; ; v11 = k )
Ritor1
parents:
diff changeset
1068 {
Ritor1
parents:
diff changeset
1069 v12 = 99;
Ritor1
parents:
diff changeset
1070 v13 = 2 * v131;
Ritor1
parents:
diff changeset
1071 v14 = &pCards[stru_505708[0].arr_44[v11 + dword_4FA9B0[2 * v131]]];
Ritor1
parents:
diff changeset
1072 v15 = v14->field_38[2];
Ritor1
parents:
diff changeset
1073 v148 = v14->field_38[2];
Ritor1
parents:
diff changeset
1074 if ( v144->field_24 >= 10 )
Ritor1
parents:
diff changeset
1075 {
Ritor1
parents:
diff changeset
1076 if ( v15 == 99 || v14->field_48[4] == 99 || v14->field_48[15] == 99 || (v19 = BYTE1(v14->field_68), v19 == 99) )
Ritor1
parents:
diff changeset
1077 v20 = 5 * (v142->field_24 - v144->field_24);
Ritor1
parents:
diff changeset
1078 else
Ritor1
parents:
diff changeset
1079 v20 = 5 * (v148 + v14->field_48[4] + v14->field_48[15] + v19);
Ritor1
parents:
diff changeset
1080 v18 = 2 * v20;
Ritor1
parents:
diff changeset
1081 }
Ritor1
parents:
diff changeset
1082 else
Ritor1
parents:
diff changeset
1083 {
Ritor1
parents:
diff changeset
1084 if ( v15 == 99 || v14->field_48[4] == 99 || v14->field_48[15] == 99 || (v16 = BYTE1(v14->field_68), v16 == 99) )
Ritor1
parents:
diff changeset
1085 v17 = 5 * (v142->field_24 - v144->field_24);
Ritor1
parents:
diff changeset
1086 else
Ritor1
parents:
diff changeset
1087 v17 = 5 * (v148 + v14->field_48[4] + v14->field_48[15] + v16);
Ritor1
parents:
diff changeset
1088 v18 = 4 * v17;
Ritor1
parents:
diff changeset
1089 }
Ritor1
parents:
diff changeset
1090 dword_4FA9B4[v13] += v18;
Ritor1
parents:
diff changeset
1091 v21 = v14->field_38[1];
Ritor1
parents:
diff changeset
1092 v146 = v14->field_38[1];
Ritor1
parents:
diff changeset
1093 if ( v144->field_28 >= 10 )
Ritor1
parents:
diff changeset
1094 {
Ritor1
parents:
diff changeset
1095 if ( v21 == 99
Ritor1
parents:
diff changeset
1096 || v14->field_48[3] == 99
Ritor1
parents:
diff changeset
1097 || v14->field_48[14] == 99
Ritor1
parents:
diff changeset
1098 || (v24 = LOBYTE(v14->field_68), v24 == 99) )
Ritor1
parents:
diff changeset
1099 v25 = v142->field_28 - v144->field_28;
Ritor1
parents:
diff changeset
1100 else
Ritor1
parents:
diff changeset
1101 v25 = v146 + v14->field_48[3] + v14->field_48[14] + v24;
Ritor1
parents:
diff changeset
1102 v23 = 2 * v25;
Ritor1
parents:
diff changeset
1103 }
Ritor1
parents:
diff changeset
1104 else
Ritor1
parents:
diff changeset
1105 {
Ritor1
parents:
diff changeset
1106 if ( v21 == 99
Ritor1
parents:
diff changeset
1107 || v14->field_48[3] == 99
Ritor1
parents:
diff changeset
1108 || v14->field_48[14] == 99
Ritor1
parents:
diff changeset
1109 || (v22 = LOBYTE(v14->field_68), v22 == 99) )
Ritor1
parents:
diff changeset
1110 v23 = 5 * (v142->field_28 - v144->field_28);
Ritor1
parents:
diff changeset
1111 else
Ritor1
parents:
diff changeset
1112 v23 = 5 * (v146 + v14->field_48[3] + v14->field_48[14] + v22);
Ritor1
parents:
diff changeset
1113 }
Ritor1
parents:
diff changeset
1114 dword_4FA9B4[v13] += v23;
Ritor1
parents:
diff changeset
1115 dword_4FA9B4[v13] += 7 * (v14->field_38[0] + v14->field_48[2] + v14->field_48[13] + v14->field_58[15]);
Ritor1
parents:
diff changeset
1116 if ( BYTE2(v14->field_30) == 99
Ritor1
parents:
diff changeset
1117 || v14->field_38[12] == 99
Ritor1
parents:
diff changeset
1118 || v14->field_48[7] == 99
Ritor1
parents:
diff changeset
1119 || (v26 = v14->field_58[9], v26 == 99) )
Ritor1
parents:
diff changeset
1120 v27 = 5 * (v142->field_2C - v144->field_2C);
Ritor1
parents:
diff changeset
1121 else
Ritor1
parents:
diff changeset
1122 v27 = 5 * (BYTE2(v14->field_30) + v14->field_38[12] + v14->field_48[7] + v26);
Ritor1
parents:
diff changeset
1123 dword_4FA9B4[v13] += 8 * v27;
Ritor1
parents:
diff changeset
1124 if ( BYTE3(v14->field_30) == 99
Ritor1
parents:
diff changeset
1125 || v14->field_38[13] == 99
Ritor1
parents:
diff changeset
1126 || v14->field_48[8] == 99
Ritor1
parents:
diff changeset
1127 || (v28 = v14->field_58[10], v28 == 99) )
Ritor1
parents:
diff changeset
1128 v29 = 5 * (v142->field_30 - v144->field_30);
Ritor1
parents:
diff changeset
1129 else
Ritor1
parents:
diff changeset
1130 v29 = 5 * (BYTE3(v14->field_30) + v14->field_38[13] + v14->field_48[8] + v28);
Ritor1
parents:
diff changeset
1131 dword_4FA9B4[v13] += 8 * v29;
Ritor1
parents:
diff changeset
1132 if ( LOBYTE(v14->field_34) == 99
Ritor1
parents:
diff changeset
1133 || v14->field_38[14] == 99
Ritor1
parents:
diff changeset
1134 || v14->field_48[9] == 99
Ritor1
parents:
diff changeset
1135 || (v30 = v14->field_58[11], v30 == 99) )
Ritor1
parents:
diff changeset
1136 v31 = 5 * (v142->field_34 - v144->field_34);
Ritor1
parents:
diff changeset
1137 else
Ritor1
parents:
diff changeset
1138 v31 = 5 * (LOBYTE(v14->field_34) + v14->field_38[14] + v14->field_48[9] + v30);
Ritor1
parents:
diff changeset
1139 dword_4FA9B4[v13] += 8 * v31;
Ritor1
parents:
diff changeset
1140 if ( BYTE1(v14->field_34) == 99
Ritor1
parents:
diff changeset
1141 || v14->field_38[15] == 99
Ritor1
parents:
diff changeset
1142 || v14->field_48[10] == 99
Ritor1
parents:
diff changeset
1143 || (v32 = v14->field_58[12], v32 == 99) )
Ritor1
parents:
diff changeset
1144 v33 = v142->field_38 - v144->field_38;
Ritor1
parents:
diff changeset
1145 else
Ritor1
parents:
diff changeset
1146 v33 = BYTE1(v14->field_34) + v14->field_38[15] + v14->field_48[10] + v32;
Ritor1
parents:
diff changeset
1147 dword_4FA9B4[v13] += 2 * v33;
Ritor1
parents:
diff changeset
1148 if ( BYTE2(v14->field_34) == 99
Ritor1
parents:
diff changeset
1149 || v14->field_48[0] == 99
Ritor1
parents:
diff changeset
1150 || v14->field_48[11] == 99
Ritor1
parents:
diff changeset
1151 || (v34 = v14->field_58[13], v34 == 99) )
Ritor1
parents:
diff changeset
1152 v35 = v142->field_3C - v144->field_3C;
Ritor1
parents:
diff changeset
1153 else
Ritor1
parents:
diff changeset
1154 v35 = BYTE2(v14->field_34) + v14->field_48[0] + v14->field_48[11] + v34;
Ritor1
parents:
diff changeset
1155 dword_4FA9B4[v13] += 2 * v35;
Ritor1
parents:
diff changeset
1156 if ( BYTE3(v14->field_34) == 99
Ritor1
parents:
diff changeset
1157 || v14->field_48[1] == 99
Ritor1
parents:
diff changeset
1158 || v14->field_48[12] == 99
Ritor1
parents:
diff changeset
1159 || (v36 = v14->field_58[14], v36 == 99) )
Ritor1
parents:
diff changeset
1160 v37 = v142->field_40 - v144->field_40;
Ritor1
parents:
diff changeset
1161 else
Ritor1
parents:
diff changeset
1162 v37 = BYTE3(v14->field_34) + v14->field_48[1] + v14->field_48[12] + v36;
Ritor1
parents:
diff changeset
1163 dword_4FA9B4[v13] += 2 * v37;
Ritor1
parents:
diff changeset
1164 if ( v14->field_38[11] == 99 || (v38 = v14->field_58[8], v38 == 99) )
Ritor1
parents:
diff changeset
1165 dword_4FA9B4[v13] += v144->field_24 - v142->field_24;
Ritor1
parents:
diff changeset
1166 else
Ritor1
parents:
diff changeset
1167 dword_4FA9B4[v13] -= v14->field_38[11] + v38;
Ritor1
parents:
diff changeset
1168 if ( v14->field_38[10] == 99 || (v39 = v14->field_58[7], v39 == 99) )
Ritor1
parents:
diff changeset
1169 dword_4FA9B4[v13] += v144->field_28 - v142->field_28;
Ritor1
parents:
diff changeset
1170 else
Ritor1
parents:
diff changeset
1171 dword_4FA9B4[v13] -= v14->field_38[10] + v39;
Ritor1
parents:
diff changeset
1172 v40 = v14->field_38[9];
Ritor1
parents:
diff changeset
1173 v138 = v14->field_38[9];
Ritor1
parents:
diff changeset
1174 dword_4FA9B4[v13] -= v40 + v14->field_58[6];
Ritor1
parents:
diff changeset
1175 v41 = v14->field_38[3];
Ritor1
parents:
diff changeset
1176 v42 = dword_4FA9B4[v13];
Ritor1
parents:
diff changeset
1177 if ( v41 == 99 )
Ritor1
parents:
diff changeset
1178 goto LABEL_97;
Ritor1
parents:
diff changeset
1179 v43 = v14->field_58[0];
Ritor1
parents:
diff changeset
1180 if ( v43 == 99 )
Ritor1
parents:
diff changeset
1181 break;
Ritor1
parents:
diff changeset
1182 v44 = v42 - v43;
Ritor1
parents:
diff changeset
1183 v12 = 99;
Ritor1
parents:
diff changeset
1184 dword_4FA9B4[v13] = v44 - v41;
Ritor1
parents:
diff changeset
1185 LABEL_98:
Ritor1
parents:
diff changeset
1186 if ( v14->field_38[4] == v12 || (v45 = v14->field_58[1], v45 == v12) )
Ritor1
parents:
diff changeset
1187 dword_4FA9B4[v13] += v144->field_30 - v142->field_30;
Ritor1
parents:
diff changeset
1188 else
Ritor1
parents:
diff changeset
1189 dword_4FA9B4[v13] -= v14->field_38[4] + v45;
Ritor1
parents:
diff changeset
1190 if ( v14->field_38[5] == v12 || (v46 = v14->field_58[2], v46 == v12) )
Ritor1
parents:
diff changeset
1191 dword_4FA9B4[v13] += v144->field_34 - v142->field_34;
Ritor1
parents:
diff changeset
1192 else
Ritor1
parents:
diff changeset
1193 dword_4FA9B4[v13] -= v14->field_38[5] + v46;
Ritor1
parents:
diff changeset
1194 if ( v14->field_38[6] == v12 || (v47 = v14->field_58[3], v47 == v12) )
Ritor1
parents:
diff changeset
1195 dword_4FA9B4[v13] += v144->field_38 - v142->field_38;
Ritor1
parents:
diff changeset
1196 else
Ritor1
parents:
diff changeset
1197 dword_4FA9B4[v13] -= v14->field_38[6] + v47;
Ritor1
parents:
diff changeset
1198 if ( v14->field_38[7] == v12 || (v48 = v14->field_58[4], v48 == v12) )
Ritor1
parents:
diff changeset
1199 dword_4FA9B4[v13] += v144->field_3C - v142->field_3C;
Ritor1
parents:
diff changeset
1200 else
Ritor1
parents:
diff changeset
1201 dword_4FA9B4[v13] -= v14->field_38[7] + v48;
Ritor1
parents:
diff changeset
1202 if ( v14->field_38[8] == v12 || (v49 = v14->field_58[5], v49 == v12) )
Ritor1
parents:
diff changeset
1203 {
Ritor1
parents:
diff changeset
1204 v51 = v144;
Ritor1
parents:
diff changeset
1205 v50 = v142;
Ritor1
parents:
diff changeset
1206 dword_4FA9B4[v13] += v144->field_40 - v142->field_40;
Ritor1
parents:
diff changeset
1207 }
Ritor1
parents:
diff changeset
1208 else
Ritor1
parents:
diff changeset
1209 {
Ritor1
parents:
diff changeset
1210 v50 = v142;
Ritor1
parents:
diff changeset
1211 dword_4FA9B4[v13] -= v14->field_38[8] + v49;
Ritor1
parents:
diff changeset
1212 v51 = v144;
Ritor1
parents:
diff changeset
1213 }
Ritor1
parents:
diff changeset
1214 if ( LOBYTE(v14->field_30) || v14->field_48[5] )
Ritor1
parents:
diff changeset
1215 dword_4FA9B4[v13] *= 10;
Ritor1
parents:
diff changeset
1216 if ( LOBYTE(v14->field_24) == 1 )
Ritor1
parents:
diff changeset
1217 {
Ritor1
parents:
diff changeset
1218 v52 = LOBYTE(v14->field_28);
Ritor1
parents:
diff changeset
1219 v53 = v51->field_38;
Ritor1
parents:
diff changeset
1220 }
Ritor1
parents:
diff changeset
1221 else
Ritor1
parents:
diff changeset
1222 {
Ritor1
parents:
diff changeset
1223 if ( LOBYTE(v14->field_24) == 2 )
Ritor1
parents:
diff changeset
1224 {
Ritor1
parents:
diff changeset
1225 v52 = BYTE1(v14->field_28);
Ritor1
parents:
diff changeset
1226 v53 = v51->field_3C;
Ritor1
parents:
diff changeset
1227 }
Ritor1
parents:
diff changeset
1228 else
Ritor1
parents:
diff changeset
1229 {
Ritor1
parents:
diff changeset
1230 if ( LOBYTE(v14->field_24) != 3 )
Ritor1
parents:
diff changeset
1231 goto LABEL_130;
Ritor1
parents:
diff changeset
1232 v52 = BYTE2(v14->field_28);
Ritor1
parents:
diff changeset
1233 v53 = v51->field_40;
Ritor1
parents:
diff changeset
1234 }
Ritor1
parents:
diff changeset
1235 }
Ritor1
parents:
diff changeset
1236 v54 = v53 - v52;
Ritor1
parents:
diff changeset
1237 if ( v54 > 3 )
Ritor1
parents:
diff changeset
1238 v54 = 3;
Ritor1
parents:
diff changeset
1239 dword_4FA9B4[v13] += 5 * v54;
Ritor1
parents:
diff changeset
1240 LABEL_130:
Ritor1
parents:
diff changeset
1241 v55 = v14->field_58[8];
Ritor1
parents:
diff changeset
1242 v139 = v50->field_24;
Ritor1
parents:
diff changeset
1243 v125 = v14->field_38[11];
Ritor1
parents:
diff changeset
1244 if ( v139 <= v55 + v125 )
Ritor1
parents:
diff changeset
1245 dword_4FA9B4[v13] += 9999;
Ritor1
parents:
diff changeset
1246 v137 = v50->field_28 + v139;
Ritor1
parents:
diff changeset
1247 if ( v137 <= v55 + v125 + v14->field_58[6] + v14->field_58[7] + v40 + v14->field_38[10] )
Ritor1
parents:
diff changeset
1248 dword_4FA9B4[v13] += 9999;
Ritor1
parents:
diff changeset
1249 if ( v14->field_48[15] + (signed int)BYTE1(v14->field_68) + v144->field_24 + v14->field_48[4] + v148 >= dword_4E1884 )
Ritor1
parents:
diff changeset
1250 dword_4FA9B4[v13] += 9999;
Ritor1
parents:
diff changeset
1251 ++v131;
Ritor1
parents:
diff changeset
1252 if ( v131 >= v135 )
Ritor1
parents:
diff changeset
1253 {
Ritor1
parents:
diff changeset
1254 v9 = v129;
Ritor1
parents:
diff changeset
1255 goto LABEL_138;
Ritor1
parents:
diff changeset
1256 }
Ritor1
parents:
diff changeset
1257 }
Ritor1
parents:
diff changeset
1258 v12 = 99;
Ritor1
parents:
diff changeset
1259 LABEL_97:
Ritor1
parents:
diff changeset
1260 v40 = v138;
Ritor1
parents:
diff changeset
1261 dword_4FA9B4[v13] = v42 + v144->field_2C - v142->field_2C;
Ritor1
parents:
diff changeset
1262 goto LABEL_98;
Ritor1
parents:
diff changeset
1263 }
Ritor1
parents:
diff changeset
1264 LABEL_138:
Ritor1
parents:
diff changeset
1265 v56 = v135 - 1;
Ritor1
parents:
diff changeset
1266 for ( l = v135 - 1; l >= 0; --l )
Ritor1
parents:
diff changeset
1267 {
Ritor1
parents:
diff changeset
1268 v137 = 0;
Ritor1
parents:
diff changeset
1269 if ( l > 0 )
Ritor1
parents:
diff changeset
1270 {
Ritor1
parents:
diff changeset
1271 v58 = (int)dword_4FA9B0;
Ritor1
parents:
diff changeset
1272 v132 = l;
Ritor1
parents:
diff changeset
1273 v137 = l;
Ritor1
parents:
diff changeset
1274 do
Ritor1
parents:
diff changeset
1275 {
Ritor1
parents:
diff changeset
1276 if ( *(unsigned int *)(v58 + 4) < *(unsigned int *)(v58 + 12) )
Ritor1
parents:
diff changeset
1277 {
Ritor1
parents:
diff changeset
1278 v59 = *(unsigned int *)v58;
Ritor1
parents:
diff changeset
1279 v60 = *(unsigned int *)(v58 + 4);
Ritor1
parents:
diff changeset
1280 *(unsigned int *)v58 = *(unsigned int *)(v58 + 8);
Ritor1
parents:
diff changeset
1281 v61 = *(unsigned int *)(v58 + 12);
Ritor1
parents:
diff changeset
1282 *(unsigned int *)(v58 + 8) = v59;
Ritor1
parents:
diff changeset
1283 *(unsigned int *)(v58 + 4) = v61;
Ritor1
parents:
diff changeset
1284 v9 = v129;
Ritor1
parents:
diff changeset
1285 *(unsigned int *)(v58 + 12) = v60;
Ritor1
parents:
diff changeset
1286 }
Ritor1
parents:
diff changeset
1287 v58 += 8;
Ritor1
parents:
diff changeset
1288 --v132;
Ritor1
parents:
diff changeset
1289 }
Ritor1
parents:
diff changeset
1290 while ( v132 );
Ritor1
parents:
diff changeset
1291 }
Ritor1
parents:
diff changeset
1292 }
Ritor1
parents:
diff changeset
1293 v62 = v135 - 1;
Ritor1
parents:
diff changeset
1294 if ( am_byte_4FAA77 )
Ritor1
parents:
diff changeset
1295 {
Ritor1
parents:
diff changeset
1296 if ( v56 >= 0 )
Ritor1
parents:
diff changeset
1297 {
Ritor1
parents:
diff changeset
1298 while ( !BYTE3(pCards[stru_505708[0].arr_44[47 * v9 + dword_4FA9B0[2 * v62]]].field_28) )
Ritor1
parents:
diff changeset
1299 {
Ritor1
parents:
diff changeset
1300 --v62;
Ritor1
parents:
diff changeset
1301 if ( v62 < 0 )
Ritor1
parents:
diff changeset
1302 return am_40BCFB(v9, v137);
Ritor1
parents:
diff changeset
1303 }
Ritor1
parents:
diff changeset
1304 v137 = dword_4FA9B0[2 * v62];
Ritor1
parents:
diff changeset
1305 }
Ritor1
parents:
diff changeset
1306 }
Ritor1
parents:
diff changeset
1307 else
Ritor1
parents:
diff changeset
1308 {
Ritor1
parents:
diff changeset
1309 v63 = 0;
Ritor1
parents:
diff changeset
1310 if ( v56 >= 0 )
Ritor1
parents:
diff changeset
1311 {
Ritor1
parents:
diff changeset
1312 while ( !BYTE3(pCards[stru_505708[0].arr_44[47 * v9 + dword_4FA9B0[2 * v62]]].field_28) )
Ritor1
parents:
diff changeset
1313 {
Ritor1
parents:
diff changeset
1314 --v62;
Ritor1
parents:
diff changeset
1315 if ( v62 < 0 )
Ritor1
parents:
diff changeset
1316 goto LABEL_151;
Ritor1
parents:
diff changeset
1317 }
Ritor1
parents:
diff changeset
1318 v137 = dword_4FA9B0[2 * v62];
Ritor1
parents:
diff changeset
1319 }
Ritor1
parents:
diff changeset
1320 LABEL_151:
Ritor1
parents:
diff changeset
1321 if ( v135 > 0 )
Ritor1
parents:
diff changeset
1322 {
Ritor1
parents:
diff changeset
1323 while ( !am_40BF15(v9, dword_4FA9B0[2 * v63]) || dword_4FA9B4[2 * v63] < 0 )
Ritor1
parents:
diff changeset
1324 {
Ritor1
parents:
diff changeset
1325 ++v63;
Ritor1
parents:
diff changeset
1326 if ( v63 >= v135 )
Ritor1
parents:
diff changeset
1327 return am_40BCFB(v9, v137);
Ritor1
parents:
diff changeset
1328 }
Ritor1
parents:
diff changeset
1329 return am_40BE0E(v9, dword_4FA9B0[2 * v63]);
Ritor1
parents:
diff changeset
1330 }
Ritor1
parents:
diff changeset
1331 }
Ritor1
parents:
diff changeset
1332 return am_40BCFB(v9, v137);
Ritor1
parents:
diff changeset
1333 }
Ritor1
parents:
diff changeset
1334 v3 = 0;
Ritor1
parents:
diff changeset
1335 v4 = a1;
Ritor1
parents:
diff changeset
1336 if ( am_byte_4FAA77 )
Ritor1
parents:
diff changeset
1337 {
Ritor1
parents:
diff changeset
1338 LABEL_11:
Ritor1
parents:
diff changeset
1339 v7 = am_40BB49(v4);
Ritor1
parents:
diff changeset
1340 v8 = rand_interval(0, v7 - 1);
Ritor1
parents:
diff changeset
1341 result = am_40BCFB(v4, v8);
Ritor1
parents:
diff changeset
1342 }
Ritor1
parents:
diff changeset
1343 else
Ritor1
parents:
diff changeset
1344 {
Ritor1
parents:
diff changeset
1345 while ( 1 )
Ritor1
parents:
diff changeset
1346 {
Ritor1
parents:
diff changeset
1347 v5 = am_40BB49(v4);
Ritor1
parents:
diff changeset
1348 v6 = rand_interval(0, v5 - 1);
Ritor1
parents:
diff changeset
1349 if ( am_40BF15(v4, v6) )
Ritor1
parents:
diff changeset
1350 break;
Ritor1
parents:
diff changeset
1351 ++v3;
Ritor1
parents:
diff changeset
1352 if ( v3 >= 10 )
Ritor1
parents:
diff changeset
1353 goto LABEL_11;
Ritor1
parents:
diff changeset
1354 }
Ritor1
parents:
diff changeset
1355 result = am_40BE0E(v4, v6);
Ritor1
parents:
diff changeset
1356 }
Ritor1
parents:
diff changeset
1357 return result;
Ritor1
parents:
diff changeset
1358 }
Ritor1
parents:
diff changeset
1359 // 408BB4: could not find valid save-restore pair for ebp
Ritor1
parents:
diff changeset
1360 // 4DF3A4: using guessed type int dword_4DF3A4;
Ritor1
parents:
diff changeset
1361 // 4E1884: using guessed type int dword_4E1884;
Ritor1
parents:
diff changeset
1362 // 4FA9B0: using guessed type int dword_4FA9B0[];
Ritor1
parents:
diff changeset
1363 // 4FA9B4: using guessed type int dword_4FA9B4[];
Ritor1
parents:
diff changeset
1364 // 4FAA00: using guessed type char byte_4FAA00;
Ritor1
parents:
diff changeset
1365 // 4FAA77: using guessed type char am_byte_4FAA77;
Ritor1
parents:
diff changeset
1366
Ritor1
parents:
diff changeset
1367
Ritor1
parents:
diff changeset
1368
Ritor1
parents:
diff changeset
1369 //----- (00409E6A) --------------------------------------------------------
Ritor1
parents:
diff changeset
1370 void ArcomageGame::Loop()
Ritor1
parents:
diff changeset
1371 {
Ritor1
parents:
diff changeset
1372 int v0; // edx@2
Ritor1
parents:
diff changeset
1373 int v1; // ecx@14
Ritor1
parents:
diff changeset
1374 signed int v2; // eax@15
Ritor1
parents:
diff changeset
1375 stru272 *v3; // esi@17
Ritor1
parents:
diff changeset
1376 __int16 *v4; // esi@23
Ritor1
parents:
diff changeset
1377
Ritor1
parents:
diff changeset
1378 while ( !pArcomageGame->field_F5 )
Ritor1
parents:
diff changeset
1379 {
Ritor1
parents:
diff changeset
1380 pArcomageGame->field_F6 = 1;
Ritor1
parents:
diff changeset
1381 byte_4FAA24 = 1;
Ritor1
parents:
diff changeset
1382 am_40A346(amuint_4FAA6C);
Ritor1
parents:
diff changeset
1383 LABEL_8:
Ritor1
parents:
diff changeset
1384 while ( byte_4FAA24 )
Ritor1
parents:
diff changeset
1385 {
Ritor1
parents:
diff changeset
1386 amuint_4FABC0 = -1;
Ritor1
parents:
diff changeset
1387 am_40A283(amuint_4FAA6C, v0);
Ritor1
parents:
diff changeset
1388 while ( 1 )
Ritor1
parents:
diff changeset
1389 {
Ritor1
parents:
diff changeset
1390 byte_4FAA24 = am_40A560(amuint_4FAA6C);
Ritor1
parents:
diff changeset
1391 if ( am_40BB49(amuint_4FAA6C) <= dword_4E1874 )
Ritor1
parents:
diff changeset
1392 break;
Ritor1
parents:
diff changeset
1393 am_byte_4FAA77 = 1;
Ritor1
parents:
diff changeset
1394 if ( pArcomageGame->field_F4 )
Ritor1
parents:
diff changeset
1395 goto LABEL_8;
Ritor1
parents:
diff changeset
1396 }
Ritor1
parents:
diff changeset
1397 am_byte_4FAA77 = 0;
Ritor1
parents:
diff changeset
1398 }
Ritor1
parents:
diff changeset
1399 pArcomageGame->field_F5 = am_40A514();
Ritor1
parents:
diff changeset
1400 if ( !pArcomageGame->field_F5 )
Ritor1
parents:
diff changeset
1401 am_40A383();
Ritor1
parents:
diff changeset
1402 if ( pArcomageGame->field_F4 )
Ritor1
parents:
diff changeset
1403 pArcomageGame->field_F5 = 1;
Ritor1
parents:
diff changeset
1404 }
Ritor1
parents:
diff changeset
1405 am_40D444();
Ritor1
parents:
diff changeset
1406 if ( byte_4FAA2C )
Ritor1
parents:
diff changeset
1407 {
Ritor1
parents:
diff changeset
1408 v2 = retzero_sub_40DFA7((int)dword_4FAA28);
Ritor1
parents:
diff changeset
1409 v1 = 1000;
Ritor1
parents:
diff changeset
1410 dword_4FAA70 = v2 / 1000;
Ritor1
parents:
diff changeset
1411 }
Ritor1
parents:
diff changeset
1412 else
Ritor1
parents:
diff changeset
1413 {
Ritor1
parents:
diff changeset
1414 dword_4FAA70 = -1;
Ritor1
parents:
diff changeset
1415 }
Ritor1
parents:
diff changeset
1416 pVideoPlayer->BinkUpdatePalette(dword_4FAA28);
Ritor1
parents:
diff changeset
1417 v3 = array_4FAC10;
Ritor1
parents:
diff changeset
1418 do
Ritor1
parents:
diff changeset
1419 {
Ritor1
parents:
diff changeset
1420 v3->ptr_0->_40E0F5(1, 1);
Ritor1
parents:
diff changeset
1421 v3->ptr_0->_40DFFE();
Ritor1
parents:
diff changeset
1422 ++v3;
Ritor1
parents:
diff changeset
1423 }
Ritor1
parents:
diff changeset
1424 while ( (signed int)v3 < (signed int)&unk_5052C8 );
Ritor1
parents:
diff changeset
1425 if (pAsyncMouse)
Ritor1
parents:
diff changeset
1426 {
Ritor1
parents:
diff changeset
1427 pAsyncMouse->_409E3D(*((unsigned char *)pAsyncMouse + 103));
Ritor1
parents:
diff changeset
1428 pAsyncMouse->_46B944();
Ritor1
parents:
diff changeset
1429 }
Ritor1
parents:
diff changeset
1430 pArcomageGame->pGameBackground.Release();
Ritor1
parents:
diff changeset
1431 pArcomageGame->pSprites.Release();
Ritor1
parents:
diff changeset
1432 pArcomageGame->bGameInProgress = 0;
Ritor1
parents:
diff changeset
1433 viewparams->bRedrawGameUI = 1;
Ritor1
parents:
diff changeset
1434 if ( pVideoPlayer->AnyMovieLoaded() )
Ritor1
parents:
diff changeset
1435 pVideoPlayer->_4BF5B2();
Ritor1
parents:
diff changeset
1436 v4 = am_sounds;
Ritor1
parents:
diff changeset
1437 do
Ritor1
parents:
diff changeset
1438 {
764
90bcfb56c8f9 sound cleaning
Gloval
parents: 735
diff changeset
1439 pSoundList->UnloadSound((unsigned __int16)*v4, 1);
0
Ritor1
parents:
diff changeset
1440 ++v4;
Ritor1
parents:
diff changeset
1441 }
Ritor1
parents:
diff changeset
1442 while ( (signed int)v4 <= (signed int)&unk_4FAA20 );
Ritor1
parents:
diff changeset
1443 }
938
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
1444
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
1445
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
1446
0
Ritor1
parents:
diff changeset
1447
Ritor1
parents:
diff changeset
1448 //----- (00409FE9) --------------------------------------------------------
Ritor1
parents:
diff changeset
1449 char __cdecl am_409FE9()
Ritor1
parents:
diff changeset
1450 {
Ritor1
parents:
diff changeset
1451 signed int v0; // edi@1
Ritor1
parents:
diff changeset
1452 signed int v1; // esi@4
Ritor1
parents:
diff changeset
1453 int *v2; // ecx@7
Ritor1
parents:
diff changeset
1454 int *v3; // eax@7
Ritor1
parents:
diff changeset
1455 signed int v4; // edx@7
Ritor1
parents:
diff changeset
1456 int v5; // edx@13
Ritor1
parents:
diff changeset
1457 signed int v6; // ecx@13
Ritor1
parents:
diff changeset
1458 signed int v7; // eax@13
Ritor1
parents:
diff changeset
1459
Ritor1
parents:
diff changeset
1460 amuint_4FAA6C = dword_505890;
Ritor1
parents:
diff changeset
1461 sub_409BE8();
Ritor1
parents:
diff changeset
1462 v0 = 0;
Ritor1
parents:
diff changeset
1463 do
Ritor1
parents:
diff changeset
1464 {
Ritor1
parents:
diff changeset
1465 if ( v0 )
Ritor1
parents:
diff changeset
1466 {
Ritor1
parents:
diff changeset
1467 v1 = v0;
Ritor1
parents:
diff changeset
1468 inv_strcpy(pArcomageGame->pPlayer2Name, stru_505708[v0].pPlayerName);
Ritor1
parents:
diff changeset
1469 if ( byte_4E185C )
Ritor1
parents:
diff changeset
1470 LOBYTE(stru_505708[v1].field_20) = 0;
Ritor1
parents:
diff changeset
1471 else
Ritor1
parents:
diff changeset
1472 LOBYTE(stru_505708[v1].field_20) = 1;
Ritor1
parents:
diff changeset
1473 }
Ritor1
parents:
diff changeset
1474 else
Ritor1
parents:
diff changeset
1475 {
Ritor1
parents:
diff changeset
1476 inv_strcpy(pArcomageGame->pPlayer1Name, (char *)stru_505708);
Ritor1
parents:
diff changeset
1477 LOBYTE(stru_505708[0].field_20) = 1;
Ritor1
parents:
diff changeset
1478 }
Ritor1
parents:
diff changeset
1479 stru_505708[v0].field_24 = amuint_4E1860;
Ritor1
parents:
diff changeset
1480 stru_505708[v0].field_28 = amuint_4E1864;
Ritor1
parents:
diff changeset
1481 stru_505708[v0].field_2C = amuint_4E1868;
Ritor1
parents:
diff changeset
1482 stru_505708[v0].field_30 = amuint_4E186C;
Ritor1
parents:
diff changeset
1483 stru_505708[v0].field_34 = amuint_4E1870;
Ritor1
parents:
diff changeset
1484 stru_505708[v0].field_38 = amuint_505884;
Ritor1
parents:
diff changeset
1485 stru_505708[v0].field_3C = amuint_505888;
Ritor1
parents:
diff changeset
1486 stru_505708[v0].field_40 = amuint_50588C;
Ritor1
parents:
diff changeset
1487 v2 = &stru_505708[v0].arr_6C[0][1];
Ritor1
parents:
diff changeset
1488 v3 = stru_505708[v0].arr_44;
Ritor1
parents:
diff changeset
1489 v4 = 10;
Ritor1
parents:
diff changeset
1490 do
Ritor1
parents:
diff changeset
1491 {
Ritor1
parents:
diff changeset
1492 *v3 = -1;
Ritor1
parents:
diff changeset
1493 if ( am_byte_4E185D )
Ritor1
parents:
diff changeset
1494 {
Ritor1
parents:
diff changeset
1495 *(v2 - 1) = -1;
Ritor1
parents:
diff changeset
1496 *v2 = -1;
Ritor1
parents:
diff changeset
1497 }
Ritor1
parents:
diff changeset
1498 else
Ritor1
parents:
diff changeset
1499 {
Ritor1
parents:
diff changeset
1500 *(v2 - 1) = 0;
Ritor1
parents:
diff changeset
1501 *v2 = 0;
Ritor1
parents:
diff changeset
1502 }
Ritor1
parents:
diff changeset
1503 ++v3;
Ritor1
parents:
diff changeset
1504 v2 += 2;
Ritor1
parents:
diff changeset
1505 --v4;
Ritor1
parents:
diff changeset
1506 }
Ritor1
parents:
diff changeset
1507 while ( v4 );
Ritor1
parents:
diff changeset
1508 ++v0;
Ritor1
parents:
diff changeset
1509 }
Ritor1
parents:
diff changeset
1510 while ( v0 < 2 );
Ritor1
parents:
diff changeset
1511 inv_strcpy(pDeckMaster, byte_5054C8);
Ritor1
parents:
diff changeset
1512 v5 = 0;
Ritor1
parents:
diff changeset
1513 v6 = (signed int)dword_505554;
Ritor1
parents:
diff changeset
1514 v7 = -2;
Ritor1
parents:
diff changeset
1515 do
Ritor1
parents:
diff changeset
1516 {
Ritor1
parents:
diff changeset
1517 byte_5054E8[v7 + 2] = 0;
Ritor1
parents:
diff changeset
1518 *(unsigned int *)v6 = v5;
Ritor1
parents:
diff changeset
1519 switch ( v7 )
Ritor1
parents:
diff changeset
1520 {
Ritor1
parents:
diff changeset
1521 default:
Ritor1
parents:
diff changeset
1522 ++v5;
Ritor1
parents:
diff changeset
1523 break;
Ritor1
parents:
diff changeset
1524 case 0:
Ritor1
parents:
diff changeset
1525 case 2:
Ritor1
parents:
diff changeset
1526 case 6:
Ritor1
parents:
diff changeset
1527 case 9:
Ritor1
parents:
diff changeset
1528 case 13:
Ritor1
parents:
diff changeset
1529 case 18:
Ritor1
parents:
diff changeset
1530 case 23:
Ritor1
parents:
diff changeset
1531 case 33:
Ritor1
parents:
diff changeset
1532 case 36:
Ritor1
parents:
diff changeset
1533 case 38:
Ritor1
parents:
diff changeset
1534 case 44:
Ritor1
parents:
diff changeset
1535 case 46:
Ritor1
parents:
diff changeset
1536 case 52:
Ritor1
parents:
diff changeset
1537 case 57:
Ritor1
parents:
diff changeset
1538 case 69:
Ritor1
parents:
diff changeset
1539 case 71:
Ritor1
parents:
diff changeset
1540 case 75:
Ritor1
parents:
diff changeset
1541 case 79:
Ritor1
parents:
diff changeset
1542 case 81:
Ritor1
parents:
diff changeset
1543 case 84:
Ritor1
parents:
diff changeset
1544 case 89:
Ritor1
parents:
diff changeset
1545 break;
Ritor1
parents:
diff changeset
1546 }
Ritor1
parents:
diff changeset
1547 v6 += 4;
Ritor1
parents:
diff changeset
1548 ++v7;
Ritor1
parents:
diff changeset
1549 }
Ritor1
parents:
diff changeset
1550 while ( v6 < (signed int)&unk_505704 );
Ritor1
parents:
diff changeset
1551 return am_40A198();
Ritor1
parents:
diff changeset
1552 }
Ritor1
parents:
diff changeset
1553 // 4E185C: using guessed type char byte_4E185C;
Ritor1
parents:
diff changeset
1554 // 4E185D: using guessed type char am_byte_4E185D;
Ritor1
parents:
diff changeset
1555 // 4E1860: using guessed type int amuint_4E1860;
Ritor1
parents:
diff changeset
1556 // 4E1864: using guessed type int amuint_4E1864;
Ritor1
parents:
diff changeset
1557 // 4E1868: using guessed type int amuint_4E1868;
Ritor1
parents:
diff changeset
1558 // 4E186C: using guessed type int amuint_4E186C;
Ritor1
parents:
diff changeset
1559 // 4E1870: using guessed type int amuint_4E1870;
Ritor1
parents:
diff changeset
1560 // 505554: using guessed type int dword_505554[];
Ritor1
parents:
diff changeset
1561 // 505884: using guessed type int amuint_505884;
Ritor1
parents:
diff changeset
1562 // 505888: using guessed type int amuint_505888;
Ritor1
parents:
diff changeset
1563 // 50588C: using guessed type int amuint_50588C;
Ritor1
parents:
diff changeset
1564 // 505890: using guessed type int dword_505890;
Ritor1
parents:
diff changeset
1565
Ritor1
parents:
diff changeset
1566 //----- (0040A198) --------------------------------------------------------
Ritor1
parents:
diff changeset
1567 char __cdecl am_40A198()
Ritor1
parents:
diff changeset
1568 {
Ritor1
parents:
diff changeset
1569 int *v0; // edi@1
Ritor1
parents:
diff changeset
1570 int *v1; // edx@2
Ritor1
parents:
diff changeset
1571 signed int v2; // esi@2
Ritor1
parents:
diff changeset
1572 signed int v3; // eax@4
Ritor1
parents:
diff changeset
1573 signed int v4; // esi@12
Ritor1
parents:
diff changeset
1574 int v5; // eax@13
Ritor1
parents:
diff changeset
1575 int v6; // edx@13
Ritor1
parents:
diff changeset
1576 char *v7; // eax@13
Ritor1
parents:
diff changeset
1577 char result; // al@14
Ritor1
parents:
diff changeset
1578 char v9[108]; // [sp+8h] [bp-6Ch]@1
Ritor1
parents:
diff changeset
1579
Ritor1
parents:
diff changeset
1580 ArcomageGame::PlaySound(0x14u);
Ritor1
parents:
diff changeset
1581 memset(byte_5054E8, 0, sizeof(byte_5054E8));
Ritor1
parents:
diff changeset
1582 memset(v9, 0, sizeof(v9));
856
Ritor1
parents: 764
diff changeset
1583 v0 = stru_505708[0].arr_44;//variable incorrect
0
Ritor1
parents:
diff changeset
1584 do
Ritor1
parents:
diff changeset
1585 {
Ritor1
parents:
diff changeset
1586 v1 = v0;
Ritor1
parents:
diff changeset
1587 v2 = 10;
Ritor1
parents:
diff changeset
1588 do
Ritor1
parents:
diff changeset
1589 {
Ritor1
parents:
diff changeset
1590 if ( *v1 > -1 )
Ritor1
parents:
diff changeset
1591 {
Ritor1
parents:
diff changeset
1592 v3 = 0;
Ritor1
parents:
diff changeset
1593 while ( dword_505554[v3] != *v1 || byte_5054E8[v3] )
Ritor1
parents:
diff changeset
1594 {
Ritor1
parents:
diff changeset
1595 ++v3;
Ritor1
parents:
diff changeset
1596 if ( v3 >= 108 )
Ritor1
parents:
diff changeset
1597 goto LABEL_10;
Ritor1
parents:
diff changeset
1598 }
Ritor1
parents:
diff changeset
1599 byte_5054E8[v3] = 1;
Ritor1
parents:
diff changeset
1600 }
Ritor1
parents:
diff changeset
1601 LABEL_10:
Ritor1
parents:
diff changeset
1602 ++v1;
Ritor1
parents:
diff changeset
1603 --v2;
Ritor1
parents:
diff changeset
1604 }
Ritor1
parents:
diff changeset
1605 while ( v2 );
Ritor1
parents:
diff changeset
1606 v0 += 47;
Ritor1
parents:
diff changeset
1607 }
Ritor1
parents:
diff changeset
1608 while ( (signed int)v0 < (signed int)&pArcomageGame->msg.pt.y );
Ritor1
parents:
diff changeset
1609 v4 = 0;
Ritor1
parents:
diff changeset
1610 do
Ritor1
parents:
diff changeset
1611 {
Ritor1
parents:
diff changeset
1612 do
Ritor1
parents:
diff changeset
1613 {
Ritor1
parents:
diff changeset
1614 v5 = rand();
Ritor1
parents:
diff changeset
1615 v6 = v5 % 108;
Ritor1
parents:
diff changeset
1616 v7 = &v9[v5 % 108];
Ritor1
parents:
diff changeset
1617 }
Ritor1
parents:
diff changeset
1618 while ( *v7 == 1 );
Ritor1
parents:
diff changeset
1619 *v7 = 1;
Ritor1
parents:
diff changeset
1620 dword_505314[v4] = dword_505554[v6];
Ritor1
parents:
diff changeset
1621 result = byte_5054E8[v6];
Ritor1
parents:
diff changeset
1622 array_4FAC10[9].field_4[v4++ + 4232] = result;
Ritor1
parents:
diff changeset
1623 }
Ritor1
parents:
diff changeset
1624 while ( v4 < 108 );
Ritor1
parents:
diff changeset
1625 dword_4FABC8 = 0;
Ritor1
parents:
diff changeset
1626 amuint_4FABC4 = -1;
Ritor1
parents:
diff changeset
1627 pArcomageGame->field_F6 = 1;
Ritor1
parents:
diff changeset
1628 return result;
Ritor1
parents:
diff changeset
1629 }
Ritor1
parents:
diff changeset
1630 // 4FABC4: using guessed type int amuint_4FABC4;
Ritor1
parents:
diff changeset
1631 // 4FABC8: using guessed type int dword_4FABC8;
Ritor1
parents:
diff changeset
1632 // 505314: using guessed type int dword_505314[];
Ritor1
parents:
diff changeset
1633 // 505554: using guessed type int dword_505554[];
Ritor1
parents:
diff changeset
1634 // 40A198: using guessed type char var_6C[108];
Ritor1
parents:
diff changeset
1635
Ritor1
parents:
diff changeset
1636 //----- (0040A255) --------------------------------------------------------
Ritor1
parents:
diff changeset
1637 int __fastcall am_40A255(int a1, int a2)
Ritor1
parents:
diff changeset
1638 {
Ritor1
parents:
diff changeset
1639 int i; // edi@1
Ritor1
parents:
diff changeset
1640 signed int v3; // esi@2
Ritor1
parents:
diff changeset
1641 int result; // eax@3
Ritor1
parents:
diff changeset
1642
Ritor1
parents:
diff changeset
1643 for ( i = 0; i < dword_4E1874; ++i )
Ritor1
parents:
diff changeset
1644 {
Ritor1
parents:
diff changeset
1645 v3 = 0;
Ritor1
parents:
diff changeset
1646 do
Ritor1
parents:
diff changeset
1647 result = am_40A283(v3++, a2);
Ritor1
parents:
diff changeset
1648 while ( v3 < 2 );
Ritor1
parents:
diff changeset
1649 }
Ritor1
parents:
diff changeset
1650 pArcomageGame->field_F6 = 1;
Ritor1
parents:
diff changeset
1651 return result;
Ritor1
parents:
diff changeset
1652 }
Ritor1
parents:
diff changeset
1653 // 4E1874: using guessed type int dword_4E1874;
Ritor1
parents:
diff changeset
1654
Ritor1
parents:
diff changeset
1655 //----- (0040A283) --------------------------------------------------------
Ritor1
parents:
diff changeset
1656 signed int __fastcall am_40A283(int a1, int a2)
Ritor1
parents:
diff changeset
1657 {
Ritor1
parents:
diff changeset
1658 signed int v2; // eax@1
Ritor1
parents:
diff changeset
1659 int v3; // edi@1
Ritor1
parents:
diff changeset
1660 int v4; // esi@1
Ritor1
parents:
diff changeset
1661 char v5; // bl@1
Ritor1
parents:
diff changeset
1662 signed int result; // eax@7
Ritor1
parents:
diff changeset
1663 int v7; // esi@8
Ritor1
parents:
diff changeset
1664
Ritor1
parents:
diff changeset
1665 v2 = dword_4FABC8;
Ritor1
parents:
diff changeset
1666 v3 = a1;
Ritor1
parents:
diff changeset
1667 v4 = a1;
Ritor1
parents:
diff changeset
1668 v5 = 0;
Ritor1
parents:
diff changeset
1669 do
Ritor1
parents:
diff changeset
1670 {
Ritor1
parents:
diff changeset
1671 if ( v2 >= 108 )
Ritor1
parents:
diff changeset
1672 {
Ritor1
parents:
diff changeset
1673 am_40A198();
Ritor1
parents:
diff changeset
1674 v2 = dword_4FABC8;
Ritor1
parents:
diff changeset
1675 }
Ritor1
parents:
diff changeset
1676 if ( !array_4FAC10[9].field_4[v2 + 4232] )
Ritor1
parents:
diff changeset
1677 {
Ritor1
parents:
diff changeset
1678 v3 = dword_505314[v2];
Ritor1
parents:
diff changeset
1679 v5 = 1;
Ritor1
parents:
diff changeset
1680 }
Ritor1
parents:
diff changeset
1681 ++v2;
Ritor1
parents:
diff changeset
1682 dword_4FABC8 = v2;
Ritor1
parents:
diff changeset
1683 }
Ritor1
parents:
diff changeset
1684 while ( !v5 );
Ritor1
parents:
diff changeset
1685 ArcomageGame::PlaySound(0x15u);
Ritor1
parents:
diff changeset
1686 result = am_40A324(v4);
Ritor1
parents:
diff changeset
1687 if ( result != -1 )
Ritor1
parents:
diff changeset
1688 {
Ritor1
parents:
diff changeset
1689 amuint_4FAA4C = result;
Ritor1
parents:
diff changeset
1690 stru_505708[0].arr_44[result + 47 * v4] = v3;
Ritor1
parents:
diff changeset
1691 v7 = 188 * v4 + 8 * result;
Ritor1
parents:
diff changeset
1692 *(int *)((char *)stru_505708[0].arr_6C[0] + v7) = rand_interval(-4, 4);
Ritor1
parents:
diff changeset
1693 result = rand_interval(-4, 4);
Ritor1
parents:
diff changeset
1694 *(int *)((char *)&stru_505708[0].arr_6C[0][1] + v7) = result;
Ritor1
parents:
diff changeset
1695 pArcomageGame->field_F6 = 1;
Ritor1
parents:
diff changeset
1696 byte_4FAA2D = 1;
Ritor1
parents:
diff changeset
1697 }
Ritor1
parents:
diff changeset
1698 return result;
Ritor1
parents:
diff changeset
1699 }
Ritor1
parents:
diff changeset
1700 // 4FAA2D: using guessed type char byte_4FAA2D;
Ritor1
parents:
diff changeset
1701 // 4FAA4C: using guessed type int amuint_4FAA4C;
Ritor1
parents:
diff changeset
1702 // 4FABC8: using guessed type int dword_4FABC8;
Ritor1
parents:
diff changeset
1703 // 505314: using guessed type int dword_505314[];
Ritor1
parents:
diff changeset
1704
Ritor1
parents:
diff changeset
1705 //----- (0040A324) --------------------------------------------------------
Ritor1
parents:
diff changeset
1706 signed int __fastcall am_40A324(int a1)
Ritor1
parents:
diff changeset
1707 {
Ritor1
parents:
diff changeset
1708 signed int result; // eax@1
Ritor1
parents:
diff changeset
1709 signed int v2; // edx@1
Ritor1
parents:
diff changeset
1710 char *v3; // ecx@1
Ritor1
parents:
diff changeset
1711
Ritor1
parents:
diff changeset
1712 result = -1;
Ritor1
parents:
diff changeset
1713 v2 = 0;
Ritor1
parents:
diff changeset
1714 v3 = (char *)stru_505708[a1].arr_44;
Ritor1
parents:
diff changeset
1715 while ( *(unsigned int *)v3 != -1 )
Ritor1
parents:
diff changeset
1716 {
Ritor1
parents:
diff changeset
1717 ++v2;
Ritor1
parents:
diff changeset
1718 v3 += 4;
Ritor1
parents:
diff changeset
1719 if ( v2 >= 10 )
Ritor1
parents:
diff changeset
1720 return result;
Ritor1
parents:
diff changeset
1721 }
Ritor1
parents:
diff changeset
1722 return v2;
Ritor1
parents:
diff changeset
1723 }
Ritor1
parents:
diff changeset
1724
Ritor1
parents:
diff changeset
1725 //----- (0040A346) --------------------------------------------------------
Ritor1
parents:
diff changeset
1726 int __fastcall am_40A346(int a1)
Ritor1
parents:
diff changeset
1727 {
Ritor1
parents:
diff changeset
1728 int v1; // ecx@1
Ritor1
parents:
diff changeset
1729 int result; // eax@1
Ritor1
parents:
diff changeset
1730
Ritor1
parents:
diff changeset
1731 v1 = a1;
Ritor1
parents:
diff changeset
1732 stru_505708[v1].field_38 += dword_4E1878 + stru_505708[v1].field_2C;
Ritor1
parents:
diff changeset
1733 stru_505708[v1].field_3C += dword_4E187C + stru_505708[v1].field_30;
Ritor1
parents:
diff changeset
1734 result = dword_4E1880 + stru_505708[v1].field_34;
Ritor1
parents:
diff changeset
1735 stru_505708[v1].field_40 += result;
Ritor1
parents:
diff changeset
1736 return result;
Ritor1
parents:
diff changeset
1737 }
Ritor1
parents:
diff changeset
1738 // 4E1878: using guessed type int dword_4E1878;
Ritor1
parents:
diff changeset
1739 // 4E187C: using guessed type int dword_4E187C;
Ritor1
parents:
diff changeset
1740 // 4E1880: using guessed type int dword_4E1880;
Ritor1
parents:
diff changeset
1741
Ritor1
parents:
diff changeset
1742 //----- (0040A383) --------------------------------------------------------
Ritor1
parents:
diff changeset
1743 void __cdecl am_40A383()
Ritor1
parents:
diff changeset
1744 {
Ritor1
parents:
diff changeset
1745 int v0; // eax@4
Ritor1
parents:
diff changeset
1746 int v1; // ecx@4
Ritor1
parents:
diff changeset
1747 unsigned __int8 v2; // sf@4
Ritor1
parents:
diff changeset
1748 unsigned __int8 v3; // of@4
Ritor1
parents:
diff changeset
1749 int v4; // eax@6
Ritor1
parents:
diff changeset
1750 char Dest[64]; // [sp+4h] [bp-64h]@4
Ritor1
parents:
diff changeset
1751 int v6; // [sp+44h] [bp-24h]@6
Ritor1
parents:
diff changeset
1752 int v7; // [sp+48h] [bp-20h]@6
Ritor1
parents:
diff changeset
1753 int v8; // [sp+4Ch] [bp-1Ch]@6
Ritor1
parents:
diff changeset
1754 int v9; // [sp+50h] [bp-18h]@6
Ritor1
parents:
diff changeset
1755 ArcomageGame_stru1 v10; // [sp+54h] [bp-14h]@7
Ritor1
parents:
diff changeset
1756 int v11[2]; // [sp+60h] [bp-8h]@4
Ritor1
parents:
diff changeset
1757
Ritor1
parents:
diff changeset
1758 if ( !pArcomageGame->field_F4 )
Ritor1
parents:
diff changeset
1759 {
Ritor1
parents:
diff changeset
1760 if ( LOBYTE(stru_505708[0].field_20) != 1 || LOBYTE(stru_505708[1].field_20) != 1 )
Ritor1
parents:
diff changeset
1761 {
Ritor1
parents:
diff changeset
1762 ++amuint_4FAA6C;
Ritor1
parents:
diff changeset
1763 am_byte_4FAA75 = 1;
Ritor1
parents:
diff changeset
1764 if ( amuint_4FAA6C >= 2 )
Ritor1
parents:
diff changeset
1765 amuint_4FAA6C = 0;
Ritor1
parents:
diff changeset
1766 }
Ritor1
parents:
diff changeset
1767 else
Ritor1
parents:
diff changeset
1768 {
Ritor1
parents:
diff changeset
1769 //nullsub_1();
Ritor1
parents:
diff changeset
1770 v11[0] = 0;
Ritor1
parents:
diff changeset
1771 v11[1] = 0;
Ritor1
parents:
diff changeset
1772 inv_strcpy("Ñëåä", Dest);
Ritor1
parents:
diff changeset
1773 v0 = 0;
Ritor1
parents:
diff changeset
1774 v11[1] = 200;
Ritor1
parents:
diff changeset
1775 v11[0] = 320 - 12 * v0 / 2;
Ritor1
parents:
diff changeset
1776 pPrimaryWindow_draws_text(-1, Dest, v11);
Ritor1
parents:
diff changeset
1777 am_byte_4FAA75 = 1;
Ritor1
parents:
diff changeset
1778 v1 = amuint_4FAA6C + 1;
Ritor1
parents:
diff changeset
1779 v3 = __OFSUB__(amuint_4FAA6C + 1, 2);
Ritor1
parents:
diff changeset
1780 v2 = amuint_4FAA6C++ - 1 < 0;
Ritor1
parents:
diff changeset
1781 if ( !(v2 ^ v3) )
Ritor1
parents:
diff changeset
1782 {
Ritor1
parents:
diff changeset
1783 v1 = 0;
Ritor1
parents:
diff changeset
1784 amuint_4FAA6C = 0;
Ritor1
parents:
diff changeset
1785 }
Ritor1
parents:
diff changeset
1786 inv_strcpy(stru_505708[v1].pPlayerName, Dest);
Ritor1
parents:
diff changeset
1787 v4 = 0;
Ritor1
parents:
diff changeset
1788 v11[1] = 260;
Ritor1
parents:
diff changeset
1789 v11[0] = 320 - 12 * v4 / 2;
Ritor1
parents:
diff changeset
1790 pPrimaryWindow_draws_text(-1, Dest, v11);
Ritor1
parents:
diff changeset
1791 v6 = 0;
Ritor1
parents:
diff changeset
1792 v8 = 640;
Ritor1
parents:
diff changeset
1793 v7 = 0;
Ritor1
parents:
diff changeset
1794 v9 = 480;
Ritor1
parents:
diff changeset
1795 //nullsub_1();
Ritor1
parents:
diff changeset
1796 CallRenderPresent();
Ritor1
parents:
diff changeset
1797 //nullsub_1();
Ritor1
parents:
diff changeset
1798 while ( 1 )
Ritor1
parents:
diff changeset
1799 {
Ritor1
parents:
diff changeset
1800 while ( 1 )
Ritor1
parents:
diff changeset
1801 {
Ritor1
parents:
diff changeset
1802 while ( !ArcomageGame::MsgLoop(20, &v10) )
Ritor1
parents:
diff changeset
1803 ;
Ritor1
parents:
diff changeset
1804 if ( v10.field_0 != 1 )
Ritor1
parents:
diff changeset
1805 break;
Ritor1
parents:
diff changeset
1806 if ( v10.field_4 )
Ritor1
parents:
diff changeset
1807 goto LABEL_13;
Ritor1
parents:
diff changeset
1808 //nullsub_1();
Ritor1
parents:
diff changeset
1809 }
Ritor1
parents:
diff changeset
1810 if ( v10.field_0 > 4 )
Ritor1
parents:
diff changeset
1811 {
Ritor1
parents:
diff changeset
1812 if ( v10.field_0 <= 8 )
Ritor1
parents:
diff changeset
1813 goto LABEL_13;
Ritor1
parents:
diff changeset
1814 if ( v10.field_0 == 10 )
Ritor1
parents:
diff changeset
1815 break;
Ritor1
parents:
diff changeset
1816 }
Ritor1
parents:
diff changeset
1817 }
Ritor1
parents:
diff changeset
1818 pArcomageGame->field_F4 = 1;
Ritor1
parents:
diff changeset
1819 byte_4FAA74 = 1;
Ritor1
parents:
diff changeset
1820 LABEL_13:
Ritor1
parents:
diff changeset
1821 v11[0] = 0;
Ritor1
parents:
diff changeset
1822 v11[1] = 0;
Ritor1
parents:
diff changeset
1823 v6 = 0;
Ritor1
parents:
diff changeset
1824 v8 = 640;
Ritor1
parents:
diff changeset
1825 v7 = 0;
Ritor1
parents:
diff changeset
1826 v9 = 480;
Ritor1
parents:
diff changeset
1827 //nullsub_1();
Ritor1
parents:
diff changeset
1828 CallRenderPresent();
Ritor1
parents:
diff changeset
1829 }
Ritor1
parents:
diff changeset
1830 }
Ritor1
parents:
diff changeset
1831 }
Ritor1
parents:
diff changeset
1832
Ritor1
parents:
diff changeset
1833
Ritor1
parents:
diff changeset
1834 //----- (0040A514) --------------------------------------------------------
Ritor1
parents:
diff changeset
1835 bool __cdecl am_40A514()
Ritor1
parents:
diff changeset
1836 {
Ritor1
parents:
diff changeset
1837 bool result; // eax@1
Ritor1
parents:
diff changeset
1838 char *v1; // ecx@1
Ritor1
parents:
diff changeset
1839
Ritor1
parents:
diff changeset
1840 LOBYTE(result) = 0;
Ritor1
parents:
diff changeset
1841 v1 = (char *)&stru_505708[0].field_24;
Ritor1
parents:
diff changeset
1842 do
Ritor1
parents:
diff changeset
1843 {
Ritor1
parents:
diff changeset
1844 if ( *(unsigned int *)v1 <= 0 )
Ritor1
parents:
diff changeset
1845 LOBYTE(result) = 1;
Ritor1
parents:
diff changeset
1846 if ( *(unsigned int *)v1 >= dword_4E1884 )
Ritor1
parents:
diff changeset
1847 LOBYTE(result) = 1;
Ritor1
parents:
diff changeset
1848 if ( *((unsigned int *)v1 + 5) >= dword_4E1888
Ritor1
parents:
diff changeset
1849 || *((unsigned int *)v1 + 6) >= dword_4E1888
Ritor1
parents:
diff changeset
1850 || *((unsigned int *)v1 + 7) >= dword_4E1888 )
Ritor1
parents:
diff changeset
1851 LOBYTE(result) = 1;
Ritor1
parents:
diff changeset
1852 v1 += 188;
Ritor1
parents:
diff changeset
1853 }
Ritor1
parents:
diff changeset
1854 while ( (signed int)v1 < (signed int)&pArcomageGame->stru1.field_4 );
Ritor1
parents:
diff changeset
1855 if ( result )
Ritor1
parents:
diff changeset
1856 byte_4FAA2C = 1;
Ritor1
parents:
diff changeset
1857 return result;
Ritor1
parents:
diff changeset
1858 }
Ritor1
parents:
diff changeset
1859 // 4E1884: using guessed type int dword_4E1884;
Ritor1
parents:
diff changeset
1860 // 4E1888: using guessed type int dword_4E1888;
Ritor1
parents:
diff changeset
1861 // 4FAA2C: using guessed type char byte_4FAA2C;
Ritor1
parents:
diff changeset
1862
Ritor1
parents:
diff changeset
1863 //----- (0040A560) --------------------------------------------------------
Ritor1
parents:
diff changeset
1864 char am_40A560(unsigned int _this)
Ritor1
parents:
diff changeset
1865 {
Ritor1
parents:
diff changeset
1866 int v1; // ebp@0
Ritor1
parents:
diff changeset
1867 unsigned __int64 v2; // qax@3
Ritor1
parents:
diff changeset
1868 unsigned __int64 v3; // kr00_8@3
Ritor1
parents:
diff changeset
1869 int v4; // ecx@17
Ritor1
parents:
diff changeset
1870 int v5; // esi@67
Ritor1
parents:
diff changeset
1871 char Dest[100]; // [sp+8h] [bp-A8h]@67
Ritor1
parents:
diff changeset
1872 int v8; // [sp+6Ch] [bp-44h]@3
Ritor1
parents:
diff changeset
1873 int pSrcXYZW[4]; // [sp+70h] [bp-40h]@75
Ritor1
parents:
diff changeset
1874 int v10[4]; // [sp+80h] [bp-30h]@69
Ritor1
parents:
diff changeset
1875 int pTargetXY[2]; // [sp+90h] [bp-20h]@75
Ritor1
parents:
diff changeset
1876 ArcomageGame_stru1 a2; // [sp+98h] [bp-18h]@8
Ritor1
parents:
diff changeset
1877 int v13; // [sp+A4h] [bp-Ch]@1
Ritor1
parents:
diff changeset
1878 int a1; // [sp+A8h] [bp-8h]@1
Ritor1
parents:
diff changeset
1879 char v15; // [sp+AEh] [bp-2h]@63
Ritor1
parents:
diff changeset
1880 char v16; // [sp+AFh] [bp-1h]@1
Ritor1
parents:
diff changeset
1881
Ritor1
parents:
diff changeset
1882 uCardID = -1;
Ritor1
parents:
diff changeset
1883 a1 = _this;
Ritor1
parents:
diff changeset
1884 v16 = 0;
Ritor1
parents:
diff changeset
1885 v13 = 20;
Ritor1
parents:
diff changeset
1886 byte_4FAA00 = 0;
Ritor1
parents:
diff changeset
1887 dword_4FAA68 = 0;
Ritor1
parents:
diff changeset
1888 amuint_4FAA38 = 10;
Ritor1
parents:
diff changeset
1889 amuint_4FAA34 = 5;
Ritor1
parents:
diff changeset
1890 if ( amuint_4FAA4C != -1 )
Ritor1
parents:
diff changeset
1891 byte_4FAA2D = 1;
Ritor1
parents:
diff changeset
1892 do
Ritor1
parents:
diff changeset
1893 {
Ritor1
parents:
diff changeset
1894 do
Ritor1
parents:
diff changeset
1895 {
Ritor1
parents:
diff changeset
1896 do
Ritor1
parents:
diff changeset
1897 {
Ritor1
parents:
diff changeset
1898 v2 = pEventTimer->Time();
Ritor1
parents:
diff changeset
1899 v3 = v2 - pArcomageGame->event_timer_time;
Ritor1
parents:
diff changeset
1900 v8 = HIDWORD(v3);
Ritor1
parents:
diff changeset
1901 }
Ritor1
parents:
diff changeset
1902 while ( SHIDWORD(v3) < 0 );
Ritor1
parents:
diff changeset
1903 }
Ritor1
parents:
diff changeset
1904 while ( SHIDWORD(v2) < (signed int)(((unsigned int)v2 < pArcomageGame->event_timer_time)
Ritor1
parents:
diff changeset
1905 + ((unsigned __int64)pArcomageGame->event_timer_time >> 32)) | HIDWORD(v3) == 0
Ritor1
parents:
diff changeset
1906 && (unsigned int)v3 < 6 );
Ritor1
parents:
diff changeset
1907 pArcomageGame->event_timer_time = pEventTimer->Time();
Ritor1
parents:
diff changeset
1908 if ( pArcomageGame->field_F4 )
Ritor1
parents:
diff changeset
1909 v16 = 1;
Ritor1
parents:
diff changeset
1910 ArcomageGame::MsgLoop(0, &a2);
Ritor1
parents:
diff changeset
1911 switch ( a2.field_0 )
Ritor1
parents:
diff changeset
1912 {
Ritor1
parents:
diff changeset
1913 case 2:
Ritor1
parents:
diff changeset
1914 if ( a2.field_4 == 129 && a2.field_8 == 1 )
Ritor1
parents:
diff changeset
1915 {
Ritor1
parents:
diff changeset
1916 pAudioPlayer->StopChannels(-1, -1);
Ritor1
parents:
diff changeset
1917 dword_4FAA68 = 0;
Ritor1
parents:
diff changeset
1918 goto LABEL_16;
Ritor1
parents:
diff changeset
1919 }
Ritor1
parents:
diff changeset
1920 break;
Ritor1
parents:
diff changeset
1921 case 9:
Ritor1
parents:
diff changeset
1922 pArcomageGame->field_F6 = 1;
Ritor1
parents:
diff changeset
1923 break;
Ritor1
parents:
diff changeset
1924 case 0xA:
Ritor1
parents:
diff changeset
1925 pAudioPlayer->StopChannels(-1, -1);
Ritor1
parents:
diff changeset
1926 byte_4FAA74 = 1;
Ritor1
parents:
diff changeset
1927 LABEL_16:
Ritor1
parents:
diff changeset
1928 v16 = 1;
Ritor1
parents:
diff changeset
1929 pArcomageGame->field_F4 = 1;
Ritor1
parents:
diff changeset
1930 break;
Ritor1
parents:
diff changeset
1931 }
Ritor1
parents:
diff changeset
1932 v4 = amuint_4FAA6C;
Ritor1
parents:
diff changeset
1933 if ( LOBYTE(stru_505708[amuint_4FAA6C].field_20) != 1 && !byte_4FAA00 && !byte_4FAA2E && !byte_4FAA2D )
Ritor1
parents:
diff changeset
1934 {
Ritor1
parents:
diff changeset
1935 if ( am_byte_4FAA75 )
Ritor1
parents:
diff changeset
1936 am_byte_4FAA76 = 1;
Ritor1
parents:
diff changeset
1937 am_408BB4(amuint_4FAA6C);
Ritor1
parents:
diff changeset
1938 v4 = amuint_4FAA6C;
Ritor1
parents:
diff changeset
1939 byte_4FAA2E = 1;
Ritor1
parents:
diff changeset
1940 }
Ritor1
parents:
diff changeset
1941 if ( amuint_4FAA4C != -1 && amuint_4FAA38 > 10 )
Ritor1
parents:
diff changeset
1942 amuint_4FAA38 = 10;
Ritor1
parents:
diff changeset
1943 if ( byte_4FAA2E || byte_4FAA2D || LOBYTE(stru_505708[v4].field_20) != 1 )
Ritor1
parents:
diff changeset
1944 {
Ritor1
parents:
diff changeset
1945 pArcomageGame->field_F6 = 1;
Ritor1
parents:
diff changeset
1946 if ( byte_4FAA2D )
Ritor1
parents:
diff changeset
1947 {
Ritor1
parents:
diff changeset
1948 --amuint_4FAA38;
Ritor1
parents:
diff changeset
1949 if ( amuint_4FAA38 < 0 )
Ritor1
parents:
diff changeset
1950 {
Ritor1
parents:
diff changeset
1951 byte_4FAA2D = 0;
Ritor1
parents:
diff changeset
1952 amuint_4FAA38 = 10;
Ritor1
parents:
diff changeset
1953 v16 = 0;
Ritor1
parents:
diff changeset
1954 }
Ritor1
parents:
diff changeset
1955 }
Ritor1
parents:
diff changeset
1956 if ( byte_4FAA2E )
Ritor1
parents:
diff changeset
1957 {
Ritor1
parents:
diff changeset
1958 --v13;
Ritor1
parents:
diff changeset
1959 if ( v13 < 0 )
Ritor1
parents:
diff changeset
1960 {
Ritor1
parents:
diff changeset
1961 if ( dword_4FAA68 > 1 )
Ritor1
parents:
diff changeset
1962 {
Ritor1
parents:
diff changeset
1963 --dword_4FAA68;
Ritor1
parents:
diff changeset
1964 byte_4FAA00 = 0;
Ritor1
parents:
diff changeset
1965 }
Ritor1
parents:
diff changeset
1966 else
Ritor1
parents:
diff changeset
1967 {
Ritor1
parents:
diff changeset
1968 v16 = 1;
Ritor1
parents:
diff changeset
1969 }
Ritor1
parents:
diff changeset
1970 byte_4FAA2E = 0;
Ritor1
parents:
diff changeset
1971 v13 = 20;
Ritor1
parents:
diff changeset
1972 }
Ritor1
parents:
diff changeset
1973 }
Ritor1
parents:
diff changeset
1974 }
Ritor1
parents:
diff changeset
1975 else
Ritor1
parents:
diff changeset
1976 {
Ritor1
parents:
diff changeset
1977 if ( am_byte_4FAA77 )
Ritor1
parents:
diff changeset
1978 {
Ritor1
parents:
diff changeset
1979 if ( a2.field_0 == 7 && am_40BCFB(a1, dword_4FABBC) )
Ritor1
parents:
diff changeset
1980 {
Ritor1
parents:
diff changeset
1981 if ( am_byte_4FAA75 )
Ritor1
parents:
diff changeset
1982 am_byte_4FAA76 = 1;
Ritor1
parents:
diff changeset
1983 if ( dword_4FAA64 > 0 )
Ritor1
parents:
diff changeset
1984 {
Ritor1
parents:
diff changeset
1985 --dword_4FAA64;
Ritor1
parents:
diff changeset
1986 am_byte_4FAA77 = am_40BB49(a1) > dword_4E1874;
Ritor1
parents:
diff changeset
1987 }
Ritor1
parents:
diff changeset
1988 byte_4FAA2E = 1;
Ritor1
parents:
diff changeset
1989 }
Ritor1
parents:
diff changeset
1990 if ( a2.field_0 == 8 && am_40BCFB(a1, dword_4FABBC) )
Ritor1
parents:
diff changeset
1991 {
Ritor1
parents:
diff changeset
1992 if ( am_byte_4FAA75 )
Ritor1
parents:
diff changeset
1993 am_byte_4FAA76 = 1;
Ritor1
parents:
diff changeset
1994 if ( dword_4FAA64 > 0 )
Ritor1
parents:
diff changeset
1995 {
Ritor1
parents:
diff changeset
1996 --dword_4FAA64;
Ritor1
parents:
diff changeset
1997 am_byte_4FAA77 = am_40BB49(a1) > dword_4E1874;
Ritor1
parents:
diff changeset
1998 }
Ritor1
parents:
diff changeset
1999 byte_4FAA2E = 1;
Ritor1
parents:
diff changeset
2000 }
Ritor1
parents:
diff changeset
2001 }
Ritor1
parents:
diff changeset
2002 else
Ritor1
parents:
diff changeset
2003 {
Ritor1
parents:
diff changeset
2004 if ( a2.field_0 == 7 )
Ritor1
parents:
diff changeset
2005 {
Ritor1
parents:
diff changeset
2006 if ( am_40BE0E(a1, dword_4FABBC) )
Ritor1
parents:
diff changeset
2007 {
Ritor1
parents:
diff changeset
2008 byte_4FAA2E = 1;
Ritor1
parents:
diff changeset
2009 if ( am_byte_4FAA75 )
Ritor1
parents:
diff changeset
2010 am_byte_4FAA76 = 1;
Ritor1
parents:
diff changeset
2011 }
Ritor1
parents:
diff changeset
2012 }
Ritor1
parents:
diff changeset
2013 if ( a2.field_0 == 8 )
Ritor1
parents:
diff changeset
2014 {
Ritor1
parents:
diff changeset
2015 if ( am_40BCFB(a1, dword_4FABBC) )
Ritor1
parents:
diff changeset
2016 {
Ritor1
parents:
diff changeset
2017 byte_4FAA2E = 1;
Ritor1
parents:
diff changeset
2018 if ( am_byte_4FAA75 )
Ritor1
parents:
diff changeset
2019 am_byte_4FAA76 = 1;
Ritor1
parents:
diff changeset
2020 }
Ritor1
parents:
diff changeset
2021 }
Ritor1
parents:
diff changeset
2022 }
Ritor1
parents:
diff changeset
2023 }
Ritor1
parents:
diff changeset
2024 //nullsub_1();
Ritor1
parents:
diff changeset
2025 if ( false )
Ritor1
parents:
diff changeset
2026 {
Ritor1
parents:
diff changeset
2027 if ( !v15 )
Ritor1
parents:
diff changeset
2028 {
Ritor1
parents:
diff changeset
2029 //nullsub_1();
Ritor1
parents:
diff changeset
2030 v15 = 1;
Ritor1
parents:
diff changeset
2031 }
Ritor1
parents:
diff changeset
2032 }
Ritor1
parents:
diff changeset
2033 else
Ritor1
parents:
diff changeset
2034 {
Ritor1
parents:
diff changeset
2035 v15 = 0;
Ritor1
parents:
diff changeset
2036 }
Ritor1
parents:
diff changeset
2037 if ( false )
Ritor1
parents:
diff changeset
2038 {
Ritor1
parents:
diff changeset
2039 //nullsub_1();
Ritor1
parents:
diff changeset
2040 //nullsub_1();
Ritor1
parents:
diff changeset
2041 inv_strcpy(pAreYouSureWishToLeave, Dest);
Ritor1
parents:
diff changeset
2042 v5 = 0;//unk::const_0(&unk_4E19FC, 0);
Ritor1
parents:
diff changeset
2043 //nullsub_1();
Ritor1
parents:
diff changeset
2044 if ( v5 == 1 )
Ritor1
parents:
diff changeset
2045 {
Ritor1
parents:
diff changeset
2046 pAudioPlayer->StopChannels(-1, -1);
Ritor1
parents:
diff changeset
2047 v16 = 1;
Ritor1
parents:
diff changeset
2048 pArcomageGame->field_F4 = 1;
Ritor1
parents:
diff changeset
2049 dword_4FAA68 = 0;
Ritor1
parents:
diff changeset
2050 }
Ritor1
parents:
diff changeset
2051 v10[0] = 0;
Ritor1
parents:
diff changeset
2052 v10[2] = 640;
Ritor1
parents:
diff changeset
2053 v10[1] = 0;
Ritor1
parents:
diff changeset
2054 v10[3] = 480;
Ritor1
parents:
diff changeset
2055 //nullsub_1();
Ritor1
parents:
diff changeset
2056 }
Ritor1
parents:
diff changeset
2057 if ( dword_4FABB8 != am_40BB67(a1) )
Ritor1
parents:
diff changeset
2058 {
Ritor1
parents:
diff changeset
2059 dword_4FABB8 = am_40BB67(a1);
Ritor1
parents:
diff changeset
2060 pArcomageGame->field_F6 = 1;
Ritor1
parents:
diff changeset
2061 }
Ritor1
parents:
diff changeset
2062 if ( pArcomageGame->field_F6 )
Ritor1
parents:
diff changeset
2063 {
Ritor1
parents:
diff changeset
2064 am_blts(v13);
Ritor1
parents:
diff changeset
2065 DoBlt_Copy(pArcomageGame->pBackgroundPixels);
Ritor1
parents:
diff changeset
2066 pArcomageGame->field_F6 = 0;
Ritor1
parents:
diff changeset
2067 }
Ritor1
parents:
diff changeset
2068 if ( pArcomageGame->field_F9 )
Ritor1
parents:
diff changeset
2069 {
Ritor1
parents:
diff changeset
2070 pTargetXY[0] = 0;
Ritor1
parents:
diff changeset
2071 pTargetXY[1] = 0;
Ritor1
parents:
diff changeset
2072 pSrcXYZW[0] = 0;
Ritor1
parents:
diff changeset
2073 pSrcXYZW[2] = 640;
Ritor1
parents:
diff changeset
2074 pSrcXYZW[1] = 0;
Ritor1
parents:
diff changeset
2075 pSrcXYZW[3] = 480;
Ritor1
parents:
diff changeset
2076 am_BeginScene(pArcomageGame->pBackgroundPixels, -1, 1);
Ritor1
parents:
diff changeset
2077 Blt_Copy((ArcomageRect *)pSrcXYZW, pTargetXY, 2);
Ritor1
parents:
diff changeset
2078 am_EndScene();
Ritor1
parents:
diff changeset
2079 am_blts(v13);
Ritor1
parents:
diff changeset
2080 pRenderer->Present();
Ritor1
parents:
diff changeset
2081 pArcomageGame->field_F9 = 0;
Ritor1
parents:
diff changeset
2082 }
Ritor1
parents:
diff changeset
2083 }
Ritor1
parents:
diff changeset
2084 while ( !v16 );
Ritor1
parents:
diff changeset
2085 return dword_4FAA68 > 0;
Ritor1
parents:
diff changeset
2086 }
Ritor1
parents:
diff changeset
2087 // 40DB22: using guessed type uint __stdcall unk__const_0(uint, uint);
Ritor1
parents:
diff changeset
2088 // 4E1874: using guessed type int dword_4E1874;
Ritor1
parents:
diff changeset
2089 // 4FAA00: using guessed type char byte_4FAA00;
Ritor1
parents:
diff changeset
2090 // 4FAA2D: using guessed type char byte_4FAA2D;
Ritor1
parents:
diff changeset
2091 // 4FAA2E: using guessed type char byte_4FAA2E;
Ritor1
parents:
diff changeset
2092 // 4FAA34: using guessed type int amuint_4FAA34;
Ritor1
parents:
diff changeset
2093 // 4FAA38: using guessed type int amuint_4FAA38;
Ritor1
parents:
diff changeset
2094 // 4FAA4C: using guessed type int amuint_4FAA4C;
Ritor1
parents:
diff changeset
2095 // 4FAA64: using guessed type int dword_4FAA64;
Ritor1
parents:
diff changeset
2096 // 4FAA68: using guessed type int dword_4FAA68;
Ritor1
parents:
diff changeset
2097 // 4FAA74: using guessed type char byte_4FAA74;
Ritor1
parents:
diff changeset
2098 // 4FAA75: using guessed type char am_byte_4FAA75;
Ritor1
parents:
diff changeset
2099 // 4FAA76: using guessed type char am_byte_4FAA76;
Ritor1
parents:
diff changeset
2100 // 4FAA77: using guessed type char am_byte_4FAA77;
Ritor1
parents:
diff changeset
2101 // 4FABB8: using guessed type int dword_4FABB8;
Ritor1
parents:
diff changeset
2102
Ritor1
parents:
diff changeset
2103 //----- (0040A9AF) --------------------------------------------------------
Ritor1
parents:
diff changeset
2104 void __thiscall am_blts(int a1)
Ritor1
parents:
diff changeset
2105 {
Ritor1
parents:
diff changeset
2106 int v1; // esi@1
Ritor1
parents:
diff changeset
2107 stru272_stru0 **v2; // esi@1
Ritor1
parents:
diff changeset
2108
Ritor1
parents:
diff changeset
2109 v1 = a1;
Ritor1
parents:
diff changeset
2110 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1);
Ritor1
parents:
diff changeset
2111 am_chroma_blts();
Ritor1
parents:
diff changeset
2112 am_EndScene();
Ritor1
parents:
diff changeset
2113 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1);
Ritor1
parents:
diff changeset
2114 am_40B4B9();
Ritor1
parents:
diff changeset
2115 am_chroma_and_copy_blts();
Ritor1
parents:
diff changeset
2116 am_chroma_blt();
Ritor1
parents:
diff changeset
2117 am_DrawUI();
Ritor1
parents:
diff changeset
2118 am_EndScene();
Ritor1
parents:
diff changeset
2119 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1);
Ritor1
parents:
diff changeset
2120 am_40B76F(v1);
Ritor1
parents:
diff changeset
2121 v2 = (stru272_stru0 **)array_4FAC10;
Ritor1
parents:
diff changeset
2122 do
Ritor1
parents:
diff changeset
2123 {
Ritor1
parents:
diff changeset
2124 if ( *((unsigned char *)v2 - 64) )
Ritor1
parents:
diff changeset
2125 (*v2)->_40E133();
Ritor1
parents:
diff changeset
2126 v2 += 1067;
Ritor1
parents:
diff changeset
2127 }
Ritor1
parents:
diff changeset
2128 while ( (signed int)v2 < (signed int)&unk_5052C8 );
Ritor1
parents:
diff changeset
2129 dword_4FABBC = am_40BB67(amuint_4FAA6C);
Ritor1
parents:
diff changeset
2130 am_40AA4E();
Ritor1
parents:
diff changeset
2131 am_EndScene();
Ritor1
parents:
diff changeset
2132 }
Ritor1
parents:
diff changeset
2133
Ritor1
parents:
diff changeset
2134 //----- (0040AA4E) --------------------------------------------------------
Ritor1
parents:
diff changeset
2135 void __cdecl am_40AA4E()
Ritor1
parents:
diff changeset
2136 {
Ritor1
parents:
diff changeset
2137 signed int v0; // ebx@1
Ritor1
parents:
diff changeset
2138 char v1; // ch@2@3
Ritor1
parents:
diff changeset
2139 char *v2; // esi@4
Ritor1
parents:
diff changeset
2140 signed int v3; // edi@6
Ritor1
parents:
diff changeset
2141 int *v4; // esi@6
Ritor1
parents:
diff changeset
2142 int v5; // [sp-4h] [bp-2Ch]@4
Ritor1
parents:
diff changeset
2143 int v6; // [sp+Ch] [bp-1Ch]@10
Ritor1
parents:
diff changeset
2144 int v7; // [sp+10h] [bp-18h]@10
Ritor1
parents:
diff changeset
2145 int v8; // [sp+14h] [bp-14h]@10
Ritor1
parents:
diff changeset
2146 int v9; // [sp+18h] [bp-10h]@10
Ritor1
parents:
diff changeset
2147 int v10; // [sp+1Ch] [bp-Ch]@6
Ritor1
parents:
diff changeset
2148 char v11; // [sp+20h] [bp-8h]@1
Ritor1
parents:
diff changeset
2149 char v12; // [sp+21h] [bp-7h]@1
Ritor1
parents:
diff changeset
2150 char v13; // [sp+22h] [bp-6h]@1
Ritor1
parents:
diff changeset
2151 char v14; // [sp+24h] [bp-4h]@1
Ritor1
parents:
diff changeset
2152 char v15; // [sp+25h] [bp-3h]@1
Ritor1
parents:
diff changeset
2153 char v16; // [sp+26h] [bp-2h]@1
Ritor1
parents:
diff changeset
2154
Ritor1
parents:
diff changeset
2155 v14 = 0;
Ritor1
parents:
diff changeset
2156 v15 = -1;
Ritor1
parents:
diff changeset
2157 v16 = 0;
Ritor1
parents:
diff changeset
2158 v11 = -1;
Ritor1
parents:
diff changeset
2159 v12 = 0;
Ritor1
parents:
diff changeset
2160 v13 = 0;
Ritor1
parents:
diff changeset
2161 v0 = (signed int)byte_4FABD1;
Ritor1
parents:
diff changeset
2162 do
Ritor1
parents:
diff changeset
2163 {
Ritor1
parents:
diff changeset
2164 if ( *(unsigned char *)(v0 - 1) && (*(stru272_stru0 **)(v0 + 63))->_40E2A7() == 2 )
Ritor1
parents:
diff changeset
2165 {
Ritor1
parents:
diff changeset
2166 BYTE3(v5) = v1;
Ritor1
parents:
diff changeset
2167 v2 = &v14;
Ritor1
parents:
diff changeset
2168 if ( !*(unsigned char *)v0 )
Ritor1
parents:
diff changeset
2169 v2 = &v11;
Ritor1
parents:
diff changeset
2170 LOWORD(v5) = *(_WORD *)v2;
Ritor1
parents:
diff changeset
2171 BYTE2(v5) = v2[2];
Ritor1
parents:
diff changeset
2172 v10 = (unsigned __int16)R8G8B8_to_TargetFormat(v5);
Ritor1
parents:
diff changeset
2173 v3 = 0;
Ritor1
parents:
diff changeset
2174 v4 = (int *)(v0 + 71);
Ritor1
parents:
diff changeset
2175 do
Ritor1
parents:
diff changeset
2176 {
Ritor1
parents:
diff changeset
2177 if ( *(v4 - 1) > 0 )
Ritor1
parents:
diff changeset
2178 {
Ritor1
parents:
diff changeset
2179 if ( v3 % 2 )
Ritor1
parents:
diff changeset
2180 {
Ritor1
parents:
diff changeset
2181 Render::SetPixel((Vec2_int_ *)v4, v10);
Ritor1
parents:
diff changeset
2182 }
Ritor1
parents:
diff changeset
2183 else
Ritor1
parents:
diff changeset
2184 {
Ritor1
parents:
diff changeset
2185 v6 = *v4;
Ritor1
parents:
diff changeset
2186 v8 = v6 + 2;
Ritor1
parents:
diff changeset
2187 v7 = v4[1];
Ritor1
parents:
diff changeset
2188 v9 = v7 + 2;
Ritor1
parents:
diff changeset
2189 DrawRect((Vec4_int_ *)&v6, v10, 1);
Ritor1
parents:
diff changeset
2190 }
Ritor1
parents:
diff changeset
2191 }
Ritor1
parents:
diff changeset
2192 ++v3;
Ritor1
parents:
diff changeset
2193 v4 += 7;
Ritor1
parents:
diff changeset
2194 }
Ritor1
parents:
diff changeset
2195 while ( v3 < 150 );
Ritor1
parents:
diff changeset
2196 }
Ritor1
parents:
diff changeset
2197 v0 += 4268;
Ritor1
parents:
diff changeset
2198 }
Ritor1
parents:
diff changeset
2199 while ( v0 < (signed int)&array_4FAC10[9].field_4[4201] );
Ritor1
parents:
diff changeset
2200 }
Ritor1
parents:
diff changeset
2201
Ritor1
parents:
diff changeset
2202 //----- (0040AB0A) --------------------------------------------------------
Ritor1
parents:
diff changeset
2203 void __cdecl am_chroma_blts()
Ritor1
parents:
diff changeset
2204 {
Ritor1
parents:
diff changeset
2205 int v0; // eax@1
Ritor1
parents:
diff changeset
2206 int v1; // eax@1
Ritor1
parents:
diff changeset
2207 int v2; // eax@1
Ritor1
parents:
diff changeset
2208 int v3; // eax@1
Ritor1
parents:
diff changeset
2209 int v4; // eax@1
Ritor1
parents:
diff changeset
2210 int v5; // eax@1
Ritor1
parents:
diff changeset
2211 int pSrcXYZW[4]; // [sp+Ch] [bp-18h]@1
Ritor1
parents:
diff changeset
2212 int pTargetXY[2]; // [sp+1Ch] [bp-8h]@1
Ritor1
parents:
diff changeset
2213
Ritor1
parents:
diff changeset
2214 pSrcXYZW[1] = 0;
Ritor1
parents:
diff changeset
2215 pSrcXYZW[0] = 765;
Ritor1
parents:
diff changeset
2216 pSrcXYZW[2] = 843;
Ritor1
parents:
diff changeset
2217 pSrcXYZW[3] = 216;
Ritor1
parents:
diff changeset
2218 pTargetXY[0] = 8;
Ritor1
parents:
diff changeset
2219 pTargetXY[1] = 56;
Ritor1
parents:
diff changeset
2220 Blt_Copy((ArcomageRect *)pSrcXYZW, pTargetXY, 2);
Ritor1
parents:
diff changeset
2221 pTargetXY[0] = 555;
Ritor1
parents:
diff changeset
2222 pTargetXY[1] = 56;
Ritor1
parents:
diff changeset
2223 Blt_Copy((ArcomageRect *)pSrcXYZW, pTargetXY, 2);
Ritor1
parents:
diff changeset
2224 LOWORD(v0) = pArcomageGame->field_54;
Ritor1
parents:
diff changeset
2225 pTargetXY[0] = 8;
Ritor1
parents:
diff changeset
2226 pSrcXYZW[0] = 283;
Ritor1
parents:
diff changeset
2227 pSrcXYZW[2] = 361;
Ritor1
parents:
diff changeset
2228 pSrcXYZW[1] = 166;
Ritor1
parents:
diff changeset
2229 pSrcXYZW[3] = 190;
Ritor1
parents:
diff changeset
2230 pTargetXY[1] = 13;
Ritor1
parents:
diff changeset
2231 Blt_Chroma((ArcomageRect *)pSrcXYZW, pTargetXY, v0, 2);
Ritor1
parents:
diff changeset
2232 LOWORD(v1) = pArcomageGame->field_54;
Ritor1
parents:
diff changeset
2233 pTargetXY[0] = 555;
Ritor1
parents:
diff changeset
2234 pTargetXY[1] = 13;
Ritor1
parents:
diff changeset
2235 Blt_Chroma((ArcomageRect *)pSrcXYZW, pTargetXY, v1, 2);
Ritor1
parents:
diff changeset
2236 LOWORD(v2) = pArcomageGame->field_54;
Ritor1
parents:
diff changeset
2237 pSrcXYZW[0] = 234;
Ritor1
parents:
diff changeset
2238 pSrcXYZW[2] = 283;
Ritor1
parents:
diff changeset
2239 pSrcXYZW[1] = 166;
Ritor1
parents:
diff changeset
2240 pSrcXYZW[3] = 190;
Ritor1
parents:
diff changeset
2241 pTargetXY[0] = 100;
Ritor1
parents:
diff changeset
2242 pTargetXY[1] = 296;
Ritor1
parents:
diff changeset
2243 Blt_Chroma((ArcomageRect *)pSrcXYZW, pTargetXY, v2, 2);
Ritor1
parents:
diff changeset
2244 LOWORD(v3) = pArcomageGame->field_54;
Ritor1
parents:
diff changeset
2245 pTargetXY[0] = 492;
Ritor1
parents:
diff changeset
2246 pTargetXY[1] = 296;
Ritor1
parents:
diff changeset
2247 Blt_Chroma((ArcomageRect *)pSrcXYZW, pTargetXY, v3, 2);
Ritor1
parents:
diff changeset
2248 LOWORD(v4) = pArcomageGame->field_54;
Ritor1
parents:
diff changeset
2249 pSrcXYZW[0] = 192;
Ritor1
parents:
diff changeset
2250 pSrcXYZW[2] = 234;
Ritor1
parents:
diff changeset
2251 pSrcXYZW[1] = 166;
Ritor1
parents:
diff changeset
2252 pSrcXYZW[3] = 190;
Ritor1
parents:
diff changeset
2253 pTargetXY[0] = 168;
Ritor1
parents:
diff changeset
2254 pTargetXY[1] = 296;
Ritor1
parents:
diff changeset
2255 Blt_Chroma((ArcomageRect *)pSrcXYZW, pTargetXY, v4, 2);
Ritor1
parents:
diff changeset
2256 pTargetXY[0] = 430;
Ritor1
parents:
diff changeset
2257 LOWORD(v5) = pArcomageGame->field_54;
Ritor1
parents:
diff changeset
2258 pTargetXY[1] = 296;
Ritor1
parents:
diff changeset
2259 Blt_Chroma((ArcomageRect *)pSrcXYZW, pTargetXY, v5, 2);
Ritor1
parents:
diff changeset
2260 }
Ritor1
parents:
diff changeset
2261
Ritor1
parents:
diff changeset
2262 //----- (0040AC5F) --------------------------------------------------------
Ritor1
parents:
diff changeset
2263 void __cdecl am_DrawUI()
Ritor1
parents:
diff changeset
2264 {
Ritor1
parents:
diff changeset
2265 int v0; // ecx@7
Ritor1
parents:
diff changeset
2266 int v1; // ecx@9
Ritor1
parents:
diff changeset
2267 int v2; // eax@11
Ritor1
parents:
diff changeset
2268 int v3; // ecx@12
Ritor1
parents:
diff changeset
2269 int v4; // eax@14
Ritor1
parents:
diff changeset
2270 int v5; // ecx@14
Ritor1
parents:
diff changeset
2271 int v6; // eax@16
Ritor1
parents:
diff changeset
2272 int v7; // ecx@16
Ritor1
parents:
diff changeset
2273 int v8; // eax@18
Ritor1
parents:
diff changeset
2274 int v9; // ecx@18
Ritor1
parents:
diff changeset
2275 int v10; // eax@20
Ritor1
parents:
diff changeset
2276 char Dest[32]; // [sp+Ch] [bp-28h]@2
Ritor1
parents:
diff changeset
2277 int v12[2]; // [sp+2Ch] [bp-8h]@2
Ritor1
parents:
diff changeset
2278
Ritor1
parents:
diff changeset
2279 if ( am_byte_4FAA77 )
Ritor1
parents:
diff changeset
2280 {
Ritor1
parents:
diff changeset
2281 inv_strcpy(pGlobalTXT_LocalizationStrings[266], Dest);// DISCARD A CARD
Ritor1
parents:
diff changeset
2282 v12[0] = 320 - pArcomageGame->pFont2->GetLineWidth(Dest) / 2;
Ritor1
parents:
diff changeset
2283 v12[1] = 306;
Ritor1
parents:
diff changeset
2284 pPrimaryWindow_draws_text(-1, Dest, v12);
Ritor1
parents:
diff changeset
2285 }
Ritor1
parents:
diff changeset
2286 inv_strcpy((const char *)stru_505708, Dest);
Ritor1
parents:
diff changeset
2287 if ( !amuint_4FAA6C )
Ritor1
parents:
diff changeset
2288 inv_strcat("***", Dest);
Ritor1
parents:
diff changeset
2289 v12[0] = 47 - pArcomageGame->pFont1->GetLineWidth(Dest) / 2;
Ritor1
parents:
diff changeset
2290 v12[1] = 21;
Ritor1
parents:
diff changeset
2291 pPrimaryWindow_draws_text(-1, Dest, v12);
Ritor1
parents:
diff changeset
2292 inv_strcpy(stru_505708[1].pPlayerName, Dest);
Ritor1
parents:
diff changeset
2293 if ( amuint_4FAA6C == 1 )
Ritor1
parents:
diff changeset
2294 inv_strcat("***", Dest);
Ritor1
parents:
diff changeset
2295 v12[0] = 595 - pArcomageGame->pFont1->GetLineWidth(Dest) / 2;
Ritor1
parents:
diff changeset
2296 v12[1] = 21;
Ritor1
parents:
diff changeset
2297 pPrimaryWindow_draws_text(-1, Dest, v12);
Ritor1
parents:
diff changeset
2298 intToString(stru_505708[0].field_24, Dest);
Ritor1
parents:
diff changeset
2299 v12[0] = 123 - pArcomageGame->pFont1->GetLineWidth(Dest) / 2;
Ritor1
parents:
diff changeset
2300 v12[1] = 305;
Ritor1
parents:
diff changeset
2301 pPrimaryWindow_draws_text(-1, Dest, v12);
Ritor1
parents:
diff changeset
2302 intToString(stru_505708[1].field_24, Dest);
Ritor1
parents:
diff changeset
2303 v12[0] = 515 - pArcomageGame->pFont1->GetLineWidth(Dest) / 2;
Ritor1
parents:
diff changeset
2304 v12[1] = 305;
Ritor1
parents:
diff changeset
2305 pPrimaryWindow_draws_text(-1, Dest, v12);
Ritor1
parents:
diff changeset
2306 intToString(stru_505708[0].field_28, Dest);
Ritor1
parents:
diff changeset
2307 v12[0] = 188 - pArcomageGame->pFont1->GetLineWidth(Dest) / 2;
Ritor1
parents:
diff changeset
2308 v12[1] = 305;
Ritor1
parents:
diff changeset
2309 pPrimaryWindow_draws_text(-1, Dest, v12);
Ritor1
parents:
diff changeset
2310 intToString(stru_505708[1].field_28, Dest);
Ritor1
parents:
diff changeset
2311 v12[0] = 451 - pArcomageGame->pFont1->GetLineWidth(Dest) / 2;
Ritor1
parents:
diff changeset
2312 v12[1] = 305;
Ritor1
parents:
diff changeset
2313 pPrimaryWindow_draws_text(-1, Dest, v12);
Ritor1
parents:
diff changeset
2314 v0 = stru_505708[0].field_2C;
Ritor1
parents:
diff changeset
2315 if ( byte_4E185E )
Ritor1
parents:
diff changeset
2316 v0 = dword_4E1878 + stru_505708[0].field_2C;
Ritor1
parents:
diff changeset
2317 intToString(v0, Dest);
Ritor1
parents:
diff changeset
2318 v12[0] = 14 - 6 * 0 / 2;
Ritor1
parents:
diff changeset
2319 v12[1] = 92;
Ritor1
parents:
diff changeset
2320 am_40B102(-1, Dest, v12);
Ritor1
parents:
diff changeset
2321 v1 = stru_505708[1].field_2C;
Ritor1
parents:
diff changeset
2322 if ( byte_4E185E )
Ritor1
parents:
diff changeset
2323 v1 = dword_4E1878 + stru_505708[1].field_2C;
Ritor1
parents:
diff changeset
2324 intToString(v1, Dest);
Ritor1
parents:
diff changeset
2325 v2 = 0;
Ritor1
parents:
diff changeset
2326 v12[1] = 92;
Ritor1
parents:
diff changeset
2327 v12[0] = 561 - 6 * v2 / 2;
Ritor1
parents:
diff changeset
2328 am_40B102(-1, Dest, v12);
Ritor1
parents:
diff changeset
2329 if ( byte_4E185E )
Ritor1
parents:
diff changeset
2330 v3 = stru_505708[0].field_30 + dword_4E187C;
Ritor1
parents:
diff changeset
2331 else
Ritor1
parents:
diff changeset
2332 v3 = stru_505708[0].field_30;
Ritor1
parents:
diff changeset
2333 intToString(v3, Dest);
Ritor1
parents:
diff changeset
2334 v4 = 0;
Ritor1
parents:
diff changeset
2335 v12[1] = 164;
Ritor1
parents:
diff changeset
2336 v12[0] = 14 - 6 * v4 / 2;
Ritor1
parents:
diff changeset
2337 am_40B102(-1, Dest, v12);
Ritor1
parents:
diff changeset
2338 v5 = stru_505708[1].field_30;
Ritor1
parents:
diff changeset
2339 if ( byte_4E185E )
Ritor1
parents:
diff changeset
2340 v5 = dword_4E187C + stru_505708[1].field_30;
Ritor1
parents:
diff changeset
2341 intToString(v5, Dest);
Ritor1
parents:
diff changeset
2342 v6 = 0;
Ritor1
parents:
diff changeset
2343 v12[1] = 164;
Ritor1
parents:
diff changeset
2344 v12[0] = 561 - 6 * v6 / 2;
Ritor1
parents:
diff changeset
2345 am_40B102(-1, Dest, v12);
Ritor1
parents:
diff changeset
2346 v7 = stru_505708[0].field_34;
Ritor1
parents:
diff changeset
2347 if ( byte_4E185E )
Ritor1
parents:
diff changeset
2348 v7 = dword_4E1880 + stru_505708[0].field_34;
Ritor1
parents:
diff changeset
2349 intToString(v7, Dest);
Ritor1
parents:
diff changeset
2350 v8 = 0;
Ritor1
parents:
diff changeset
2351 v12[1] = 236;
Ritor1
parents:
diff changeset
2352 v12[0] = 14 - 6 * v8 / 2;
Ritor1
parents:
diff changeset
2353 am_40B102(-1, Dest, v12);
Ritor1
parents:
diff changeset
2354 v9 = stru_505708[1].field_34;
Ritor1
parents:
diff changeset
2355 if ( byte_4E185E )
Ritor1
parents:
diff changeset
2356 v9 = dword_4E1880 + stru_505708[1].field_34;
Ritor1
parents:
diff changeset
2357 intToString(v9, Dest);
Ritor1
parents:
diff changeset
2358 v10 = 0;
Ritor1
parents:
diff changeset
2359 v12[1] = 236;
Ritor1
parents:
diff changeset
2360 v12[0] = 561 - 6 * v10 / 2;
Ritor1
parents:
diff changeset
2361 am_40B102(-1, Dest, v12);
Ritor1
parents:
diff changeset
2362 intToString(stru_505708[0].field_38, Dest);
Ritor1
parents:
diff changeset
2363 v12[1] = 114;
Ritor1
parents:
diff changeset
2364 v12[0] = 10;
Ritor1
parents:
diff changeset
2365 am_40B17E(-1, (int)Dest, v12);
Ritor1
parents:
diff changeset
2366 intToString(stru_505708[1].field_38, Dest);
Ritor1
parents:
diff changeset
2367 v12[0] = 557;
Ritor1
parents:
diff changeset
2368 v12[1] = 114;
Ritor1
parents:
diff changeset
2369 am_40B17E(-1, (int)Dest, v12);
Ritor1
parents:
diff changeset
2370 intToString(stru_505708[0].field_3C, Dest);
Ritor1
parents:
diff changeset
2371 v12[0] = 10;
Ritor1
parents:
diff changeset
2372 v12[1] = 186;
Ritor1
parents:
diff changeset
2373 am_40B1F3(-1, (int)Dest, (int)v12);
Ritor1
parents:
diff changeset
2374 intToString(stru_505708[1].field_3C, Dest);
Ritor1
parents:
diff changeset
2375 v12[0] = 557;
Ritor1
parents:
diff changeset
2376 v12[1] = 186;
Ritor1
parents:
diff changeset
2377 am_40B1F3(-1, (int)Dest, (int)v12);
Ritor1
parents:
diff changeset
2378 intToString(stru_505708[0].field_40, Dest);
Ritor1
parents:
diff changeset
2379 v12[0] = 10;
Ritor1
parents:
diff changeset
2380 v12[1] = 258;
Ritor1
parents:
diff changeset
2381 am_40B268(-1, Dest, v12);
Ritor1
parents:
diff changeset
2382 intToString(stru_505708[1].field_40, Dest);
Ritor1
parents:
diff changeset
2383 v12[0] = 557;
Ritor1
parents:
diff changeset
2384 v12[1] = 258;
Ritor1
parents:
diff changeset
2385 am_40B268(-1, Dest, v12);
Ritor1
parents:
diff changeset
2386 }
Ritor1
parents:
diff changeset
2387 // 4E185E: using guessed type char byte_4E185E;
Ritor1
parents:
diff changeset
2388 // 4E1878: using guessed type int dword_4E1878;
Ritor1
parents:
diff changeset
2389 // 4E187C: using guessed type int dword_4E187C;
Ritor1
parents:
diff changeset
2390 // 4E1880: using guessed type int dword_4E1880;
Ritor1
parents:
diff changeset
2391 // 4FAA77: using guessed type char am_byte_4FAA77;
Ritor1
parents:
diff changeset
2392
Ritor1
parents:
diff changeset
2393 //----- (0040B102) --------------------------------------------------------
Ritor1
parents:
diff changeset
2394 void __fastcall am_40B102(int a1, char *a2, int *pXY)
Ritor1
parents:
diff changeset
2395 {
Ritor1
parents:
diff changeset
2396 char *v3; // esi@1
Ritor1
parents:
diff changeset
2397 int v4; // eax@1
Ritor1
parents:
diff changeset
2398 unsigned __int8 v5; // bl@2
Ritor1
parents:
diff changeset
2399 char v6; // zf@2
Ritor1
parents:
diff changeset
2400 int v7; // eax@3
Ritor1
parents:
diff changeset
2401 int v8; // ecx@3
Ritor1
parents:
diff changeset
2402 int v9; // [sp+8h] [bp-18h]@3
Ritor1
parents:
diff changeset
2403 int v10; // [sp+Ch] [bp-14h]@3
Ritor1
parents:
diff changeset
2404 int v11; // [sp+10h] [bp-10h]@3
Ritor1
parents:
diff changeset
2405 int v12; // [sp+14h] [bp-Ch]@3
Ritor1
parents:
diff changeset
2406 int v13; // [sp+18h] [bp-8h]@1
Ritor1
parents:
diff changeset
2407 int v14; // [sp+1Ch] [bp-4h]@1
Ritor1
parents:
diff changeset
2408
Ritor1
parents:
diff changeset
2409 v3 = a2;
Ritor1
parents:
diff changeset
2410 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1);
Ritor1
parents:
diff changeset
2411 v4 = pXY[1];
Ritor1
parents:
diff changeset
2412 v13 = *pXY;
Ritor1
parents:
diff changeset
2413 v14 = v4;
Ritor1
parents:
diff changeset
2414 do
Ritor1
parents:
diff changeset
2415 {
Ritor1
parents:
diff changeset
2416 v5 = *v3++;
Ritor1
parents:
diff changeset
2417 v6 = v5 == 0;
Ritor1
parents:
diff changeset
2418 if ( v5 )
Ritor1
parents:
diff changeset
2419 {
Ritor1
parents:
diff changeset
2420 v7 = 22 * v5;
Ritor1
parents:
diff changeset
2421 v8 = v7 - 864;
Ritor1
parents:
diff changeset
2422 v7 -= 842;
Ritor1
parents:
diff changeset
2423 v11 = v7;
Ritor1
parents:
diff changeset
2424 LOWORD(v7) = pArcomageGame->field_54;
Ritor1
parents:
diff changeset
2425 v9 = v8;
Ritor1
parents:
diff changeset
2426 v10 = 190;
Ritor1
parents:
diff changeset
2427 v12 = 207;
Ritor1
parents:
diff changeset
2428 Blt_Chroma((ArcomageRect *)&v9, &v13, v7, 1);
Ritor1
parents:
diff changeset
2429 v13 += 22;
Ritor1
parents:
diff changeset
2430 v6 = v5 == 0;
Ritor1
parents:
diff changeset
2431 }
Ritor1
parents:
diff changeset
2432 }
Ritor1
parents:
diff changeset
2433 while ( !v6 );
Ritor1
parents:
diff changeset
2434 am_EndScene();
Ritor1
parents:
diff changeset
2435 }
Ritor1
parents:
diff changeset
2436
Ritor1
parents:
diff changeset
2437 //----- (0040B17E) --------------------------------------------------------
Ritor1
parents:
diff changeset
2438 void __fastcall am_40B17E(int a1, int a2, int *pXY)
Ritor1
parents:
diff changeset
2439 {
Ritor1
parents:
diff changeset
2440 int v3; // esi@1
Ritor1
parents:
diff changeset
2441 int v4; // eax@1
Ritor1
parents:
diff changeset
2442 unsigned __int8 v5; // bl@2
Ritor1
parents:
diff changeset
2443 char v6; // zf@2
Ritor1
parents:
diff changeset
2444 int v7; // eax@3
Ritor1
parents:
diff changeset
2445 int v8; // [sp+8h] [bp-18h]@3
Ritor1
parents:
diff changeset
2446 int v9; // [sp+Ch] [bp-14h]@3
Ritor1
parents:
diff changeset
2447 int v10; // [sp+10h] [bp-10h]@3
Ritor1
parents:
diff changeset
2448 int v11; // [sp+14h] [bp-Ch]@3
Ritor1
parents:
diff changeset
2449 int v12; // [sp+18h] [bp-8h]@1
Ritor1
parents:
diff changeset
2450 int v13; // [sp+1Ch] [bp-4h]@1
Ritor1
parents:
diff changeset
2451
Ritor1
parents:
diff changeset
2452 v3 = a2;
Ritor1
parents:
diff changeset
2453 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1);
Ritor1
parents:
diff changeset
2454 v4 = pXY[1];
Ritor1
parents:
diff changeset
2455 v12 = *pXY;
Ritor1
parents:
diff changeset
2456 v13 = v4;
Ritor1
parents:
diff changeset
2457 do
Ritor1
parents:
diff changeset
2458 {
Ritor1
parents:
diff changeset
2459 v5 = *(unsigned char *)v3++;
Ritor1
parents:
diff changeset
2460 v6 = v5 == 0;
Ritor1
parents:
diff changeset
2461 if ( v5 )
Ritor1
parents:
diff changeset
2462 {
Ritor1
parents:
diff changeset
2463 v7 = 13 * v5;
Ritor1
parents:
diff changeset
2464 v8 = v7 - 370;
Ritor1
parents:
diff changeset
2465 v10 = v7 - 357;
Ritor1
parents:
diff changeset
2466 v9 = 128;
Ritor1
parents:
diff changeset
2467 v11 = 138;
Ritor1
parents:
diff changeset
2468 Blt_Copy((ArcomageRect *)&v8, &v12, 2);
Ritor1
parents:
diff changeset
2469 v12 += 13;
Ritor1
parents:
diff changeset
2470 v6 = v5 == 0;
Ritor1
parents:
diff changeset
2471 }
Ritor1
parents:
diff changeset
2472 }
Ritor1
parents:
diff changeset
2473 while ( !v6 );
Ritor1
parents:
diff changeset
2474 am_EndScene();
Ritor1
parents:
diff changeset
2475 }
Ritor1
parents:
diff changeset
2476
Ritor1
parents:
diff changeset
2477 //----- (0040B1F3) --------------------------------------------------------
Ritor1
parents:
diff changeset
2478 void __fastcall am_40B1F3(int a1, int a2, int a3)
Ritor1
parents:
diff changeset
2479 {
Ritor1
parents:
diff changeset
2480 int v3; // esi@1
Ritor1
parents:
diff changeset
2481 int v4; // eax@1
Ritor1
parents:
diff changeset
2482 unsigned __int8 v5; // bl@2
Ritor1
parents:
diff changeset
2483 char v6; // zf@2
Ritor1
parents:
diff changeset
2484 int v7; // eax@3
Ritor1
parents:
diff changeset
2485 int v8; // [sp+8h] [bp-18h]@3
Ritor1
parents:
diff changeset
2486 int v9; // [sp+Ch] [bp-14h]@3
Ritor1
parents:
diff changeset
2487 int v10; // [sp+10h] [bp-10h]@3
Ritor1
parents:
diff changeset
2488 int v11; // [sp+14h] [bp-Ch]@3
Ritor1
parents:
diff changeset
2489 int v12; // [sp+18h] [bp-8h]@1
Ritor1
parents:
diff changeset
2490 int v13; // [sp+1Ch] [bp-4h]@1
Ritor1
parents:
diff changeset
2491
Ritor1
parents:
diff changeset
2492 v3 = a2;
Ritor1
parents:
diff changeset
2493 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1);
Ritor1
parents:
diff changeset
2494 v4 = *(unsigned int *)(a3 + 4);
Ritor1
parents:
diff changeset
2495 v12 = *(unsigned int *)a3;
Ritor1
parents:
diff changeset
2496 v13 = v4;
Ritor1
parents:
diff changeset
2497 do
Ritor1
parents:
diff changeset
2498 {
Ritor1
parents:
diff changeset
2499 v5 = *(unsigned char *)v3++;
Ritor1
parents:
diff changeset
2500 v6 = v5 == 0;
Ritor1
parents:
diff changeset
2501 if ( v5 )
Ritor1
parents:
diff changeset
2502 {
Ritor1
parents:
diff changeset
2503 v7 = 13 * v5;
Ritor1
parents:
diff changeset
2504 v8 = v7 - 370;
Ritor1
parents:
diff changeset
2505 v10 = v7 - 357;
Ritor1
parents:
diff changeset
2506 v9 = 138;
Ritor1
parents:
diff changeset
2507 v11 = 148;
Ritor1
parents:
diff changeset
2508 Blt_Copy((ArcomageRect *)&v8, &v12, 2);
Ritor1
parents:
diff changeset
2509 v12 += 13;
Ritor1
parents:
diff changeset
2510 v6 = v5 == 0;
Ritor1
parents:
diff changeset
2511 }
Ritor1
parents:
diff changeset
2512 }
Ritor1
parents:
diff changeset
2513 while ( !v6 );
Ritor1
parents:
diff changeset
2514 am_EndScene();
Ritor1
parents:
diff changeset
2515 }
Ritor1
parents:
diff changeset
2516
Ritor1
parents:
diff changeset
2517 //----- (0040B268) --------------------------------------------------------
Ritor1
parents:
diff changeset
2518 void __fastcall am_40B268(int a1, char *a2, int *pXY)
Ritor1
parents:
diff changeset
2519 {
Ritor1
parents:
diff changeset
2520 char *v3; // esi@1
Ritor1
parents:
diff changeset
2521 int v4; // eax@1
Ritor1
parents:
diff changeset
2522 unsigned __int8 v5; // bl@2
Ritor1
parents:
diff changeset
2523 char v6; // zf@2
Ritor1
parents:
diff changeset
2524 int v7; // eax@3
Ritor1
parents:
diff changeset
2525 int v8; // [sp+8h] [bp-18h]@3
Ritor1
parents:
diff changeset
2526 int v9; // [sp+Ch] [bp-14h]@3
Ritor1
parents:
diff changeset
2527 int v10; // [sp+10h] [bp-10h]@3
Ritor1
parents:
diff changeset
2528 int v11; // [sp+14h] [bp-Ch]@3
Ritor1
parents:
diff changeset
2529 int v12; // [sp+18h] [bp-8h]@1
Ritor1
parents:
diff changeset
2530 int v13; // [sp+1Ch] [bp-4h]@1
Ritor1
parents:
diff changeset
2531
Ritor1
parents:
diff changeset
2532 v3 = a2;
Ritor1
parents:
diff changeset
2533 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1);
Ritor1
parents:
diff changeset
2534 v4 = pXY[1];
Ritor1
parents:
diff changeset
2535 v12 = *pXY;
Ritor1
parents:
diff changeset
2536 v13 = v4;
Ritor1
parents:
diff changeset
2537 do
Ritor1
parents:
diff changeset
2538 {
Ritor1
parents:
diff changeset
2539 v5 = *v3++;
Ritor1
parents:
diff changeset
2540 v6 = v5 == 0;
Ritor1
parents:
diff changeset
2541 if ( v5 )
Ritor1
parents:
diff changeset
2542 {
Ritor1
parents:
diff changeset
2543 v7 = 13 * v5;
Ritor1
parents:
diff changeset
2544 v8 = v7 - 370;
Ritor1
parents:
diff changeset
2545 v10 = v7 - 357;
Ritor1
parents:
diff changeset
2546 v9 = 148;
Ritor1
parents:
diff changeset
2547 v11 = 158;
Ritor1
parents:
diff changeset
2548 Blt_Copy((ArcomageRect *)&v8, &v12, 2);
Ritor1
parents:
diff changeset
2549 v12 += 13;
Ritor1
parents:
diff changeset
2550 v6 = v5 == 0;
Ritor1
parents:
diff changeset
2551 }
Ritor1
parents:
diff changeset
2552 }
Ritor1
parents:
diff changeset
2553 while ( !v6 );
Ritor1
parents:
diff changeset
2554 am_EndScene();
Ritor1
parents:
diff changeset
2555 }
Ritor1
parents:
diff changeset
2556
Ritor1
parents:
diff changeset
2557 //----- (0040B2DD) --------------------------------------------------------
Ritor1
parents:
diff changeset
2558 void __cdecl am_chroma_and_copy_blts()
Ritor1
parents:
diff changeset
2559 {
Ritor1
parents:
diff changeset
2560 int v0; // eax@1
Ritor1
parents:
diff changeset
2561 int v1; // esi@3
Ritor1
parents:
diff changeset
2562 int v2; // eax@3
Ritor1
parents:
diff changeset
2563 int v3; // eax@3
Ritor1
parents:
diff changeset
2564 int v4; // esi@5
Ritor1
parents:
diff changeset
2565 int v5; // eax@5
Ritor1
parents:
diff changeset
2566 int pSrcXYZW[4]; // [sp+0h] [bp-18h]@3
Ritor1
parents:
diff changeset
2567 int v7; // [sp+4h] [bp-14h]@3
Ritor1
parents:
diff changeset
2568 int v8; // [sp+8h] [bp-10h]@3
Ritor1
parents:
diff changeset
2569 int v9; // [sp+Ch] [bp-Ch]@3
Ritor1
parents:
diff changeset
2570 int pTargetXY[2]; // [sp+10h] [bp-8h]@3
Ritor1
parents:
diff changeset
2571
Ritor1
parents:
diff changeset
2572 v0 = stru_505708[0].field_24;
Ritor1
parents:
diff changeset
2573 if ( stru_505708[0].field_24 > dword_4E1884 )
Ritor1
parents:
diff changeset
2574 v0 = dword_4E1884;
Ritor1
parents:
diff changeset
2575 v7 = 0;
Ritor1
parents:
diff changeset
2576 pSrcXYZW[0] = 892;
Ritor1
parents:
diff changeset
2577 v8 = 937;
Ritor1
parents:
diff changeset
2578 pTargetXY[0] = 102;
Ritor1
parents:
diff changeset
2579 v1 = 200 * v0 / dword_4E1884;
Ritor1
parents:
diff changeset
2580 v9 = v1;
Ritor1
parents:
diff changeset
2581 pTargetXY[1] = 297 - v1;
Ritor1
parents:
diff changeset
2582 Blt_Copy((ArcomageRect *)pSrcXYZW, pTargetXY, 2);
Ritor1
parents:
diff changeset
2583 v7 = 0;
Ritor1
parents:
diff changeset
2584 v2 = 203 - v1;
Ritor1
parents:
diff changeset
2585 pTargetXY[1] = 203 - v1;
Ritor1
parents:
diff changeset
2586 LOWORD(v2) = pArcomageGame->field_54;
Ritor1
parents:
diff changeset
2587 pSrcXYZW[0] = 384;
Ritor1
parents:
diff changeset
2588 v8 = 452;
Ritor1
parents:
diff changeset
2589 v9 = 94;
Ritor1
parents:
diff changeset
2590 pTargetXY[0] = 91;
Ritor1
parents:
diff changeset
2591 Blt_Chroma((ArcomageRect *)pSrcXYZW, pTargetXY, v2, 2);
Ritor1
parents:
diff changeset
2592 v3 = stru_505708[1].field_24;
Ritor1
parents:
diff changeset
2593 if ( stru_505708[1].field_24 > dword_4E1884 )
Ritor1
parents:
diff changeset
2594 v3 = dword_4E1884;
Ritor1
parents:
diff changeset
2595 v7 = 0;
Ritor1
parents:
diff changeset
2596 pSrcXYZW[0] = 892;
Ritor1
parents:
diff changeset
2597 v8 = 937;
Ritor1
parents:
diff changeset
2598 pTargetXY[0] = 494;
Ritor1
parents:
diff changeset
2599 v4 = 200 * v3 / dword_4E1884;
Ritor1
parents:
diff changeset
2600 v9 = v4;
Ritor1
parents:
diff changeset
2601 pTargetXY[1] = 297 - v4;
Ritor1
parents:
diff changeset
2602 Blt_Copy((ArcomageRect *)pSrcXYZW, pTargetXY, 2);
Ritor1
parents:
diff changeset
2603 LOWORD(v5) = pArcomageGame->field_54;
Ritor1
parents:
diff changeset
2604 pSrcXYZW[0] = 384;
Ritor1
parents:
diff changeset
2605 v8 = 452;
Ritor1
parents:
diff changeset
2606 v7 = 94;
Ritor1
parents:
diff changeset
2607 v9 = 188;
Ritor1
parents:
diff changeset
2608 pTargetXY[0] = 483;
Ritor1
parents:
diff changeset
2609 pTargetXY[1] = 203 - v4;
Ritor1
parents:
diff changeset
2610 Blt_Chroma((ArcomageRect *)pSrcXYZW, pTargetXY, v5, 2);
Ritor1
parents:
diff changeset
2611 }
Ritor1
parents:
diff changeset
2612 // 4E1884: using guessed type int dword_4E1884;
Ritor1
parents:
diff changeset
2613
Ritor1
parents:
diff changeset
2614 //----- (0040B400) --------------------------------------------------------
Ritor1
parents:
diff changeset
2615 void __cdecl am_chroma_blt()
Ritor1
parents:
diff changeset
2616 {
Ritor1
parents:
diff changeset
2617 int v0; // eax@1
Ritor1
parents:
diff changeset
2618 int v1; // eax@4
Ritor1
parents:
diff changeset
2619 int v2; // ecx@4
Ritor1
parents:
diff changeset
2620 int v3; // eax@5
Ritor1
parents:
diff changeset
2621 int v4; // eax@8
Ritor1
parents:
diff changeset
2622 int v5; // esi@8
Ritor1
parents:
diff changeset
2623 int pSrcXYZW[4]; // [sp+4h] [bp-18h]@4
Ritor1
parents:
diff changeset
2624 int pTargetXY[2]; // [sp+14h] [bp-8h]@4
Ritor1
parents:
diff changeset
2625
Ritor1
parents:
diff changeset
2626 v0 = stru_505708[0].field_28;
Ritor1
parents:
diff changeset
2627 if ( stru_505708[0].field_28 <= 100 )
Ritor1
parents:
diff changeset
2628 {
Ritor1
parents:
diff changeset
2629 if ( stru_505708[0].field_28 <= 0 )
Ritor1
parents:
diff changeset
2630 goto LABEL_5;
Ritor1
parents:
diff changeset
2631 }
Ritor1
parents:
diff changeset
2632 else
Ritor1
parents:
diff changeset
2633 {
Ritor1
parents:
diff changeset
2634 v0 = 100;
Ritor1
parents:
diff changeset
2635 }
Ritor1
parents:
diff changeset
2636 pSrcXYZW[1] = 0;
Ritor1
parents:
diff changeset
2637 pSrcXYZW[0] = 843;
Ritor1
parents:
diff changeset
2638 v1 = 200 * v0 / 100;
Ritor1
parents:
diff changeset
2639 pSrcXYZW[2] = 867;
Ritor1
parents:
diff changeset
2640 pTargetXY[0] = 177;
Ritor1
parents:
diff changeset
2641 pSrcXYZW[3] = v1;
Ritor1
parents:
diff changeset
2642 v2 = 297 - v1;
Ritor1
parents:
diff changeset
2643 LOWORD(v1) = pArcomageGame->field_54;
Ritor1
parents:
diff changeset
2644 pTargetXY[1] = v2;
Ritor1
parents:
diff changeset
2645 Blt_Chroma((ArcomageRect *)pSrcXYZW, pTargetXY, v1, 2);
Ritor1
parents:
diff changeset
2646 LABEL_5:
Ritor1
parents:
diff changeset
2647 v3 = stru_505708[1].field_28;
Ritor1
parents:
diff changeset
2648 if ( stru_505708[1].field_28 <= 100 )
Ritor1
parents:
diff changeset
2649 {
Ritor1
parents:
diff changeset
2650 if ( stru_505708[1].field_28 <= 0 )
Ritor1
parents:
diff changeset
2651 return;
Ritor1
parents:
diff changeset
2652 }
Ritor1
parents:
diff changeset
2653 else
Ritor1
parents:
diff changeset
2654 {
Ritor1
parents:
diff changeset
2655 v3 = 100;
Ritor1
parents:
diff changeset
2656 }
Ritor1
parents:
diff changeset
2657 pSrcXYZW[1] = 0;
Ritor1
parents:
diff changeset
2658 pSrcXYZW[0] = 843;
Ritor1
parents:
diff changeset
2659 v4 = 200 * v3 / 100;
Ritor1
parents:
diff changeset
2660 pSrcXYZW[2] = 867;
Ritor1
parents:
diff changeset
2661 pTargetXY[0] = 439;
Ritor1
parents:
diff changeset
2662 pSrcXYZW[3] = v4;
Ritor1
parents:
diff changeset
2663 v5 = 297 - v4;
Ritor1
parents:
diff changeset
2664 LOWORD(v4) = pArcomageGame->field_54;
Ritor1
parents:
diff changeset
2665 pTargetXY[1] = v5;
Ritor1
parents:
diff changeset
2666 Blt_Chroma((ArcomageRect *)pSrcXYZW, pTargetXY, v4, 2);
Ritor1
parents:
diff changeset
2667 }
Ritor1
parents:
diff changeset
2668
Ritor1
parents:
diff changeset
2669 //----- (0040B4B9) --------------------------------------------------------
Ritor1
parents:
diff changeset
2670 void __cdecl am_40B4B9()
Ritor1
parents:
diff changeset
2671 {
Ritor1
parents:
diff changeset
2672 int v0; // esi@1
Ritor1
parents:
diff changeset
2673 int v1; // ebx@1
Ritor1
parents:
diff changeset
2674 int v2; // edi@1
Ritor1
parents:
diff changeset
2675 int v3; // edx@2
Ritor1
parents:
diff changeset
2676 int v4; // eax@3
Ritor1
parents:
diff changeset
2677 int v5; // ecx@3
Ritor1
parents:
diff changeset
2678 int v6; // eax@3
Ritor1
parents:
diff changeset
2679 unsigned int v7; // ecx@4
Ritor1
parents:
diff changeset
2680 int v8; // eax@16
Ritor1
parents:
diff changeset
2681 int v9; // ecx@16
Ritor1
parents:
diff changeset
2682 int v10; // eax@16
Ritor1
parents:
diff changeset
2683 signed int v11; // edi@18
Ritor1
parents:
diff changeset
2684 int v12; // esi@20
Ritor1
parents:
diff changeset
2685 unsigned int v13; // ecx@20
Ritor1
parents:
diff changeset
2686 int v14; // eax@23
Ritor1
parents:
diff changeset
2687 unsigned int v15; // eax@25
Ritor1
parents:
diff changeset
2688 unsigned int v16; // ecx@25
Ritor1
parents:
diff changeset
2689 int *v17; // esi@26
Ritor1
parents:
diff changeset
2690 unsigned int v18; // eax@29
Ritor1
parents:
diff changeset
2691 int *v19; // ecx@29
Ritor1
parents:
diff changeset
2692 int v20; // ecx@31
Ritor1
parents:
diff changeset
2693 int v21; // [sp-4h] [bp-2Ch]@8
Ritor1
parents:
diff changeset
2694 int pSrcXYZW[4]; // [sp+Ch] [bp-1Ch]@8
Ritor1
parents:
diff changeset
2695 int pTargetXY[2]; // [sp+1Ch] [bp-Ch]@1
Ritor1
parents:
diff changeset
2696 int v24; // [sp+24h] [bp-4h]@1
Ritor1
parents:
diff changeset
2697
Ritor1
parents:
diff changeset
2698 v0 = am_40BB49(amuint_4FAA6C);
Ritor1
parents:
diff changeset
2699 v1 = 0;
Ritor1
parents:
diff changeset
2700 v2 = 0;
Ritor1
parents:
diff changeset
2701 pTargetXY[1] = 327;
Ritor1
parents:
diff changeset
2702 v24 = (640 - 96 * v0) / (v0 + 1);
Ritor1
parents:
diff changeset
2703 pTargetXY[0] = (640 - 96 * v0) / (v0 + 1);
Ritor1
parents:
diff changeset
2704 while ( v2 < v0 )
Ritor1
parents:
diff changeset
2705 {
Ritor1
parents:
diff changeset
2706 v3 = amuint_4FAA6C;
Ritor1
parents:
diff changeset
2707 if ( am_byte_4E185D != (_BYTE)v1 )
Ritor1
parents:
diff changeset
2708 {
Ritor1
parents:
diff changeset
2709 v4 = 188 * amuint_4FAA6C + 8 * v2;
Ritor1
parents:
diff changeset
2710 v5 = *(int *)((char *)stru_505708[0].arr_6C[0] + v4);
Ritor1
parents:
diff changeset
2711 v6 = *(int *)((char *)&stru_505708[0].arr_6C[0][1] + v4);
Ritor1
parents:
diff changeset
2712 pTargetXY[0] += v5;
Ritor1
parents:
diff changeset
2713 pTargetXY[1] += v6;
Ritor1
parents:
diff changeset
2714 }
Ritor1
parents:
diff changeset
2715 v7 = stru_505708[0].arr_44[v2 + 47 * amuint_4FAA6C];
Ritor1
parents:
diff changeset
2716 if ( v7 == -1 )
Ritor1
parents:
diff changeset
2717 {
Ritor1
parents:
diff changeset
2718 ++v0;
Ritor1
parents:
diff changeset
2719 goto LABEL_15;
Ritor1
parents:
diff changeset
2720 }
Ritor1
parents:
diff changeset
2721 if ( v2 != amuint_4FAA4C )
Ritor1
parents:
diff changeset
2722 {
Ritor1
parents:
diff changeset
2723 if ( LOBYTE(stru_505708[amuint_4FAA6C].field_20) == (_BYTE)v1 && byte_505881 == (_BYTE)v1 )
Ritor1
parents:
diff changeset
2724 {
Ritor1
parents:
diff changeset
2725 pSrcXYZW[0] = 192;
Ritor1
parents:
diff changeset
2726 pSrcXYZW[2] = 288;
Ritor1
parents:
diff changeset
2727 pSrcXYZW[1] = v1;
Ritor1
parents:
diff changeset
2728 pSrcXYZW[3] = 128;
Ritor1
parents:
diff changeset
2729 v21 = 2;
Ritor1
parents:
diff changeset
2730 LABEL_12:
Ritor1
parents:
diff changeset
2731 Blt_Copy((ArcomageRect *)pSrcXYZW, pTargetXY, v21);
Ritor1
parents:
diff changeset
2732 goto LABEL_13;
Ritor1
parents:
diff changeset
2733 }
Ritor1
parents:
diff changeset
2734 ArcomageGame::GetCardRect(v7, (ArcomageRect *)pSrcXYZW);
Ritor1
parents:
diff changeset
2735 if ( !am_40BF15(amuint_4FAA6C, v2) )
Ritor1
parents:
diff changeset
2736 {
Ritor1
parents:
diff changeset
2737 v1 = 0;
Ritor1
parents:
diff changeset
2738 v21 = 0;
Ritor1
parents:
diff changeset
2739 goto LABEL_12;
Ritor1
parents:
diff changeset
2740 }
Ritor1
parents:
diff changeset
2741 Blt_Copy((ArcomageRect *)pSrcXYZW, pTargetXY, 2);
Ritor1
parents:
diff changeset
2742 v1 = 0;
Ritor1
parents:
diff changeset
2743 }
Ritor1
parents:
diff changeset
2744 LABEL_13:
Ritor1
parents:
diff changeset
2745 v3 = amuint_4FAA6C;
Ritor1
parents:
diff changeset
2746 pTargetXY[0] += v24 + 96;
Ritor1
parents:
diff changeset
2747 LABEL_15:
Ritor1
parents:
diff changeset
2748 if ( am_byte_4E185D != (_BYTE)v1 )
Ritor1
parents:
diff changeset
2749 {
Ritor1
parents:
diff changeset
2750 v8 = 188 * v3 + 8 * v2;
Ritor1
parents:
diff changeset
2751 v9 = *(int *)((char *)stru_505708[0].arr_6C[0] + v8);
Ritor1
parents:
diff changeset
2752 v10 = *(int *)((char *)&stru_505708[0].arr_6C[0][1] + v8);
Ritor1
parents:
diff changeset
2753 pTargetXY[0] -= v9;
Ritor1
parents:
diff changeset
2754 pTargetXY[1] -= v10;
Ritor1
parents:
diff changeset
2755 }
Ritor1
parents:
diff changeset
2756 ++v2;
Ritor1
parents:
diff changeset
2757 }
Ritor1
parents:
diff changeset
2758 v11 = 0;
Ritor1
parents:
diff changeset
2759 do
Ritor1
parents:
diff changeset
2760 {
Ritor1
parents:
diff changeset
2761 if ( am_byte_4FAA76 == (_BYTE)v1 )
Ritor1
parents:
diff changeset
2762 {
Ritor1
parents:
diff changeset
2763 v12 = 4 * v11;
Ritor1
parents:
diff changeset
2764 v13 = amuint_4FAA78[8 * v11];
Ritor1
parents:
diff changeset
2765 if ( v13 != -1 )
Ritor1
parents:
diff changeset
2766 {
Ritor1
parents:
diff changeset
2767 ArcomageGame::GetCardRect(v13, (ArcomageRect *)pSrcXYZW);
Ritor1
parents:
diff changeset
2768 Blt_Copy((ArcomageRect *)pSrcXYZW, amuint_4FAA90[v12], v1);
Ritor1
parents:
diff changeset
2769 }
Ritor1
parents:
diff changeset
2770 if ( am_byte_4FAA7C[v12 * 8] != (_BYTE)v1 )
Ritor1
parents:
diff changeset
2771 {
Ritor1
parents:
diff changeset
2772 pTargetXY[0] = amuint_4FAA90[v12][0] + 12;
Ritor1
parents:
diff changeset
2773 v14 = amuint_4FAA90[v12][1] + 40;
Ritor1
parents:
diff changeset
2774 pTargetXY[1] = amuint_4FAA90[v12][1] + 40;
Ritor1
parents:
diff changeset
2775 LOWORD(v14) = pArcomageGame->field_54;
Ritor1
parents:
diff changeset
2776 pSrcXYZW[0] = 843;
Ritor1
parents:
diff changeset
2777 pSrcXYZW[2] = 916;
Ritor1
parents:
diff changeset
2778 pSrcXYZW[1] = 200;
Ritor1
parents:
diff changeset
2779 pSrcXYZW[3] = 216;
Ritor1
parents:
diff changeset
2780 Blt_Chroma((ArcomageRect *)pSrcXYZW, pTargetXY, v14, 2);
Ritor1
parents:
diff changeset
2781 }
Ritor1
parents:
diff changeset
2782 }
Ritor1
parents:
diff changeset
2783 else
Ritor1
parents:
diff changeset
2784 {
Ritor1
parents:
diff changeset
2785 if ( amuint_4FAA34 <= v1 )
Ritor1
parents:
diff changeset
2786 {
Ritor1
parents:
diff changeset
2787 if ( v11 == 9 )
Ritor1
parents:
diff changeset
2788 {
Ritor1
parents:
diff changeset
2789 am_byte_4FAA76 = v1;
Ritor1
parents:
diff changeset
2790 am_byte_4FAA75 = v1;
Ritor1
parents:
diff changeset
2791 amuint_4FAA34 = 5;
Ritor1
parents:
diff changeset
2792 }
Ritor1
parents:
diff changeset
2793 v18 = 32 * v11;
Ritor1
parents:
diff changeset
2794 v19 = &amuint_4FAA78[8 * v11];
Ritor1
parents:
diff changeset
2795 if ( *v19 != -1 )
Ritor1
parents:
diff changeset
2796 amuint_4FABC4 = *v19;
Ritor1
parents:
diff changeset
2797 *v19 = -1;
Ritor1
parents:
diff changeset
2798 amuint_4FAA90[v18 / 8][0] = amuint_4FAA80[v18 / 4];
Ritor1
parents:
diff changeset
2799 v20 = amuint_4FAA84[v18 / 4];
Ritor1
parents:
diff changeset
2800 am_byte_4FAA7C[v18] = v1;
Ritor1
parents:
diff changeset
2801 amuint_4FAA90[v18 / 8][1] = v20;
Ritor1
parents:
diff changeset
2802 }
Ritor1
parents:
diff changeset
2803 else
Ritor1
parents:
diff changeset
2804 {
Ritor1
parents:
diff changeset
2805 v15 = 32 * v11;
Ritor1
parents:
diff changeset
2806 v16 = amuint_4FAA78[8 * v11];
Ritor1
parents:
diff changeset
2807 if ( v16 != -1 )
Ritor1
parents:
diff changeset
2808 {
Ritor1
parents:
diff changeset
2809 v17 = amuint_4FAA90[v15 / 8];
Ritor1
parents:
diff changeset
2810 *v17 += amuint_4FAA88[v15 / 4];
Ritor1
parents:
diff changeset
2811 amuint_4FAA90[v15 / 8][1] += amuint_4FAA8C[v15 / 4];
Ritor1
parents:
diff changeset
2812 ArcomageGame::GetCardRect(v16, (ArcomageRect *)pSrcXYZW);
Ritor1
parents:
diff changeset
2813 Blt_Copy((ArcomageRect *)pSrcXYZW, v17, v1);
Ritor1
parents:
diff changeset
2814 }
Ritor1
parents:
diff changeset
2815 }
Ritor1
parents:
diff changeset
2816 }
Ritor1
parents:
diff changeset
2817 ++v11;
Ritor1
parents:
diff changeset
2818 }
Ritor1
parents:
diff changeset
2819 while ( v11 < 10 );
Ritor1
parents:
diff changeset
2820 if ( am_byte_4FAA76 != (_BYTE)v1 )
Ritor1
parents:
diff changeset
2821 --amuint_4FAA34;
Ritor1
parents:
diff changeset
2822 pSrcXYZW[0] = 192;
Ritor1
parents:
diff changeset
2823 pSrcXYZW[2] = 288;
Ritor1
parents:
diff changeset
2824 pSrcXYZW[1] = v1;
Ritor1
parents:
diff changeset
2825 pSrcXYZW[3] = 128;
Ritor1
parents:
diff changeset
2826 pTargetXY[0] = 120;
Ritor1
parents:
diff changeset
2827 pTargetXY[1] = 18;
Ritor1
parents:
diff changeset
2828 Blt_Copy((ArcomageRect *)pSrcXYZW, pTargetXY, v1);
Ritor1
parents:
diff changeset
2829 }
Ritor1
parents:
diff changeset
2830 // 4E185D: using guessed type char am_byte_4E185D;
Ritor1
parents:
diff changeset
2831 // 4FAA34: using guessed type int amuint_4FAA34;
Ritor1
parents:
diff changeset
2832 // 4FAA4C: using guessed type int amuint_4FAA4C;
Ritor1
parents:
diff changeset
2833 // 4FAA75: using guessed type char am_byte_4FAA75;
Ritor1
parents:
diff changeset
2834 // 4FAA76: using guessed type char am_byte_4FAA76;
Ritor1
parents:
diff changeset
2835 // 4FAA78: using guessed type int amuint_4FAA78[];
Ritor1
parents:
diff changeset
2836 // 4FAA80: using guessed type int amuint_4FAA80[];
Ritor1
parents:
diff changeset
2837 // 4FAA84: using guessed type int amuint_4FAA84[];
Ritor1
parents:
diff changeset
2838 // 4FAA88: using guessed type int amuint_4FAA88[];
Ritor1
parents:
diff changeset
2839 // 4FAA8C: using guessed type int amuint_4FAA8C[];
Ritor1
parents:
diff changeset
2840 // 4FABC4: using guessed type int amuint_4FABC4;
Ritor1
parents:
diff changeset
2841 // 505881: using guessed type char byte_505881;
Ritor1
parents:
diff changeset
2842
Ritor1
parents:
diff changeset
2843
Ritor1
parents:
diff changeset
2844
Ritor1
parents:
diff changeset
2845 //----- (0040B76F) --------------------------------------------------------
Ritor1
parents:
diff changeset
2846 void __fastcall am_40B76F(int a1)
Ritor1
parents:
diff changeset
2847 {
Ritor1
parents:
diff changeset
2848 int v1; // eax@3
Ritor1
parents:
diff changeset
2849 int v2; // eax@3
Ritor1
parents:
diff changeset
2850 int v3; // esi@4
Ritor1
parents:
diff changeset
2851 int v4; // eax@4
Ritor1
parents:
diff changeset
2852 int *v5; // edx@6
Ritor1
parents:
diff changeset
2853 int *v6; // ecx@6
Ritor1
parents:
diff changeset
2854 signed int v7; // ebx@11
Ritor1
parents:
diff changeset
2855 int v8; // eax@15
Ritor1
parents:
diff changeset
2856 signed int v9; // ecx@15
Ritor1
parents:
diff changeset
2857 int v10; // eax@20
Ritor1
parents:
diff changeset
2858 int v11; // ecx@20
Ritor1
parents:
diff changeset
2859 int v12; // eax@20
Ritor1
parents:
diff changeset
2860 unsigned int v13; // ecx@21
Ritor1
parents:
diff changeset
2861 double v14; // st7@22
Ritor1
parents:
diff changeset
2862 int *v15; // edx@23
Ritor1
parents:
diff changeset
2863 int v16; // eax@32
Ritor1
parents:
diff changeset
2864 char v17; // zf@37
Ritor1
parents:
diff changeset
2865 int v18; // eax@41
Ritor1
parents:
diff changeset
2866 int v19; // eax@46
Ritor1
parents:
diff changeset
2867 int v20; // ecx@46
Ritor1
parents:
diff changeset
2868 int v21; // eax@46
Ritor1
parents:
diff changeset
2869 int v22; // [sp-4h] [bp-2Ch]@6
Ritor1
parents:
diff changeset
2870 int v23; // [sp-4h] [bp-2Ch]@28
Ritor1
parents:
diff changeset
2871 int pSrcXYZW[4]; // [sp+Ch] [bp-1Ch]@6
Ritor1
parents:
diff changeset
2872 int pTargetXY[2]; // [sp+1Ch] [bp-Ch]@20
Ritor1
parents:
diff changeset
2873 int v26; // [sp+24h] [bp-4h]@1
Ritor1
parents:
diff changeset
2874
Ritor1
parents:
diff changeset
2875 v26 = a1;
Ritor1
parents:
diff changeset
2876 if ( amuint_4FAA4C != -1 )
Ritor1
parents:
diff changeset
2877 {
Ritor1
parents:
diff changeset
2878 if ( amuint_4FAA38 >= 9 )
Ritor1
parents:
diff changeset
2879 {
Ritor1
parents:
diff changeset
2880 am_uint_4FAA44_blt_xy[1] = 18;
Ritor1
parents:
diff changeset
2881 am_uint_4FAA44_blt_xy[0] = 120;
Ritor1
parents:
diff changeset
2882 v1 = am_40BB49(amuint_4FAA6C);
Ritor1
parents:
diff changeset
2883 v2 = (640 - 96 * v1) / v1 + 96;
Ritor1
parents:
diff changeset
2884 if ( am_byte_4E185D )
Ritor1
parents:
diff changeset
2885 {
Ritor1
parents:
diff changeset
2886 v3 = 188 * amuint_4FAA6C + 8 * amuint_4FAA4C;
Ritor1
parents:
diff changeset
2887 amuint_4FAA3C_blt_xy[0] = (amuint_4FAA4C * v2 + *(int *)((char *)stru_505708[0].arr_6C[0] + v3) - 120) / 10;
Ritor1
parents:
diff changeset
2888 v4 = (*(int *)((char *)&stru_505708[0].arr_6C[0][1] + v3) + 309) / 10;
Ritor1
parents:
diff changeset
2889 }
Ritor1
parents:
diff changeset
2890 else
Ritor1
parents:
diff changeset
2891 {
Ritor1
parents:
diff changeset
2892 amuint_4FAA3C_blt_xy[0] = (amuint_4FAA4C * v2 - 120) / 10;
Ritor1
parents:
diff changeset
2893 v4 = 30;
Ritor1
parents:
diff changeset
2894 }
Ritor1
parents:
diff changeset
2895 am_uint_4FAA44_blt_xy[1] += v4;
Ritor1
parents:
diff changeset
2896 am_uint_4FAA44_blt_xy[0] += amuint_4FAA3C_blt_xy[0];
Ritor1
parents:
diff changeset
2897 pSrcXYZW[1] = 0;
Ritor1
parents:
diff changeset
2898 amuint_4FAA3C_blt_xy[1] = v4;
Ritor1
parents:
diff changeset
2899 pSrcXYZW[0] = 192;
Ritor1
parents:
diff changeset
2900 pSrcXYZW[2] = 288;
Ritor1
parents:
diff changeset
2901 pSrcXYZW[3] = 128;
Ritor1
parents:
diff changeset
2902 v22 = 2;
Ritor1
parents:
diff changeset
2903 v5 = am_uint_4FAA44_blt_xy;
Ritor1
parents:
diff changeset
2904 v6 = pSrcXYZW;
Ritor1
parents:
diff changeset
2905 goto LABEL_7;
Ritor1
parents:
diff changeset
2906 }
Ritor1
parents:
diff changeset
2907 pSrcXYZW[1] = 0;
Ritor1
parents:
diff changeset
2908 v6 = pSrcXYZW;
Ritor1
parents:
diff changeset
2909 v5 = am_uint_4FAA44_blt_xy;
Ritor1
parents:
diff changeset
2910 v22 = 2;
Ritor1
parents:
diff changeset
2911 pSrcXYZW[3] = 128;
Ritor1
parents:
diff changeset
2912 pSrcXYZW[2] = 288;
Ritor1
parents:
diff changeset
2913 pSrcXYZW[0] = 192;
Ritor1
parents:
diff changeset
2914 if ( amuint_4FAA38 )
Ritor1
parents:
diff changeset
2915 {
Ritor1
parents:
diff changeset
2916 am_uint_4FAA44_blt_xy[0] += amuint_4FAA3C_blt_xy[0];
Ritor1
parents:
diff changeset
2917 am_uint_4FAA44_blt_xy[1] += amuint_4FAA3C_blt_xy[1];
Ritor1
parents:
diff changeset
2918 LABEL_7:
Ritor1
parents:
diff changeset
2919 Blt_Copy((ArcomageRect *)v6, v5, v22);
Ritor1
parents:
diff changeset
2920 goto LABEL_11;
Ritor1
parents:
diff changeset
2921 }
Ritor1
parents:
diff changeset
2922 am_uint_4FAA44_blt_xy[0] += amuint_4FAA3C_blt_xy[0];
Ritor1
parents:
diff changeset
2923 am_uint_4FAA44_blt_xy[1] += amuint_4FAA3C_blt_xy[1];
Ritor1
parents:
diff changeset
2924 Blt_Copy((ArcomageRect *)pSrcXYZW, am_uint_4FAA44_blt_xy, 2);
Ritor1
parents:
diff changeset
2925 amuint_4FAA4C = -1;
Ritor1
parents:
diff changeset
2926 }
Ritor1
parents:
diff changeset
2927 LABEL_11:
Ritor1
parents:
diff changeset
2928 v7 = (signed int)amuint_4FAA78;
Ritor1
parents:
diff changeset
2929 if ( uCardID != -1 )
Ritor1
parents:
diff changeset
2930 {
Ritor1
parents:
diff changeset
2931 if ( v26 <= 10 )
Ritor1
parents:
diff changeset
2932 {
Ritor1
parents:
diff changeset
2933 if ( v26 == 10 )
Ritor1
parents:
diff changeset
2934 {
Ritor1
parents:
diff changeset
2935 ArcomageGame::GetCardRect(uCardID, (ArcomageRect *)pSrcXYZW);
Ritor1
parents:
diff changeset
2936 v8 = 0;
Ritor1
parents:
diff changeset
2937 v9 = (signed int)amuint_4FAA78;
Ritor1
parents:
diff changeset
2938 while ( *(unsigned int *)v9 != -1 )
Ritor1
parents:
diff changeset
2939 {
Ritor1
parents:
diff changeset
2940 v9 += 32;
Ritor1
parents:
diff changeset
2941 ++v8;
Ritor1
parents:
diff changeset
2942 if ( v9 >= (signed int)&dword_4FABB8 )
Ritor1
parents:
diff changeset
2943 goto LABEL_20;
Ritor1
parents:
diff changeset
2944 }
Ritor1
parents:
diff changeset
2945 amuint_4FAA78[8 * v8] = uCardID;
Ritor1
parents:
diff changeset
2946 am_byte_4FAA7C[32 * v8] = 1;
Ritor1
parents:
diff changeset
2947 LABEL_20:
Ritor1
parents:
diff changeset
2948 v10 = 8 * v8;
Ritor1
parents:
diff changeset
2949 v11 = amuint_4FAA80[v10];
Ritor1
parents:
diff changeset
2950 v12 = amuint_4FAA84[v10];
Ritor1
parents:
diff changeset
2951 pTargetXY[0] = v11;
Ritor1
parents:
diff changeset
2952 pTargetXY[1] = v12;
Ritor1
parents:
diff changeset
2953 Blt_Copy((ArcomageRect *)pSrcXYZW, pTargetXY, 0);
Ritor1
parents:
diff changeset
2954 uCardID = -1;
Ritor1
parents:
diff changeset
2955 }
Ritor1
parents:
diff changeset
2956 }
Ritor1
parents:
diff changeset
2957 else
Ritor1
parents:
diff changeset
2958 {
Ritor1
parents:
diff changeset
2959 ArcomageGame::GetCardRect(uCardID, (ArcomageRect *)pSrcXYZW);
Ritor1
parents:
diff changeset
2960 amuint_4FAA5C_blt_xy[0] += amuint_4FAA54_blt_xy[0];
Ritor1
parents:
diff changeset
2961 amuint_4FAA5C_blt_xy[1] += amuint_4FAA54_blt_xy[1];
Ritor1
parents:
diff changeset
2962 Blt_Copy((ArcomageRect *)pSrcXYZW, amuint_4FAA5C_blt_xy, 0);
Ritor1
parents:
diff changeset
2963 }
Ritor1
parents:
diff changeset
2964 }
Ritor1
parents:
diff changeset
2965 v13 = amuint_4FABC0;
Ritor1
parents:
diff changeset
2966 if ( amuint_4FABC0 != -1 )
Ritor1
parents:
diff changeset
2967 {
Ritor1
parents:
diff changeset
2968 v14 = (double)v26;
Ritor1
parents:
diff changeset
2969 if ( v14 > 15.0 )
Ritor1
parents:
diff changeset
2970 {
Ritor1
parents:
diff changeset
2971 ArcomageGame::GetCardRect(amuint_4FABC0, (ArcomageRect *)pSrcXYZW);
Ritor1
parents:
diff changeset
2972 v15 = amuint_4FAA5C_blt_xy;
Ritor1
parents:
diff changeset
2973 amuint_4FAA5C_blt_xy[0] += amuint_4FAA54_blt_xy[0];
Ritor1
parents:
diff changeset
2974 amuint_4FAA5C_blt_xy[1] += amuint_4FAA54_blt_xy[1];
Ritor1
parents:
diff changeset
2975 LABEL_28:
Ritor1
parents:
diff changeset
2976 v23 = 2;
Ritor1
parents:
diff changeset
2977 LABEL_29:
Ritor1
parents:
diff changeset
2978 Blt_Copy((ArcomageRect *)pSrcXYZW, v15, v23);
Ritor1
parents:
diff changeset
2979 return;
Ritor1
parents:
diff changeset
2980 }
Ritor1
parents:
diff changeset
2981 if ( v14 == 15.0 )
Ritor1
parents:
diff changeset
2982 {
Ritor1
parents:
diff changeset
2983 am_40BF77(amuint_4FAA6C, amuint_4FABC0);
Ritor1
parents:
diff changeset
2984 v13 = amuint_4FABC0;
Ritor1
parents:
diff changeset
2985 goto LABEL_26;
Ritor1
parents:
diff changeset
2986 }
Ritor1
parents:
diff changeset
2987 if ( v14 == 5.0 )
Ritor1
parents:
diff changeset
2988 {
Ritor1
parents:
diff changeset
2989 amuint_4FAA5C_blt_xy[0] = 272;
Ritor1
parents:
diff changeset
2990 amuint_4FAA5C_blt_xy[1] = 173;
Ritor1
parents:
diff changeset
2991 v16 = 0;
Ritor1
parents:
diff changeset
2992 do
Ritor1
parents:
diff changeset
2993 {
Ritor1
parents:
diff changeset
2994 if ( *(unsigned int *)v7 == -1 )
Ritor1
parents:
diff changeset
2995 break;
Ritor1
parents:
diff changeset
2996 v7 += 32;
Ritor1
parents:
diff changeset
2997 ++v16;
Ritor1
parents:
diff changeset
2998 }
Ritor1
parents:
diff changeset
2999 while ( v7 < (signed int)&dword_4FABB8 );
Ritor1
parents:
diff changeset
3000 v26 = 32 * v16;
Ritor1
parents:
diff changeset
3001 amuint_4FAA54_blt_xy[0] = (amuint_4FAA80[8 * v16] - 272) / 5;
Ritor1
parents:
diff changeset
3002 amuint_4FAA54_blt_xy[1] = (amuint_4FAA84[8 * v16] - 173) / 5;
Ritor1
parents:
diff changeset
3003 ArcomageGame::GetCardRect(amuint_4FABC0, (ArcomageRect *)pSrcXYZW);
Ritor1
parents:
diff changeset
3004 pTargetXY[0] = 272;
Ritor1
parents:
diff changeset
3005 pTargetXY[1] = 173;
Ritor1
parents:
diff changeset
3006 goto LABEL_27;
Ritor1
parents:
diff changeset
3007 }
Ritor1
parents:
diff changeset
3008 if ( v14 >= 5.0 )
Ritor1
parents:
diff changeset
3009 {
Ritor1
parents:
diff changeset
3010 v17 = v26 == 0;
Ritor1
parents:
diff changeset
3011 }
Ritor1
parents:
diff changeset
3012 else
Ritor1
parents:
diff changeset
3013 {
Ritor1
parents:
diff changeset
3014 v17 = v26 == 0;
Ritor1
parents:
diff changeset
3015 if ( v26 > 0 )
Ritor1
parents:
diff changeset
3016 {
Ritor1
parents:
diff changeset
3017 ArcomageGame::GetCardRect(amuint_4FABC0, (ArcomageRect *)pSrcXYZW);
Ritor1
parents:
diff changeset
3018 v15 = amuint_4FAA5C_blt_xy;
Ritor1
parents:
diff changeset
3019 amuint_4FAA5C_blt_xy[0] += amuint_4FAA54_blt_xy[0];
Ritor1
parents:
diff changeset
3020 amuint_4FAA5C_blt_xy[1] += amuint_4FAA54_blt_xy[1];
Ritor1
parents:
diff changeset
3021 v23 = 0;
Ritor1
parents:
diff changeset
3022 goto LABEL_29;
Ritor1
parents:
diff changeset
3023 }
Ritor1
parents:
diff changeset
3024 }
Ritor1
parents:
diff changeset
3025 if ( !v17 )
Ritor1
parents:
diff changeset
3026 {
Ritor1
parents:
diff changeset
3027 LABEL_26:
Ritor1
parents:
diff changeset
3028 ArcomageGame::GetCardRect(v13, (ArcomageRect *)pSrcXYZW);
Ritor1
parents:
diff changeset
3029 pTargetXY[0] = 272;
Ritor1
parents:
diff changeset
3030 pTargetXY[1] = 173;
Ritor1
parents:
diff changeset
3031 LABEL_27:
Ritor1
parents:
diff changeset
3032 v15 = pTargetXY;
Ritor1
parents:
diff changeset
3033 goto LABEL_28;
Ritor1
parents:
diff changeset
3034 }
Ritor1
parents:
diff changeset
3035 ArcomageGame::GetCardRect(amuint_4FABC0, (ArcomageRect *)pSrcXYZW);
Ritor1
parents:
diff changeset
3036 v18 = 0;
Ritor1
parents:
diff changeset
3037 while ( *(unsigned int *)v7 != -1 )
Ritor1
parents:
diff changeset
3038 {
Ritor1
parents:
diff changeset
3039 v7 += 32;
Ritor1
parents:
diff changeset
3040 ++v18;
Ritor1
parents:
diff changeset
3041 if ( v7 >= (signed int)&dword_4FABB8 )
Ritor1
parents:
diff changeset
3042 goto LABEL_46;
Ritor1
parents:
diff changeset
3043 }
Ritor1
parents:
diff changeset
3044 amuint_4FAA78[8 * v18] = amuint_4FABC0;
Ritor1
parents:
diff changeset
3045 LABEL_46:
Ritor1
parents:
diff changeset
3046 v19 = 8 * v18;
Ritor1
parents:
diff changeset
3047 v20 = amuint_4FAA80[v19];
Ritor1
parents:
diff changeset
3048 v21 = amuint_4FAA84[v19];
Ritor1
parents:
diff changeset
3049 pTargetXY[0] = v20;
Ritor1
parents:
diff changeset
3050 pTargetXY[1] = v21;
Ritor1
parents:
diff changeset
3051 Blt_Copy((ArcomageRect *)pSrcXYZW, pTargetXY, 0);
Ritor1
parents:
diff changeset
3052 amuint_4FABC0 = -1;
Ritor1
parents:
diff changeset
3053 }
Ritor1
parents:
diff changeset
3054 }
Ritor1
parents:
diff changeset
3055 // 4E185D: using guessed type char am_byte_4E185D;
Ritor1
parents:
diff changeset
3056 // 4FAA38: using guessed type int amuint_4FAA38;
Ritor1
parents:
diff changeset
3057 // 4FAA4C: using guessed type int amuint_4FAA4C;
Ritor1
parents:
diff changeset
3058 // 4FAA78: using guessed type int amuint_4FAA78[];
Ritor1
parents:
diff changeset
3059 // 4FAA80: using guessed type int amuint_4FAA80[];
Ritor1
parents:
diff changeset
3060 // 4FAA84: using guessed type int amuint_4FAA84[];
Ritor1
parents:
diff changeset
3061 // 4FABB8: using guessed type int dword_4FABB8;
Ritor1
parents:
diff changeset
3062
Ritor1
parents:
diff changeset
3063 //----- (0040BB12) --------------------------------------------------------
Ritor1
parents:
diff changeset
3064 void ArcomageGame::GetCardRect(unsigned int uCardID, ArcomageRect *pCardRect)
Ritor1
parents:
diff changeset
3065 {
Ritor1
parents:
diff changeset
3066 ArcomageRect *pXYZW; // esi@1
Ritor1
parents:
diff changeset
3067 int v3; // edx@1
Ritor1
parents:
diff changeset
3068 int v4; // ecx@1
Ritor1
parents:
diff changeset
3069
Ritor1
parents:
diff changeset
3070 pXYZW = pCardRect;
Ritor1
parents:
diff changeset
3071 v3 = pCards[uCardID].slot % 10;
Ritor1
parents:
diff changeset
3072 v4 = (pCards[uCardID].slot / 10 << 7) + 220;
Ritor1
parents:
diff changeset
3073 pXYZW->y = v4;
Ritor1
parents:
diff changeset
3074 pXYZW->x = 96 * v3;
Ritor1
parents:
diff changeset
3075 pXYZW->w = v4 + 128;
Ritor1
parents:
diff changeset
3076 pXYZW->z = 96 * v3 + 96;
Ritor1
parents:
diff changeset
3077 }
Ritor1
parents:
diff changeset
3078
Ritor1
parents:
diff changeset
3079 //----- (0040BB49) --------------------------------------------------------
Ritor1
parents:
diff changeset
3080 int __fastcall am_40BB49(int a1)
Ritor1
parents:
diff changeset
3081 {
Ritor1
parents:
diff changeset
3082 int result; // eax@1
Ritor1
parents:
diff changeset
3083 char *v2; // ecx@1
Ritor1
parents:
diff changeset
3084 signed int v3; // edx@1
Ritor1
parents:
diff changeset
3085
Ritor1
parents:
diff changeset
3086 result = 0;
Ritor1
parents:
diff changeset
3087 v2 = (char *)stru_505708[a1].arr_44;
Ritor1
parents:
diff changeset
3088 v3 = 10;
Ritor1
parents:
diff changeset
3089 do
Ritor1
parents:
diff changeset
3090 {
Ritor1
parents:
diff changeset
3091 if ( *(unsigned int *)v2 != -1 )
Ritor1
parents:
diff changeset
3092 ++result;
Ritor1
parents:
diff changeset
3093 v2 += 4;
Ritor1
parents:
diff changeset
3094 --v3;
Ritor1
parents:
diff changeset
3095 }
Ritor1
parents:
diff changeset
3096 while ( v3 );
Ritor1
parents:
diff changeset
3097 return result;
Ritor1
parents:
diff changeset
3098 }
Ritor1
parents:
diff changeset
3099
Ritor1
parents:
diff changeset
3100 //----- (0040BB67) --------------------------------------------------------
Ritor1
parents:
diff changeset
3101 signed int __fastcall am_40BB67(int a1)
Ritor1
parents:
diff changeset
3102 {
Ritor1
parents:
diff changeset
3103 int v1; // esi@1
Ritor1
parents:
diff changeset
3104 signed int result; // eax@1
Ritor1
parents:
diff changeset
3105 int v3; // ebx@1
Ritor1
parents:
diff changeset
3106 char v4; // zf@1
Ritor1
parents:
diff changeset
3107 int v5; // eax@3
Ritor1
parents:
diff changeset
3108 int v6; // eax@4
Ritor1
parents:
diff changeset
3109 int v7; // ecx@6
Ritor1
parents:
diff changeset
3110 char *v8; // eax@6
Ritor1
parents:
diff changeset
3111 int v9; // eax@10
Ritor1
parents:
diff changeset
3112 int v10; // ecx@10
Ritor1
parents:
diff changeset
3113 int v11; // eax@10
Ritor1
parents:
diff changeset
3114 char v12; // ch@2@11
Ritor1
parents:
diff changeset
3115 int v13; // ST00_4@12
Ritor1
parents:
diff changeset
3116 unsigned __int16 v14; // ax@12
Ritor1
parents:
diff changeset
3117 int v15; // eax@13
Ritor1
parents:
diff changeset
3118 int v16; // ecx@13
Ritor1
parents:
diff changeset
3119 int v17; // eax@13
Ritor1
parents:
diff changeset
3120 char v18; // al@16
Ritor1
parents:
diff changeset
3121 char v19; // ch@2@16
Ritor1
parents:
diff changeset
3122 int v20; // ST00_4@19
Ritor1
parents:
diff changeset
3123 unsigned __int16 v21; // ax@19
Ritor1
parents:
diff changeset
3124 int pXYZW[4]; // [sp+Ch] [bp-3Ch]@3
Ritor1
parents:
diff changeset
3125 stru273 v26; // [sp+1Ch] [bp-2Ch]@2
Ritor1
parents:
diff changeset
3126 int a1a; // [sp+28h] [bp-20h]@1
Ritor1
parents:
diff changeset
3127 int v25; // [sp+2Ch] [bp-1Ch]@3
Ritor1
parents:
diff changeset
3128 int var18; // [sp+30h] [bp-18h]@3
Ritor1
parents:
diff changeset
3129 int i; // [sp+34h] [bp-14h]@4
Ritor1
parents:
diff changeset
3130 int v28; // [sp+38h] [bp-10h]@1
Ritor1
parents:
diff changeset
3131 int a2; // [sp+3Ch] [bp-Ch]@3
Ritor1
parents:
diff changeset
3132 int v30; // [sp+40h] [bp-8h]@1
Ritor1
parents:
diff changeset
3133 char v31; // [sp+44h] [bp-4h]@12
Ritor1
parents:
diff changeset
3134 char v32; // [sp+45h] [bp-3h]@12
Ritor1
parents:
diff changeset
3135 char v33; // [sp+46h] [bp-2h]@12
Ritor1
parents:
diff changeset
3136
Ritor1
parents:
diff changeset
3137 v1 = a1;
Ritor1
parents:
diff changeset
3138 v30 = 0;
Ritor1
parents:
diff changeset
3139 result = -1;
Ritor1
parents:
diff changeset
3140 v3 = 188 * a1;
Ritor1
parents:
diff changeset
3141 a1a = a1;
Ritor1
parents:
diff changeset
3142 v4 = LOBYTE(stru_505708[a1].field_20) == 0;
Ritor1
parents:
diff changeset
3143 v28 = -1;
Ritor1
parents:
diff changeset
3144 if ( !v4 )
Ritor1
parents:
diff changeset
3145 {
Ritor1
parents:
diff changeset
3146 if ( v26._40DD2F() )
Ritor1
parents:
diff changeset
3147 {
Ritor1
parents:
diff changeset
3148 v5 = am_40BB49(v1);
Ritor1
parents:
diff changeset
3149 a2 = 0;
Ritor1
parents:
diff changeset
3150 v25 = v5;
Ritor1
parents:
diff changeset
3151 pXYZW[1] = 327;
Ritor1
parents:
diff changeset
3152 pXYZW[3] = 455;
Ritor1
parents:
diff changeset
3153 pXYZW[0] = (640 - 96 * v5) / (v5 + 1);
Ritor1
parents:
diff changeset
3154 var18 = pXYZW[0] + 96;
Ritor1
parents:
diff changeset
3155 pXYZW[2] = pXYZW[0] + 96;
Ritor1
parents:
diff changeset
3156 if ( v5 > 0 )
Ritor1
parents:
diff changeset
3157 {
Ritor1
parents:
diff changeset
3158 v6 = 47 * v1;
Ritor1
parents:
diff changeset
3159 for ( i = 47 * v1; ; v6 = i )
Ritor1
parents:
diff changeset
3160 {
Ritor1
parents:
diff changeset
3161 v7 = v30;
Ritor1
parents:
diff changeset
3162 v8 = (char *)&stru_505708[0].arr_44[v30 + v6];
Ritor1
parents:
diff changeset
3163 if ( *(unsigned int *)v8 == -1 )
Ritor1
parents:
diff changeset
3164 {
Ritor1
parents:
diff changeset
3165 do
Ritor1
parents:
diff changeset
3166 {
Ritor1
parents:
diff changeset
3167 v8 += 4;
Ritor1
parents:
diff changeset
3168 ++v7;
Ritor1
parents:
diff changeset
3169 }
Ritor1
parents:
diff changeset
3170 while ( *(unsigned int *)v8 == -1 );
Ritor1
parents:
diff changeset
3171 v30 = v7;
Ritor1
parents:
diff changeset
3172 }
Ritor1
parents:
diff changeset
3173 if ( am_byte_4E185D )
Ritor1
parents:
diff changeset
3174 {
Ritor1
parents:
diff changeset
3175 v9 = v3 + 8 * v7;
Ritor1
parents:
diff changeset
3176 v10 = *(int *)((char *)stru_505708[0].arr_6C[0] + v9);
Ritor1
parents:
diff changeset
3177 v11 = *(int *)((char *)&stru_505708[0].arr_6C[0][1] + v9);
Ritor1
parents:
diff changeset
3178 pXYZW[0] += v10;
Ritor1
parents:
diff changeset
3179 pXYZW[2] += v10;
Ritor1
parents:
diff changeset
3180 pXYZW[1] += v11;
Ritor1
parents:
diff changeset
3181 pXYZW[3] += v11;
Ritor1
parents:
diff changeset
3182 }
Ritor1
parents:
diff changeset
3183 if ( v26.Inside((Vec4_int_ *)pXYZW) )
Ritor1
parents:
diff changeset
3184 break;
Ritor1
parents:
diff changeset
3185 v31 = 0;
Ritor1
parents:
diff changeset
3186 v32 = 0;
Ritor1
parents:
diff changeset
3187 v33 = 0;
Ritor1
parents:
diff changeset
3188 BYTE3(v13) = v12;
Ritor1
parents:
diff changeset
3189 LOWORD(v13) = *(_WORD *)&v31;
Ritor1
parents:
diff changeset
3190 BYTE2(v13) = 0;
Ritor1
parents:
diff changeset
3191 v14 = R8G8B8_to_TargetFormat(v13);
Ritor1
parents:
diff changeset
3192 DrawRect((Vec4_int_ *)pXYZW, v14, 0);
Ritor1
parents:
diff changeset
3193 pXYZW[0] += var18;
Ritor1
parents:
diff changeset
3194 pXYZW[2] += var18;
Ritor1
parents:
diff changeset
3195 if ( am_byte_4E185D )
Ritor1
parents:
diff changeset
3196 {
Ritor1
parents:
diff changeset
3197 v15 = v3 + 8 * v30;
Ritor1
parents:
diff changeset
3198 v16 = *(int *)((char *)stru_505708[0].arr_6C[0] + v15);
Ritor1
parents:
diff changeset
3199 v17 = *(int *)((char *)&stru_505708[0].arr_6C[0][1] + v15);
Ritor1
parents:
diff changeset
3200 pXYZW[0] -= v16;
Ritor1
parents:
diff changeset
3201 pXYZW[2] -= v16;
Ritor1
parents:
diff changeset
3202 pXYZW[1] -= v17;
Ritor1
parents:
diff changeset
3203 pXYZW[3] -= v17;
Ritor1
parents:
diff changeset
3204 }
Ritor1
parents:
diff changeset
3205 ++v30;
Ritor1
parents:
diff changeset
3206 ++a2;
Ritor1
parents:
diff changeset
3207 if ( a2 >= v25 )
Ritor1
parents:
diff changeset
3208 goto LABEL_20;
Ritor1
parents:
diff changeset
3209 }
Ritor1
parents:
diff changeset
3210 v28 = a2;
Ritor1
parents:
diff changeset
3211 v18 = am_40BF15(a1a, a2);
Ritor1
parents:
diff changeset
3212 v31 = -1;
Ritor1
parents:
diff changeset
3213 if ( v18 )
Ritor1
parents:
diff changeset
3214 {
Ritor1
parents:
diff changeset
3215 v32 = -1;
Ritor1
parents:
diff changeset
3216 v33 = -1;
Ritor1
parents:
diff changeset
3217 }
Ritor1
parents:
diff changeset
3218 else
Ritor1
parents:
diff changeset
3219 {
Ritor1
parents:
diff changeset
3220 v32 = 0;
Ritor1
parents:
diff changeset
3221 v33 = 0;
Ritor1
parents:
diff changeset
3222 }
Ritor1
parents:
diff changeset
3223 BYTE3(v20) = v19;
Ritor1
parents:
diff changeset
3224 LOWORD(v20) = *(_WORD *)&v31;
Ritor1
parents:
diff changeset
3225 BYTE2(v20) = v33;
Ritor1
parents:
diff changeset
3226 v21 = R8G8B8_to_TargetFormat(v20);
Ritor1
parents:
diff changeset
3227 DrawRect((Vec4_int_ *)pXYZW, v21, 0);
Ritor1
parents:
diff changeset
3228 }
Ritor1
parents:
diff changeset
3229 }
Ritor1
parents:
diff changeset
3230 LABEL_20:
Ritor1
parents:
diff changeset
3231 result = v28;
Ritor1
parents:
diff changeset
3232 }
Ritor1
parents:
diff changeset
3233 return result;
Ritor1
parents:
diff changeset
3234 }
Ritor1
parents:
diff changeset
3235 // 4E185D: using guessed type char am_byte_4E185D;
Ritor1
parents:
diff changeset
3236
Ritor1
parents:
diff changeset
3237 //----- (0040BCFB) --------------------------------------------------------
Ritor1
parents:
diff changeset
3238 char __fastcall am_40BCFB(int a1, signed int a2)
Ritor1
parents:
diff changeset
3239 {
Ritor1
parents:
diff changeset
3240 int v2; // esi@2
Ritor1
parents:
diff changeset
3241 signed int v3; // edi@2
Ritor1
parents:
diff changeset
3242 char *v4; // eax@2
Ritor1
parents:
diff changeset
3243 int v5; // ecx@7
Ritor1
parents:
diff changeset
3244 int v6; // ebx@7
Ritor1
parents:
diff changeset
3245 int v7; // esi@8
Ritor1
parents:
diff changeset
3246 int v8; // eax@8
Ritor1
parents:
diff changeset
3247 int v9; // esi@8
Ritor1
parents:
diff changeset
3248 int v10; // ecx@8
Ritor1
parents:
diff changeset
3249 int v11; // eax@8
Ritor1
parents:
diff changeset
3250 int v12; // eax@8
Ritor1
parents:
diff changeset
3251 signed int v13; // edx@9
Ritor1
parents:
diff changeset
3252 unsigned int v14; // eax@12
Ritor1
parents:
diff changeset
3253 char result; // al@12
Ritor1
parents:
diff changeset
3254
Ritor1
parents:
diff changeset
3255 if ( a2 <= -1 )
Ritor1
parents:
diff changeset
3256 goto LABEL_16;
Ritor1
parents:
diff changeset
3257 v2 = 0;
Ritor1
parents:
diff changeset
3258 v3 = 0;
Ritor1
parents:
diff changeset
3259 v4 = (char *)stru_505708[a1].arr_44;
Ritor1
parents:
diff changeset
3260 do
Ritor1
parents:
diff changeset
3261 {
Ritor1
parents:
diff changeset
3262 if ( *(unsigned int *)v4 != -1 )
Ritor1
parents:
diff changeset
3263 {
Ritor1
parents:
diff changeset
3264 if ( a2 == v2 )
Ritor1
parents:
diff changeset
3265 break;
Ritor1
parents:
diff changeset
3266 ++v2;
Ritor1
parents:
diff changeset
3267 }
Ritor1
parents:
diff changeset
3268 ++v3;
Ritor1
parents:
diff changeset
3269 v4 += 4;
Ritor1
parents:
diff changeset
3270 }
Ritor1
parents:
diff changeset
3271 while ( v3 < 10 );
Ritor1
parents:
diff changeset
3272 v5 = v3 + 47 * a1;
Ritor1
parents:
diff changeset
3273 v6 = 4 * v5 + 5265228;
Ritor1
parents:
diff changeset
3274 if ( BYTE3(pCards[stru_505708[0].arr_44[v5]].field_28) )
Ritor1
parents:
diff changeset
3275 {
Ritor1
parents:
diff changeset
3276 ArcomageGame::PlaySound(0x16u);
Ritor1
parents:
diff changeset
3277 v7 = amuint_4FAA6C;
Ritor1
parents:
diff changeset
3278 v8 = am_40BB49(amuint_4FAA6C);
Ritor1
parents:
diff changeset
3279 v9 = 188 * v7 + 8 * v3;
Ritor1
parents:
diff changeset
3280 v10 = 96 * v3 + *(int *)((char *)stru_505708[0].arr_6C[0] + v9) + (640 - 96 * v8) / (v8 + 1);
Ritor1
parents:
diff changeset
3281 v11 = *(int *)((char *)&stru_505708[0].arr_6C[0][1] + v9) + 327;
Ritor1
parents:
diff changeset
3282 amuint_4FAA5C_blt_xy[0] = v10;
Ritor1
parents:
diff changeset
3283 amuint_4FAA5C_blt_xy[1] = v11;
Ritor1
parents:
diff changeset
3284 v12 = 0;
Ritor1
parents:
diff changeset
3285 if ( !am_byte_4FAA75 )
Ritor1
parents:
diff changeset
3286 {
Ritor1
parents:
diff changeset
3287 v13 = (signed int)amuint_4FAA78;
Ritor1
parents:
diff changeset
3288 do
Ritor1
parents:
diff changeset
3289 {
Ritor1
parents:
diff changeset
3290 if ( *(unsigned int *)v13 == -1 )
Ritor1
parents:
diff changeset
3291 break;
Ritor1
parents:
diff changeset
3292 v13 += 32;
Ritor1
parents:
diff changeset
3293 ++v12;
Ritor1
parents:
diff changeset
3294 }
Ritor1
parents:
diff changeset
3295 while ( v13 < (signed int)&dword_4FABB8 );
Ritor1
parents:
diff changeset
3296 }
Ritor1
parents:
diff changeset
3297 pArcomageGame->field_F6 = 1;
Ritor1
parents:
diff changeset
3298 amuint_4FAA54_blt_xy[0] = (amuint_4FAA80[8 * v12] - v10) / 10;
Ritor1
parents:
diff changeset
3299 amuint_4FAA54_blt_xy[1] = (amuint_4FAA84[8 * v12] - 327) / 10;
Ritor1
parents:
diff changeset
3300 v14 = *(unsigned int *)v6;
Ritor1
parents:
diff changeset
3301 *(unsigned int *)v6 = -1;
Ritor1
parents:
diff changeset
3302 am_byte_4FAA77 = 0;
Ritor1
parents:
diff changeset
3303 uCardID = v14;
Ritor1
parents:
diff changeset
3304 result = 1;
Ritor1
parents:
diff changeset
3305 }
Ritor1
parents:
diff changeset
3306 else
Ritor1
parents:
diff changeset
3307 {
Ritor1
parents:
diff changeset
3308 LABEL_16:
Ritor1
parents:
diff changeset
3309 result = 0;
Ritor1
parents:
diff changeset
3310 }
Ritor1
parents:
diff changeset
3311 return result;
Ritor1
parents:
diff changeset
3312 }
Ritor1
parents:
diff changeset
3313 // 4FAA75: using guessed type char am_byte_4FAA75;
Ritor1
parents:
diff changeset
3314 // 4FAA77: using guessed type char am_byte_4FAA77;
Ritor1
parents:
diff changeset
3315 // 4FAA78: using guessed type int amuint_4FAA78[];
Ritor1
parents:
diff changeset
3316 // 4FAA80: using guessed type int amuint_4FAA80[];
Ritor1
parents:
diff changeset
3317 // 4FAA84: using guessed type int amuint_4FAA84[];
Ritor1
parents:
diff changeset
3318 // 4FABB8: using guessed type int dword_4FABB8;
Ritor1
parents:
diff changeset
3319
Ritor1
parents:
diff changeset
3320 //----- (0040BE0E) --------------------------------------------------------
Ritor1
parents:
diff changeset
3321 bool __fastcall am_40BE0E(int a1, signed int a2)
Ritor1
parents:
diff changeset
3322 {
Ritor1
parents:
diff changeset
3323 bool result; // eax@0
Ritor1
parents:
diff changeset
3324 int v3; // ebp@1
Ritor1
parents:
diff changeset
3325 int v4; // ecx@2
Ritor1
parents:
diff changeset
3326 ArcomageGame_stru0 *v5; // esi@2
Ritor1
parents:
diff changeset
3327 int v6; // edi@2
Ritor1
parents:
diff changeset
3328 int v7; // eax@2
Ritor1
parents:
diff changeset
3329 int v8; // ebx@8
Ritor1
parents:
diff changeset
3330 int v9; // eax@8
Ritor1
parents:
diff changeset
3331 int v10; // ebx@8
Ritor1
parents:
diff changeset
3332 int v11; // ebp@8
Ritor1
parents:
diff changeset
3333 int v12; // ecx@8
Ritor1
parents:
diff changeset
3334 int v13; // eax@8
Ritor1
parents:
diff changeset
3335 ArcomageCard *v14; // eax@8
Ritor1
parents:
diff changeset
3336 int v15; // ecx@8
Ritor1
parents:
diff changeset
3337 int v16; // ecx@8
Ritor1
parents:
diff changeset
3338
Ritor1
parents:
diff changeset
3339 v3 = a1;
Ritor1
parents:
diff changeset
3340 if ( a2 <= -1 )
Ritor1
parents:
diff changeset
3341 goto LABEL_12;
Ritor1
parents:
diff changeset
3342 v4 = 0;
Ritor1
parents:
diff changeset
3343 v5 = &stru_505708[v3];
Ritor1
parents:
diff changeset
3344 v6 = 0;
Ritor1
parents:
diff changeset
3345 v7 = (int)v5->arr_44;
Ritor1
parents:
diff changeset
3346 do
Ritor1
parents:
diff changeset
3347 {
Ritor1
parents:
diff changeset
3348 if ( *(unsigned int *)v7 != -1 )
Ritor1
parents:
diff changeset
3349 {
Ritor1
parents:
diff changeset
3350 if ( a2 == v4 )
Ritor1
parents:
diff changeset
3351 break;
Ritor1
parents:
diff changeset
3352 ++v4;
Ritor1
parents:
diff changeset
3353 }
Ritor1
parents:
diff changeset
3354 ++v6;
Ritor1
parents:
diff changeset
3355 v7 += 4;
Ritor1
parents:
diff changeset
3356 }
Ritor1
parents:
diff changeset
3357 while ( v6 < 10 );
Ritor1
parents:
diff changeset
3358 result = am_40BF15(v3, v6);
Ritor1
parents:
diff changeset
3359 if ( result )
Ritor1
parents:
diff changeset
3360 {
Ritor1
parents:
diff changeset
3361 ArcomageGame::PlaySound(0x17u);
Ritor1
parents:
diff changeset
3362 v8 = amuint_4FAA6C;
Ritor1
parents:
diff changeset
3363 v9 = am_40BB49(amuint_4FAA6C);
Ritor1
parents:
diff changeset
3364 v10 = 188 * v8 + 8 * v6;
Ritor1
parents:
diff changeset
3365 v11 = v6 + 47 * v3;
Ritor1
parents:
diff changeset
3366 amuint_4FAA54_blt_xy[1] = -30;
Ritor1
parents:
diff changeset
3367 pArcomageGame->field_F6 = 1;
Ritor1
parents:
diff changeset
3368 v12 = 96 * v6 + *(int *)((char *)stru_505708[0].arr_6C[0] + v10) + (640 - 96 * v9) / (v9 + 1);
Ritor1
parents:
diff changeset
3369 v13 = *(int *)((char *)&stru_505708[0].arr_6C[0][1] + v10) + 327;
Ritor1
parents:
diff changeset
3370 amuint_4FAA5C_blt_xy[0] = v12;
Ritor1
parents:
diff changeset
3371 amuint_4FAA5C_blt_xy[1] = v13;
Ritor1
parents:
diff changeset
3372 amuint_4FAA54_blt_xy[0] = (272 - v12) / 5;
Ritor1
parents:
diff changeset
3373 v14 = &pCards[v5->arr_44[v6]];
Ritor1
parents:
diff changeset
3374 v5->field_38 -= LOBYTE(v14->field_28);
Ritor1
parents:
diff changeset
3375 v15 = BYTE1(v14->field_28);
Ritor1
parents:
diff changeset
3376 v5->field_40 -= BYTE2(v14->field_28);
Ritor1
parents:
diff changeset
3377 v5->field_3C -= v15;
Ritor1
parents:
diff changeset
3378 result = 4 * v11 + 5265228;
Ritor1
parents:
diff changeset
3379 v16 = stru_505708[0].arr_44[v11];
Ritor1
parents:
diff changeset
3380 stru_505708[0].arr_44[v11] = -1;
Ritor1
parents:
diff changeset
3381 amuint_4FABC0 = v16;
Ritor1
parents:
diff changeset
3382 LOBYTE(result) = 1;
Ritor1
parents:
diff changeset
3383 }
Ritor1
parents:
diff changeset
3384 else
Ritor1
parents:
diff changeset
3385 {
Ritor1
parents:
diff changeset
3386 LABEL_12:
Ritor1
parents:
diff changeset
3387 LOBYTE(result) = 0;
Ritor1
parents:
diff changeset
3388 }
Ritor1
parents:
diff changeset
3389 return result;
Ritor1
parents:
diff changeset
3390 }
Ritor1
parents:
diff changeset
3391
Ritor1
parents:
diff changeset
3392 //----- (0040BF15) --------------------------------------------------------
Ritor1
parents:
diff changeset
3393 bool __fastcall am_40BF15(int a1, int a2)
Ritor1
parents:
diff changeset
3394 {
Ritor1
parents:
diff changeset
3395 ArcomageGame_stru0 *v2; // esi@1
Ritor1
parents:
diff changeset
3396 bool result; // eax@1
Ritor1
parents:
diff changeset
3397 ArcomageCard *v4; // ecx@1
Ritor1
parents:
diff changeset
3398
Ritor1
parents:
diff changeset
3399 v2 = &stru_505708[a1];
Ritor1
parents:
diff changeset
3400 LOBYTE(result) = 1;
Ritor1
parents:
diff changeset
3401 v4 = &pCards[v2->arr_44[a2]];
Ritor1
parents:
diff changeset
3402 if ( SBYTE1(v4->field_24) > v2->field_2C )
Ritor1
parents:
diff changeset
3403 LOBYTE(result) = 0;
Ritor1
parents:
diff changeset
3404 if ( SBYTE2(v4->field_24) > v2->field_30 )
Ritor1
parents:
diff changeset
3405 LOBYTE(result) = 0;
Ritor1
parents:
diff changeset
3406 if ( SBYTE3(v4->field_24) > v2->field_34 )
Ritor1
parents:
diff changeset
3407 LOBYTE(result) = 0;
Ritor1
parents:
diff changeset
3408 if ( SLOBYTE(v4->field_28) > v2->field_38 )
Ritor1
parents:
diff changeset
3409 LOBYTE(result) = 0;
Ritor1
parents:
diff changeset
3410 if ( SBYTE1(v4->field_28) > v2->field_3C )
Ritor1
parents:
diff changeset
3411 LOBYTE(result) = 0;
Ritor1
parents:
diff changeset
3412 if ( SBYTE2(v4->field_28) > v2->field_40 )
Ritor1
parents:
diff changeset
3413 LOBYTE(result) = 0;
Ritor1
parents:
diff changeset
3414 return result;
Ritor1
parents:
diff changeset
3415 }
Ritor1
parents:
diff changeset
3416
Ritor1
parents:
diff changeset
3417
Ritor1
parents:
diff changeset
3418
Ritor1
parents:
diff changeset
3419
Ritor1
parents:
diff changeset
3420 //----- (0040BF77) --------------------------------------------------------
Ritor1
parents:
diff changeset
3421 void __fastcall am_40BF77(int a1, unsigned int uCardID)
Ritor1
parents:
diff changeset
3422 {
Ritor1
parents:
diff changeset
3423 ArcomageGame_stru0 *v2; // esi@1
Ritor1
parents:
diff changeset
3424 int v3; // eax@1
Ritor1
parents:
diff changeset
3425 ArcomageGame_stru0 *v4; // edi@1
Ritor1
parents:
diff changeset
3426 int v5; // eax@2
Ritor1
parents:
diff changeset
3427 char v6; // sf@2
Ritor1
parents:
diff changeset
3428 unsigned __int8 v7; // of@2
Ritor1
parents:
diff changeset
3429 int v8; // eax@3
Ritor1
parents:
diff changeset
3430 int v9; // eax@4
Ritor1
parents:
diff changeset
3431 char v10; // zf@5
Ritor1
parents:
diff changeset
3432 int v11; // eax@8
Ritor1
parents:
diff changeset
3433 unsigned __int8 v12; // zf@8
Ritor1
parents:
diff changeset
3434 char v13; // sf@8
Ritor1
parents:
diff changeset
3435 unsigned __int8 v14; // of@8
Ritor1
parents:
diff changeset
3436 int v15; // eax@9
Ritor1
parents:
diff changeset
3437 int v16; // eax@10
Ritor1
parents:
diff changeset
3438 char v17; // zf@12
Ritor1
parents:
diff changeset
3439 char v18; // al@15
Ritor1
parents:
diff changeset
3440 int v19; // eax@16
Ritor1
parents:
diff changeset
3441 int v20; // eax@17
Ritor1
parents:
diff changeset
3442 int v21; // eax@22
Ritor1
parents:
diff changeset
3443 int v22; // eax@23
Ritor1
parents:
diff changeset
3444 int v23; // eax@26
Ritor1
parents:
diff changeset
3445 int v24; // edx@26
Ritor1
parents:
diff changeset
3446 signed int v25; // ebx@26
Ritor1
parents:
diff changeset
3447 ArcomageCard *v26; // ebx@28
Ritor1
parents:
diff changeset
3448 int v27; // eax@28
Ritor1
parents:
diff changeset
3449 int v28; // edx@33
Ritor1
parents:
diff changeset
3450 int v29; // eax@33
Ritor1
parents:
diff changeset
3451 int v30; // eax@35
Ritor1
parents:
diff changeset
3452 int v31; // edx@40
Ritor1
parents:
diff changeset
3453 int v32; // eax@40
Ritor1
parents:
diff changeset
3454 int v33; // eax@42
Ritor1
parents:
diff changeset
3455 int v34; // edx@47
Ritor1
parents:
diff changeset
3456 int v35; // eax@47
Ritor1
parents:
diff changeset
3457 int v36; // eax@49
Ritor1
parents:
diff changeset
3458 int v37; // edx@54
Ritor1
parents:
diff changeset
3459 int v38; // eax@54
Ritor1
parents:
diff changeset
3460 bool v39; // eax@56
Ritor1
parents:
diff changeset
3461 int v40; // edx@61
Ritor1
parents:
diff changeset
3462 int v41; // eax@61
Ritor1
parents:
diff changeset
3463 int v42; // eax@63
Ritor1
parents:
diff changeset
3464 int v43; // edx@68
Ritor1
parents:
diff changeset
3465 int v44; // eax@68
Ritor1
parents:
diff changeset
3466 char v45; // al@70
Ritor1
parents:
diff changeset
3467 int v46; // eax@72
Ritor1
parents:
diff changeset
3468 int v47; // edx@77
Ritor1
parents:
diff changeset
3469 int v48; // eax@77
Ritor1
parents:
diff changeset
3470 int v49; // eax@79
Ritor1
parents:
diff changeset
3471 int v50; // edx@84
Ritor1
parents:
diff changeset
3472 int v51; // eax@84
Ritor1
parents:
diff changeset
3473 int v52; // eax@86
Ritor1
parents:
diff changeset
3474 int v53; // eax@91
Ritor1
parents:
diff changeset
3475 int v54; // edx@91
Ritor1
parents:
diff changeset
3476 int v55; // eax@93
Ritor1
parents:
diff changeset
3477 int v56; // eax@98
Ritor1
parents:
diff changeset
3478 int v57; // edx@98
Ritor1
parents:
diff changeset
3479 int v58; // eax@100
Ritor1
parents:
diff changeset
3480 int v59; // eax@105
Ritor1
parents:
diff changeset
3481 int v60; // edx@105
Ritor1
parents:
diff changeset
3482 int v61; // eax@107
Ritor1
parents:
diff changeset
3483 int v62; // eax@112
Ritor1
parents:
diff changeset
3484 int v63; // edx@112
Ritor1
parents:
diff changeset
3485 int v64; // eax@114
Ritor1
parents:
diff changeset
3486 int v65; // eax@119
Ritor1
parents:
diff changeset
3487 int v66; // edx@119
Ritor1
parents:
diff changeset
3488 int v67; // eax@121
Ritor1
parents:
diff changeset
3489 int v68; // eax@126
Ritor1
parents:
diff changeset
3490 int v69; // edx@126
Ritor1
parents:
diff changeset
3491 char v70; // al@128
Ritor1
parents:
diff changeset
3492 int v71; // eax@130
Ritor1
parents:
diff changeset
3493 int v72; // eax@135
Ritor1
parents:
diff changeset
3494 int v73; // edx@135
Ritor1
parents:
diff changeset
3495 int v74; // eax@137
Ritor1
parents:
diff changeset
3496 int v75; // eax@142
Ritor1
parents:
diff changeset
3497 int v76; // edx@142
Ritor1
parents:
diff changeset
3498 int v77; // eax@144
Ritor1
parents:
diff changeset
3499 int v78; // eax@151
Ritor1
parents:
diff changeset
3500 int v79; // ecx@151
Ritor1
parents:
diff changeset
3501 int v80; // eax@155
Ritor1
parents:
diff changeset
3502 int v81; // eax@162
Ritor1
parents:
diff changeset
3503 int v82; // ecx@162
Ritor1
parents:
diff changeset
3504 int v83; // eax@166
Ritor1
parents:
diff changeset
3505 int v84; // eax@173
Ritor1
parents:
diff changeset
3506 int v85; // ecx@173
Ritor1
parents:
diff changeset
3507 int v86; // eax@177
Ritor1
parents:
diff changeset
3508 int v87; // eax@184
Ritor1
parents:
diff changeset
3509 int v88; // ecx@184
Ritor1
parents:
diff changeset
3510 bool v89; // eax@188
Ritor1
parents:
diff changeset
3511 int v90; // eax@195
Ritor1
parents:
diff changeset
3512 int v91; // ecx@195
Ritor1
parents:
diff changeset
3513 int v92; // eax@199
Ritor1
parents:
diff changeset
3514 int v93; // eax@206
Ritor1
parents:
diff changeset
3515 int v94; // ecx@206
Ritor1
parents:
diff changeset
3516 char v95; // al@210
Ritor1
parents:
diff changeset
3517 int v96; // eax@211
Ritor1
parents:
diff changeset
3518 int v97; // edx@211
Ritor1
parents:
diff changeset
3519 int v98; // eax@211
Ritor1
parents:
diff changeset
3520 int v99; // eax@211
Ritor1
parents:
diff changeset
3521 int v100; // eax@212
Ritor1
parents:
diff changeset
3522 int v101; // eax@219
Ritor1
parents:
diff changeset
3523 int v102; // ecx@219
Ritor1
parents:
diff changeset
3524 int v103; // eax@223
Ritor1
parents:
diff changeset
3525 int v104; // eax@231
Ritor1
parents:
diff changeset
3526 int v105; // edx@231
Ritor1
parents:
diff changeset
3527 signed int v106; // ebx@231
Ritor1
parents:
diff changeset
3528 ArcomageCard *v107; // ebx@233
Ritor1
parents:
diff changeset
3529 int v108; // eax@233
Ritor1
parents:
diff changeset
3530 int v109; // edx@238
Ritor1
parents:
diff changeset
3531 int v110; // eax@238
Ritor1
parents:
diff changeset
3532 int v111; // eax@240
Ritor1
parents:
diff changeset
3533 int v112; // edx@245
Ritor1
parents:
diff changeset
3534 int v113; // eax@245
Ritor1
parents:
diff changeset
3535 int v114; // eax@247
Ritor1
parents:
diff changeset
3536 int v115; // edx@252
Ritor1
parents:
diff changeset
3537 int v116; // eax@252
Ritor1
parents:
diff changeset
3538 int v117; // eax@254
Ritor1
parents:
diff changeset
3539 int v118; // edx@259
Ritor1
parents:
diff changeset
3540 int v119; // eax@259
Ritor1
parents:
diff changeset
3541 bool v120; // eax@261
Ritor1
parents:
diff changeset
3542 int v121; // edx@266
Ritor1
parents:
diff changeset
3543 int v122; // eax@266
Ritor1
parents:
diff changeset
3544 int v123; // eax@268
Ritor1
parents:
diff changeset
3545 int v124; // edx@273
Ritor1
parents:
diff changeset
3546 int v125; // eax@273
Ritor1
parents:
diff changeset
3547 char v126; // al@275
Ritor1
parents:
diff changeset
3548 int v127; // eax@277
Ritor1
parents:
diff changeset
3549 int v128; // edx@282
Ritor1
parents:
diff changeset
3550 int v129; // eax@282
Ritor1
parents:
diff changeset
3551 int v130; // eax@284
Ritor1
parents:
diff changeset
3552 int v131; // edx@289
Ritor1
parents:
diff changeset
3553 int v132; // eax@289
Ritor1
parents:
diff changeset
3554 int v133; // eax@291
Ritor1
parents:
diff changeset
3555 int v134; // eax@296
Ritor1
parents:
diff changeset
3556 int v135; // edx@296
Ritor1
parents:
diff changeset
3557 int v136; // eax@298
Ritor1
parents:
diff changeset
3558 int v137; // eax@303
Ritor1
parents:
diff changeset
3559 int v138; // edx@303
Ritor1
parents:
diff changeset
3560 int v139; // eax@305
Ritor1
parents:
diff changeset
3561 int v140; // eax@310
Ritor1
parents:
diff changeset
3562 int v141; // edx@310
Ritor1
parents:
diff changeset
3563 int v142; // eax@312
Ritor1
parents:
diff changeset
3564 int v143; // eax@317
Ritor1
parents:
diff changeset
3565 int v144; // edx@317
Ritor1
parents:
diff changeset
3566 int v145; // eax@319
Ritor1
parents:
diff changeset
3567 int v146; // eax@324
Ritor1
parents:
diff changeset
3568 int v147; // edx@324
Ritor1
parents:
diff changeset
3569 int v148; // eax@326
Ritor1
parents:
diff changeset
3570 int v149; // eax@331
Ritor1
parents:
diff changeset
3571 int v150; // edx@331
Ritor1
parents:
diff changeset
3572 char v151; // al@333
Ritor1
parents:
diff changeset
3573 int v152; // eax@335
Ritor1
parents:
diff changeset
3574 int v153; // eax@340
Ritor1
parents:
diff changeset
3575 int v154; // edx@340
Ritor1
parents:
diff changeset
3576 int v155; // eax@342
Ritor1
parents:
diff changeset
3577 int v156; // eax@347
Ritor1
parents:
diff changeset
3578 int v157; // edx@347
Ritor1
parents:
diff changeset
3579 int v158; // eax@349
Ritor1
parents:
diff changeset
3580 int v159; // eax@356
Ritor1
parents:
diff changeset
3581 int v160; // ecx@356
Ritor1
parents:
diff changeset
3582 int v161; // eax@360
Ritor1
parents:
diff changeset
3583 int v162; // eax@367
Ritor1
parents:
diff changeset
3584 int v163; // ecx@367
Ritor1
parents:
diff changeset
3585 int v164; // eax@371
Ritor1
parents:
diff changeset
3586 int v165; // eax@378
Ritor1
parents:
diff changeset
3587 int v166; // ecx@378
Ritor1
parents:
diff changeset
3588 int v167; // eax@382
Ritor1
parents:
diff changeset
3589 int v168; // eax@389
Ritor1
parents:
diff changeset
3590 int v169; // ecx@389
Ritor1
parents:
diff changeset
3591 bool v170; // eax@393
Ritor1
parents:
diff changeset
3592 int v171; // eax@400
Ritor1
parents:
diff changeset
3593 int v172; // ecx@400
Ritor1
parents:
diff changeset
3594 int v173; // eax@404
Ritor1
parents:
diff changeset
3595 int v174; // eax@411
Ritor1
parents:
diff changeset
3596 int v175; // ecx@411
Ritor1
parents:
diff changeset
3597 char v176; // al@415
Ritor1
parents:
diff changeset
3598 int v177; // eax@416
Ritor1
parents:
diff changeset
3599 int v178; // edx@416
Ritor1
parents:
diff changeset
3600 int v179; // eax@416
Ritor1
parents:
diff changeset
3601 int v180; // eax@416
Ritor1
parents:
diff changeset
3602 int v181; // eax@417
Ritor1
parents:
diff changeset
3603 int v182; // eax@424
Ritor1
parents:
diff changeset
3604 int v183; // ecx@424
Ritor1
parents:
diff changeset
3605 int v184; // eax@429
Ritor1
parents:
diff changeset
3606 int v185; // ecx@429
Ritor1
parents:
diff changeset
3607 signed int v186; // esi@511
Ritor1
parents:
diff changeset
3608 Vec2_int_ v187; // [sp+Ch] [bp-64h]@488
Ritor1
parents:
diff changeset
3609 //int v188; // [sp+10h] [bp-60h]@488
Ritor1
parents:
diff changeset
3610 int v189; // [sp+14h] [bp-5Ch]@1
Ritor1
parents:
diff changeset
3611 ArcomageCard *pCard; // [sp+18h] [bp-58h]@1
Ritor1
parents:
diff changeset
3612 int v191; // [sp+1Ch] [bp-54h]@1
Ritor1
parents:
diff changeset
3613 int v192; // [sp+20h] [bp-50h]@1
Ritor1
parents:
diff changeset
3614 int v193; // [sp+24h] [bp-4Ch]@1
Ritor1
parents:
diff changeset
3615 int v194; // [sp+28h] [bp-48h]@1
Ritor1
parents:
diff changeset
3616 int v195; // [sp+2Ch] [bp-44h]@1
Ritor1
parents:
diff changeset
3617 int v196; // [sp+30h] [bp-40h]@1
Ritor1
parents:
diff changeset
3618 int v197; // [sp+34h] [bp-3Ch]@1
Ritor1
parents:
diff changeset
3619 int v198; // [sp+38h] [bp-38h]@1
Ritor1
parents:
diff changeset
3620 int v199; // [sp+3Ch] [bp-34h]@1
Ritor1
parents:
diff changeset
3621 int v200; // [sp+40h] [bp-30h]@1
Ritor1
parents:
diff changeset
3622 int v201; // [sp+44h] [bp-2Ch]@1
Ritor1
parents:
diff changeset
3623 int v202; // [sp+48h] [bp-28h]@1
Ritor1
parents:
diff changeset
3624 int v203; // [sp+4Ch] [bp-24h]@1
Ritor1
parents:
diff changeset
3625 int v204; // [sp+50h] [bp-20h]@1
Ritor1
parents:
diff changeset
3626 bool v205; // [sp+54h] [bp-1Ch]@1
Ritor1
parents:
diff changeset
3627 int v206; // [sp+58h] [bp-18h]@1
Ritor1
parents:
diff changeset
3628 int v207; // [sp+5Ch] [bp-14h]@1
Ritor1
parents:
diff changeset
3629 int v208; // [sp+60h] [bp-10h]@1
Ritor1
parents:
diff changeset
3630 int v209; // [sp+64h] [bp-Ch]@1
Ritor1
parents:
diff changeset
3631 int v210; // [sp+68h] [bp-8h]@1
Ritor1
parents:
diff changeset
3632 int v211; // [sp+6Ch] [bp-4h]@1
Ritor1
parents:
diff changeset
3633
Ritor1
parents:
diff changeset
3634 v194 = 0;
Ritor1
parents:
diff changeset
3635 v210 = 0;
Ritor1
parents:
diff changeset
3636 v208 = 0;
Ritor1
parents:
diff changeset
3637 v197 = 0;
Ritor1
parents:
diff changeset
3638 v205 = 0;
Ritor1
parents:
diff changeset
3639 v203 = 0;
Ritor1
parents:
diff changeset
3640 v201 = 0;
Ritor1
parents:
diff changeset
3641 v199 = 0;
Ritor1
parents:
diff changeset
3642 v192 = 0;
Ritor1
parents:
diff changeset
3643 v196 = 0;
Ritor1
parents:
diff changeset
3644 v211 = 0;
Ritor1
parents:
diff changeset
3645 v209 = 0;
Ritor1
parents:
diff changeset
3646 v207 = 0;
Ritor1
parents:
diff changeset
3647 v206 = 0;
Ritor1
parents:
diff changeset
3648 v204 = 0;
Ritor1
parents:
diff changeset
3649 v202 = 0;
Ritor1
parents:
diff changeset
3650 v200 = 0;
Ritor1
parents:
diff changeset
3651 v198 = 0;
Ritor1
parents:
diff changeset
3652 v191 = 0;
Ritor1
parents:
diff changeset
3653 v195 = 0;
Ritor1
parents:
diff changeset
3654 v193 = a1;
Ritor1
parents:
diff changeset
3655 v2 = &stru_505708[a1];
Ritor1
parents:
diff changeset
3656 pCard = &pCards[uCardID];
Ritor1
parents:
diff changeset
3657 v3 = pCard->field_2C;
Ritor1
parents:
diff changeset
3658 v189 = (a1 + 1) % 2;
Ritor1
parents:
diff changeset
3659 v4 = &stru_505708[v189];
Ritor1
parents:
diff changeset
3660 switch ( v3 )
Ritor1
parents:
diff changeset
3661 {
Ritor1
parents:
diff changeset
3662 case 2:
Ritor1
parents:
diff changeset
3663 v5 = v2->field_2C;
Ritor1
parents:
diff changeset
3664 v7 = __OFSUB__(v5, v4->field_2C);
Ritor1
parents:
diff changeset
3665 v6 = v5 - v4->field_2C < 0;
Ritor1
parents:
diff changeset
3666 goto LABEL_18;
Ritor1
parents:
diff changeset
3667 case 3:
Ritor1
parents:
diff changeset
3668 v8 = v2->field_30;
Ritor1
parents:
diff changeset
3669 v7 = __OFSUB__(v8, v4->field_30);
Ritor1
parents:
diff changeset
3670 v6 = v8 - v4->field_30 < 0;
Ritor1
parents:
diff changeset
3671 goto LABEL_18;
Ritor1
parents:
diff changeset
3672 case 4:
Ritor1
parents:
diff changeset
3673 v9 = v2->field_34;
Ritor1
parents:
diff changeset
3674 v7 = __OFSUB__(v9, v4->field_34);
Ritor1
parents:
diff changeset
3675 v6 = v9 - v4->field_34 < 0;
Ritor1
parents:
diff changeset
3676 goto LABEL_18;
Ritor1
parents:
diff changeset
3677 case 5:
Ritor1
parents:
diff changeset
3678 v10 = v2->field_2C == v4->field_2C;
Ritor1
parents:
diff changeset
3679 goto LABEL_21;
Ritor1
parents:
diff changeset
3680 case 6:
Ritor1
parents:
diff changeset
3681 v10 = v2->field_30 == v4->field_30;
Ritor1
parents:
diff changeset
3682 goto LABEL_21;
Ritor1
parents:
diff changeset
3683 case 7:
Ritor1
parents:
diff changeset
3684 v10 = v2->field_34 == v4->field_34;
Ritor1
parents:
diff changeset
3685 goto LABEL_21;
Ritor1
parents:
diff changeset
3686 case 8:
Ritor1
parents:
diff changeset
3687 v11 = v2->field_2C;
Ritor1
parents:
diff changeset
3688 v14 = __OFSUB__(v11, v4->field_2C);
Ritor1
parents:
diff changeset
3689 v12 = v11 == v4->field_2C;
Ritor1
parents:
diff changeset
3690 v13 = v11 - v4->field_2C < 0;
Ritor1
parents:
diff changeset
3691 goto LABEL_24;
Ritor1
parents:
diff changeset
3692 case 9:
Ritor1
parents:
diff changeset
3693 v15 = v2->field_30;
Ritor1
parents:
diff changeset
3694 v14 = __OFSUB__(v15, v4->field_30);
Ritor1
parents:
diff changeset
3695 v12 = v15 == v4->field_30;
Ritor1
parents:
diff changeset
3696 v13 = v15 - v4->field_30 < 0;
Ritor1
parents:
diff changeset
3697 goto LABEL_24;
Ritor1
parents:
diff changeset
3698 case 10:
Ritor1
parents:
diff changeset
3699 v16 = v2->field_34;
Ritor1
parents:
diff changeset
3700 v14 = __OFSUB__(v16, v4->field_34);
Ritor1
parents:
diff changeset
3701 v12 = v16 == v4->field_34;
Ritor1
parents:
diff changeset
3702 v13 = v16 - v4->field_34 < 0;
Ritor1
parents:
diff changeset
3703 goto LABEL_24;
Ritor1
parents:
diff changeset
3704 case 11:
Ritor1
parents:
diff changeset
3705 v10 = v2->field_28 == 0;
Ritor1
parents:
diff changeset
3706 goto LABEL_21;
Ritor1
parents:
diff changeset
3707 case 12:
Ritor1
parents:
diff changeset
3708 v17 = v2->field_28 == 0;
Ritor1
parents:
diff changeset
3709 goto LABEL_15;
Ritor1
parents:
diff changeset
3710 case 13:
Ritor1
parents:
diff changeset
3711 v10 = v4->field_28 == 0;
Ritor1
parents:
diff changeset
3712 goto LABEL_21;
Ritor1
parents:
diff changeset
3713 case 14:
Ritor1
parents:
diff changeset
3714 v17 = v4->field_28 == 0;
Ritor1
parents:
diff changeset
3715 LABEL_15:
Ritor1
parents:
diff changeset
3716 v18 = !v17;
Ritor1
parents:
diff changeset
3717 goto LABEL_25;
Ritor1
parents:
diff changeset
3718 case 15:
Ritor1
parents:
diff changeset
3719 v19 = v2->field_28;
Ritor1
parents:
diff changeset
3720 v7 = __OFSUB__(v19, v4->field_28);
Ritor1
parents:
diff changeset
3721 v6 = v19 - v4->field_28 < 0;
Ritor1
parents:
diff changeset
3722 goto LABEL_18;
Ritor1
parents:
diff changeset
3723 case 16:
Ritor1
parents:
diff changeset
3724 v20 = v2->field_24;
Ritor1
parents:
diff changeset
3725 v7 = __OFSUB__(v20, v4->field_24);
Ritor1
parents:
diff changeset
3726 v6 = v20 - v4->field_24 < 0;
Ritor1
parents:
diff changeset
3727 LABEL_18:
Ritor1
parents:
diff changeset
3728 v18 = v6 ^ v7;
Ritor1
parents:
diff changeset
3729 goto LABEL_25;
Ritor1
parents:
diff changeset
3730 case 17:
Ritor1
parents:
diff changeset
3731 v10 = v2->field_28 == v4->field_28;
Ritor1
parents:
diff changeset
3732 goto LABEL_21;
Ritor1
parents:
diff changeset
3733 case 18:
Ritor1
parents:
diff changeset
3734 v10 = v2->field_24 == v4->field_24;
Ritor1
parents:
diff changeset
3735 LABEL_21:
Ritor1
parents:
diff changeset
3736 v18 = v10;
Ritor1
parents:
diff changeset
3737 goto LABEL_25;
Ritor1
parents:
diff changeset
3738 case 19:
Ritor1
parents:
diff changeset
3739 v21 = v2->field_28;
Ritor1
parents:
diff changeset
3740 v14 = __OFSUB__(v21, v4->field_28);
Ritor1
parents:
diff changeset
3741 v12 = v21 == v4->field_28;
Ritor1
parents:
diff changeset
3742 v13 = v21 - v4->field_28 < 0;
Ritor1
parents:
diff changeset
3743 goto LABEL_24;
Ritor1
parents:
diff changeset
3744 case 20:
Ritor1
parents:
diff changeset
3745 v22 = v2->field_24;
Ritor1
parents:
diff changeset
3746 v14 = __OFSUB__(v22, v4->field_24);
Ritor1
parents:
diff changeset
3747 v12 = v22 == v4->field_24;
Ritor1
parents:
diff changeset
3748 v13 = v22 - v4->field_24 < 0;
Ritor1
parents:
diff changeset
3749 LABEL_24:
Ritor1
parents:
diff changeset
3750 v18 = !((unsigned __int8)(v13 ^ v14) | v12);
Ritor1
parents:
diff changeset
3751 LABEL_25:
Ritor1
parents:
diff changeset
3752 if ( v18 )
Ritor1
parents:
diff changeset
3753 goto LABEL_26;
Ritor1
parents:
diff changeset
3754 goto LABEL_231;
Ritor1
parents:
diff changeset
3755 default:
Ritor1
parents:
diff changeset
3756 LABEL_26:
Ritor1
parents:
diff changeset
3757 v23 = BYTE1(pCard->field_30);
Ritor1
parents:
diff changeset
3758 v24 = v23 + (LOBYTE(pCard->field_30) == 1);
Ritor1
parents:
diff changeset
3759 v25 = 0;
Ritor1
parents:
diff changeset
3760 dword_4FAA68 = v23 + (LOBYTE(pCard->field_30) == 1);
Ritor1
parents:
diff changeset
3761 dword_4FAA64 = v23;
Ritor1
parents:
diff changeset
3762 if ( v23 > 0 )
Ritor1
parents:
diff changeset
3763 {
Ritor1
parents:
diff changeset
3764 do
Ritor1
parents:
diff changeset
3765 {
Ritor1
parents:
diff changeset
3766 am_40A283(v193, v24);
Ritor1
parents:
diff changeset
3767 ++v25;
Ritor1
parents:
diff changeset
3768 }
Ritor1
parents:
diff changeset
3769 while ( v25 < SBYTE1(pCard->field_30) );
Ritor1
parents:
diff changeset
3770 }
Ritor1
parents:
diff changeset
3771 v26 = pCard;
Ritor1
parents:
diff changeset
3772 am_byte_4FAA77 = am_40BB49(v193) > dword_4E1874;
Ritor1
parents:
diff changeset
3773 LOBYTE(v27) = BYTE2(pCard->field_30);
Ritor1
parents:
diff changeset
3774 if ( (_BYTE)v27 )
Ritor1
parents:
diff changeset
3775 {
Ritor1
parents:
diff changeset
3776 if ( (_BYTE)v27 == 99 )
Ritor1
parents:
diff changeset
3777 {
Ritor1
parents:
diff changeset
3778 v28 = v2->field_2C;
Ritor1
parents:
diff changeset
3779 v29 = v4->field_2C;
Ritor1
parents:
diff changeset
3780 if ( v28 < v29 )
Ritor1
parents:
diff changeset
3781 {
Ritor1
parents:
diff changeset
3782 v2->field_2C = v29;
Ritor1
parents:
diff changeset
3783 v194 = v29 - v28;
Ritor1
parents:
diff changeset
3784 }
Ritor1
parents:
diff changeset
3785 }
Ritor1
parents:
diff changeset
3786 else
Ritor1
parents:
diff changeset
3787 {
Ritor1
parents:
diff changeset
3788 v27 = (char)v27;
Ritor1
parents:
diff changeset
3789 v6 = (char)v27 + v2->field_2C < 0;
Ritor1
parents:
diff changeset
3790 v2->field_2C += (char)v27;
Ritor1
parents:
diff changeset
3791 if ( v6 )
Ritor1
parents:
diff changeset
3792 v2->field_2C = 0;
Ritor1
parents:
diff changeset
3793 v194 = v27;
Ritor1
parents:
diff changeset
3794 }
Ritor1
parents:
diff changeset
3795 }
Ritor1
parents:
diff changeset
3796 LOBYTE(v30) = BYTE3(v26->field_30);
Ritor1
parents:
diff changeset
3797 if ( (_BYTE)v30 )
Ritor1
parents:
diff changeset
3798 {
Ritor1
parents:
diff changeset
3799 if ( (_BYTE)v30 == 99 )
Ritor1
parents:
diff changeset
3800 {
Ritor1
parents:
diff changeset
3801 v31 = v2->field_30;
Ritor1
parents:
diff changeset
3802 v32 = v4->field_30;
Ritor1
parents:
diff changeset
3803 if ( v31 < v32 )
Ritor1
parents:
diff changeset
3804 {
Ritor1
parents:
diff changeset
3805 v2->field_30 = v32;
Ritor1
parents:
diff changeset
3806 v210 = v32 - v31;
Ritor1
parents:
diff changeset
3807 }
Ritor1
parents:
diff changeset
3808 }
Ritor1
parents:
diff changeset
3809 else
Ritor1
parents:
diff changeset
3810 {
Ritor1
parents:
diff changeset
3811 v30 = (char)v30;
Ritor1
parents:
diff changeset
3812 v6 = (char)v30 + v2->field_30 < 0;
Ritor1
parents:
diff changeset
3813 v2->field_30 += (char)v30;
Ritor1
parents:
diff changeset
3814 if ( v6 )
Ritor1
parents:
diff changeset
3815 v2->field_30 = 0;
Ritor1
parents:
diff changeset
3816 v210 = v30;
Ritor1
parents:
diff changeset
3817 }
Ritor1
parents:
diff changeset
3818 }
Ritor1
parents:
diff changeset
3819 LOBYTE(v33) = LOBYTE(v26->field_34);
Ritor1
parents:
diff changeset
3820 if ( (_BYTE)v33 )
Ritor1
parents:
diff changeset
3821 {
Ritor1
parents:
diff changeset
3822 if ( (_BYTE)v33 == 99 )
Ritor1
parents:
diff changeset
3823 {
Ritor1
parents:
diff changeset
3824 v34 = v2->field_34;
Ritor1
parents:
diff changeset
3825 v35 = v4->field_34;
Ritor1
parents:
diff changeset
3826 if ( v34 < v35 )
Ritor1
parents:
diff changeset
3827 {
Ritor1
parents:
diff changeset
3828 v2->field_34 = v35;
Ritor1
parents:
diff changeset
3829 v208 = v35 - v34;
Ritor1
parents:
diff changeset
3830 }
Ritor1
parents:
diff changeset
3831 }
Ritor1
parents:
diff changeset
3832 else
Ritor1
parents:
diff changeset
3833 {
Ritor1
parents:
diff changeset
3834 v33 = (char)v33;
Ritor1
parents:
diff changeset
3835 v6 = (char)v33 + v2->field_34 < 0;
Ritor1
parents:
diff changeset
3836 v2->field_34 += (char)v33;
Ritor1
parents:
diff changeset
3837 if ( v6 )
Ritor1
parents:
diff changeset
3838 v2->field_34 = 0;
Ritor1
parents:
diff changeset
3839 v208 = v33;
Ritor1
parents:
diff changeset
3840 }
Ritor1
parents:
diff changeset
3841 }
Ritor1
parents:
diff changeset
3842 LOBYTE(v36) = BYTE1(v26->field_34);
Ritor1
parents:
diff changeset
3843 if ( (_BYTE)v36 )
Ritor1
parents:
diff changeset
3844 {
Ritor1
parents:
diff changeset
3845 if ( (_BYTE)v36 == 99 )
Ritor1
parents:
diff changeset
3846 {
Ritor1
parents:
diff changeset
3847 v37 = v2->field_38;
Ritor1
parents:
diff changeset
3848 v38 = v4->field_38;
Ritor1
parents:
diff changeset
3849 if ( v37 < v38 )
Ritor1
parents:
diff changeset
3850 {
Ritor1
parents:
diff changeset
3851 v2->field_38 = v38;
Ritor1
parents:
diff changeset
3852 v197 = v38 - v37;
Ritor1
parents:
diff changeset
3853 }
Ritor1
parents:
diff changeset
3854 }
Ritor1
parents:
diff changeset
3855 else
Ritor1
parents:
diff changeset
3856 {
Ritor1
parents:
diff changeset
3857 v36 = (char)v36;
Ritor1
parents:
diff changeset
3858 v6 = (char)v36 + v2->field_38 < 0;
Ritor1
parents:
diff changeset
3859 v2->field_38 += (char)v36;
Ritor1
parents:
diff changeset
3860 if ( v6 )
Ritor1
parents:
diff changeset
3861 v2->field_38 = 0;
Ritor1
parents:
diff changeset
3862 v197 = v36;
Ritor1
parents:
diff changeset
3863 }
Ritor1
parents:
diff changeset
3864 }
Ritor1
parents:
diff changeset
3865 LOBYTE(v39) = BYTE2(v26->field_34);
Ritor1
parents:
diff changeset
3866 if ( v39 )
Ritor1
parents:
diff changeset
3867 {
Ritor1
parents:
diff changeset
3868 if ( v39 == 99 )
Ritor1
parents:
diff changeset
3869 {
Ritor1
parents:
diff changeset
3870 v40 = v2->field_3C;
Ritor1
parents:
diff changeset
3871 v41 = v4->field_3C;
Ritor1
parents:
diff changeset
3872 if ( v40 < v41 )
Ritor1
parents:
diff changeset
3873 {
Ritor1
parents:
diff changeset
3874 v2->field_3C = v41;
Ritor1
parents:
diff changeset
3875 v205 = v41 - v40;
Ritor1
parents:
diff changeset
3876 }
Ritor1
parents:
diff changeset
3877 }
Ritor1
parents:
diff changeset
3878 else
Ritor1
parents:
diff changeset
3879 {
Ritor1
parents:
diff changeset
3880 v39 = v39;
Ritor1
parents:
diff changeset
3881 v6 = v39 + v2->field_3C < 0;
Ritor1
parents:
diff changeset
3882 v2->field_3C += v39;
Ritor1
parents:
diff changeset
3883 if ( v6 )
Ritor1
parents:
diff changeset
3884 v2->field_3C = 0;
Ritor1
parents:
diff changeset
3885 v205 = v39;
Ritor1
parents:
diff changeset
3886 }
Ritor1
parents:
diff changeset
3887 }
Ritor1
parents:
diff changeset
3888 LOBYTE(v42) = BYTE3(v26->field_34);
Ritor1
parents:
diff changeset
3889 if ( (_BYTE)v42 )
Ritor1
parents:
diff changeset
3890 {
Ritor1
parents:
diff changeset
3891 if ( (_BYTE)v42 == 99 )
Ritor1
parents:
diff changeset
3892 {
Ritor1
parents:
diff changeset
3893 v43 = v2->field_40;
Ritor1
parents:
diff changeset
3894 v44 = v4->field_40;
Ritor1
parents:
diff changeset
3895 if ( v43 < v44 )
Ritor1
parents:
diff changeset
3896 {
Ritor1
parents:
diff changeset
3897 v2->field_40 = v44;
Ritor1
parents:
diff changeset
3898 v203 = v44 - v43;
Ritor1
parents:
diff changeset
3899 }
Ritor1
parents:
diff changeset
3900 }
Ritor1
parents:
diff changeset
3901 else
Ritor1
parents:
diff changeset
3902 {
Ritor1
parents:
diff changeset
3903 v42 = (char)v42;
Ritor1
parents:
diff changeset
3904 v6 = (char)v42 + v2->field_40 < 0;
Ritor1
parents:
diff changeset
3905 v2->field_40 += (char)v42;
Ritor1
parents:
diff changeset
3906 if ( v6 )
Ritor1
parents:
diff changeset
3907 v2->field_40 = 0;
Ritor1
parents:
diff changeset
3908 v203 = v42;
Ritor1
parents:
diff changeset
3909 }
Ritor1
parents:
diff changeset
3910 }
Ritor1
parents:
diff changeset
3911 v45 = v26->field_38[0];
Ritor1
parents:
diff changeset
3912 if ( v45 )
Ritor1
parents:
diff changeset
3913 {
Ritor1
parents:
diff changeset
3914 v196 = am_40D402(v193, v45);
Ritor1
parents:
diff changeset
3915 v192 = v26->field_38[0] - v196;
Ritor1
parents:
diff changeset
3916 }
Ritor1
parents:
diff changeset
3917 LOBYTE(v46) = v26->field_38[1];
Ritor1
parents:
diff changeset
3918 if ( (_BYTE)v46 )
Ritor1
parents:
diff changeset
3919 {
Ritor1
parents:
diff changeset
3920 if ( (_BYTE)v46 == 99 )
Ritor1
parents:
diff changeset
3921 {
Ritor1
parents:
diff changeset
3922 v47 = v2->field_28;
Ritor1
parents:
diff changeset
3923 v48 = v4->field_28;
Ritor1
parents:
diff changeset
3924 if ( v47 < v48 )
Ritor1
parents:
diff changeset
3925 {
Ritor1
parents:
diff changeset
3926 v2->field_28 = v48;
Ritor1
parents:
diff changeset
3927 v201 = v48 - v47;
Ritor1
parents:
diff changeset
3928 }
Ritor1
parents:
diff changeset
3929 }
Ritor1
parents:
diff changeset
3930 else
Ritor1
parents:
diff changeset
3931 {
Ritor1
parents:
diff changeset
3932 v46 = (char)v46;
Ritor1
parents:
diff changeset
3933 v6 = (char)v46 + v2->field_28 < 0;
Ritor1
parents:
diff changeset
3934 v2->field_28 += (char)v46;
Ritor1
parents:
diff changeset
3935 if ( v6 )
Ritor1
parents:
diff changeset
3936 v2->field_28 = 0;
Ritor1
parents:
diff changeset
3937 v201 = v46;
Ritor1
parents:
diff changeset
3938 }
Ritor1
parents:
diff changeset
3939 }
Ritor1
parents:
diff changeset
3940 LOBYTE(v49) = v26->field_38[2];
Ritor1
parents:
diff changeset
3941 if ( (_BYTE)v49 )
Ritor1
parents:
diff changeset
3942 {
Ritor1
parents:
diff changeset
3943 if ( (_BYTE)v49 == 99 )
Ritor1
parents:
diff changeset
3944 {
Ritor1
parents:
diff changeset
3945 v50 = v2->field_24;
Ritor1
parents:
diff changeset
3946 v51 = v4->field_24;
Ritor1
parents:
diff changeset
3947 if ( v50 < v51 )
Ritor1
parents:
diff changeset
3948 {
Ritor1
parents:
diff changeset
3949 v2->field_24 = v51;
Ritor1
parents:
diff changeset
3950 v199 = v51 - v50;
Ritor1
parents:
diff changeset
3951 }
Ritor1
parents:
diff changeset
3952 }
Ritor1
parents:
diff changeset
3953 else
Ritor1
parents:
diff changeset
3954 {
Ritor1
parents:
diff changeset
3955 v49 = (char)v49;
Ritor1
parents:
diff changeset
3956 v6 = (char)v49 + v2->field_24 < 0;
Ritor1
parents:
diff changeset
3957 v2->field_24 += (char)v49;
Ritor1
parents:
diff changeset
3958 if ( v6 )
Ritor1
parents:
diff changeset
3959 v2->field_24 = 0;
Ritor1
parents:
diff changeset
3960 v199 = v49;
Ritor1
parents:
diff changeset
3961 }
Ritor1
parents:
diff changeset
3962 }
Ritor1
parents:
diff changeset
3963 LOBYTE(v52) = v26->field_38[3];
Ritor1
parents:
diff changeset
3964 if ( (_BYTE)v52 )
Ritor1
parents:
diff changeset
3965 {
Ritor1
parents:
diff changeset
3966 if ( (_BYTE)v52 == 99 )
Ritor1
parents:
diff changeset
3967 {
Ritor1
parents:
diff changeset
3968 v53 = v2->field_2C;
Ritor1
parents:
diff changeset
3969 v54 = v4->field_2C;
Ritor1
parents:
diff changeset
3970 if ( v53 > v54 )
Ritor1
parents:
diff changeset
3971 {
Ritor1
parents:
diff changeset
3972 v4->field_2C = v53;
Ritor1
parents:
diff changeset
3973 v211 = v53 - v54;
Ritor1
parents:
diff changeset
3974 }
Ritor1
parents:
diff changeset
3975 }
Ritor1
parents:
diff changeset
3976 else
Ritor1
parents:
diff changeset
3977 {
Ritor1
parents:
diff changeset
3978 v52 = (char)v52;
Ritor1
parents:
diff changeset
3979 v6 = (char)v52 + v4->field_2C < 0;
Ritor1
parents:
diff changeset
3980 v4->field_2C += (char)v52;
Ritor1
parents:
diff changeset
3981 if ( v6 )
Ritor1
parents:
diff changeset
3982 v4->field_2C = 0;
Ritor1
parents:
diff changeset
3983 v211 = v52;
Ritor1
parents:
diff changeset
3984 }
Ritor1
parents:
diff changeset
3985 }
Ritor1
parents:
diff changeset
3986 LOBYTE(v55) = v26->field_38[4];
Ritor1
parents:
diff changeset
3987 if ( (_BYTE)v55 )
Ritor1
parents:
diff changeset
3988 {
Ritor1
parents:
diff changeset
3989 if ( (_BYTE)v55 == 99 )
Ritor1
parents:
diff changeset
3990 {
Ritor1
parents:
diff changeset
3991 v56 = v2->field_30;
Ritor1
parents:
diff changeset
3992 v57 = v4->field_30;
Ritor1
parents:
diff changeset
3993 if ( v56 > v57 )
Ritor1
parents:
diff changeset
3994 {
Ritor1
parents:
diff changeset
3995 v4->field_30 = v56;
Ritor1
parents:
diff changeset
3996 v209 = v56 - v57;
Ritor1
parents:
diff changeset
3997 }
Ritor1
parents:
diff changeset
3998 }
Ritor1
parents:
diff changeset
3999 else
Ritor1
parents:
diff changeset
4000 {
Ritor1
parents:
diff changeset
4001 v55 = (char)v55;
Ritor1
parents:
diff changeset
4002 v6 = (char)v55 + v4->field_30 < 0;
Ritor1
parents:
diff changeset
4003 v4->field_30 += (char)v55;
Ritor1
parents:
diff changeset
4004 if ( v6 )
Ritor1
parents:
diff changeset
4005 v4->field_30 = 0;
Ritor1
parents:
diff changeset
4006 v209 = v55;
Ritor1
parents:
diff changeset
4007 }
Ritor1
parents:
diff changeset
4008 }
Ritor1
parents:
diff changeset
4009 LOBYTE(v58) = v26->field_38[5];
Ritor1
parents:
diff changeset
4010 if ( (_BYTE)v58 )
Ritor1
parents:
diff changeset
4011 {
Ritor1
parents:
diff changeset
4012 if ( (_BYTE)v58 == 99 )
Ritor1
parents:
diff changeset
4013 {
Ritor1
parents:
diff changeset
4014 v59 = v2->field_34;
Ritor1
parents:
diff changeset
4015 v60 = v4->field_34;
Ritor1
parents:
diff changeset
4016 if ( v59 > v60 )
Ritor1
parents:
diff changeset
4017 {
Ritor1
parents:
diff changeset
4018 v4->field_34 = v59;
Ritor1
parents:
diff changeset
4019 v207 = v59 - v60;
Ritor1
parents:
diff changeset
4020 }
Ritor1
parents:
diff changeset
4021 }
Ritor1
parents:
diff changeset
4022 else
Ritor1
parents:
diff changeset
4023 {
Ritor1
parents:
diff changeset
4024 v58 = (char)v58;
Ritor1
parents:
diff changeset
4025 v6 = (char)v58 + v4->field_34 < 0;
Ritor1
parents:
diff changeset
4026 v4->field_34 += (char)v58;
Ritor1
parents:
diff changeset
4027 if ( v6 )
Ritor1
parents:
diff changeset
4028 v4->field_34 = 0;
Ritor1
parents:
diff changeset
4029 v207 = v58;
Ritor1
parents:
diff changeset
4030 }
Ritor1
parents:
diff changeset
4031 }
Ritor1
parents:
diff changeset
4032 LOBYTE(v61) = v26->field_38[6];
Ritor1
parents:
diff changeset
4033 if ( (_BYTE)v61 )
Ritor1
parents:
diff changeset
4034 {
Ritor1
parents:
diff changeset
4035 if ( (_BYTE)v61 == 99 )
Ritor1
parents:
diff changeset
4036 {
Ritor1
parents:
diff changeset
4037 v62 = v2->field_38;
Ritor1
parents:
diff changeset
4038 v63 = v4->field_38;
Ritor1
parents:
diff changeset
4039 if ( v62 > v63 )
Ritor1
parents:
diff changeset
4040 {
Ritor1
parents:
diff changeset
4041 v4->field_38 = v62;
Ritor1
parents:
diff changeset
4042 v206 = v62 - v63;
Ritor1
parents:
diff changeset
4043 }
Ritor1
parents:
diff changeset
4044 }
Ritor1
parents:
diff changeset
4045 else
Ritor1
parents:
diff changeset
4046 {
Ritor1
parents:
diff changeset
4047 v61 = (char)v61;
Ritor1
parents:
diff changeset
4048 v6 = (char)v61 + v4->field_38 < 0;
Ritor1
parents:
diff changeset
4049 v4->field_38 += (char)v61;
Ritor1
parents:
diff changeset
4050 if ( v6 )
Ritor1
parents:
diff changeset
4051 v4->field_38 = 0;
Ritor1
parents:
diff changeset
4052 v206 = v61;
Ritor1
parents:
diff changeset
4053 }
Ritor1
parents:
diff changeset
4054 }
Ritor1
parents:
diff changeset
4055 LOBYTE(v64) = v26->field_38[7];
Ritor1
parents:
diff changeset
4056 if ( (_BYTE)v64 )
Ritor1
parents:
diff changeset
4057 {
Ritor1
parents:
diff changeset
4058 if ( (_BYTE)v64 == 99 )
Ritor1
parents:
diff changeset
4059 {
Ritor1
parents:
diff changeset
4060 v65 = v2->field_3C;
Ritor1
parents:
diff changeset
4061 v66 = v4->field_3C;
Ritor1
parents:
diff changeset
4062 if ( v65 > v66 )
Ritor1
parents:
diff changeset
4063 {
Ritor1
parents:
diff changeset
4064 v4->field_3C = v65;
Ritor1
parents:
diff changeset
4065 v204 = v65 - v66;
Ritor1
parents:
diff changeset
4066 }
Ritor1
parents:
diff changeset
4067 }
Ritor1
parents:
diff changeset
4068 else
Ritor1
parents:
diff changeset
4069 {
Ritor1
parents:
diff changeset
4070 v64 = (char)v64;
Ritor1
parents:
diff changeset
4071 v6 = (char)v64 + v4->field_3C < 0;
Ritor1
parents:
diff changeset
4072 v4->field_3C += (char)v64;
Ritor1
parents:
diff changeset
4073 if ( v6 )
Ritor1
parents:
diff changeset
4074 v4->field_3C = 0;
Ritor1
parents:
diff changeset
4075 v204 = v64;
Ritor1
parents:
diff changeset
4076 }
Ritor1
parents:
diff changeset
4077 }
Ritor1
parents:
diff changeset
4078 LOBYTE(v67) = v26->field_38[8];
Ritor1
parents:
diff changeset
4079 if ( (_BYTE)v67 )
Ritor1
parents:
diff changeset
4080 {
Ritor1
parents:
diff changeset
4081 if ( (_BYTE)v67 == 99 )
Ritor1
parents:
diff changeset
4082 {
Ritor1
parents:
diff changeset
4083 v68 = v2->field_40;
Ritor1
parents:
diff changeset
4084 v69 = v4->field_40;
Ritor1
parents:
diff changeset
4085 if ( v68 > v69 )
Ritor1
parents:
diff changeset
4086 {
Ritor1
parents:
diff changeset
4087 v4->field_40 = v68;
Ritor1
parents:
diff changeset
4088 v202 = v68 - v69;
Ritor1
parents:
diff changeset
4089 }
Ritor1
parents:
diff changeset
4090 }
Ritor1
parents:
diff changeset
4091 else
Ritor1
parents:
diff changeset
4092 {
Ritor1
parents:
diff changeset
4093 v67 = (char)v67;
Ritor1
parents:
diff changeset
4094 v6 = (char)v67 + v4->field_40 < 0;
Ritor1
parents:
diff changeset
4095 v4->field_40 += (char)v67;
Ritor1
parents:
diff changeset
4096 if ( v6 )
Ritor1
parents:
diff changeset
4097 v4->field_40 = 0;
Ritor1
parents:
diff changeset
4098 v202 = v67;
Ritor1
parents:
diff changeset
4099 }
Ritor1
parents:
diff changeset
4100 }
Ritor1
parents:
diff changeset
4101 v70 = v26->field_38[9];
Ritor1
parents:
diff changeset
4102 if ( v70 )
Ritor1
parents:
diff changeset
4103 {
Ritor1
parents:
diff changeset
4104 v195 = am_40D402(v189, v70);
Ritor1
parents:
diff changeset
4105 v191 = v26->field_38[9] - v195;
Ritor1
parents:
diff changeset
4106 }
Ritor1
parents:
diff changeset
4107 LOBYTE(v71) = v26->field_38[10];
Ritor1
parents:
diff changeset
4108 if ( (_BYTE)v71 )
Ritor1
parents:
diff changeset
4109 {
Ritor1
parents:
diff changeset
4110 if ( (_BYTE)v71 == 99 )
Ritor1
parents:
diff changeset
4111 {
Ritor1
parents:
diff changeset
4112 v72 = v2->field_28;
Ritor1
parents:
diff changeset
4113 v73 = v4->field_28;
Ritor1
parents:
diff changeset
4114 if ( v72 > v73 )
Ritor1
parents:
diff changeset
4115 {
Ritor1
parents:
diff changeset
4116 v4->field_28 = v72;
Ritor1
parents:
diff changeset
4117 v200 = v72 - v73;
Ritor1
parents:
diff changeset
4118 }
Ritor1
parents:
diff changeset
4119 }
Ritor1
parents:
diff changeset
4120 else
Ritor1
parents:
diff changeset
4121 {
Ritor1
parents:
diff changeset
4122 v71 = (char)v71;
Ritor1
parents:
diff changeset
4123 v6 = (char)v71 + v4->field_28 < 0;
Ritor1
parents:
diff changeset
4124 v4->field_28 += (char)v71;
Ritor1
parents:
diff changeset
4125 if ( v6 )
Ritor1
parents:
diff changeset
4126 v4->field_28 = 0;
Ritor1
parents:
diff changeset
4127 v200 = v71;
Ritor1
parents:
diff changeset
4128 }
Ritor1
parents:
diff changeset
4129 }
Ritor1
parents:
diff changeset
4130 LOBYTE(v74) = v26->field_38[11];
Ritor1
parents:
diff changeset
4131 if ( (_BYTE)v74 )
Ritor1
parents:
diff changeset
4132 {
Ritor1
parents:
diff changeset
4133 if ( (_BYTE)v74 == 99 )
Ritor1
parents:
diff changeset
4134 {
Ritor1
parents:
diff changeset
4135 v75 = v2->field_24;
Ritor1
parents:
diff changeset
4136 v76 = v4->field_24;
Ritor1
parents:
diff changeset
4137 if ( v75 > v76 )
Ritor1
parents:
diff changeset
4138 {
Ritor1
parents:
diff changeset
4139 v4->field_24 = v75;
Ritor1
parents:
diff changeset
4140 v198 = v75 - v76;
Ritor1
parents:
diff changeset
4141 }
Ritor1
parents:
diff changeset
4142 }
Ritor1
parents:
diff changeset
4143 else
Ritor1
parents:
diff changeset
4144 {
Ritor1
parents:
diff changeset
4145 v74 = (char)v74;
Ritor1
parents:
diff changeset
4146 v6 = (char)v74 + v4->field_24 < 0;
Ritor1
parents:
diff changeset
4147 v4->field_24 += (char)v74;
Ritor1
parents:
diff changeset
4148 if ( v6 )
Ritor1
parents:
diff changeset
4149 v4->field_24 = 0;
Ritor1
parents:
diff changeset
4150 v198 = v74;
Ritor1
parents:
diff changeset
4151 }
Ritor1
parents:
diff changeset
4152 }
Ritor1
parents:
diff changeset
4153 LOBYTE(v77) = v26->field_38[12];
Ritor1
parents:
diff changeset
4154 if ( (_BYTE)v77 )
Ritor1
parents:
diff changeset
4155 {
Ritor1
parents:
diff changeset
4156 if ( (_BYTE)v77 == 99 )
Ritor1
parents:
diff changeset
4157 {
Ritor1
parents:
diff changeset
4158 v78 = v2->field_2C;
Ritor1
parents:
diff changeset
4159 v79 = v4->field_2C;
Ritor1
parents:
diff changeset
4160 if ( v78 != v79 )
Ritor1
parents:
diff changeset
4161 {
Ritor1
parents:
diff changeset
4162 if ( v78 <= v79 )
Ritor1
parents:
diff changeset
4163 {
Ritor1
parents:
diff changeset
4164 v2->field_2C = v79;
Ritor1
parents:
diff changeset
4165 v194 = v79 - v78;
Ritor1
parents:
diff changeset
4166 }
Ritor1
parents:
diff changeset
4167 else
Ritor1
parents:
diff changeset
4168 {
Ritor1
parents:
diff changeset
4169 v4->field_2C = v78;
Ritor1
parents:
diff changeset
4170 v211 = v78 - v79;
Ritor1
parents:
diff changeset
4171 }
Ritor1
parents:
diff changeset
4172 }
Ritor1
parents:
diff changeset
4173 }
Ritor1
parents:
diff changeset
4174 else
Ritor1
parents:
diff changeset
4175 {
Ritor1
parents:
diff changeset
4176 v77 = (char)v77;
Ritor1
parents:
diff changeset
4177 v2->field_2C += (char)v77;
Ritor1
parents:
diff changeset
4178 v4->field_2C += (char)v77;
Ritor1
parents:
diff changeset
4179 if ( v2->field_2C < 0 )
Ritor1
parents:
diff changeset
4180 v2->field_2C = 0;
Ritor1
parents:
diff changeset
4181 if ( v4->field_2C < 0 )
Ritor1
parents:
diff changeset
4182 v4->field_2C = 0;
Ritor1
parents:
diff changeset
4183 v194 = v77;
Ritor1
parents:
diff changeset
4184 v211 = v77;
Ritor1
parents:
diff changeset
4185 }
Ritor1
parents:
diff changeset
4186 }
Ritor1
parents:
diff changeset
4187 LOBYTE(v80) = v26->field_38[13];
Ritor1
parents:
diff changeset
4188 if ( (_BYTE)v80 )
Ritor1
parents:
diff changeset
4189 {
Ritor1
parents:
diff changeset
4190 if ( (_BYTE)v80 == 99 )
Ritor1
parents:
diff changeset
4191 {
Ritor1
parents:
diff changeset
4192 v81 = v2->field_30;
Ritor1
parents:
diff changeset
4193 v82 = v4->field_30;
Ritor1
parents:
diff changeset
4194 if ( v81 != v82 )
Ritor1
parents:
diff changeset
4195 {
Ritor1
parents:
diff changeset
4196 if ( v81 <= v82 )
Ritor1
parents:
diff changeset
4197 {
Ritor1
parents:
diff changeset
4198 v2->field_30 = v82;
Ritor1
parents:
diff changeset
4199 v210 = v82 - v81;
Ritor1
parents:
diff changeset
4200 }
Ritor1
parents:
diff changeset
4201 else
Ritor1
parents:
diff changeset
4202 {
Ritor1
parents:
diff changeset
4203 v4->field_30 = v81;
Ritor1
parents:
diff changeset
4204 v209 = v81 - v82;
Ritor1
parents:
diff changeset
4205 }
Ritor1
parents:
diff changeset
4206 }
Ritor1
parents:
diff changeset
4207 }
Ritor1
parents:
diff changeset
4208 else
Ritor1
parents:
diff changeset
4209 {
Ritor1
parents:
diff changeset
4210 v80 = (char)v80;
Ritor1
parents:
diff changeset
4211 v2->field_30 += (char)v80;
Ritor1
parents:
diff changeset
4212 v4->field_30 += (char)v80;
Ritor1
parents:
diff changeset
4213 if ( v2->field_30 < 0 )
Ritor1
parents:
diff changeset
4214 v2->field_30 = 0;
Ritor1
parents:
diff changeset
4215 if ( v4->field_30 < 0 )
Ritor1
parents:
diff changeset
4216 v4->field_30 = 0;
Ritor1
parents:
diff changeset
4217 v209 = v80;
Ritor1
parents:
diff changeset
4218 v210 = v80;
Ritor1
parents:
diff changeset
4219 }
Ritor1
parents:
diff changeset
4220 }
Ritor1
parents:
diff changeset
4221 LOBYTE(v83) = v26->field_38[14];
Ritor1
parents:
diff changeset
4222 if ( (_BYTE)v83 )
Ritor1
parents:
diff changeset
4223 {
Ritor1
parents:
diff changeset
4224 if ( (_BYTE)v83 == 99 )
Ritor1
parents:
diff changeset
4225 {
Ritor1
parents:
diff changeset
4226 v84 = v2->field_34;
Ritor1
parents:
diff changeset
4227 v85 = v4->field_34;
Ritor1
parents:
diff changeset
4228 if ( v84 != v85 )
Ritor1
parents:
diff changeset
4229 {
Ritor1
parents:
diff changeset
4230 if ( v84 <= v85 )
Ritor1
parents:
diff changeset
4231 {
Ritor1
parents:
diff changeset
4232 v2->field_34 = v85;
Ritor1
parents:
diff changeset
4233 v208 = v85 - v84;
Ritor1
parents:
diff changeset
4234 }
Ritor1
parents:
diff changeset
4235 else
Ritor1
parents:
diff changeset
4236 {
Ritor1
parents:
diff changeset
4237 v4->field_34 = v84;
Ritor1
parents:
diff changeset
4238 v207 = v84 - v85;
Ritor1
parents:
diff changeset
4239 }
Ritor1
parents:
diff changeset
4240 }
Ritor1
parents:
diff changeset
4241 }
Ritor1
parents:
diff changeset
4242 else
Ritor1
parents:
diff changeset
4243 {
Ritor1
parents:
diff changeset
4244 v83 = (char)v83;
Ritor1
parents:
diff changeset
4245 v2->field_34 += (char)v83;
Ritor1
parents:
diff changeset
4246 v4->field_34 += (char)v83;
Ritor1
parents:
diff changeset
4247 if ( v2->field_34 < 0 )
Ritor1
parents:
diff changeset
4248 v2->field_34 = 0;
Ritor1
parents:
diff changeset
4249 if ( v4->field_34 < 0 )
Ritor1
parents:
diff changeset
4250 v4->field_34 = 0;
Ritor1
parents:
diff changeset
4251 v208 = v83;
Ritor1
parents:
diff changeset
4252 v207 = v83;
Ritor1
parents:
diff changeset
4253 }
Ritor1
parents:
diff changeset
4254 }
Ritor1
parents:
diff changeset
4255 LOBYTE(v86) = v26->field_38[15];
Ritor1
parents:
diff changeset
4256 if ( (_BYTE)v86 )
Ritor1
parents:
diff changeset
4257 {
Ritor1
parents:
diff changeset
4258 if ( (_BYTE)v86 == 99 )
Ritor1
parents:
diff changeset
4259 {
Ritor1
parents:
diff changeset
4260 v87 = v2->field_38;
Ritor1
parents:
diff changeset
4261 v88 = v4->field_38;
Ritor1
parents:
diff changeset
4262 if ( v87 != v88 )
Ritor1
parents:
diff changeset
4263 {
Ritor1
parents:
diff changeset
4264 if ( v87 <= v88 )
Ritor1
parents:
diff changeset
4265 {
Ritor1
parents:
diff changeset
4266 v2->field_38 = v88;
Ritor1
parents:
diff changeset
4267 v197 = v88 - v87;
Ritor1
parents:
diff changeset
4268 }
Ritor1
parents:
diff changeset
4269 else
Ritor1
parents:
diff changeset
4270 {
Ritor1
parents:
diff changeset
4271 v4->field_38 = v87;
Ritor1
parents:
diff changeset
4272 v206 = v87 - v88;
Ritor1
parents:
diff changeset
4273 }
Ritor1
parents:
diff changeset
4274 }
Ritor1
parents:
diff changeset
4275 }
Ritor1
parents:
diff changeset
4276 else
Ritor1
parents:
diff changeset
4277 {
Ritor1
parents:
diff changeset
4278 v86 = (char)v86;
Ritor1
parents:
diff changeset
4279 v2->field_38 += (char)v86;
Ritor1
parents:
diff changeset
4280 v4->field_38 += (char)v86;
Ritor1
parents:
diff changeset
4281 if ( v2->field_38 < 0 )
Ritor1
parents:
diff changeset
4282 v2->field_38 = 0;
Ritor1
parents:
diff changeset
4283 if ( v4->field_38 < 0 )
Ritor1
parents:
diff changeset
4284 v4->field_38 = 0;
Ritor1
parents:
diff changeset
4285 v197 = v86;
Ritor1
parents:
diff changeset
4286 v206 = v86;
Ritor1
parents:
diff changeset
4287 }
Ritor1
parents:
diff changeset
4288 }
Ritor1
parents:
diff changeset
4289 LOBYTE(v89) = v26->field_48[0];
Ritor1
parents:
diff changeset
4290 if ( v89 )
Ritor1
parents:
diff changeset
4291 {
Ritor1
parents:
diff changeset
4292 if ( v89 == 99 )
Ritor1
parents:
diff changeset
4293 {
Ritor1
parents:
diff changeset
4294 v90 = v2->field_3C;
Ritor1
parents:
diff changeset
4295 v91 = v4->field_3C;
Ritor1
parents:
diff changeset
4296 if ( v90 != v91 )
Ritor1
parents:
diff changeset
4297 {
Ritor1
parents:
diff changeset
4298 if ( v90 <= v91 )
Ritor1
parents:
diff changeset
4299 {
Ritor1
parents:
diff changeset
4300 v205 = v91 > v90;
Ritor1
parents:
diff changeset
4301 v2->field_3C = v91;
Ritor1
parents:
diff changeset
4302 }
Ritor1
parents:
diff changeset
4303 else
Ritor1
parents:
diff changeset
4304 {
Ritor1
parents:
diff changeset
4305 v204 = 1;
Ritor1
parents:
diff changeset
4306 v4->field_3C = v90;
Ritor1
parents:
diff changeset
4307 }
Ritor1
parents:
diff changeset
4308 }
Ritor1
parents:
diff changeset
4309 }
Ritor1
parents:
diff changeset
4310 else
Ritor1
parents:
diff changeset
4311 {
Ritor1
parents:
diff changeset
4312 v89 = v89;
Ritor1
parents:
diff changeset
4313 v2->field_3C += v89;
Ritor1
parents:
diff changeset
4314 v4->field_3C += v89;
Ritor1
parents:
diff changeset
4315 if ( v2->field_3C < 0 )
Ritor1
parents:
diff changeset
4316 v2->field_3C = 0;
Ritor1
parents:
diff changeset
4317 if ( v4->field_3C < 0 )
Ritor1
parents:
diff changeset
4318 v4->field_3C = 0;
Ritor1
parents:
diff changeset
4319 v205 = v89;
Ritor1
parents:
diff changeset
4320 v204 = v89;
Ritor1
parents:
diff changeset
4321 }
Ritor1
parents:
diff changeset
4322 }
Ritor1
parents:
diff changeset
4323 LOBYTE(v92) = v26->field_48[1];
Ritor1
parents:
diff changeset
4324 if ( (_BYTE)v92 )
Ritor1
parents:
diff changeset
4325 {
Ritor1
parents:
diff changeset
4326 if ( (_BYTE)v92 == 99 )
Ritor1
parents:
diff changeset
4327 {
Ritor1
parents:
diff changeset
4328 v93 = v2->field_40;
Ritor1
parents:
diff changeset
4329 v94 = v4->field_40;
Ritor1
parents:
diff changeset
4330 if ( v93 != v94 )
Ritor1
parents:
diff changeset
4331 {
Ritor1
parents:
diff changeset
4332 if ( v93 <= v94 )
Ritor1
parents:
diff changeset
4333 {
Ritor1
parents:
diff changeset
4334 v2->field_40 = v94;
Ritor1
parents:
diff changeset
4335 v203 = v94 - v93;
Ritor1
parents:
diff changeset
4336 }
Ritor1
parents:
diff changeset
4337 else
Ritor1
parents:
diff changeset
4338 {
Ritor1
parents:
diff changeset
4339 v4->field_40 = v93;
Ritor1
parents:
diff changeset
4340 v202 = v93 - v94;
Ritor1
parents:
diff changeset
4341 }
Ritor1
parents:
diff changeset
4342 }
Ritor1
parents:
diff changeset
4343 }
Ritor1
parents:
diff changeset
4344 else
Ritor1
parents:
diff changeset
4345 {
Ritor1
parents:
diff changeset
4346 v92 = (char)v92;
Ritor1
parents:
diff changeset
4347 v2->field_40 += (char)v92;
Ritor1
parents:
diff changeset
4348 v4->field_40 += (char)v92;
Ritor1
parents:
diff changeset
4349 if ( v2->field_40 < 0 )
Ritor1
parents:
diff changeset
4350 v2->field_40 = 0;
Ritor1
parents:
diff changeset
4351 if ( v4->field_40 < 0 )
Ritor1
parents:
diff changeset
4352 v4->field_40 = 0;
Ritor1
parents:
diff changeset
4353 v203 = v92;
Ritor1
parents:
diff changeset
4354 v202 = v92;
Ritor1
parents:
diff changeset
4355 }
Ritor1
parents:
diff changeset
4356 }
Ritor1
parents:
diff changeset
4357 v95 = v26->field_48[2];
Ritor1
parents:
diff changeset
4358 if ( v95 )
Ritor1
parents:
diff changeset
4359 {
Ritor1
parents:
diff changeset
4360 v96 = am_40D402(v193, v95);
Ritor1
parents:
diff changeset
4361 v97 = v26->field_48[2];
Ritor1
parents:
diff changeset
4362 v196 = v96;
Ritor1
parents:
diff changeset
4363 v98 = am_40D402(v189, v97);
Ritor1
parents:
diff changeset
4364 v195 = v98;
Ritor1
parents:
diff changeset
4365 v99 = v26->field_48[2] - v98;
Ritor1
parents:
diff changeset
4366 v192 = v26->field_48[2] - v196;
Ritor1
parents:
diff changeset
4367 v191 = v99;
Ritor1
parents:
diff changeset
4368 }
Ritor1
parents:
diff changeset
4369 LOBYTE(v100) = v26->field_48[3];
Ritor1
parents:
diff changeset
4370 if ( (_BYTE)v100 )
Ritor1
parents:
diff changeset
4371 {
Ritor1
parents:
diff changeset
4372 if ( (_BYTE)v100 == 99 )
Ritor1
parents:
diff changeset
4373 {
Ritor1
parents:
diff changeset
4374 v101 = v2->field_28;
Ritor1
parents:
diff changeset
4375 v102 = v4->field_28;
Ritor1
parents:
diff changeset
4376 if ( v101 != v102 )
Ritor1
parents:
diff changeset
4377 {
Ritor1
parents:
diff changeset
4378 if ( v101 <= v102 )
Ritor1
parents:
diff changeset
4379 {
Ritor1
parents:
diff changeset
4380 v2->field_28 = v102;
Ritor1
parents:
diff changeset
4381 v201 = v102 - v101;
Ritor1
parents:
diff changeset
4382 }
Ritor1
parents:
diff changeset
4383 else
Ritor1
parents:
diff changeset
4384 {
Ritor1
parents:
diff changeset
4385 v4->field_28 = v101;
Ritor1
parents:
diff changeset
4386 v200 = v101 - v102;
Ritor1
parents:
diff changeset
4387 }
Ritor1
parents:
diff changeset
4388 }
Ritor1
parents:
diff changeset
4389 }
Ritor1
parents:
diff changeset
4390 else
Ritor1
parents:
diff changeset
4391 {
Ritor1
parents:
diff changeset
4392 v100 = (char)v100;
Ritor1
parents:
diff changeset
4393 v2->field_28 += (char)v100;
Ritor1
parents:
diff changeset
4394 v4->field_28 += (char)v100;
Ritor1
parents:
diff changeset
4395 if ( v2->field_28 < 0 )
Ritor1
parents:
diff changeset
4396 v2->field_28 = 0;
Ritor1
parents:
diff changeset
4397 if ( v4->field_28 < 0 )
Ritor1
parents:
diff changeset
4398 v4->field_28 = 0;
Ritor1
parents:
diff changeset
4399 v201 = v100;
Ritor1
parents:
diff changeset
4400 v200 = v100;
Ritor1
parents:
diff changeset
4401 }
Ritor1
parents:
diff changeset
4402 }
Ritor1
parents:
diff changeset
4403 LOBYTE(v103) = v26->field_48[4];
Ritor1
parents:
diff changeset
4404 break;
Ritor1
parents:
diff changeset
4405 case 0:
Ritor1
parents:
diff changeset
4406 LABEL_231:
Ritor1
parents:
diff changeset
4407 v104 = pCard->field_48[6];
Ritor1
parents:
diff changeset
4408 v105 = v104 + (pCard->field_48[5] == 1);
Ritor1
parents:
diff changeset
4409 v106 = 0;
Ritor1
parents:
diff changeset
4410 dword_4FAA68 = v104 + (pCard->field_48[5] == 1);
Ritor1
parents:
diff changeset
4411 dword_4FAA64 = v104;
Ritor1
parents:
diff changeset
4412 if ( v104 > 0 )
Ritor1
parents:
diff changeset
4413 {
Ritor1
parents:
diff changeset
4414 do
Ritor1
parents:
diff changeset
4415 {
Ritor1
parents:
diff changeset
4416 am_40A283(v193, v105);
Ritor1
parents:
diff changeset
4417 ++v106;
Ritor1
parents:
diff changeset
4418 }
Ritor1
parents:
diff changeset
4419 while ( v106 < pCard->field_48[6] );
Ritor1
parents:
diff changeset
4420 }
Ritor1
parents:
diff changeset
4421 v107 = pCard;
Ritor1
parents:
diff changeset
4422 am_byte_4FAA77 = am_40BB49(v193) > dword_4E1874;
Ritor1
parents:
diff changeset
4423 LOBYTE(v108) = pCard->field_48[7];
Ritor1
parents:
diff changeset
4424 if ( (_BYTE)v108 )
Ritor1
parents:
diff changeset
4425 {
Ritor1
parents:
diff changeset
4426 if ( (_BYTE)v108 == 99 )
Ritor1
parents:
diff changeset
4427 {
Ritor1
parents:
diff changeset
4428 v109 = v2->field_2C;
Ritor1
parents:
diff changeset
4429 v110 = v4->field_2C;
Ritor1
parents:
diff changeset
4430 if ( v109 < v110 )
Ritor1
parents:
diff changeset
4431 {
Ritor1
parents:
diff changeset
4432 v2->field_2C = v110;
Ritor1
parents:
diff changeset
4433 v194 = v110 - v109;
Ritor1
parents:
diff changeset
4434 }
Ritor1
parents:
diff changeset
4435 }
Ritor1
parents:
diff changeset
4436 else
Ritor1
parents:
diff changeset
4437 {
Ritor1
parents:
diff changeset
4438 v108 = (char)v108;
Ritor1
parents:
diff changeset
4439 v6 = (char)v108 + v2->field_2C < 0;
Ritor1
parents:
diff changeset
4440 v2->field_2C += (char)v108;
Ritor1
parents:
diff changeset
4441 if ( v6 )
Ritor1
parents:
diff changeset
4442 v2->field_2C = 0;
Ritor1
parents:
diff changeset
4443 v194 = v108;
Ritor1
parents:
diff changeset
4444 }
Ritor1
parents:
diff changeset
4445 }
Ritor1
parents:
diff changeset
4446 LOBYTE(v111) = v107->field_48[8];
Ritor1
parents:
diff changeset
4447 if ( (_BYTE)v111 )
Ritor1
parents:
diff changeset
4448 {
Ritor1
parents:
diff changeset
4449 if ( (_BYTE)v111 == 99 )
Ritor1
parents:
diff changeset
4450 {
Ritor1
parents:
diff changeset
4451 v112 = v2->field_30;
Ritor1
parents:
diff changeset
4452 v113 = v4->field_30;
Ritor1
parents:
diff changeset
4453 if ( v112 < v113 )
Ritor1
parents:
diff changeset
4454 {
Ritor1
parents:
diff changeset
4455 v2->field_30 = v113;
Ritor1
parents:
diff changeset
4456 v210 = v113 - v112;
Ritor1
parents:
diff changeset
4457 }
Ritor1
parents:
diff changeset
4458 }
Ritor1
parents:
diff changeset
4459 else
Ritor1
parents:
diff changeset
4460 {
Ritor1
parents:
diff changeset
4461 v111 = (char)v111;
Ritor1
parents:
diff changeset
4462 v6 = (char)v111 + v2->field_30 < 0;
Ritor1
parents:
diff changeset
4463 v2->field_30 += (char)v111;
Ritor1
parents:
diff changeset
4464 if ( v6 )
Ritor1
parents:
diff changeset
4465 v2->field_30 = 0;
Ritor1
parents:
diff changeset
4466 v210 = v111;
Ritor1
parents:
diff changeset
4467 }
Ritor1
parents:
diff changeset
4468 }
Ritor1
parents:
diff changeset
4469 LOBYTE(v114) = v107->field_48[9];
Ritor1
parents:
diff changeset
4470 if ( (_BYTE)v114 )
Ritor1
parents:
diff changeset
4471 {
Ritor1
parents:
diff changeset
4472 if ( (_BYTE)v114 == 99 )
Ritor1
parents:
diff changeset
4473 {
Ritor1
parents:
diff changeset
4474 v115 = v2->field_34;
Ritor1
parents:
diff changeset
4475 v116 = v4->field_34;
Ritor1
parents:
diff changeset
4476 if ( v115 < v116 )
Ritor1
parents:
diff changeset
4477 {
Ritor1
parents:
diff changeset
4478 v2->field_34 = v116;
Ritor1
parents:
diff changeset
4479 v208 = v116 - v115;
Ritor1
parents:
diff changeset
4480 }
Ritor1
parents:
diff changeset
4481 }
Ritor1
parents:
diff changeset
4482 else
Ritor1
parents:
diff changeset
4483 {
Ritor1
parents:
diff changeset
4484 v114 = (char)v114;
Ritor1
parents:
diff changeset
4485 v6 = (char)v114 + v2->field_34 < 0;
Ritor1
parents:
diff changeset
4486 v2->field_34 += (char)v114;
Ritor1
parents:
diff changeset
4487 if ( v6 )
Ritor1
parents:
diff changeset
4488 v2->field_34 = 0;
Ritor1
parents:
diff changeset
4489 v208 = v114;
Ritor1
parents:
diff changeset
4490 }
Ritor1
parents:
diff changeset
4491 }
Ritor1
parents:
diff changeset
4492 LOBYTE(v117) = v107->field_48[10];
Ritor1
parents:
diff changeset
4493 if ( (_BYTE)v117 )
Ritor1
parents:
diff changeset
4494 {
Ritor1
parents:
diff changeset
4495 if ( (_BYTE)v117 == 99 )
Ritor1
parents:
diff changeset
4496 {
Ritor1
parents:
diff changeset
4497 v118 = v2->field_38;
Ritor1
parents:
diff changeset
4498 v119 = v4->field_38;
Ritor1
parents:
diff changeset
4499 if ( v118 < v119 )
Ritor1
parents:
diff changeset
4500 {
Ritor1
parents:
diff changeset
4501 v2->field_38 = v119;
Ritor1
parents:
diff changeset
4502 v197 = v119 - v118;
Ritor1
parents:
diff changeset
4503 }
Ritor1
parents:
diff changeset
4504 }
Ritor1
parents:
diff changeset
4505 else
Ritor1
parents:
diff changeset
4506 {
Ritor1
parents:
diff changeset
4507 v117 = (char)v117;
Ritor1
parents:
diff changeset
4508 v6 = (char)v117 + v2->field_38 < 0;
Ritor1
parents:
diff changeset
4509 v2->field_38 += (char)v117;
Ritor1
parents:
diff changeset
4510 if ( v6 )
Ritor1
parents:
diff changeset
4511 v2->field_38 = 0;
Ritor1
parents:
diff changeset
4512 v197 = v117;
Ritor1
parents:
diff changeset
4513 }
Ritor1
parents:
diff changeset
4514 }
Ritor1
parents:
diff changeset
4515 LOBYTE(v120) = v107->field_48[11];
Ritor1
parents:
diff changeset
4516 if ( v120 )
Ritor1
parents:
diff changeset
4517 {
Ritor1
parents:
diff changeset
4518 if ( v120 == 99 )
Ritor1
parents:
diff changeset
4519 {
Ritor1
parents:
diff changeset
4520 v121 = v2->field_3C;
Ritor1
parents:
diff changeset
4521 v122 = v4->field_3C;
Ritor1
parents:
diff changeset
4522 if ( v121 < v122 )
Ritor1
parents:
diff changeset
4523 {
Ritor1
parents:
diff changeset
4524 v2->field_3C = v122;
Ritor1
parents:
diff changeset
4525 v205 = v122 - v121;
Ritor1
parents:
diff changeset
4526 }
Ritor1
parents:
diff changeset
4527 }
Ritor1
parents:
diff changeset
4528 else
Ritor1
parents:
diff changeset
4529 {
Ritor1
parents:
diff changeset
4530 v120 = v120;
Ritor1
parents:
diff changeset
4531 v6 = v120 + v2->field_3C < 0;
Ritor1
parents:
diff changeset
4532 v2->field_3C += v120;
Ritor1
parents:
diff changeset
4533 if ( v6 )
Ritor1
parents:
diff changeset
4534 v2->field_3C = 0;
Ritor1
parents:
diff changeset
4535 v205 = v120;
Ritor1
parents:
diff changeset
4536 }
Ritor1
parents:
diff changeset
4537 }
Ritor1
parents:
diff changeset
4538 LOBYTE(v123) = v107->field_48[12];
Ritor1
parents:
diff changeset
4539 if ( (_BYTE)v123 )
Ritor1
parents:
diff changeset
4540 {
Ritor1
parents:
diff changeset
4541 if ( (_BYTE)v123 == 99 )
Ritor1
parents:
diff changeset
4542 {
Ritor1
parents:
diff changeset
4543 v124 = v2->field_40;
Ritor1
parents:
diff changeset
4544 v125 = v4->field_40;
Ritor1
parents:
diff changeset
4545 if ( v124 < v125 )
Ritor1
parents:
diff changeset
4546 {
Ritor1
parents:
diff changeset
4547 v2->field_40 = v125;
Ritor1
parents:
diff changeset
4548 v203 = v125 - v124;
Ritor1
parents:
diff changeset
4549 }
Ritor1
parents:
diff changeset
4550 }
Ritor1
parents:
diff changeset
4551 else
Ritor1
parents:
diff changeset
4552 {
Ritor1
parents:
diff changeset
4553 v123 = (char)v123;
Ritor1
parents:
diff changeset
4554 v6 = (char)v123 + v2->field_40 < 0;
Ritor1
parents:
diff changeset
4555 v2->field_40 += (char)v123;
Ritor1
parents:
diff changeset
4556 if ( v6 )
Ritor1
parents:
diff changeset
4557 v2->field_40 = 0;
Ritor1
parents:
diff changeset
4558 v203 = v123;
Ritor1
parents:
diff changeset
4559 }
Ritor1
parents:
diff changeset
4560 }
Ritor1
parents:
diff changeset
4561 v126 = v107->field_48[13];
Ritor1
parents:
diff changeset
4562 if ( v126 )
Ritor1
parents:
diff changeset
4563 {
Ritor1
parents:
diff changeset
4564 v196 = am_40D402(v193, v126);
Ritor1
parents:
diff changeset
4565 v192 = v107->field_48[13] - v196;
Ritor1
parents:
diff changeset
4566 }
Ritor1
parents:
diff changeset
4567 LOBYTE(v127) = v107->field_48[14];
Ritor1
parents:
diff changeset
4568 if ( (_BYTE)v127 )
Ritor1
parents:
diff changeset
4569 {
Ritor1
parents:
diff changeset
4570 if ( (_BYTE)v127 == 99 )
Ritor1
parents:
diff changeset
4571 {
Ritor1
parents:
diff changeset
4572 v128 = v2->field_28;
Ritor1
parents:
diff changeset
4573 v129 = v4->field_28;
Ritor1
parents:
diff changeset
4574 if ( v128 < v129 )
Ritor1
parents:
diff changeset
4575 {
Ritor1
parents:
diff changeset
4576 v2->field_28 = v129;
Ritor1
parents:
diff changeset
4577 v201 = v129 - v128;
Ritor1
parents:
diff changeset
4578 }
Ritor1
parents:
diff changeset
4579 }
Ritor1
parents:
diff changeset
4580 else
Ritor1
parents:
diff changeset
4581 {
Ritor1
parents:
diff changeset
4582 v127 = (char)v127;
Ritor1
parents:
diff changeset
4583 v6 = (char)v127 + v2->field_28 < 0;
Ritor1
parents:
diff changeset
4584 v2->field_28 += (char)v127;
Ritor1
parents:
diff changeset
4585 if ( v6 )
Ritor1
parents:
diff changeset
4586 v2->field_28 = 0;
Ritor1
parents:
diff changeset
4587 v201 = v127;
Ritor1
parents:
diff changeset
4588 }
Ritor1
parents:
diff changeset
4589 }
Ritor1
parents:
diff changeset
4590 LOBYTE(v130) = v107->field_48[15];
Ritor1
parents:
diff changeset
4591 if ( (_BYTE)v130 )
Ritor1
parents:
diff changeset
4592 {
Ritor1
parents:
diff changeset
4593 if ( (_BYTE)v130 == 99 )
Ritor1
parents:
diff changeset
4594 {
Ritor1
parents:
diff changeset
4595 v131 = v2->field_24;
Ritor1
parents:
diff changeset
4596 v132 = v4->field_24;
Ritor1
parents:
diff changeset
4597 if ( v131 < v132 )
Ritor1
parents:
diff changeset
4598 {
Ritor1
parents:
diff changeset
4599 v2->field_24 = v132;
Ritor1
parents:
diff changeset
4600 v199 = v132 - v131;
Ritor1
parents:
diff changeset
4601 }
Ritor1
parents:
diff changeset
4602 }
Ritor1
parents:
diff changeset
4603 else
Ritor1
parents:
diff changeset
4604 {
Ritor1
parents:
diff changeset
4605 v130 = (char)v130;
Ritor1
parents:
diff changeset
4606 v6 = (char)v130 + v2->field_24 < 0;
Ritor1
parents:
diff changeset
4607 v2->field_24 += (char)v130;
Ritor1
parents:
diff changeset
4608 if ( v6 )
Ritor1
parents:
diff changeset
4609 v2->field_24 = 0;
Ritor1
parents:
diff changeset
4610 v199 = v130;
Ritor1
parents:
diff changeset
4611 }
Ritor1
parents:
diff changeset
4612 }
Ritor1
parents:
diff changeset
4613 LOBYTE(v133) = v107->field_58[0];
Ritor1
parents:
diff changeset
4614 if ( (_BYTE)v133 )
Ritor1
parents:
diff changeset
4615 {
Ritor1
parents:
diff changeset
4616 if ( (_BYTE)v133 == 99 )
Ritor1
parents:
diff changeset
4617 {
Ritor1
parents:
diff changeset
4618 v134 = v2->field_2C;
Ritor1
parents:
diff changeset
4619 v135 = v4->field_2C;
Ritor1
parents:
diff changeset
4620 if ( v134 > v135 )
Ritor1
parents:
diff changeset
4621 {
Ritor1
parents:
diff changeset
4622 v4->field_2C = v134;
Ritor1
parents:
diff changeset
4623 v211 = v134 - v135;
Ritor1
parents:
diff changeset
4624 }
Ritor1
parents:
diff changeset
4625 }
Ritor1
parents:
diff changeset
4626 else
Ritor1
parents:
diff changeset
4627 {
Ritor1
parents:
diff changeset
4628 v133 = (char)v133;
Ritor1
parents:
diff changeset
4629 v6 = (char)v133 + v4->field_2C < 0;
Ritor1
parents:
diff changeset
4630 v4->field_2C += (char)v133;
Ritor1
parents:
diff changeset
4631 if ( v6 )
Ritor1
parents:
diff changeset
4632 v4->field_2C = 0;
Ritor1
parents:
diff changeset
4633 v211 = v133;
Ritor1
parents:
diff changeset
4634 }
Ritor1
parents:
diff changeset
4635 }
Ritor1
parents:
diff changeset
4636 LOBYTE(v136) = v107->field_58[1];
Ritor1
parents:
diff changeset
4637 if ( (_BYTE)v136 )
Ritor1
parents:
diff changeset
4638 {
Ritor1
parents:
diff changeset
4639 if ( (_BYTE)v136 == 99 )
Ritor1
parents:
diff changeset
4640 {
Ritor1
parents:
diff changeset
4641 v137 = v2->field_30;
Ritor1
parents:
diff changeset
4642 v138 = v4->field_30;
Ritor1
parents:
diff changeset
4643 if ( v137 > v138 )
Ritor1
parents:
diff changeset
4644 {
Ritor1
parents:
diff changeset
4645 v4->field_30 = v137;
Ritor1
parents:
diff changeset
4646 v209 = v137 - v138;
Ritor1
parents:
diff changeset
4647 }
Ritor1
parents:
diff changeset
4648 }
Ritor1
parents:
diff changeset
4649 else
Ritor1
parents:
diff changeset
4650 {
Ritor1
parents:
diff changeset
4651 v136 = (char)v136;
Ritor1
parents:
diff changeset
4652 v6 = (char)v136 + v4->field_30 < 0;
Ritor1
parents:
diff changeset
4653 v4->field_30 += (char)v136;
Ritor1
parents:
diff changeset
4654 if ( v6 )
Ritor1
parents:
diff changeset
4655 v4->field_30 = 0;
Ritor1
parents:
diff changeset
4656 v209 = v136;
Ritor1
parents:
diff changeset
4657 }
Ritor1
parents:
diff changeset
4658 }
Ritor1
parents:
diff changeset
4659 LOBYTE(v139) = v107->field_58[2];
Ritor1
parents:
diff changeset
4660 if ( (_BYTE)v139 )
Ritor1
parents:
diff changeset
4661 {
Ritor1
parents:
diff changeset
4662 if ( (_BYTE)v139 == 99 )
Ritor1
parents:
diff changeset
4663 {
Ritor1
parents:
diff changeset
4664 v140 = v2->field_34;
Ritor1
parents:
diff changeset
4665 v141 = v4->field_34;
Ritor1
parents:
diff changeset
4666 if ( v140 > v141 )
Ritor1
parents:
diff changeset
4667 {
Ritor1
parents:
diff changeset
4668 v4->field_34 = v140;
Ritor1
parents:
diff changeset
4669 v207 = v140 - v141;
Ritor1
parents:
diff changeset
4670 }
Ritor1
parents:
diff changeset
4671 }
Ritor1
parents:
diff changeset
4672 else
Ritor1
parents:
diff changeset
4673 {
Ritor1
parents:
diff changeset
4674 v139 = (char)v139;
Ritor1
parents:
diff changeset
4675 v6 = (char)v139 + v4->field_34 < 0;
Ritor1
parents:
diff changeset
4676 v4->field_34 += (char)v139;
Ritor1
parents:
diff changeset
4677 if ( v6 )
Ritor1
parents:
diff changeset
4678 v4->field_34 = 0;
Ritor1
parents:
diff changeset
4679 v207 = v139;
Ritor1
parents:
diff changeset
4680 }
Ritor1
parents:
diff changeset
4681 }
Ritor1
parents:
diff changeset
4682 LOBYTE(v142) = v107->field_58[3];
Ritor1
parents:
diff changeset
4683 if ( (_BYTE)v142 )
Ritor1
parents:
diff changeset
4684 {
Ritor1
parents:
diff changeset
4685 if ( (_BYTE)v142 == 99 )
Ritor1
parents:
diff changeset
4686 {
Ritor1
parents:
diff changeset
4687 v143 = v2->field_38;
Ritor1
parents:
diff changeset
4688 v144 = v4->field_38;
Ritor1
parents:
diff changeset
4689 if ( v143 > v144 )
Ritor1
parents:
diff changeset
4690 {
Ritor1
parents:
diff changeset
4691 v4->field_38 = v143;
Ritor1
parents:
diff changeset
4692 v206 = v143 - v144;
Ritor1
parents:
diff changeset
4693 }
Ritor1
parents:
diff changeset
4694 }
Ritor1
parents:
diff changeset
4695 else
Ritor1
parents:
diff changeset
4696 {
Ritor1
parents:
diff changeset
4697 v142 = (char)v142;
Ritor1
parents:
diff changeset
4698 v6 = (char)v142 + v4->field_38 < 0;
Ritor1
parents:
diff changeset
4699 v4->field_38 += (char)v142;
Ritor1
parents:
diff changeset
4700 if ( v6 )
Ritor1
parents:
diff changeset
4701 v4->field_38 = 0;
Ritor1
parents:
diff changeset
4702 v206 = v142;
Ritor1
parents:
diff changeset
4703 }
Ritor1
parents:
diff changeset
4704 }
Ritor1
parents:
diff changeset
4705 LOBYTE(v145) = v107->field_58[4];
Ritor1
parents:
diff changeset
4706 if ( (_BYTE)v145 )
Ritor1
parents:
diff changeset
4707 {
Ritor1
parents:
diff changeset
4708 if ( (_BYTE)v145 == 99 )
Ritor1
parents:
diff changeset
4709 {
Ritor1
parents:
diff changeset
4710 v146 = v2->field_3C;
Ritor1
parents:
diff changeset
4711 v147 = v4->field_3C;
Ritor1
parents:
diff changeset
4712 if ( v146 > v147 )
Ritor1
parents:
diff changeset
4713 {
Ritor1
parents:
diff changeset
4714 v4->field_3C = v146;
Ritor1
parents:
diff changeset
4715 v204 = v146 - v147;
Ritor1
parents:
diff changeset
4716 }
Ritor1
parents:
diff changeset
4717 }
Ritor1
parents:
diff changeset
4718 else
Ritor1
parents:
diff changeset
4719 {
Ritor1
parents:
diff changeset
4720 v145 = (char)v145;
Ritor1
parents:
diff changeset
4721 v6 = (char)v145 + v4->field_3C < 0;
Ritor1
parents:
diff changeset
4722 v4->field_3C += (char)v145;
Ritor1
parents:
diff changeset
4723 if ( v6 )
Ritor1
parents:
diff changeset
4724 v4->field_3C = 0;
Ritor1
parents:
diff changeset
4725 v204 = v145;
Ritor1
parents:
diff changeset
4726 }
Ritor1
parents:
diff changeset
4727 }
Ritor1
parents:
diff changeset
4728 LOBYTE(v148) = v107->field_58[5];
Ritor1
parents:
diff changeset
4729 if ( (_BYTE)v148 )
Ritor1
parents:
diff changeset
4730 {
Ritor1
parents:
diff changeset
4731 if ( (_BYTE)v148 == 99 )
Ritor1
parents:
diff changeset
4732 {
Ritor1
parents:
diff changeset
4733 v149 = v2->field_40;
Ritor1
parents:
diff changeset
4734 v150 = v4->field_40;
Ritor1
parents:
diff changeset
4735 if ( v149 > v150 )
Ritor1
parents:
diff changeset
4736 {
Ritor1
parents:
diff changeset
4737 v4->field_40 = v149;
Ritor1
parents:
diff changeset
4738 v202 = v149 - v150;
Ritor1
parents:
diff changeset
4739 }
Ritor1
parents:
diff changeset
4740 }
Ritor1
parents:
diff changeset
4741 else
Ritor1
parents:
diff changeset
4742 {
Ritor1
parents:
diff changeset
4743 v148 = (char)v148;
Ritor1
parents:
diff changeset
4744 v6 = (char)v148 + v4->field_40 < 0;
Ritor1
parents:
diff changeset
4745 v4->field_40 += (char)v148;
Ritor1
parents:
diff changeset
4746 if ( v6 )
Ritor1
parents:
diff changeset
4747 v4->field_40 = 0;
Ritor1
parents:
diff changeset
4748 v202 = v148;
Ritor1
parents:
diff changeset
4749 }
Ritor1
parents:
diff changeset
4750 }
Ritor1
parents:
diff changeset
4751 v151 = v107->field_58[6];
Ritor1
parents:
diff changeset
4752 if ( v151 )
Ritor1
parents:
diff changeset
4753 {
Ritor1
parents:
diff changeset
4754 v195 = am_40D402(v189, v151);
Ritor1
parents:
diff changeset
4755 v191 = v107->field_58[6] - v195;
Ritor1
parents:
diff changeset
4756 }
Ritor1
parents:
diff changeset
4757 LOBYTE(v152) = v107->field_58[7];
Ritor1
parents:
diff changeset
4758 if ( (_BYTE)v152 )
Ritor1
parents:
diff changeset
4759 {
Ritor1
parents:
diff changeset
4760 if ( (_BYTE)v152 == 99 )
Ritor1
parents:
diff changeset
4761 {
Ritor1
parents:
diff changeset
4762 v153 = v2->field_28;
Ritor1
parents:
diff changeset
4763 v154 = v4->field_28;
Ritor1
parents:
diff changeset
4764 if ( v153 > v154 )
Ritor1
parents:
diff changeset
4765 {
Ritor1
parents:
diff changeset
4766 v4->field_28 = v153;
Ritor1
parents:
diff changeset
4767 v200 = v153 - v154;
Ritor1
parents:
diff changeset
4768 }
Ritor1
parents:
diff changeset
4769 }
Ritor1
parents:
diff changeset
4770 else
Ritor1
parents:
diff changeset
4771 {
Ritor1
parents:
diff changeset
4772 v152 = (char)v152;
Ritor1
parents:
diff changeset
4773 v6 = (char)v152 + v4->field_28 < 0;
Ritor1
parents:
diff changeset
4774 v4->field_28 += (char)v152;
Ritor1
parents:
diff changeset
4775 if ( v6 )
Ritor1
parents:
diff changeset
4776 v4->field_28 = 0;
Ritor1
parents:
diff changeset
4777 v200 = v152;
Ritor1
parents:
diff changeset
4778 }
Ritor1
parents:
diff changeset
4779 }
Ritor1
parents:
diff changeset
4780 LOBYTE(v155) = v107->field_58[8];
Ritor1
parents:
diff changeset
4781 if ( (_BYTE)v155 )
Ritor1
parents:
diff changeset
4782 {
Ritor1
parents:
diff changeset
4783 if ( (_BYTE)v155 == 99 )
Ritor1
parents:
diff changeset
4784 {
Ritor1
parents:
diff changeset
4785 v156 = v2->field_24;
Ritor1
parents:
diff changeset
4786 v157 = v4->field_24;
Ritor1
parents:
diff changeset
4787 if ( v156 > v157 )
Ritor1
parents:
diff changeset
4788 {
Ritor1
parents:
diff changeset
4789 v4->field_24 = v156;
Ritor1
parents:
diff changeset
4790 v198 = v156 - v157;
Ritor1
parents:
diff changeset
4791 }
Ritor1
parents:
diff changeset
4792 }
Ritor1
parents:
diff changeset
4793 else
Ritor1
parents:
diff changeset
4794 {
Ritor1
parents:
diff changeset
4795 v155 = (char)v155;
Ritor1
parents:
diff changeset
4796 v6 = (char)v155 + v4->field_24 < 0;
Ritor1
parents:
diff changeset
4797 v4->field_24 += (char)v155;
Ritor1
parents:
diff changeset
4798 if ( v6 )
Ritor1
parents:
diff changeset
4799 v4->field_24 = 0;
Ritor1
parents:
diff changeset
4800 v198 = v155;
Ritor1
parents:
diff changeset
4801 }
Ritor1
parents:
diff changeset
4802 }
Ritor1
parents:
diff changeset
4803 LOBYTE(v158) = v107->field_58[9];
Ritor1
parents:
diff changeset
4804 if ( (_BYTE)v158 )
Ritor1
parents:
diff changeset
4805 {
Ritor1
parents:
diff changeset
4806 if ( (_BYTE)v158 == 99 )
Ritor1
parents:
diff changeset
4807 {
Ritor1
parents:
diff changeset
4808 v159 = v2->field_2C;
Ritor1
parents:
diff changeset
4809 v160 = v4->field_2C;
Ritor1
parents:
diff changeset
4810 if ( v159 != v160 )
Ritor1
parents:
diff changeset
4811 {
Ritor1
parents:
diff changeset
4812 if ( v159 <= v160 )
Ritor1
parents:
diff changeset
4813 {
Ritor1
parents:
diff changeset
4814 v2->field_2C = v160;
Ritor1
parents:
diff changeset
4815 v194 = v160 - v159;
Ritor1
parents:
diff changeset
4816 }
Ritor1
parents:
diff changeset
4817 else
Ritor1
parents:
diff changeset
4818 {
Ritor1
parents:
diff changeset
4819 v4->field_2C = v159;
Ritor1
parents:
diff changeset
4820 v211 = v159 - v160;
Ritor1
parents:
diff changeset
4821 }
Ritor1
parents:
diff changeset
4822 }
Ritor1
parents:
diff changeset
4823 }
Ritor1
parents:
diff changeset
4824 else
Ritor1
parents:
diff changeset
4825 {
Ritor1
parents:
diff changeset
4826 v158 = (char)v158;
Ritor1
parents:
diff changeset
4827 v2->field_2C += (char)v158;
Ritor1
parents:
diff changeset
4828 v4->field_2C += (char)v158;
Ritor1
parents:
diff changeset
4829 if ( v2->field_2C < 0 )
Ritor1
parents:
diff changeset
4830 v2->field_2C = 0;
Ritor1
parents:
diff changeset
4831 if ( v4->field_2C < 0 )
Ritor1
parents:
diff changeset
4832 v4->field_2C = 0;
Ritor1
parents:
diff changeset
4833 v194 = v158;
Ritor1
parents:
diff changeset
4834 v211 = v158;
Ritor1
parents:
diff changeset
4835 }
Ritor1
parents:
diff changeset
4836 }
Ritor1
parents:
diff changeset
4837 LOBYTE(v161) = v107->field_58[10];
Ritor1
parents:
diff changeset
4838 if ( (_BYTE)v161 )
Ritor1
parents:
diff changeset
4839 {
Ritor1
parents:
diff changeset
4840 if ( (_BYTE)v161 == 99 )
Ritor1
parents:
diff changeset
4841 {
Ritor1
parents:
diff changeset
4842 v162 = v2->field_30;
Ritor1
parents:
diff changeset
4843 v163 = v4->field_30;
Ritor1
parents:
diff changeset
4844 if ( v162 != v163 )
Ritor1
parents:
diff changeset
4845 {
Ritor1
parents:
diff changeset
4846 if ( v162 <= v163 )
Ritor1
parents:
diff changeset
4847 {
Ritor1
parents:
diff changeset
4848 v2->field_30 = v163;
Ritor1
parents:
diff changeset
4849 v210 = v163 - v162;
Ritor1
parents:
diff changeset
4850 }
Ritor1
parents:
diff changeset
4851 else
Ritor1
parents:
diff changeset
4852 {
Ritor1
parents:
diff changeset
4853 v4->field_30 = v162;
Ritor1
parents:
diff changeset
4854 v209 = v162 - v163;
Ritor1
parents:
diff changeset
4855 }
Ritor1
parents:
diff changeset
4856 }
Ritor1
parents:
diff changeset
4857 }
Ritor1
parents:
diff changeset
4858 else
Ritor1
parents:
diff changeset
4859 {
Ritor1
parents:
diff changeset
4860 v161 = (char)v161;
Ritor1
parents:
diff changeset
4861 v2->field_30 += (char)v161;
Ritor1
parents:
diff changeset
4862 v4->field_30 += (char)v161;
Ritor1
parents:
diff changeset
4863 if ( v2->field_30 < 0 )
Ritor1
parents:
diff changeset
4864 v2->field_30 = 0;
Ritor1
parents:
diff changeset
4865 if ( v4->field_30 < 0 )
Ritor1
parents:
diff changeset
4866 v4->field_30 = 0;
Ritor1
parents:
diff changeset
4867 v209 = v161;
Ritor1
parents:
diff changeset
4868 v210 = v161;
Ritor1
parents:
diff changeset
4869 }
Ritor1
parents:
diff changeset
4870 }
Ritor1
parents:
diff changeset
4871 LOBYTE(v164) = v107->field_58[11];
Ritor1
parents:
diff changeset
4872 if ( (_BYTE)v164 )
Ritor1
parents:
diff changeset
4873 {
Ritor1
parents:
diff changeset
4874 if ( (_BYTE)v164 == 99 )
Ritor1
parents:
diff changeset
4875 {
Ritor1
parents:
diff changeset
4876 v165 = v2->field_34;
Ritor1
parents:
diff changeset
4877 v166 = v4->field_34;
Ritor1
parents:
diff changeset
4878 if ( v165 != v166 )
Ritor1
parents:
diff changeset
4879 {
Ritor1
parents:
diff changeset
4880 if ( v165 <= v166 )
Ritor1
parents:
diff changeset
4881 {
Ritor1
parents:
diff changeset
4882 v2->field_34 = v166;
Ritor1
parents:
diff changeset
4883 v208 = v166 - v165;
Ritor1
parents:
diff changeset
4884 }
Ritor1
parents:
diff changeset
4885 else
Ritor1
parents:
diff changeset
4886 {
Ritor1
parents:
diff changeset
4887 v4->field_34 = v165;
Ritor1
parents:
diff changeset
4888 v207 = v165 - v166;
Ritor1
parents:
diff changeset
4889 }
Ritor1
parents:
diff changeset
4890 }
Ritor1
parents:
diff changeset
4891 }
Ritor1
parents:
diff changeset
4892 else
Ritor1
parents:
diff changeset
4893 {
Ritor1
parents:
diff changeset
4894 v164 = (char)v164;
Ritor1
parents:
diff changeset
4895 v2->field_34 += (char)v164;
Ritor1
parents:
diff changeset
4896 v4->field_34 += (char)v164;
Ritor1
parents:
diff changeset
4897 if ( v2->field_34 < 0 )
Ritor1
parents:
diff changeset
4898 v2->field_34 = 0;
Ritor1
parents:
diff changeset
4899 if ( v4->field_34 < 0 )
Ritor1
parents:
diff changeset
4900 v4->field_34 = 0;
Ritor1
parents:
diff changeset
4901 v208 = v164;
Ritor1
parents:
diff changeset
4902 v207 = v164;
Ritor1
parents:
diff changeset
4903 }
Ritor1
parents:
diff changeset
4904 }
Ritor1
parents:
diff changeset
4905 LOBYTE(v167) = v107->field_58[12];
Ritor1
parents:
diff changeset
4906 if ( (_BYTE)v167 )
Ritor1
parents:
diff changeset
4907 {
Ritor1
parents:
diff changeset
4908 if ( (_BYTE)v167 == 99 )
Ritor1
parents:
diff changeset
4909 {
Ritor1
parents:
diff changeset
4910 v168 = v2->field_38;
Ritor1
parents:
diff changeset
4911 v169 = v4->field_38;
Ritor1
parents:
diff changeset
4912 if ( v168 != v169 )
Ritor1
parents:
diff changeset
4913 {
Ritor1
parents:
diff changeset
4914 if ( v168 <= v169 )
Ritor1
parents:
diff changeset
4915 {
Ritor1
parents:
diff changeset
4916 v2->field_38 = v169;
Ritor1
parents:
diff changeset
4917 v197 = v169 - v168;
Ritor1
parents:
diff changeset
4918 }
Ritor1
parents:
diff changeset
4919 else
Ritor1
parents:
diff changeset
4920 {
Ritor1
parents:
diff changeset
4921 v4->field_38 = v168;
Ritor1
parents:
diff changeset
4922 v206 = v168 - v169;
Ritor1
parents:
diff changeset
4923 }
Ritor1
parents:
diff changeset
4924 }
Ritor1
parents:
diff changeset
4925 }
Ritor1
parents:
diff changeset
4926 else
Ritor1
parents:
diff changeset
4927 {
Ritor1
parents:
diff changeset
4928 v167 = (char)v167;
Ritor1
parents:
diff changeset
4929 v2->field_38 += (char)v167;
Ritor1
parents:
diff changeset
4930 v4->field_38 += (char)v167;
Ritor1
parents:
diff changeset
4931 if ( v2->field_38 < 0 )
Ritor1
parents:
diff changeset
4932 v2->field_38 = 0;
Ritor1
parents:
diff changeset
4933 if ( v4->field_38 < 0 )
Ritor1
parents:
diff changeset
4934 v4->field_38 = 0;
Ritor1
parents:
diff changeset
4935 v197 = v167;
Ritor1
parents:
diff changeset
4936 v206 = v167;
Ritor1
parents:
diff changeset
4937 }
Ritor1
parents:
diff changeset
4938 }
Ritor1
parents:
diff changeset
4939 LOBYTE(v170) = v107->field_58[13];
Ritor1
parents:
diff changeset
4940 if ( v170 )
Ritor1
parents:
diff changeset
4941 {
Ritor1
parents:
diff changeset
4942 if ( v170 == 99 )
Ritor1
parents:
diff changeset
4943 {
Ritor1
parents:
diff changeset
4944 v171 = v2->field_3C;
Ritor1
parents:
diff changeset
4945 v172 = v4->field_3C;
Ritor1
parents:
diff changeset
4946 if ( v171 != v172 )
Ritor1
parents:
diff changeset
4947 {
Ritor1
parents:
diff changeset
4948 if ( v171 <= v172 )
Ritor1
parents:
diff changeset
4949 {
Ritor1
parents:
diff changeset
4950 v205 = v172 > v171;
Ritor1
parents:
diff changeset
4951 v2->field_3C = v172;
Ritor1
parents:
diff changeset
4952 }
Ritor1
parents:
diff changeset
4953 else
Ritor1
parents:
diff changeset
4954 {
Ritor1
parents:
diff changeset
4955 v204 = 1;
Ritor1
parents:
diff changeset
4956 v4->field_3C = v171;
Ritor1
parents:
diff changeset
4957 }
Ritor1
parents:
diff changeset
4958 }
Ritor1
parents:
diff changeset
4959 }
Ritor1
parents:
diff changeset
4960 else
Ritor1
parents:
diff changeset
4961 {
Ritor1
parents:
diff changeset
4962 v170 = v170;
Ritor1
parents:
diff changeset
4963 v2->field_3C += v170;
Ritor1
parents:
diff changeset
4964 v4->field_3C += v170;
Ritor1
parents:
diff changeset
4965 if ( v2->field_3C < 0 )
Ritor1
parents:
diff changeset
4966 v2->field_3C = 0;
Ritor1
parents:
diff changeset
4967 if ( v4->field_3C < 0 )
Ritor1
parents:
diff changeset
4968 v4->field_3C = 0;
Ritor1
parents:
diff changeset
4969 v205 = v170;
Ritor1
parents:
diff changeset
4970 v204 = v170;
Ritor1
parents:
diff changeset
4971 }
Ritor1
parents:
diff changeset
4972 }
Ritor1
parents:
diff changeset
4973 LOBYTE(v173) = v107->field_58[14];
Ritor1
parents:
diff changeset
4974 if ( (_BYTE)v173 )
Ritor1
parents:
diff changeset
4975 {
Ritor1
parents:
diff changeset
4976 if ( (_BYTE)v173 == 99 )
Ritor1
parents:
diff changeset
4977 {
Ritor1
parents:
diff changeset
4978 v174 = v2->field_40;
Ritor1
parents:
diff changeset
4979 v175 = v4->field_40;
Ritor1
parents:
diff changeset
4980 if ( v174 != v175 )
Ritor1
parents:
diff changeset
4981 {
Ritor1
parents:
diff changeset
4982 if ( v174 <= v175 )
Ritor1
parents:
diff changeset
4983 {
Ritor1
parents:
diff changeset
4984 v2->field_40 = v175;
Ritor1
parents:
diff changeset
4985 v203 = v175 - v174;
Ritor1
parents:
diff changeset
4986 }
Ritor1
parents:
diff changeset
4987 else
Ritor1
parents:
diff changeset
4988 {
Ritor1
parents:
diff changeset
4989 v4->field_40 = v174;
Ritor1
parents:
diff changeset
4990 v202 = v174 - v175;
Ritor1
parents:
diff changeset
4991 }
Ritor1
parents:
diff changeset
4992 }
Ritor1
parents:
diff changeset
4993 }
Ritor1
parents:
diff changeset
4994 else
Ritor1
parents:
diff changeset
4995 {
Ritor1
parents:
diff changeset
4996 v173 = (char)v173;
Ritor1
parents:
diff changeset
4997 v2->field_40 += (char)v173;
Ritor1
parents:
diff changeset
4998 v4->field_40 += (char)v173;
Ritor1
parents:
diff changeset
4999 if ( v2->field_40 < 0 )
Ritor1
parents:
diff changeset
5000 v2->field_40 = 0;
Ritor1
parents:
diff changeset
5001 if ( v4->field_40 < 0 )
Ritor1
parents:
diff changeset
5002 v4->field_40 = 0;
Ritor1
parents:
diff changeset
5003 v203 = v173;
Ritor1
parents:
diff changeset
5004 v202 = v173;
Ritor1
parents:
diff changeset
5005 }
Ritor1
parents:
diff changeset
5006 }
Ritor1
parents:
diff changeset
5007 v176 = v107->field_58[15];
Ritor1
parents:
diff changeset
5008 if ( v176 )
Ritor1
parents:
diff changeset
5009 {
Ritor1
parents:
diff changeset
5010 v177 = am_40D402(v193, v176);
Ritor1
parents:
diff changeset
5011 v178 = v107->field_58[15];
Ritor1
parents:
diff changeset
5012 v196 = v177;
Ritor1
parents:
diff changeset
5013 v179 = am_40D402(v189, v178);
Ritor1
parents:
diff changeset
5014 v195 = v179;
Ritor1
parents:
diff changeset
5015 v180 = v107->field_58[15] - v179;
Ritor1
parents:
diff changeset
5016 v192 = v107->field_58[15] - v196;
Ritor1
parents:
diff changeset
5017 v191 = v180;
Ritor1
parents:
diff changeset
5018 }
Ritor1
parents:
diff changeset
5019 LOBYTE(v181) = LOBYTE(v107->field_68);
Ritor1
parents:
diff changeset
5020 if ( (_BYTE)v181 )
Ritor1
parents:
diff changeset
5021 {
Ritor1
parents:
diff changeset
5022 if ( (_BYTE)v181 == 99 )
Ritor1
parents:
diff changeset
5023 {
Ritor1
parents:
diff changeset
5024 v182 = v2->field_28;
Ritor1
parents:
diff changeset
5025 v183 = v4->field_28;
Ritor1
parents:
diff changeset
5026 if ( v182 != v183 )
Ritor1
parents:
diff changeset
5027 {
Ritor1
parents:
diff changeset
5028 if ( v182 <= v183 )
Ritor1
parents:
diff changeset
5029 {
Ritor1
parents:
diff changeset
5030 v2->field_28 = v183;
Ritor1
parents:
diff changeset
5031 v201 = v183 - v182;
Ritor1
parents:
diff changeset
5032 }
Ritor1
parents:
diff changeset
5033 else
Ritor1
parents:
diff changeset
5034 {
Ritor1
parents:
diff changeset
5035 v4->field_28 = v182;
Ritor1
parents:
diff changeset
5036 v200 = v182 - v183;
Ritor1
parents:
diff changeset
5037 }
Ritor1
parents:
diff changeset
5038 }
Ritor1
parents:
diff changeset
5039 }
Ritor1
parents:
diff changeset
5040 else
Ritor1
parents:
diff changeset
5041 {
Ritor1
parents:
diff changeset
5042 v181 = (char)v181;
Ritor1
parents:
diff changeset
5043 v2->field_28 += (char)v181;
Ritor1
parents:
diff changeset
5044 v4->field_28 += (char)v181;
Ritor1
parents:
diff changeset
5045 if ( v2->field_28 < 0 )
Ritor1
parents:
diff changeset
5046 v2->field_28 = 0;
Ritor1
parents:
diff changeset
5047 if ( v4->field_28 < 0 )
Ritor1
parents:
diff changeset
5048 v4->field_28 = 0;
Ritor1
parents:
diff changeset
5049 v201 = v181;
Ritor1
parents:
diff changeset
5050 v200 = v181;
Ritor1
parents:
diff changeset
5051 }
Ritor1
parents:
diff changeset
5052 }
Ritor1
parents:
diff changeset
5053 LOBYTE(v103) = BYTE1(v107->field_68);
Ritor1
parents:
diff changeset
5054 break;
Ritor1
parents:
diff changeset
5055 }
Ritor1
parents:
diff changeset
5056 if ( (_BYTE)v103 )
Ritor1
parents:
diff changeset
5057 {
Ritor1
parents:
diff changeset
5058 if ( (_BYTE)v103 == 99 )
Ritor1
parents:
diff changeset
5059 {
Ritor1
parents:
diff changeset
5060 v184 = v2->field_24;
Ritor1
parents:
diff changeset
5061 v185 = v4->field_24;
Ritor1
parents:
diff changeset
5062 if ( v184 != v185 )
Ritor1
parents:
diff changeset
5063 {
Ritor1
parents:
diff changeset
5064 if ( v184 <= v185 )
Ritor1
parents:
diff changeset
5065 {
Ritor1
parents:
diff changeset
5066 v2->field_24 = v185;
Ritor1
parents:
diff changeset
5067 v199 = v185 - v184;
Ritor1
parents:
diff changeset
5068 }
Ritor1
parents:
diff changeset
5069 else
Ritor1
parents:
diff changeset
5070 {
Ritor1
parents:
diff changeset
5071 v4->field_24 = v184;
Ritor1
parents:
diff changeset
5072 v198 = v184 - v185;
Ritor1
parents:
diff changeset
5073 }
Ritor1
parents:
diff changeset
5074 }
Ritor1
parents:
diff changeset
5075 }
Ritor1
parents:
diff changeset
5076 else
Ritor1
parents:
diff changeset
5077 {
Ritor1
parents:
diff changeset
5078 v103 = (char)v103;
Ritor1
parents:
diff changeset
5079 v2->field_24 += (char)v103;
Ritor1
parents:
diff changeset
5080 v4->field_24 += (char)v103;
Ritor1
parents:
diff changeset
5081 if ( v2->field_24 < 0 )
Ritor1
parents:
diff changeset
5082 v2->field_24 = 0;
Ritor1
parents:
diff changeset
5083 if ( v4->field_24 < 0 )
Ritor1
parents:
diff changeset
5084 v4->field_24 = 0;
Ritor1
parents:
diff changeset
5085 v199 = v103;
Ritor1
parents:
diff changeset
5086 v198 = v103;
Ritor1
parents:
diff changeset
5087 }
Ritor1
parents:
diff changeset
5088 }
Ritor1
parents:
diff changeset
5089 if ( v194 > 0 || v211 > 0 )
Ritor1
parents:
diff changeset
5090 ArcomageGame::PlaySound(0x1Eu);
Ritor1
parents:
diff changeset
5091 if ( v194 < 0 || v211 < 0 )
Ritor1
parents:
diff changeset
5092 ArcomageGame::PlaySound(0x1Fu);
Ritor1
parents:
diff changeset
5093 if ( v210 > 0 || v209 > 0 )
Ritor1
parents:
diff changeset
5094 ArcomageGame::PlaySound(0x21u);
Ritor1
parents:
diff changeset
5095 if ( v210 < 0 || v209 < 0 )
Ritor1
parents:
diff changeset
5096 ArcomageGame::PlaySound(0x22u);
Ritor1
parents:
diff changeset
5097 if ( v208 > 0 || v207 > 0 )
Ritor1
parents:
diff changeset
5098 ArcomageGame::PlaySound(0x24u);
Ritor1
parents:
diff changeset
5099 if ( v208 < 0 || v207 < 0 )
Ritor1
parents:
diff changeset
5100 ArcomageGame::PlaySound(0x25u);
Ritor1
parents:
diff changeset
5101 if ( v197 > 0 || v206 > 0 )
Ritor1
parents:
diff changeset
5102 ArcomageGame::PlaySound(0x27u);
Ritor1
parents:
diff changeset
5103 if ( v197 < 0 || v206 < 0 )
Ritor1
parents:
diff changeset
5104 ArcomageGame::PlaySound(0x28u);
Ritor1
parents:
diff changeset
5105 if ( v205 > 0 || v204 > 0 )
Ritor1
parents:
diff changeset
5106 ArcomageGame::PlaySound(0x2Au);
Ritor1
parents:
diff changeset
5107 if ( v205 < 0 || v204 < 0 )
Ritor1
parents:
diff changeset
5108 ArcomageGame::PlaySound(0x2Bu);
Ritor1
parents:
diff changeset
5109 if ( v203 > 0 || v202 > 0 )
Ritor1
parents:
diff changeset
5110 ArcomageGame::PlaySound(0x2Du);
Ritor1
parents:
diff changeset
5111 if ( v203 < 0 || v202 < 0 )
Ritor1
parents:
diff changeset
5112 ArcomageGame::PlaySound(0x2Eu);
Ritor1
parents:
diff changeset
5113 if ( v192 || v191 || v196 || v195 )
Ritor1
parents:
diff changeset
5114 ArcomageGame::PlaySound(0x30u);
Ritor1
parents:
diff changeset
5115 if ( v201 > 0 || v200 > 0 )
Ritor1
parents:
diff changeset
5116 ArcomageGame::PlaySound(0x31u);
Ritor1
parents:
diff changeset
5117 if ( v201 < 0 || v200 < 0 )
Ritor1
parents:
diff changeset
5118 ArcomageGame::PlaySound(0x32u);
Ritor1
parents:
diff changeset
5119 if ( v199 > 0 || v198 > 0 )
Ritor1
parents:
diff changeset
5120 ArcomageGame::PlaySound(0x34u);
Ritor1
parents:
diff changeset
5121 if ( v199 < 0 || v198 < 0 )
Ritor1
parents:
diff changeset
5122 ArcomageGame::PlaySound(0x35u);
Ritor1
parents:
diff changeset
5123 if ( v193 )
Ritor1
parents:
diff changeset
5124 {
Ritor1
parents:
diff changeset
5125 if ( v194 )
Ritor1
parents:
diff changeset
5126 {
Ritor1
parents:
diff changeset
5127 v187.x = 573;
Ritor1
parents:
diff changeset
5128 v187.y = 92;
Ritor1
parents:
diff changeset
5129 am_40D2B4(&v187, v194);
Ritor1
parents:
diff changeset
5130 }
Ritor1
parents:
diff changeset
5131 if ( v211 )
Ritor1
parents:
diff changeset
5132 {
Ritor1
parents:
diff changeset
5133 v187.x = 26;
Ritor1
parents:
diff changeset
5134 v187.y = 92;
Ritor1
parents:
diff changeset
5135 am_40D2B4(&v187, v211);
Ritor1
parents:
diff changeset
5136 }
Ritor1
parents:
diff changeset
5137 if ( v210 )
Ritor1
parents:
diff changeset
5138 {
Ritor1
parents:
diff changeset
5139 v187.x = 573;
Ritor1
parents:
diff changeset
5140 v187.y = 164;
Ritor1
parents:
diff changeset
5141 am_40D2B4(&v187, v210);
Ritor1
parents:
diff changeset
5142 }
Ritor1
parents:
diff changeset
5143 if ( v209 )
Ritor1
parents:
diff changeset
5144 {
Ritor1
parents:
diff changeset
5145 v187.x = 26;
Ritor1
parents:
diff changeset
5146 v187.y = 164;
Ritor1
parents:
diff changeset
5147 am_40D2B4(&v187, v209);
Ritor1
parents:
diff changeset
5148 }
Ritor1
parents:
diff changeset
5149 if ( v208 )
Ritor1
parents:
diff changeset
5150 {
Ritor1
parents:
diff changeset
5151 v187.x = 573;
Ritor1
parents:
diff changeset
5152 v187.y = 236;
Ritor1
parents:
diff changeset
5153 am_40D2B4(&v187, v208);
Ritor1
parents:
diff changeset
5154 }
Ritor1
parents:
diff changeset
5155 if ( v207 )
Ritor1
parents:
diff changeset
5156 {
Ritor1
parents:
diff changeset
5157 v187.x = 26;
Ritor1
parents:
diff changeset
5158 v187.y = 236;
Ritor1
parents:
diff changeset
5159 am_40D2B4(&v187, v207);
Ritor1
parents:
diff changeset
5160 }
Ritor1
parents:
diff changeset
5161 if ( v197 )
Ritor1
parents:
diff changeset
5162 {
Ritor1
parents:
diff changeset
5163 v187.x = 563;
Ritor1
parents:
diff changeset
5164 v187.y = 114;
Ritor1
parents:
diff changeset
5165 am_40D2B4(&v187, v197);
Ritor1
parents:
diff changeset
5166 }
Ritor1
parents:
diff changeset
5167 if ( v206 )
Ritor1
parents:
diff changeset
5168 {
Ritor1
parents:
diff changeset
5169 v187.x = 16;
Ritor1
parents:
diff changeset
5170 v187.y = 114;
Ritor1
parents:
diff changeset
5171 am_40D2B4(&v187, v206);
Ritor1
parents:
diff changeset
5172 }
Ritor1
parents:
diff changeset
5173 if ( v205 )
Ritor1
parents:
diff changeset
5174 {
Ritor1
parents:
diff changeset
5175 v187.x = 563;
Ritor1
parents:
diff changeset
5176 v187.y = 186;
Ritor1
parents:
diff changeset
5177 am_40D2B4(&v187, v205);
Ritor1
parents:
diff changeset
5178 }
Ritor1
parents:
diff changeset
5179 if ( v204 )
Ritor1
parents:
diff changeset
5180 {
Ritor1
parents:
diff changeset
5181 v187.x = 16;
Ritor1
parents:
diff changeset
5182 v187.y = 186;
Ritor1
parents:
diff changeset
5183 am_40D2B4(&v187, v204);
Ritor1
parents:
diff changeset
5184 }
Ritor1
parents:
diff changeset
5185 if ( v203 )
Ritor1
parents:
diff changeset
5186 {
Ritor1
parents:
diff changeset
5187 v187.x = 563;
Ritor1
parents:
diff changeset
5188 v187.y = 258;
Ritor1
parents:
diff changeset
5189 am_40D2B4(&v187, v203);
Ritor1
parents:
diff changeset
5190 }
Ritor1
parents:
diff changeset
5191 if ( v202 )
Ritor1
parents:
diff changeset
5192 {
Ritor1
parents:
diff changeset
5193 v187.x = 16;
Ritor1
parents:
diff changeset
5194 v187.y = 258;
Ritor1
parents:
diff changeset
5195 am_40D2B4(&v187, v202);
Ritor1
parents:
diff changeset
5196 }
Ritor1
parents:
diff changeset
5197 v186 = 296;
Ritor1
parents:
diff changeset
5198 if ( v201 )
Ritor1
parents:
diff changeset
5199 {
Ritor1
parents:
diff changeset
5200 v187.x = 442;
Ritor1
parents:
diff changeset
5201 v187.y = 296;
Ritor1
parents:
diff changeset
5202 am_40D2B4(&v187, v201);
Ritor1
parents:
diff changeset
5203 }
Ritor1
parents:
diff changeset
5204 if ( v200 )
Ritor1
parents:
diff changeset
5205 {
Ritor1
parents:
diff changeset
5206 v187.x = 180;
Ritor1
parents:
diff changeset
5207 v187.y = 296;
Ritor1
parents:
diff changeset
5208 am_40D2B4(&v187, v200);
Ritor1
parents:
diff changeset
5209 }
Ritor1
parents:
diff changeset
5210 if ( v199 )
Ritor1
parents:
diff changeset
5211 {
Ritor1
parents:
diff changeset
5212 v187.x = 514;
Ritor1
parents:
diff changeset
5213 v187.y = 296;
Ritor1
parents:
diff changeset
5214 am_40D2B4(&v187, v199);
Ritor1
parents:
diff changeset
5215 }
Ritor1
parents:
diff changeset
5216 if ( v198 )
Ritor1
parents:
diff changeset
5217 {
Ritor1
parents:
diff changeset
5218 v187.x = 122;
Ritor1
parents:
diff changeset
5219 v187.y = 296;
Ritor1
parents:
diff changeset
5220 am_40D2B4(&v187, v198);
Ritor1
parents:
diff changeset
5221 }
Ritor1
parents:
diff changeset
5222 if ( v196 )
Ritor1
parents:
diff changeset
5223 {
Ritor1
parents:
diff changeset
5224 v187.x = 442;
Ritor1
parents:
diff changeset
5225 v187.y = 296;
Ritor1
parents:
diff changeset
5226 am_40D2B4(&v187, v196);
Ritor1
parents:
diff changeset
5227 }
Ritor1
parents:
diff changeset
5228 if ( v192 )
Ritor1
parents:
diff changeset
5229 {
Ritor1
parents:
diff changeset
5230 v187.x = 514;
Ritor1
parents:
diff changeset
5231 v187.y = 296;
Ritor1
parents:
diff changeset
5232 am_40D2B4(&v187, v192);
Ritor1
parents:
diff changeset
5233 }
Ritor1
parents:
diff changeset
5234 if ( v195 )
Ritor1
parents:
diff changeset
5235 {
Ritor1
parents:
diff changeset
5236 v187.x = 180;
Ritor1
parents:
diff changeset
5237 v187.y = 296;
Ritor1
parents:
diff changeset
5238 am_40D2B4(&v187, v195);
Ritor1
parents:
diff changeset
5239 }
Ritor1
parents:
diff changeset
5240 if ( v191 )
Ritor1
parents:
diff changeset
5241 {
Ritor1
parents:
diff changeset
5242 v187.x = 122;
Ritor1
parents:
diff changeset
5243 goto LABEL_567;
Ritor1
parents:
diff changeset
5244 }
Ritor1
parents:
diff changeset
5245 }
Ritor1
parents:
diff changeset
5246 else
Ritor1
parents:
diff changeset
5247 {
Ritor1
parents:
diff changeset
5248 if ( v194 )
Ritor1
parents:
diff changeset
5249 {
Ritor1
parents:
diff changeset
5250 v187.x = 26;
Ritor1
parents:
diff changeset
5251 v187.y = 92;
Ritor1
parents:
diff changeset
5252 am_40D2B4(&v187, v194);
Ritor1
parents:
diff changeset
5253 }
Ritor1
parents:
diff changeset
5254 if ( v211 )
Ritor1
parents:
diff changeset
5255 {
Ritor1
parents:
diff changeset
5256 v187.x = 573;
Ritor1
parents:
diff changeset
5257 v187.y = 92;
Ritor1
parents:
diff changeset
5258 am_40D2B4(&v187, v211);
Ritor1
parents:
diff changeset
5259 }
Ritor1
parents:
diff changeset
5260 if ( v210 )
Ritor1
parents:
diff changeset
5261 {
Ritor1
parents:
diff changeset
5262 v187.x = 26;
Ritor1
parents:
diff changeset
5263 v187.y = 164;
Ritor1
parents:
diff changeset
5264 am_40D2B4(&v187, v210);
Ritor1
parents:
diff changeset
5265 }
Ritor1
parents:
diff changeset
5266 if ( v209 )
Ritor1
parents:
diff changeset
5267 {
Ritor1
parents:
diff changeset
5268 v187.x = 573;
Ritor1
parents:
diff changeset
5269 v187.y = 164;
Ritor1
parents:
diff changeset
5270 am_40D2B4(&v187, v209);
Ritor1
parents:
diff changeset
5271 }
Ritor1
parents:
diff changeset
5272 if ( v208 )
Ritor1
parents:
diff changeset
5273 {
Ritor1
parents:
diff changeset
5274 v187.x = 26;
Ritor1
parents:
diff changeset
5275 v187.y = 236;
Ritor1
parents:
diff changeset
5276 am_40D2B4(&v187, v208);
Ritor1
parents:
diff changeset
5277 }
Ritor1
parents:
diff changeset
5278 if ( v207 )
Ritor1
parents:
diff changeset
5279 {
Ritor1
parents:
diff changeset
5280 v187.x = 573;
Ritor1
parents:
diff changeset
5281 v187.y = 236;
Ritor1
parents:
diff changeset
5282 am_40D2B4(&v187, v207);
Ritor1
parents:
diff changeset
5283 }
Ritor1
parents:
diff changeset
5284 if ( v197 )
Ritor1
parents:
diff changeset
5285 {
Ritor1
parents:
diff changeset
5286 v187.x = 16;
Ritor1
parents:
diff changeset
5287 v187.y = 114;
Ritor1
parents:
diff changeset
5288 am_40D2B4(&v187, v197);
Ritor1
parents:
diff changeset
5289 }
Ritor1
parents:
diff changeset
5290 if ( v206 )
Ritor1
parents:
diff changeset
5291 {
Ritor1
parents:
diff changeset
5292 v187.x = 563;
Ritor1
parents:
diff changeset
5293 v187.y = 114;
Ritor1
parents:
diff changeset
5294 am_40D2B4(&v187, v206);
Ritor1
parents:
diff changeset
5295 }
Ritor1
parents:
diff changeset
5296 if ( v205 )
Ritor1
parents:
diff changeset
5297 {
Ritor1
parents:
diff changeset
5298 v187.x = 16;
Ritor1
parents:
diff changeset
5299 v187.y = 186;
Ritor1
parents:
diff changeset
5300 am_40D2B4(&v187, v205);
Ritor1
parents:
diff changeset
5301 }
Ritor1
parents:
diff changeset
5302 if ( v204 )
Ritor1
parents:
diff changeset
5303 {
Ritor1
parents:
diff changeset
5304 v187.x = 563;
Ritor1
parents:
diff changeset
5305 v187.y = 186;
Ritor1
parents:
diff changeset
5306 am_40D2B4(&v187, v204);
Ritor1
parents:
diff changeset
5307 }
Ritor1
parents:
diff changeset
5308 if ( v203 )
Ritor1
parents:
diff changeset
5309 {
Ritor1
parents:
diff changeset
5310 v187.x = 16;
Ritor1
parents:
diff changeset
5311 v187.y = 258;
Ritor1
parents:
diff changeset
5312 am_40D2B4(&v187, v203);
Ritor1
parents:
diff changeset
5313 }
Ritor1
parents:
diff changeset
5314 if ( v202 )
Ritor1
parents:
diff changeset
5315 {
Ritor1
parents:
diff changeset
5316 v187.x = 563;
Ritor1
parents:
diff changeset
5317 v187.y = 258;
Ritor1
parents:
diff changeset
5318 am_40D2B4(&v187, v202);
Ritor1
parents:
diff changeset
5319 }
Ritor1
parents:
diff changeset
5320 v186 = 296;
Ritor1
parents:
diff changeset
5321 if ( v201 )
Ritor1
parents:
diff changeset
5322 {
Ritor1
parents:
diff changeset
5323 v187.x = 180;
Ritor1
parents:
diff changeset
5324 v187.y = 296;
Ritor1
parents:
diff changeset
5325 am_40D2B4(&v187, v201);
Ritor1
parents:
diff changeset
5326 }
Ritor1
parents:
diff changeset
5327 if ( v200 )
Ritor1
parents:
diff changeset
5328 {
Ritor1
parents:
diff changeset
5329 v187.x = 442;
Ritor1
parents:
diff changeset
5330 v187.y = 296;
Ritor1
parents:
diff changeset
5331 am_40D2B4(&v187, v200);
Ritor1
parents:
diff changeset
5332 }
Ritor1
parents:
diff changeset
5333 if ( v199 )
Ritor1
parents:
diff changeset
5334 {
Ritor1
parents:
diff changeset
5335 v187.x = 122;
Ritor1
parents:
diff changeset
5336 v187.y = 296;
Ritor1
parents:
diff changeset
5337 am_40D2B4(&v187, v199);
Ritor1
parents:
diff changeset
5338 }
Ritor1
parents:
diff changeset
5339 if ( v198 )
Ritor1
parents:
diff changeset
5340 {
Ritor1
parents:
diff changeset
5341 v187.x = 514;
Ritor1
parents:
diff changeset
5342 v187.y = 296;
Ritor1
parents:
diff changeset
5343 am_40D2B4(&v187, v198);
Ritor1
parents:
diff changeset
5344 }
Ritor1
parents:
diff changeset
5345 if ( v196 )
Ritor1
parents:
diff changeset
5346 {
Ritor1
parents:
diff changeset
5347 v187.x = 180;
Ritor1
parents:
diff changeset
5348 v187.y = 296;
Ritor1
parents:
diff changeset
5349 am_40D2B4(&v187, v196);
Ritor1
parents:
diff changeset
5350 }
Ritor1
parents:
diff changeset
5351 if ( v192 )
Ritor1
parents:
diff changeset
5352 {
Ritor1
parents:
diff changeset
5353 v187.x = 122;
Ritor1
parents:
diff changeset
5354 v187.y = 296;
Ritor1
parents:
diff changeset
5355 am_40D2B4(&v187, v192);
Ritor1
parents:
diff changeset
5356 }
Ritor1
parents:
diff changeset
5357 if ( v195 )
Ritor1
parents:
diff changeset
5358 {
Ritor1
parents:
diff changeset
5359 v187.x = 442;
Ritor1
parents:
diff changeset
5360 v187.y = 296;
Ritor1
parents:
diff changeset
5361 am_40D2B4(&v187, v195);
Ritor1
parents:
diff changeset
5362 }
Ritor1
parents:
diff changeset
5363 if ( v191 )
Ritor1
parents:
diff changeset
5364 {
Ritor1
parents:
diff changeset
5365 v187.x = 514;
Ritor1
parents:
diff changeset
5366 LABEL_567:
Ritor1
parents:
diff changeset
5367 v187.y = v186;
Ritor1
parents:
diff changeset
5368 am_40D2B4(&v187, v191);
Ritor1
parents:
diff changeset
5369 return;
Ritor1
parents:
diff changeset
5370 }
Ritor1
parents:
diff changeset
5371 }
Ritor1
parents:
diff changeset
5372 }
Ritor1
parents:
diff changeset
5373
Ritor1
parents:
diff changeset
5374
Ritor1
parents:
diff changeset
5375
Ritor1
parents:
diff changeset
5376
Ritor1
parents:
diff changeset
5377 //----- (0040D2B4) --------------------------------------------------------
Ritor1
parents:
diff changeset
5378 int __fastcall am_40D2B4(Vec2_int_ *a1, int a2)
Ritor1
parents:
diff changeset
5379 {
Ritor1
parents:
diff changeset
5380 int v2; // ebp@1
Ritor1
parents:
diff changeset
5381 Vec2_int_ *v3; // edi@1
Ritor1
parents:
diff changeset
5382 char *v4; // ebx@1
Ritor1
parents:
diff changeset
5383 int result; // eax@3
Ritor1
parents:
diff changeset
5384 unsigned int v6; // esi@7
Ritor1
parents:
diff changeset
5385 stru272_stru0 *v7; // ecx@10
Ritor1
parents:
diff changeset
5386 stru272_stru0 *v8; // ecx@12
Ritor1
parents:
diff changeset
5387 int v9; // edx@17
Ritor1
parents:
diff changeset
5388 int v10; // ecx@17
Ritor1
parents:
diff changeset
5389 signed int v11; // [sp+10h] [bp-8h]@1
Ritor1
parents:
diff changeset
5390 stru272_stru0 **v12; // [sp+14h] [bp-4h]@1
Ritor1
parents:
diff changeset
5391
Ritor1
parents:
diff changeset
5392 v11 = 0;
Ritor1
parents:
diff changeset
5393 v2 = a2;
Ritor1
parents:
diff changeset
5394 v3 = a1;
Ritor1
parents:
diff changeset
5395 v4 = byte_4FABD0;
Ritor1
parents:
diff changeset
5396 v12 = (stru272_stru0 **)array_4FAC10;
Ritor1
parents:
diff changeset
5397 while ( *v4 )
Ritor1
parents:
diff changeset
5398 {
Ritor1
parents:
diff changeset
5399 result = (*v12)->_40E2A7();
Ritor1
parents:
diff changeset
5400 if ( !result )
Ritor1
parents:
diff changeset
5401 {
Ritor1
parents:
diff changeset
5402 *v4 = 0;
Ritor1
parents:
diff changeset
5403 --v11;
Ritor1
parents:
diff changeset
5404 v12 -= 1067;
Ritor1
parents:
diff changeset
5405 v4 -= 4268;
Ritor1
parents:
diff changeset
5406 }
Ritor1
parents:
diff changeset
5407 ++v11;
Ritor1
parents:
diff changeset
5408 v12 += 1067;
Ritor1
parents:
diff changeset
5409 v4 += 4268;
Ritor1
parents:
diff changeset
5410 if ( v11 >= 10 )
Ritor1
parents:
diff changeset
5411 return result;
Ritor1
parents:
diff changeset
5412 }
Ritor1
parents:
diff changeset
5413 v6 = 4268 * v11;
Ritor1
parents:
diff changeset
5414 byte_4FABD0[4268 * v11] = 1;
Ritor1
parents:
diff changeset
5415 if ( v2 <= 0 )
Ritor1
parents:
diff changeset
5416 {
Ritor1
parents:
diff changeset
5417 byte_4FABD1[v6] = 0;
Ritor1
parents:
diff changeset
5418 v2 = -v2;
Ritor1
parents:
diff changeset
5419 }
Ritor1
parents:
diff changeset
5420 else
Ritor1
parents:
diff changeset
5421 {
Ritor1
parents:
diff changeset
5422 byte_4FABD1[v6] = 1;
Ritor1
parents:
diff changeset
5423 }
Ritor1
parents:
diff changeset
5424 *(unsigned int *)((char *)&unk_4FABD4 + v6) = v3->x - 20;
Ritor1
parents:
diff changeset
5425 dword_4FABDC[v6 / 4] = v3->x + 20;
Ritor1
parents:
diff changeset
5426 dword_4FABD8[v6 / 4] = v3->y - 20;
Ritor1
parents:
diff changeset
5427 dword_4FABE0[v6 / 4] = v3->y + 20;
Ritor1
parents:
diff changeset
5428 v7 = array_4FAC10[v6 / 0x10AC].ptr_0;
Ritor1
parents:
diff changeset
5429 dword_4FABE4[v6 / 4] = -60;
Ritor1
parents:
diff changeset
5430 dword_4FABE8[v6 / 4] = 60;
Ritor1
parents:
diff changeset
5431 dword_4FABEC[v6 / 4] = 180;
Ritor1
parents:
diff changeset
5432 dword_4FABF0[v6 / 4] = 0x3F000000u;
Ritor1
parents:
diff changeset
5433 dword_4FABF4[v6 / 4] = 150;
Ritor1
parents:
diff changeset
5434 dword_4FABF8[v6 / 4] = 0x42480000u;
Ritor1
parents:
diff changeset
5435 dword_4FABFC[v6 / 4] = 0x40400000u;
Ritor1
parents:
diff changeset
5436 dword_4FAC00[v6 / 4] = 0x41000000u;
Ritor1
parents:
diff changeset
5437 dword_4FAC04[v6 / 4] = 5;
Ritor1
parents:
diff changeset
5438 dword_4FAC08[v6 / 4] = 15;
Ritor1
parents:
diff changeset
5439 dword_4FAC0C[v6 / 4] = (int)array_4FAC10[v6 / 0x10AC].field_4;
Ritor1
parents:
diff changeset
5440 v7->_40E01A((int)((char *)&unk_4FABD4 + v6));
Ritor1
parents:
diff changeset
5441 if ( 10 * v2 > 150 )
Ritor1
parents:
diff changeset
5442 v2 = 15;
Ritor1
parents:
diff changeset
5443 v8 = array_4FAC10[v6 / 0x10AC].ptr_0;
Ritor1
parents:
diff changeset
5444 if ( v8->field_0 != 0x67707274 )
Ritor1
parents:
diff changeset
5445 return 2;
Ritor1
parents:
diff changeset
5446 if ( !v8->field_59 )
Ritor1
parents:
diff changeset
5447 return 3;
Ritor1
parents:
diff changeset
5448 v8->field_8 = 10 * v2;
Ritor1
parents:
diff changeset
5449 v9 = v8->field_4;
Ritor1
parents:
diff changeset
5450 v8->field_30 = 0.0;
Ritor1
parents:
diff changeset
5451 v8->field_58 = 0;
Ritor1
parents:
diff changeset
5452 v8->field_44 = 0;
Ritor1
parents:
diff changeset
5453 v8->field_4C = 0;
Ritor1
parents:
diff changeset
5454 v8->field_48 = 0;
Ritor1
parents:
diff changeset
5455 v8->field_50 = 0;
Ritor1
parents:
diff changeset
5456 v10 = v8->field_54;
Ritor1
parents:
diff changeset
5457 do
Ritor1
parents:
diff changeset
5458 {
Ritor1
parents:
diff changeset
5459 *(unsigned int *)v10 = 0;
Ritor1
parents:
diff changeset
5460 v10 += 28;
Ritor1
parents:
diff changeset
5461 --v9;
Ritor1
parents:
diff changeset
5462 }
Ritor1
parents:
diff changeset
5463 while ( v9 );
Ritor1
parents:
diff changeset
5464 return 0;
Ritor1
parents:
diff changeset
5465 }
Ritor1
parents:
diff changeset
5466 // 40D2B4: using guessed type int __fastcall am_40D2B4(uint, uint);
Ritor1
parents:
diff changeset
5467 // 4FABD8: using guessed type int dword_4FABD8[];
Ritor1
parents:
diff changeset
5468 // 4FABDC: using guessed type int dword_4FABDC[];
Ritor1
parents:
diff changeset
5469 // 4FABE0: using guessed type int dword_4FABE0[];
Ritor1
parents:
diff changeset
5470 // 4FABE4: using guessed type int dword_4FABE4[];
Ritor1
parents:
diff changeset
5471 // 4FABE8: using guessed type int dword_4FABE8[];
Ritor1
parents:
diff changeset
5472 // 4FABEC: using guessed type int dword_4FABEC[];
Ritor1
parents:
diff changeset
5473 // 4FABF0: using guessed type int dword_4FABF0[];
Ritor1
parents:
diff changeset
5474 // 4FABF4: using guessed type int dword_4FABF4[];
Ritor1
parents:
diff changeset
5475 // 4FABF8: using guessed type int dword_4FABF8[];
Ritor1
parents:
diff changeset
5476 // 4FABFC: using guessed type int dword_4FABFC[];
Ritor1
parents:
diff changeset
5477 // 4FAC00: using guessed type int dword_4FAC00[];
Ritor1
parents:
diff changeset
5478 // 4FAC04: using guessed type int dword_4FAC04[];
Ritor1
parents:
diff changeset
5479 // 4FAC08: using guessed type int dword_4FAC08[];
Ritor1
parents:
diff changeset
5480 // 4FAC0C: using guessed type int dword_4FAC0C[];
Ritor1
parents:
diff changeset
5481
Ritor1
parents:
diff changeset
5482 //----- (0040D402) --------------------------------------------------------
Ritor1
parents:
diff changeset
5483 int __fastcall am_40D402(int a1, int a2)
Ritor1
parents:
diff changeset
5484 {
Ritor1
parents:
diff changeset
5485 ArcomageGame_stru0 *v2; // ecx@1
Ritor1
parents:
diff changeset
5486 int v3; // esi@1
Ritor1
parents:
diff changeset
5487 int result; // eax@3
Ritor1
parents:
diff changeset
5488
Ritor1
parents:
diff changeset
5489 v2 = &stru_505708[a1];
Ritor1
parents:
diff changeset
5490 v3 = v2->field_28;
Ritor1
parents:
diff changeset
5491 if ( v3 <= 0 )
Ritor1
parents:
diff changeset
5492 {
Ritor1
parents:
diff changeset
5493 result = 0;
Ritor1
parents:
diff changeset
5494 }
Ritor1
parents:
diff changeset
5495 else
Ritor1
parents:
diff changeset
5496 {
Ritor1
parents:
diff changeset
5497 if ( v3 >= -a2 )
Ritor1
parents:
diff changeset
5498 {
Ritor1
parents:
diff changeset
5499 result = a2;
Ritor1
parents:
diff changeset
5500 v2->field_28 = a2 + v3;
Ritor1
parents:
diff changeset
5501 goto LABEL_7;
Ritor1
parents:
diff changeset
5502 }
Ritor1
parents:
diff changeset
5503 a2 += v3;
Ritor1
parents:
diff changeset
5504 result = -v3;
Ritor1
parents:
diff changeset
5505 v2->field_28 = 0;
Ritor1
parents:
diff changeset
5506 }
Ritor1
parents:
diff changeset
5507 v2->field_24 += a2;
Ritor1
parents:
diff changeset
5508 LABEL_7:
Ritor1
parents:
diff changeset
5509 if ( v2->field_24 < 0 )
Ritor1
parents:
diff changeset
5510 v2->field_24 = 0;
Ritor1
parents:
diff changeset
5511 return result;
Ritor1
parents:
diff changeset
5512 }
Ritor1
parents:
diff changeset
5513 // 40D402: using guessed type int __fastcall am_40D402(uint, uint);
Ritor1
parents:
diff changeset
5514
Ritor1
parents:
diff changeset
5515 //----- (0040D444) --------------------------------------------------------
Ritor1
parents:
diff changeset
5516 int __cdecl am_40D444()
Ritor1
parents:
diff changeset
5517 {
Ritor1
parents:
diff changeset
5518 int v0; // esi@1
Ritor1
parents:
diff changeset
5519 int v1; // edi@1
Ritor1
parents:
diff changeset
5520 int v2; // eax@1
Ritor1
parents:
diff changeset
5521 int v3; // eax@23
Ritor1
parents:
diff changeset
5522 int v4; // edx@25
Ritor1
parents:
diff changeset
5523 int v5; // ecx@28
Ritor1
parents:
diff changeset
5524 int v6; // eax@28
Ritor1
parents:
diff changeset
5525 GUIWindow *v7; // ecx@50
Ritor1
parents:
diff changeset
5526 signed int v8; // eax@50
Ritor1
parents:
diff changeset
5527 char *v9; // eax@52
Ritor1
parents:
diff changeset
5528 signed int v10; // eax@54
Ritor1
parents:
diff changeset
5529 char *v11; // esi@59
Ritor1
parents:
diff changeset
5530 char *v12; // esi@65
Ritor1
parents:
diff changeset
5531 signed int v14; // [sp-4h] [bp-58h]@46
Ritor1
parents:
diff changeset
5532 char pText[64]; // [sp+Ch] [bp-48h]@1
Ritor1
parents:
diff changeset
5533 int xy[2]; // [sp+4Ch] [bp-8h]@1
Ritor1
parents:
diff changeset
5534
Ritor1
parents:
diff changeset
5535 v0 = -1;
Ritor1
parents:
diff changeset
5536 v1 = -1;
Ritor1
parents:
diff changeset
5537 //nullsub_1();
Ritor1
parents:
diff changeset
5538 xy[0] = 0;
Ritor1
parents:
diff changeset
5539 xy[1] = 0;
Ritor1
parents:
diff changeset
5540 inv_strcpy("Ïîáåäè", pText);
Ritor1
parents:
diff changeset
5541 v2 = 0;
Ritor1
parents:
diff changeset
5542 xy[1] = 160;
Ritor1
parents:
diff changeset
5543 xy[0] = 320 - 12 * v2 / 2;
Ritor1
parents:
diff changeset
5544 pPrimaryWindow_draws_text(-1, pText, xy);
Ritor1
parents:
diff changeset
5545 if ( stru_505708[0].field_24 < dword_4E1884 )
Ritor1
parents:
diff changeset
5546 {
Ritor1
parents:
diff changeset
5547 if ( stru_505708[1].field_24 < dword_4E1884 )
Ritor1
parents:
diff changeset
5548 goto LABEL_10;
Ritor1
parents:
diff changeset
5549 v0 = 2;
Ritor1
parents:
diff changeset
5550 }
Ritor1
parents:
diff changeset
5551 else
Ritor1
parents:
diff changeset
5552 {
Ritor1
parents:
diff changeset
5553 if ( stru_505708[1].field_24 < dword_4E1884 )
Ritor1
parents:
diff changeset
5554 {
Ritor1
parents:
diff changeset
5555 v0 = 1;
Ritor1
parents:
diff changeset
5556 }
Ritor1
parents:
diff changeset
5557 else
Ritor1
parents:
diff changeset
5558 {
Ritor1
parents:
diff changeset
5559 if ( stru_505708[0].field_24 == stru_505708[1].field_24 )
Ritor1
parents:
diff changeset
5560 {
Ritor1
parents:
diff changeset
5561 v0 = 0;
Ritor1
parents:
diff changeset
5562 v1 = 4;
Ritor1
parents:
diff changeset
5563 goto LABEL_10;
Ritor1
parents:
diff changeset
5564 }
Ritor1
parents:
diff changeset
5565 v0 = (stru_505708[0].field_24 <= stru_505708[1].field_24) + 1;
Ritor1
parents:
diff changeset
5566 }
Ritor1
parents:
diff changeset
5567 }
Ritor1
parents:
diff changeset
5568 v1 = 0;
Ritor1
parents:
diff changeset
5569 LABEL_10:
Ritor1
parents:
diff changeset
5570 if ( stru_505708[0].field_24 <= 0 )
Ritor1
parents:
diff changeset
5571 {
Ritor1
parents:
diff changeset
5572 if ( stru_505708[1].field_24 > 0 )
Ritor1
parents:
diff changeset
5573 {
Ritor1
parents:
diff changeset
5574 v0 = 2;
Ritor1
parents:
diff changeset
5575 }
Ritor1
parents:
diff changeset
5576 else
Ritor1
parents:
diff changeset
5577 {
Ritor1
parents:
diff changeset
5578 if ( stru_505708[0].field_24 == stru_505708[1].field_24 )
Ritor1
parents:
diff changeset
5579 {
Ritor1
parents:
diff changeset
5580 LABEL_20:
Ritor1
parents:
diff changeset
5581 if ( stru_505708[0].field_28 == stru_505708[1].field_28 )
Ritor1
parents:
diff changeset
5582 {
Ritor1
parents:
diff changeset
5583 v0 = 0;
Ritor1
parents:
diff changeset
5584 v1 = 4;
Ritor1
parents:
diff changeset
5585 }
Ritor1
parents:
diff changeset
5586 else
Ritor1
parents:
diff changeset
5587 {
Ritor1
parents:
diff changeset
5588 v0 = (stru_505708[0].field_28 <= stru_505708[1].field_28) + 1;
Ritor1
parents:
diff changeset
5589 v1 = 1;
Ritor1
parents:
diff changeset
5590 }
Ritor1
parents:
diff changeset
5591 goto LABEL_23;
Ritor1
parents:
diff changeset
5592 }
Ritor1
parents:
diff changeset
5593 v0 = (stru_505708[0].field_24 <= stru_505708[1].field_24) + 1;
Ritor1
parents:
diff changeset
5594 }
Ritor1
parents:
diff changeset
5595 goto LABEL_17;
Ritor1
parents:
diff changeset
5596 }
Ritor1
parents:
diff changeset
5597 if ( stru_505708[1].field_24 <= 0 )
Ritor1
parents:
diff changeset
5598 {
Ritor1
parents:
diff changeset
5599 v0 = 1;
Ritor1
parents:
diff changeset
5600 LABEL_17:
Ritor1
parents:
diff changeset
5601 v1 = 2;
Ritor1
parents:
diff changeset
5602 }
Ritor1
parents:
diff changeset
5603 if ( !v0 && v1 == 4 )
Ritor1
parents:
diff changeset
5604 goto LABEL_20;
Ritor1
parents:
diff changeset
5605 LABEL_23:
Ritor1
parents:
diff changeset
5606 v3 = stru_505708[0].field_38;
Ritor1
parents:
diff changeset
5607 if ( stru_505708[0].field_38 <= stru_505708[0].field_3C )
Ritor1
parents:
diff changeset
5608 {
Ritor1
parents:
diff changeset
5609 v3 = stru_505708[0].field_40;
Ritor1
parents:
diff changeset
5610 v4 = stru_505708[0].field_3C;
Ritor1
parents:
diff changeset
5611 if ( stru_505708[0].field_3C > stru_505708[0].field_40 )
Ritor1
parents:
diff changeset
5612 goto LABEL_28;
Ritor1
parents:
diff changeset
5613 }
Ritor1
parents:
diff changeset
5614 else
Ritor1
parents:
diff changeset
5615 {
Ritor1
parents:
diff changeset
5616 if ( stru_505708[0].field_38 <= stru_505708[0].field_40 )
Ritor1
parents:
diff changeset
5617 {
Ritor1
parents:
diff changeset
5618 v4 = stru_505708[0].field_40;
Ritor1
parents:
diff changeset
5619 goto LABEL_28;
Ritor1
parents:
diff changeset
5620 }
Ritor1
parents:
diff changeset
5621 }
Ritor1
parents:
diff changeset
5622 v4 = v3;
Ritor1
parents:
diff changeset
5623 LABEL_28:
Ritor1
parents:
diff changeset
5624 v5 = stru_505708[1].field_38;
Ritor1
parents:
diff changeset
5625 v6 = stru_505708[1].field_3C;
Ritor1
parents:
diff changeset
5626 if ( stru_505708[1].field_38 <= stru_505708[1].field_3C )
Ritor1
parents:
diff changeset
5627 {
Ritor1
parents:
diff changeset
5628 v5 = stru_505708[1].field_40;
Ritor1
parents:
diff changeset
5629 if ( stru_505708[1].field_3C > stru_505708[1].field_40 )
Ritor1
parents:
diff changeset
5630 goto LABEL_33;
Ritor1
parents:
diff changeset
5631 goto LABEL_32;
Ritor1
parents:
diff changeset
5632 }
Ritor1
parents:
diff changeset
5633 v6 = stru_505708[1].field_40;
Ritor1
parents:
diff changeset
5634 if ( stru_505708[1].field_38 > stru_505708[1].field_40 )
Ritor1
parents:
diff changeset
5635 LABEL_32:
Ritor1
parents:
diff changeset
5636 v6 = v5;
Ritor1
parents:
diff changeset
5637 LABEL_33:
Ritor1
parents:
diff changeset
5638 if ( v0 == -1 )
Ritor1
parents:
diff changeset
5639 {
Ritor1
parents:
diff changeset
5640 if ( v1 != -1 )
Ritor1
parents:
diff changeset
5641 goto LABEL_49;
Ritor1
parents:
diff changeset
5642 if ( v4 < dword_4E1888 )
Ritor1
parents:
diff changeset
5643 {
Ritor1
parents:
diff changeset
5644 if ( v6 < dword_4E1888 )
Ritor1
parents:
diff changeset
5645 goto LABEL_49;
Ritor1
parents:
diff changeset
5646 v0 = 2;
Ritor1
parents:
diff changeset
5647 }
Ritor1
parents:
diff changeset
5648 else
Ritor1
parents:
diff changeset
5649 {
Ritor1
parents:
diff changeset
5650 if ( v6 < dword_4E1888 )
Ritor1
parents:
diff changeset
5651 {
Ritor1
parents:
diff changeset
5652 v0 = 1;
Ritor1
parents:
diff changeset
5653 }
Ritor1
parents:
diff changeset
5654 else
Ritor1
parents:
diff changeset
5655 {
Ritor1
parents:
diff changeset
5656 if ( v4 == v6 )
Ritor1
parents:
diff changeset
5657 goto LABEL_46;
Ritor1
parents:
diff changeset
5658 v0 = (v4 <= v6) + 1;
Ritor1
parents:
diff changeset
5659 }
Ritor1
parents:
diff changeset
5660 }
Ritor1
parents:
diff changeset
5661 v1 = 3;
Ritor1
parents:
diff changeset
5662 }
Ritor1
parents:
diff changeset
5663 if ( !v0 && v1 == 4 )
Ritor1
parents:
diff changeset
5664 {
Ritor1
parents:
diff changeset
5665 if ( v4 != v6 )
Ritor1
parents:
diff changeset
5666 {
Ritor1
parents:
diff changeset
5667 v14 = 5;
Ritor1
parents:
diff changeset
5668 v0 = (v4 <= v6) + 1;
Ritor1
parents:
diff changeset
5669 goto LABEL_48;
Ritor1
parents:
diff changeset
5670 }
Ritor1
parents:
diff changeset
5671 LABEL_46:
Ritor1
parents:
diff changeset
5672 v0 = 0;
Ritor1
parents:
diff changeset
5673 v14 = 4;
Ritor1
parents:
diff changeset
5674 LABEL_48:
Ritor1
parents:
diff changeset
5675 v1 = v14;
Ritor1
parents:
diff changeset
5676 }
Ritor1
parents:
diff changeset
5677 LABEL_49:
Ritor1
parents:
diff changeset
5678 pArcomageGame->field_B0 = v1;
Ritor1
parents:
diff changeset
5679 pArcomageGame->uGameResult = v0;
Ritor1
parents:
diff changeset
5680 if ( v0 == 1 )
Ritor1
parents:
diff changeset
5681 {
336
ea55d6414029 Event_proceccor preliminary
Gloval
parents: 189
diff changeset
5682 v7 = window_SpeakInHouse;
ea55d6414029 Event_proceccor preliminary
Gloval
parents: 189
diff changeset
5683 v8 = (signed int)window_SpeakInHouse->ptr_1C;
0
Ritor1
parents:
diff changeset
5684 if ( v8 >= 108 )
Ritor1
parents:
diff changeset
5685 {
Ritor1
parents:
diff changeset
5686 if ( v8 <= 120 )
Ritor1
parents:
diff changeset
5687 {
Ritor1
parents:
diff changeset
5688 v9 = (char *)&pParty->uNumGoldInBank + v8 + 1;
Ritor1
parents:
diff changeset
5689 if ( !*v9 )
Ritor1
parents:
diff changeset
5690 {
Ritor1
parents:
diff changeset
5691 *v9 = 1;
Ritor1
parents:
diff changeset
5692
Ritor1
parents:
diff changeset
5693 //auto _a = (signed __int64)(p2DEvents_minus1__20[13 * (unsigned int)v7->ptr_1C] * 100.0);
Ritor1
parents:
diff changeset
5694 auto _a = (signed __int64)(p2DEvents[(unsigned int)v7->ptr_1C - 1].fPriceMultiplier * 100.0);
Ritor1
parents:
diff changeset
5695 party_finds_gold(_a, 0);
Ritor1
parents:
diff changeset
5696 }
Ritor1
parents:
diff changeset
5697 }
Ritor1
parents:
diff changeset
5698 }
Ritor1
parents:
diff changeset
5699 v10 = 108;
Ritor1
parents:
diff changeset
5700 do
Ritor1
parents:
diff changeset
5701 {
Ritor1
parents:
diff changeset
5702 if ( !*((unsigned char *)&pParty->uNumGoldInBank + v10 + 1) )
Ritor1
parents:
diff changeset
5703 break;
Ritor1
parents:
diff changeset
5704 ++v10;
Ritor1
parents:
diff changeset
5705 }
Ritor1
parents:
diff changeset
5706 while ( v10 <= 120 );
Ritor1
parents:
diff changeset
5707 if ( v10 == 121 )
484
4bd56919f075 avard quest guild bits
Gloval
parents: 463
diff changeset
5708 _449B7E_toggle_bit(pParty->_quest_bits, 238, 1u);
735
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 484
diff changeset
5709 v11 = (char *)pParty->pPlayers[0]._guilds_member_bits;
0
Ritor1
parents:
diff changeset
5710 do
Ritor1
parents:
diff changeset
5711 {
Ritor1
parents:
diff changeset
5712 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)v11, 1) )
949
Nomad
parents: 938
diff changeset
5713 _449B7E_toggle_bit((unsigned char *)v11, PLAYER_GUILD_BITS__ARCOMAGE_WIN, 1);
0
Ritor1
parents:
diff changeset
5714 v11 += 6972;
Ritor1
parents:
diff changeset
5715 }
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 336
diff changeset
5716 while ( (signed int)v11 < (signed int)((char *)&pParty->StandartItemsInShops[36] + 2) );
949
Nomad
parents: 938
diff changeset
5717 ++pParty->uNumArcomageWins;
Nomad
parents: 938
diff changeset
5718 if ( pParty->uNumArcomageWins > 1000000 )
Nomad
parents: 938
diff changeset
5719 pParty->uNumArcomageWins = 1000000;
0
Ritor1
parents:
diff changeset
5720 }
Ritor1
parents:
diff changeset
5721 else
Ritor1
parents:
diff changeset
5722 {
735
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 484
diff changeset
5723 v12 = (char *)pParty->pPlayers[0]._guilds_member_bits;
0
Ritor1
parents:
diff changeset
5724 do
Ritor1
parents:
diff changeset
5725 {
Ritor1
parents:
diff changeset
5726 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)v12, 1) )
949
Nomad
parents: 938
diff changeset
5727 _449B7E_toggle_bit((unsigned char *)v12, PLAYER_GUILD_BITS__ARCOMAGE_LOSE, 1);
0
Ritor1
parents:
diff changeset
5728 v12 += 6972;
Ritor1
parents:
diff changeset
5729 }
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 336
diff changeset
5730 while ( (signed int)v12 < (signed int)((char *)&pParty->StandartItemsInShops[36] + 2) );
949
Nomad
parents: 938
diff changeset
5731 ++pParty->uNumArcomageLoses;
Nomad
parents: 938
diff changeset
5732 if ( pParty->uNumArcomageLoses > 1000000 )
Nomad
parents: 938
diff changeset
5733 pParty->uNumArcomageLoses = 1000000;
0
Ritor1
parents:
diff changeset
5734 }
Ritor1
parents:
diff changeset
5735 return 0;
Ritor1
parents:
diff changeset
5736 }
Ritor1
parents:
diff changeset
5737
Ritor1
parents:
diff changeset
5738
Ritor1
parents:
diff changeset
5739
Ritor1
parents:
diff changeset
5740 //----- (00409C8B) --------------------------------------------------------
Ritor1
parents:
diff changeset
5741 void __cdecl PrepareArcomage()
Ritor1
parents:
diff changeset
5742 {
Ritor1
parents:
diff changeset
5743 int v0; // ecx@3
Ritor1
parents:
diff changeset
5744 signed __int64 v1; // qax@4
Ritor1
parents:
diff changeset
5745 int v2; // esi@4
Ritor1
parents:
diff changeset
5746 __int16 *v3; // esi@5
Ritor1
parents:
diff changeset
5747 signed int v4; // edi@5
Ritor1
parents:
diff changeset
5748 stru272 *v5; // esi@7
Ritor1
parents:
diff changeset
5749 int v6; // edx@9
Ritor1
parents:
diff changeset
5750 int v7; // ecx@9
Ritor1
parents:
diff changeset
5751 int pXYZW[4]; // [sp+8h] [bp-1Ch]@5
Ritor1
parents:
diff changeset
5752 int pXY[2]; // [sp+18h] [bp-Ch]@5
Ritor1
parents:
diff changeset
5753 int v10; // [sp+20h] [bp-4h]@3
Ritor1
parents:
diff changeset
5754
Ritor1
parents:
diff changeset
5755 if (pAsyncMouse)
Ritor1
parents:
diff changeset
5756 pAsyncMouse->_409E3D(1);
Ritor1
parents:
diff changeset
5757 pAudioPlayer->StopChannels(-1, -1);
Ritor1
parents:
diff changeset
5758 strcpy(pArcomageGame->pPlayer1Name, pArcomagePlayer1Name);
Ritor1
parents:
diff changeset
5759 strcpy(pArcomageGame->pPlayer2Name, pArcomagePlayer2Name);
Ritor1
parents:
diff changeset
5760 am_byte_4FAA76 = 0;
Ritor1
parents:
diff changeset
5761 am_byte_4FAA75 = 0;
Ritor1
parents:
diff changeset
5762 v10 = 1;
Ritor1
parents:
diff changeset
5763 v0 = (int)am_byte_4FAA7C;
Ritor1
parents:
diff changeset
5764 do
Ritor1
parents:
diff changeset
5765 {
Ritor1
parents:
diff changeset
5766 v1 = v10;
Ritor1
parents:
diff changeset
5767 *(int *)(v0 - 4) = -1;
Ritor1
parents:
diff changeset
5768 *(char *)v0 = 0;
Ritor1
parents:
diff changeset
5769 v0 += 32;
Ritor1
parents:
diff changeset
5770 v2 = 138 * (unsigned __int64)(v1 / 4) + 18;
Ritor1
parents:
diff changeset
5771 HIDWORD(v1) = 100 * (unsigned __int64)(v1 % 4) + 120;
Ritor1
parents:
diff changeset
5772 *(int *)(v0 - 28) = HIDWORD(v1);
Ritor1
parents:
diff changeset
5773 *(int *)(v0 - 24) = v2;
Ritor1
parents:
diff changeset
5774 *(int *)(v0 - 20) = (120 - HIDWORD(v1)) / 5;
Ritor1
parents:
diff changeset
5775 ++v10;
Ritor1
parents:
diff changeset
5776 *(int *)(v0 - 16) = (18 - v2) / 5;
Ritor1
parents:
diff changeset
5777 *(int *)(v0 - 12) = *(int *)(v0 - 28);
Ritor1
parents:
diff changeset
5778 *(int *)(v0 - 8) = *(int *)(v0 - 24);
Ritor1
parents:
diff changeset
5779 }
Ritor1
parents:
diff changeset
5780 while ( v10 - 1 < 10 );
Ritor1
parents:
diff changeset
5781 pXY[0] = 0;
Ritor1
parents:
diff changeset
5782 pXY[1] = 0;
Ritor1
parents:
diff changeset
5783 ArcomageGame::LoadBackground();
Ritor1
parents:
diff changeset
5784 pXYZW[0] = 0;
Ritor1
parents:
diff changeset
5785 pXYZW[2] = 640;
Ritor1
parents:
diff changeset
5786 pXYZW[1] = 0;
Ritor1
parents:
diff changeset
5787 pXYZW[3] = 480;
Ritor1
parents:
diff changeset
5788 am_BeginScene(pArcomageGame->pBackgroundPixels, -1, 1);
Ritor1
parents:
diff changeset
5789 Blt_Copy((ArcomageRect *)pXYZW, pXY, 2);
Ritor1
parents:
diff changeset
5790 am_EndScene();
Ritor1
parents:
diff changeset
5791 pRenderer->Present();
Ritor1
parents:
diff changeset
5792 ArcomageGame::LoadSprites();
Ritor1
parents:
diff changeset
5793 CallRenderPresent();
Ritor1
parents:
diff changeset
5794 v3 = am_sounds;
Ritor1
parents:
diff changeset
5795 v4 = 120;
Ritor1
parents:
diff changeset
5796 do
Ritor1
parents:
diff changeset
5797 {
Ritor1
parents:
diff changeset
5798 *v3 = pSoundList->LoadSound(v4++, 0);
Ritor1
parents:
diff changeset
5799 ++v3;
Ritor1
parents:
diff changeset
5800 }
Ritor1
parents:
diff changeset
5801 while ( (signed int)v3 <= (signed int)&unk_4FAA20 );
Ritor1
parents:
diff changeset
5802 v5 = array_4FAC10;
Ritor1
parents:
diff changeset
5803 do
Ritor1
parents:
diff changeset
5804 {
Ritor1
parents:
diff changeset
5805 v5->_40DFD1();
Ritor1
parents:
diff changeset
5806 ++v5;
Ritor1
parents:
diff changeset
5807 }
Ritor1
parents:
diff changeset
5808 while ( (signed int)v5 < (signed int)&unk_5052C8 );
Ritor1
parents:
diff changeset
5809 dword_4FABBC = -1;
Ritor1
parents:
diff changeset
5810 amuint_4FAA4C = -1;
Ritor1
parents:
diff changeset
5811 byte_4FAA74 = 0;
Ritor1
parents:
diff changeset
5812 pArcomageGame->field_F4 = 0;
Ritor1
parents:
diff changeset
5813 byte_4FAA2C = 0;
Ritor1
parents:
diff changeset
5814 byte_505880 = 0;
Ritor1
parents:
diff changeset
5815 dword_4FAA70 = 0;
Ritor1
parents:
diff changeset
5816 am_byte_4FAA77 = 0;
Ritor1
parents:
diff changeset
5817 am_409FE9();
Ritor1
parents:
diff changeset
5818 am_40A255(v7, v6);
Ritor1
parents:
diff changeset
5819 //nullsub_1();
Ritor1
parents:
diff changeset
5820 pArcomageGame->field_F5 = 0;
Ritor1
parents:
diff changeset
5821 pArcomageGame->pFont1 = pFontComic;
Ritor1
parents:
diff changeset
5822 pArcomageGame->pFont2 = pFontArrus;
Ritor1
parents:
diff changeset
5823 }
Ritor1
parents:
diff changeset
5824
Ritor1
parents:
diff changeset
5825
Ritor1
parents:
diff changeset
5826 //----- (0040D711) --------------------------------------------------------
Ritor1
parents:
diff changeset
5827 ArcomageGame::ArcomageGame()
Ritor1
parents:
diff changeset
5828 {
Ritor1
parents:
diff changeset
5829 ArcomageGame *v1; // esi@1
Ritor1
parents:
diff changeset
5830
Ritor1
parents:
diff changeset
5831 v1 = this;
Ritor1
parents:
diff changeset
5832 this->field_4 = 0;
Ritor1
parents:
diff changeset
5833 //RGBTexture::RGBTexture(&this->pGameBackground);
Ritor1
parents:
diff changeset
5834 //RGBTexture::RGBTexture(&v1->pSprites);
Ritor1
parents:
diff changeset
5835 v1->bGameInProgress = 0;
Ritor1
parents:
diff changeset
5836 v1->field_F9 = 0;
Ritor1
parents:
diff changeset
5837 }
938
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5838
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5839
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5840
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5841
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5842
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5843
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5844 //----- (00409BE8) --------------------------------------------------------
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5845 void __cdecl sub_409BE8()
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5846 {
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5847 void *v0; // eax@1
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5848 stru348 *v1; // eax@1
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5849 int v2; // ecx@1
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5850 int v3; // eax@1
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5851
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5852 v0 = window_SpeakInHouse->ptr_1C;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5853 dword_4E1874 = 5;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5854 v1 = &stru_4E1890[(int)((char *)v0 - 108)];
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5855 amuint_4E1860 = v1->field_4;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5856 amuint_4E1864 = v1->field_6;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5857 amuint_4E1868 = v1->field_8 - 1;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5858 amuint_4E186C = v1->field_A - 1;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5859 amuint_4E1870 = v1->field_C - 1;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5860 amuint_505884 = v1->field_E;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5861 amuint_505888 = v1->field_10;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5862 amuint_50588C = v1->field_12;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5863 dword_4E1878 = 1;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5864 dword_4E187C = 1;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5865 dword_4E1880 = 1;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5866 dword_4E1884 = v1->field_0;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5867 v2 = v1->field_2;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5868 v3 = v1->field_14;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5869 dword_4E1888 = v2;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5870 dword_4DF3A4 = v3;
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
5871 }