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