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