comparison Arcomage.cpp @ 1183:fa30ea497e94

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