| /trunk/decompiled/cs__07D4.c |
| |
| 3359 |
3359 |
emu_pop(&emu_cs); |
| 3360 |
3360 |
return; |
| 3361 |
3361 |
} |
| 3362 |
|
|
| 3363 |
|
/** |
| 3364 |
|
* Decompiled function emu_Map_IsPositionInViewport() |
| 3365 |
|
* |
| 3366 |
|
* @name emu_Map_IsPositionInViewport |
| 3367 |
|
* @implements 07D4:196B:0073:56C1 () |
| 3368 |
|
* @implements 07D4:19AF:002F:75C1 |
| 3369 |
|
* @implements 07D4:19C0:001E:03DD |
| 3370 |
|
* @implements 07D4:19DA:0004:EAB9 |
| 3371 |
|
* @implements 07D4:19DC:0002:C2BA |
| 3372 |
|
* @implements 07D4:19DE:0005:A97A |
| 3373 |
|
* @implements 07D4:19E3:0004:893F |
| 3374 |
|
* |
| 3375 |
|
* Called From: 07D4:069F:0028:4EFB |
| 3376 |
|
* Called From: 07D4:06E3:001C:B1AC |
| 3377 |
|
* Called From: 07D4:06E3:0019:3A04 |
| 3378 |
|
* Called From: 07D4:0727:001C:B1A3 |
| 3379 |
|
* Called From: 07D4:0727:0019:3A0B |
| 3380 |
|
* Called From: 07D4:077D:002E:5463 |
| 3381 |
|
* Called From: 07D4:077D:002B:7689 |
| 3382 |
|
* Called From: 07D4:0A04:0031:066B |
| 3383 |
|
* Called From: 07D4:0F49:0019:6454 |
| 3384 |
|
* Called From: 07D4:10A4:0031:05C3 |
| 3385 |
|
* Called From: 176C:06F4:0029:3063 |
| 3386 |
|
*/ |
| 3387 |
|
void emu_Map_IsPositionInViewport() |
| 3388 |
|
{ |
| 3389 |
|
l__196B: |
| 3390 |
|
emu_push(emu_bp); |
| 3391 |
|
emu_bp = emu_sp; |
| 3392 |
|
emu_subw(&emu_sp, 0x4); |
| 3393 |
|
emu_cl = 0x4; |
| 3394 |
|
emu_ax = emu_get_memory16(emu_ss, emu_bp, 0x6); |
| 3395 |
|
emu_shrw(&emu_ax, emu_cl); |
| 3396 |
|
emu_bx = emu_get_memory16(emu_ds, 0x00, 0x39FE); |
| 3397 |
|
emu_andw(&emu_bx, 0x3F); |
| 3398 |
|
emu_shlw(&emu_bx, emu_cl); |
| 3399 |
|
emu_subw(&emu_ax, emu_bx); |
| 3400 |
|
emu_get_memory16(emu_ss, emu_bp, -0x2) = emu_ax; |
| 3401 |
|
emu_cl = 0x4; |
| 3402 |
|
emu_ax = emu_get_memory16(emu_ss, emu_bp, 0x8); |
| 3403 |
|
emu_shrw(&emu_ax, emu_cl); |
| 3404 |
|
emu_bx = emu_get_memory16(emu_ds, 0x00, 0x39FE); |
| 3405 |
|
emu_andw(&emu_bx, 0xFC0); |
| 3406 |
|
emu_cl = 0x2; |
| 3407 |
|
emu_shrw(&emu_bx, emu_cl); |
| 3408 |
|
emu_subw(&emu_ax, emu_bx); |
| 3409 |
|
emu_get_memory16(emu_ss, emu_bp, -0x4) = emu_ax; |
| 3410 |
|
emu_ax = emu_get_memory16(emu_ss, emu_bp, 0xA); |
| 3411 |
|
emu_orw(&emu_ax, emu_get_memory16(emu_ss, emu_bp, 0xC)); |
| 3412 |
|
if (emu_ax != 0) { |
| 3413 |
|
emu_lfp(&emu_es, &emu_bx, &emu_get_memory16(emu_ss, emu_bp, 0xA)); |
| 3414 |
|
emu_ax = emu_get_memory16(emu_ss, emu_bp, -0x2); |
| 3415 |
|
emu_get_memory16(emu_es, emu_bx, 0x0) = emu_ax; |
| 3416 |
|
} |
| 3417 |
|
l__19AF: |
| 3418 |
|
emu_ax = emu_get_memory16(emu_ss, emu_bp, 0xE); |
| 3419 |
|
emu_orw(&emu_ax, emu_get_memory16(emu_ss, emu_bp, 0x10)); |
| 3420 |
|
if (emu_ax != 0) { |
| 3421 |
|
emu_lfp(&emu_es, &emu_bx, &emu_get_memory16(emu_ss, emu_bp, 0xE)); |
| 3422 |
|
emu_ax = emu_get_memory16(emu_ss, emu_bp, -0x4); |
| 3423 |
|
emu_get_memory16(emu_es, emu_bx, 0x0) = emu_ax; |
| 3424 |
|
} |
| 3425 |
|
l__19C0: |
| 3426 |
|
emu_cmpw(&emu_get_memory16(emu_ss, emu_bp, -0x2), 0xFFF0); |
| 3427 |
|
if ((int16)emu_get_memory16(emu_ss, emu_bp, -0x2) >= (int16)0xFFF0) { |
| 3428 |
|
emu_cmpw(&emu_get_memory16(emu_ss, emu_bp, -0x2), 0x100); |
| 3429 |
|
if ((int16)emu_get_memory16(emu_ss, emu_bp, -0x2) <= (int16)0x100) { |
| 3430 |
|
emu_cmpw(&emu_get_memory16(emu_ss, emu_bp, -0x4), 0xFFF0); |
| 3431 |
|
if ((int16)emu_get_memory16(emu_ss, emu_bp, -0x4) >= (int16)0xFFF0) { |
| 3432 |
|
emu_cmpw(&emu_get_memory16(emu_ss, emu_bp, -0x4), 0xB0); |
| 3433 |
|
if ((int16)emu_get_memory16(emu_ss, emu_bp, -0x4) <= (int16)0xB0) goto l__19DE; |
| 3434 |
|
} |
| 3435 |
|
} |
| 3436 |
|
} |
| 3437 |
|
l__19DA: |
| 3438 |
|
emu_xorw(&emu_ax, emu_ax); |
| 3439 |
|
l__19DC: |
| 3440 |
|
goto l__19E3; |
| 3441 |
|
l__19DE: |
| 3442 |
|
emu_ax = 0x1; |
| 3443 |
|
goto l__19DC; |
| 3444 |
|
l__19E3: |
| 3445 |
|
emu_sp = emu_bp; |
| 3446 |
|
emu_pop(&emu_bp); |
| 3447 |
|
|
| 3448 |
|
/* Return from this function */ |
| 3449 |
|
emu_pop(&emu_ip); |
| 3450 |
|
emu_pop(&emu_cs); |
| 3451 |
|
return; |
| 3452 |
|
} |
| |
| /trunk/src/unit.c |
| |
| 54 |
54 |
extern void f__B4CD_1816_0033_B55B(); |
| 55 |
55 |
extern void f__B4E9_0050_003F_292A(); |
| 56 |
56 |
extern void emu_Map_DeviateArea(); |
| 57 |
|
extern void emu_Map_IsPositionInViewport(); |
| 58 |
57 |
extern void emu_Structure_UpdateMap(); |
| 59 |
58 |
extern void emu_Tile_RemoveFogInRadius(); |
| 60 |
59 |
extern void overlay(uint16 cs, uint8 force); |
| |
| |
| 377 |
377 |
if (u->scriptDelay == 0) { |
| 378 |
378 |
if (Script_IsLoaded(&u->script)) { |
| 379 |
379 |
g_global->scriptUnitLeft = g_global->scriptUnitSpeed * 5; |
| 380 |
|
if (!ui->flags.s.scriptNoSlowdown) { |
| 381 |
|
emu_push(0); emu_push(0); |
| 382 |
|
emu_push(0); emu_push(0); |
| 383 |
|
emu_push(u->position.s.y); emu_push(u->position.s.x); |
| 384 |
|
emu_push(emu_cs); emu_push(0x06F9); emu_cs = 0x07D4; emu_Map_IsPositionInViewport(); |
| 385 |
|
emu_sp += 12; |
| 386 |
|
|
| 387 |
|
if (emu_ax == 0) g_global->scriptUnitLeft = 1; |
| |
380 |
if (!ui->flags.s.scriptNoSlowdown && !Map_IsPositionInViewport(u->position, NULL, NULL)) { |
| |
381 |
g_global->scriptUnitLeft = 1; |
| 388 |
382 |
} |
| 389 |
383 |
|
| 390 |
384 |
u->script.variables[3] = g_global->playerHouseID; |
| |