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