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