annotate Arcomage.cpp @ 1093:c59ac5ea63f5

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