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