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