| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#include "Infotrons.h" |
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
void subAnimateInfotrons(int si) |
| 14 |
{ |
| 15 |
int tFld; |
| 16 |
|
| 17 |
int ax, bx, dx, X, Y; |
| 18 |
int al, bl; |
| 19 |
|
| 20 |
tFld = PlayField16[si]; |
| 21 |
if ((tFld & 0xFF) != fiInfotron) |
| 22 |
return; |
| 23 |
|
| 24 |
if (tFld == fiInfotron) |
| 25 |
{ |
| 26 |
ax = PlayField16[si + FieldWidth]; |
| 27 |
if (ax == 0) |
| 28 |
goto loc_g_11D5; |
| 29 |
|
| 30 |
if (ax == fiZonk) |
| 31 |
goto loc_g_11A6; |
| 32 |
|
| 33 |
if (ax == fiInfotron) |
| 34 |
goto loc_g_11A6; |
| 35 |
|
| 36 |
if (ax == fiRAM) |
| 37 |
goto loc_g_11A6; |
| 38 |
|
| 39 |
return; |
| 40 |
|
| 41 |
loc_g_11A6: |
| 42 |
ax = PlayField16[si + FieldWidth - 1]; |
| 43 |
if (ax == 0 || ax == 0x8888 || ax == 0xAAAA) |
| 44 |
goto loc_g_11DC; |
| 45 |
|
| 46 |
loc_g_11BD: |
| 47 |
ax = PlayField16[si + FieldWidth + 1]; |
| 48 |
if (ax == 0 || ax == 0x8888 || ax == 0xAAAA) |
| 49 |
goto loc_g_11F2; |
| 50 |
|
| 51 |
return; |
| 52 |
|
| 53 |
loc_g_11D5: |
| 54 |
MovHighByte(&PlayField16[si], 0x40); |
| 55 |
goto loc_g_1207; |
| 56 |
|
| 57 |
loc_g_11DC: |
| 58 |
if (PlayField16[si - 1] == 0) |
| 59 |
goto loc_g_11E5; |
| 60 |
|
| 61 |
goto loc_g_11BD; |
| 62 |
|
| 63 |
loc_g_11E5: |
| 64 |
MovHighByte(&PlayField16[si], 0x50); |
| 65 |
PlayField16[si - 1] = 0x8888; |
| 66 |
goto loc_g_1207; |
| 67 |
|
| 68 |
loc_g_11F2: |
| 69 |
if (PlayField16[si + 1] == 0) |
| 70 |
goto loc_g_11FA; |
| 71 |
|
| 72 |
return; |
| 73 |
|
| 74 |
loc_g_11FA: |
| 75 |
MovHighByte(&PlayField16[si], 0x60); |
| 76 |
PlayField16[si + 1] = 0x8888; |
| 77 |
} |
| 78 |
|
| 79 |
loc_g_1207: |
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
bl = HighByte(PlayField16[si]); |
| 84 |
bx = 0; |
| 85 |
MovLowByte(&bx, bl); |
| 86 |
|
| 87 |
al = bl & 0xF0; |
| 88 |
if (al == 0x10) |
| 89 |
goto loc_g_1242; |
| 90 |
|
| 91 |
if (al == 0x20) |
| 92 |
goto loc_g_138D; |
| 93 |
|
| 94 |
if (al == 0x30) |
| 95 |
goto loc_g_13E9; |
| 96 |
|
| 97 |
if (al == 0x40) |
| 98 |
goto loc_g_1444; |
| 99 |
|
| 100 |
if (al == 0x50) |
| 101 |
goto loc_g_1472; |
| 102 |
|
| 103 |
if (al == 0x60) |
| 104 |
goto loc_g_14E0; |
| 105 |
|
| 106 |
if (al == 0x70) |
| 107 |
goto loc_g_154E; |
| 108 |
|
| 109 |
return; |
| 110 |
|
| 111 |
loc_g_1242: |
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
X = GetStretchX(si); |
| 116 |
Y = GetStretchY(si - FieldWidth); |
| 117 |
dx = bl & 0x7; |
| 118 |
DDSpriteBuffer_BltImg(X, Y, aniSpace, 0); |
| 119 |
DDSpriteBuffer_BltImg(X, Y + TwoPixels * (dx + 1), aniInfotron, dx); |
| 120 |
|
| 121 |
|
| 122 |
bl = HighByte(PlayField16[si]) + 1; |
| 123 |
if (bl == 0x16) |
| 124 |
{ |
| 125 |
MovHighByte(&PlayField16[si], bl); |
| 126 |
subCleanUpForInfotronsAbove(si - FieldWidth); |
| 127 |
|
| 128 |
return; |
| 129 |
} |
| 130 |
|
| 131 |
if (bl < 0x18) |
| 132 |
{ |
| 133 |
MovHighByte(&PlayField16[si], bl); |
| 134 |
|
| 135 |
return; |
| 136 |
} |
| 137 |
|
| 138 |
MovHighByte(&PlayField16[si], 0); |
| 139 |
|
| 140 |
|
| 141 |
ax = PlayField16[si + FieldWidth]; |
| 142 |
if (ax == 0) |
| 143 |
goto loc_g_132D; |
| 144 |
|
| 145 |
if (ax == 0x9999) |
| 146 |
goto loc_g_132D; |
| 147 |
|
| 148 |
if ((ax & 0xFF) == fiMurphy) |
| 149 |
goto loc_g_1364; |
| 150 |
|
| 151 |
if (ax == fiRedDisk) |
| 152 |
goto loc_g_1386; |
| 153 |
|
| 154 |
if ((ax & 0xFF) == fiSnikSnak) |
| 155 |
goto loc_g_1386; |
| 156 |
|
| 157 |
|
| 158 |
if ((ax & 0xFF) == fiElectron) |
| 159 |
goto loc_g_1386; |
| 160 |
|
| 161 |
if (ax == fiYellowDisk) |
| 162 |
goto loc_g_1386; |
| 163 |
|
| 164 |
if (ax == fiOrangeDisk) |
| 165 |
goto loc_g_1386; |
| 166 |
|
| 167 |
|
| 168 |
subSoundFX(si, fiInfotron, actImpact); |
| 169 |
|
| 170 |
if (! (ax == fiZonk || ax == fiInfotron || ax == fiRAM)) |
| 171 |
return; |
| 172 |
|
| 173 |
|
| 174 |
ax = PlayField16[si + FieldWidth - 1]; |
| 175 |
if (ax == 0 || ax == 0x8888 || ax == 0xAAAA) |
| 176 |
goto loc_g_133A; |
| 177 |
|
| 178 |
ax = PlayField16[si + FieldWidth + 1]; |
| 179 |
if (ax == 0 || ax == 0x8888 || ax == 0xAAAA) |
| 180 |
goto loc_g_1350; |
| 181 |
|
| 182 |
return; |
| 183 |
|
| 184 |
loc_g_132D: |
| 185 |
PlayField16[si] = 0x7004; |
| 186 |
PlayField16[si + FieldWidth] = 0x9999; |
| 187 |
|
| 188 |
return; |
| 189 |
|
| 190 |
loc_g_133A: |
| 191 |
|
| 192 |
|
| 193 |
if (PlayField16[si - 1] != 0) |
| 194 |
goto loc_g_11BD; |
| 195 |
|
| 196 |
MovHighByte(&PlayField16[si], 0x50); |
| 197 |
PlayField16[si - 1] = 0x8888; |
| 198 |
|
| 199 |
return; |
| 200 |
|
| 201 |
loc_g_1350: |
| 202 |
if (PlayField16[si + 1] != 0) |
| 203 |
return; |
| 204 |
|
| 205 |
MovHighByte(&PlayField16[si], 0x60); |
| 206 |
PlayField16[si + 1] = 0x8888; |
| 207 |
|
| 208 |
return; |
| 209 |
|
| 210 |
loc_g_1364: |
| 211 |
bl = HighByte(PlayField16[si + FieldWidth]); |
| 212 |
if (bl == 0xE || bl == 0xF || bl == 0x28) |
| 213 |
return; |
| 214 |
|
| 215 |
if (bl == 0x29 || bl == 0x25 || bl == 0x26) |
| 216 |
return; |
| 217 |
|
| 218 |
loc_g_1386: |
| 219 |
si = si + FieldWidth; |
| 220 |
ExplodeFieldSP(si); |
| 221 |
|
| 222 |
return; |
| 223 |
|
| 224 |
loc_g_138D: |
| 225 |
|
| 226 |
|
| 227 |
|
| 228 |
X = GetStretchX(si + 1); |
| 229 |
Y = GetStretchY(si); |
| 230 |
dx = (bl & 0x7) + 1; |
| 231 |
DDSpriteBuffer_BltImg(X, Y, aniSpace, 0); |
| 232 |
DDSpriteBuffer_BltImg(X - (TwoPixels * dx), Y, aniInfotronRollLeft, dx - 1); |
| 233 |
|
| 234 |
|
| 235 |
bl = HighByte(PlayField16[si]) + 1; |
| 236 |
if (bl == 0x24) |
| 237 |
PlayField16[si + 1] = 0xAAAA; |
| 238 |
|
| 239 |
if (bl == 0x26) |
| 240 |
{ |
| 241 |
MovHighByte(&PlayField16[si], bl); |
| 242 |
subCleanUpForInfotronsAbove(si + 1); |
| 243 |
} |
| 244 |
else if (bl < 0x28) |
| 245 |
{ |
| 246 |
MovHighByte(&PlayField16[si], bl); |
| 247 |
} |
| 248 |
else |
| 249 |
{ |
| 250 |
PlayField16[si] = 0x7004; |
| 251 |
} |
| 252 |
|
| 253 |
return; |
| 254 |
|
| 255 |
loc_g_13E9: |
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
X = GetStretchX(si - 1); |
| 260 |
Y = GetStretchY(si); |
| 261 |
dx = (bl & 0x7) + 1; |
| 262 |
DDSpriteBuffer_BltImg(X, Y, aniSpace, 0); |
| 263 |
DDSpriteBuffer_BltImg(X + (TwoPixels * dx), Y, aniInfotronRollRight, dx - 1); |
| 264 |
|
| 265 |
|
| 266 |
bl = HighByte(PlayField16[si]) + 1; |
| 267 |
if (bl == 0x34) |
| 268 |
PlayField16[si - 1] = 0xAAAA; |
| 269 |
|
| 270 |
if (bl == 0x36) |
| 271 |
{ |
| 272 |
MovHighByte(&PlayField16[si], bl); |
| 273 |
subCleanUpForInfotronsAbove(si - 1); |
| 274 |
} |
| 275 |
else if (bl < 0x38) |
| 276 |
{ |
| 277 |
MovHighByte(&PlayField16[si], bl); |
| 278 |
} |
| 279 |
else |
| 280 |
{ |
| 281 |
PlayField16[si] = 0x7004; |
| 282 |
} |
| 283 |
|
| 284 |
return; |
| 285 |
|
| 286 |
loc_g_1444: |
| 287 |
bl = bl + 1; |
| 288 |
if (bl < 0x42) |
| 289 |
{ |
| 290 |
MovHighByte(&PlayField16[si], bl); |
| 291 |
} |
| 292 |
else if (PlayField16[si + FieldWidth] != 0) |
| 293 |
{ |
| 294 |
bl = bl - 1; |
| 295 |
MovHighByte(&PlayField16[si], bl); |
| 296 |
} |
| 297 |
else |
| 298 |
{ |
| 299 |
PlayField16[si] = 0xFFFF; |
| 300 |
si = si + FieldWidth; |
| 301 |
PlayField16[si] = 0x1004; |
| 302 |
} |
| 303 |
|
| 304 |
return; |
| 305 |
|
| 306 |
loc_g_1472: |
| 307 |
|
| 308 |
|
| 309 |
|
| 310 |
X = GetStretchX(si); |
| 311 |
Y = GetStretchY(si); |
| 312 |
dx = (bl & 0xF) + 1; |
| 313 |
DDSpriteBuffer_BltImg(X, Y, aniSpace, 0); |
| 314 |
DDSpriteBuffer_BltImg(X - (TwoPixels * dx), Y, aniInfotronRollLeft, dx - 1); |
| 315 |
|
| 316 |
|
| 317 |
bl = HighByte(PlayField16[si]) + 1; |
| 318 |
if (bl < 0x52) |
| 319 |
{ |
| 320 |
MovHighByte(&PlayField16[si], bl); |
| 321 |
|
| 322 |
return; |
| 323 |
} |
| 324 |
|
| 325 |
if (PlayField16[si + FieldWidth - 1] != 0) |
| 326 |
goto loc_g_14D9; |
| 327 |
|
| 328 |
if (PlayField16[si - 1] != 0) |
| 329 |
{ |
| 330 |
if (PlayField16[si - 1] != 0x8888) |
| 331 |
goto loc_g_14D9; |
| 332 |
} |
| 333 |
|
| 334 |
PlayField16[si] = 0xFFFF; |
| 335 |
si = si - 1; |
| 336 |
PlayField16[si] = 0x2204; |
| 337 |
PlayField16[si + FieldWidth] = 0x9999; |
| 338 |
|
| 339 |
return; |
| 340 |
|
| 341 |
loc_g_14D9: |
| 342 |
bl = bl - 1; |
| 343 |
MovHighByte(&PlayField16[si], bl); |
| 344 |
|
| 345 |
return; |
| 346 |
|
| 347 |
loc_g_14E0: |
| 348 |
|
| 349 |
|
| 350 |
|
| 351 |
X = GetStretchX(si); |
| 352 |
Y = GetStretchY(si); |
| 353 |
dx = (bl & 0x7) + 1; |
| 354 |
DDSpriteBuffer_BltImg(X, Y, aniSpace, 0); |
| 355 |
DDSpriteBuffer_BltImg(X + (TwoPixels * dx), Y, aniInfotronRollRight, dx - 1); |
| 356 |
|
| 357 |
|
| 358 |
bl = HighByte(PlayField16[si]) + 1; |
| 359 |
if (bl < 0x62) |
| 360 |
{ |
| 361 |
MovHighByte(&PlayField16[si], bl); |
| 362 |
|
| 363 |
return; |
| 364 |
} |
| 365 |
|
| 366 |
if (PlayField16[si + FieldWidth + 1] != 0) |
| 367 |
goto loc_g_1547; |
| 368 |
|
| 369 |
if (PlayField16[si + 1] != 0) |
| 370 |
{ |
| 371 |
if (PlayField16[si + 1] != 0x8888) |
| 372 |
goto loc_g_1547; |
| 373 |
} |
| 374 |
|
| 375 |
PlayField16[si] = 0xFFFF; |
| 376 |
si = si + 1; |
| 377 |
PlayField16[si] = 0x3204; |
| 378 |
PlayField16[si + FieldWidth] = 0x9999; |
| 379 |
|
| 380 |
return; |
| 381 |
|
| 382 |
loc_g_1547: |
| 383 |
bl = bl - 1; |
| 384 |
MovHighByte(&PlayField16[si], bl); |
| 385 |
|
| 386 |
return; |
| 387 |
|
| 388 |
loc_g_154E: |
| 389 |
ax = PlayField16[si + FieldWidth]; |
| 390 |
if (ax == 0 || ax == 0x9999) |
| 391 |
{ |
| 392 |
PlayField16[si] = 0xFFFF; |
| 393 |
si = si + FieldWidth; |
| 394 |
PlayField16[si] = 0x1004; |
| 395 |
goto loc_g_1242; |
| 396 |
} |
| 397 |
} |
| 398 |
|
| 399 |
void subCleanUpForInfotronsAbove(int si) |
| 400 |
{ |
| 401 |
int ax; |
| 402 |
|
| 403 |
if (LowByte(PlayField16[si]) != fiExplosion) |
| 404 |
PlayField16[si] = 0; |
| 405 |
|
| 406 |
if (PlayField16[si - FieldWidth] != 0) |
| 407 |
{ |
| 408 |
if (PlayField16[si - FieldWidth] != 0x9999) |
| 409 |
return; |
| 410 |
|
| 411 |
if (LowByte(PlayField16[si - 2 * FieldWidth]) != fiZonk) |
| 412 |
return; |
| 413 |
} |
| 414 |
|
| 415 |
if (PlayField16[si - FieldWidth - 1] == fiInfotron) |
| 416 |
goto loc_g_16FE; |
| 417 |
|
| 418 |
loc_g_16F6: |
| 419 |
if (PlayField16[si - FieldWidth + 1] == fiInfotron) |
| 420 |
goto loc_g_1722; |
| 421 |
|
| 422 |
return; |
| 423 |
|
| 424 |
loc_g_16FE: |
| 425 |
ax = PlayField16[si - 1]; |
| 426 |
if (ax == fiZonk || ax == fiInfotron || ax == fiRAM) |
| 427 |
{ |
| 428 |
PlayField16[si - FieldWidth - 1] = 0x6004; |
| 429 |
PlayField16[si - FieldWidth] = 0x8888; |
| 430 |
|
| 431 |
return; |
| 432 |
} |
| 433 |
|
| 434 |
goto loc_g_16F6; |
| 435 |
|
| 436 |
loc_g_1722: |
| 437 |
ax = PlayField16[si + 1]; |
| 438 |
if (ax == fiZonk || ax == fiInfotron || ax == fiRAM) |
| 439 |
{ |
| 440 |
PlayField16[si - FieldWidth + 1] = 0x5004; |
| 441 |
PlayField16[si - FieldWidth] = 0x8888; |
| 442 |
} |
| 443 |
} |