From 2ecef3762379ade1841f68fff383b8d01fe21876 Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Wed, 9 Oct 2013 11:34:50 +0200 Subject: Avancee sur le reverse... --- reverse-engineering/dosbox_snif/dos_lemm.h | 23 +- .../dosbox_snif/main_validate_code.c | 2 +- reverse-engineering/work/dos_lemm.h | 2 +- reverse-engineering/work/seg_code_0208.txt | 418 +++++++++++---------- 4 files changed, 233 insertions(+), 212 deletions(-) diff --git a/reverse-engineering/dosbox_snif/dos_lemm.h b/reverse-engineering/dosbox_snif/dos_lemm.h index 313a6ee..5504fee 100644 --- a/reverse-engineering/dosbox_snif/dos_lemm.h +++ b/reverse-engineering/dosbox_snif/dos_lemm.h @@ -20,7 +20,7 @@ struct _state { uint8_t s_drawning:1; //0x10 uint8_t s_ending:1; //0x20 uint8_t s_dying:1; //0x40 - uint8_t s_exploding2:1; //0x80 + uint8_t s_exploding:1; //0x80 } __attribute__ ((__packed__)); union state { @@ -30,7 +30,7 @@ union state { enum state_masks { s_splatting = 0x01, - s_exploding = 0x02, + s_exploding_spe = 0x02, s_falling = 0x04, s_ascending = 0x08, s_digging = 0x10, @@ -45,13 +45,13 @@ enum state_masks { s_drawning = 0x1000, s_ending = 0x2000, s_dying = 0x4000, - s_exploding2 = 0x8000 + s_exploding = 0x8000 }; struct _flags1 { - uint8_t fl1_cap_climber:1; // 0x01 + uint8_t fl1_cap_climber:1; // 0x01 uint8_t fl1_unused:6; - uint8_t fl1_walk_pause_for_shruggling:1; // 0x80 + uint8_t fl1_walk_pause_for_shruggling:1; // 0x80 } __attribute__ ((__packed__)); union flags1 { @@ -87,7 +87,9 @@ struct _lemm_data { int8_t direction; //0x27 uint8_t spr_frame; //0x28 uint8_t draw_hint; //0x29 - uint8_t unk5[0x3]; + uint8_t draw_trick1; //0x2a + uint8_t unk5; + uint8_t unk6; } __attribute__ ((__packed__)); union lemm_data { @@ -125,10 +127,13 @@ struct game_data { uint8_t lemm_level_count; // [0x44] uint8_t next_spawn_ticks; // [0x45] uint8_t spawn_rate_ticks; // [0x46] - uint8_t unk5[0x20]; // TODO + uint8_t unk5; // TODO + uint8_t nuke_all_in_progress; // [0x48] + uint8_t nuke_i; // [0x49] + uint8_t unk6[0x1d]; // TODO struct _avail_skills avail_skills; // [0x67] - [0x7e] - uint8_t unk6[0x06]; // TODO - struct _lemm_data lemmings[1]; // [0x85] + uint8_t unk7[0x06]; // TODO + struct _lemm_data lemmings[1]; // [0x85] //struct _lemm_data lemmings[100]; // [0x85] } __attribute__ ((__packed__)); diff --git a/reverse-engineering/dosbox_snif/main_validate_code.c b/reverse-engineering/dosbox_snif/main_validate_code.c index 4548b3d..22ce62d 100644 --- a/reverse-engineering/dosbox_snif/main_validate_code.c +++ b/reverse-engineering/dosbox_snif/main_validate_code.c @@ -89,7 +89,7 @@ int main(int argc, char *argv[]) { } else { // Compare simulation results and orignal code results if ( game_data_diff(&g_simulated, &g_after) != 0 ) { - (void) scanf("nothing"); + (void) scanf("%s"); } } diff --git a/reverse-engineering/work/dos_lemm.h b/reverse-engineering/work/dos_lemm.h index 45360d4..69f0475 120000 --- a/reverse-engineering/work/dos_lemm.h +++ b/reverse-engineering/work/dos_lemm.h @@ -1 +1 @@ -../../src/dosbox_snif/dos_lemm.h \ No newline at end of file +../dosbox_snif/dos_lemm.h \ No newline at end of file diff --git a/reverse-engineering/work/seg_code_0208.txt b/reverse-engineering/work/seg_code_0208.txt index 21a4ca0..6f6de9a 100644 --- a/reverse-engineering/work/seg_code_0208.txt +++ b/reverse-engineering/work/seg_code_0208.txt @@ -1,3 +1,5 @@ +en cours : 00001B28 + When ds == 0xb55 : [0x4] : VGA read mode 1 (compare) line pitch in bytes (0x00d0, LEVEL_WIDTH/8); @@ -2785,14 +2787,14 @@ no_lemm_left: 0000184C 7503 jnz 0x1851 // 0000184E E9C400 jmp word 0x1915 // 00001851 06 push es # -00001852 807C26FF cmp byte [si+0x26],0xff if ( lemm.is_gone ) goto next_lemming; +00001852 807C26FF cmp byte [si+0x26],0xff if ( lemm->is_gone ) goto next_lemming; 00001856 7503 jnz 0x185b // 00001858 E9A600 jmp word 0x1901 // -0000185B 8A4420 mov al,[si+0x20] if ( lemm.expl_countdown != 0 ) { +0000185B 8A4420 mov al,[si+0x20] if ( lemm->expl_countdown != 0 ) { 0000185E 22C0 and al,al // 00001860 7408 jz 0x186a // -00001862 E8930E call word 0x26f8 commit_suicide(); -00001865 7503 jnz 0x186a if ( cpu_flag_z == 0 ) goto next_lemming; # +00001862 E8930E call word 0x26f8 if ( commit_suicide() == 1 ) goto next_lemming; +00001865 7503 jnz 0x186a // 00001867 E99700 jmp word 0x1901 // } 0000186A 8A4424 mov al,[si+0x24] if ( lemm->flags1.walk_pause_for_shruggling ) @@ -2803,11 +2805,11 @@ no_lemm_left: 00001877 23C0 and ax,ax if ( lemm->state.raw == 0x0 ) 00001879 7503 jnz 0x187e goto lbl_walking; 0000187B E9DF00 jmp word 0x195d // -0000187E A90200 test ax,0x2 if ( lemm->state.bits.s_exploding ) -00001881 7403 jz 0x1886 goto lbl_exploding; +0000187E A90200 test ax,0x2 if ( lemm->state.bits.s_exploding_spe ) +00001881 7403 jz 0x1886 goto lbl_exploding_spe; 00001883 E9E303 jmp word 0x1c69 // -00001886 A90080 test ax,0x8000 if ( lemm->state.bits.s_exploding2 ) -00001889 7403 jz 0x188e goto lbl_exploding2; +00001886 A90080 test ax,0x8000 if ( lemm->state.bits.s_exploding ) +00001889 7403 jz 0x188e goto lbl_exploding; 0000188B E9750D jmp word 0x2603 // 0000188E A90400 test ax,0x4 if ( lemm->state.bits.s_falling ) 00001891 7403 jz 0x1896 goto lbl_falling; @@ -2860,32 +2862,34 @@ next_lemming: 00001905 FE0E3F00 dec byte [0x3f] lemm_count_to_process--; 00001909 7403 jz 0x190e if ( lemm_count_to_process != 0 ) continue; 0000190B E943FF jmp word 0x1851 // -0000190E 803E480000 cmp byte [0x48],0x0 if ( [0x48] != 0 ) goto label1; +0000190E 803E480000 cmp byte [0x48],0x0 if ( nuke_all_in_progress ) goto lbl_nuke_all; 00001913 7506 jnz 0x191b } /*while*/ 00001915 C6064D0000 mov byte [0x4d],0x0 [0x4d]=0; 0000191A C3 ret return; -label1: -0000191B A04900 mov al,[0x49] int i = [0x49]; -0000191E 3A064000 cmp al,[0x40] if ( i == lemm_spawned_count ) { [0x48]=0; [0x4d]=0; return; } -00001922 742E jz 0x1952 // -00001924 B92D00 mov cx,0x2d lemm=&(lemmings[i]); +lbl_nuke_all: +0000191B A04900 mov al,[0x49] // +0000191E 3A064000 cmp al,[0x40] if ( nuke_i == lemm_spawned_count ) { +00001922 742E jz 0x1952 nuke_all_in_progress = 0; [0x4d]=0; return; + } +00001924 B92D00 mov cx,0x2d lemm=&(lemmings[nuke_i]); 00001927 32E4 xor ah,ah // 00001929 F7E1 mul cx // 0000192B 058500 add ax,0x85 // 0000192E 8BF0 mov si,ax // -00001930 807C2000 cmp byte [si+0x20],0x0 if ( lemm.expl_countdown != 0 ) { [0x49]++; return; } -00001934 7517 jnz 0x194d // -00001936 807C26FF cmp byte [si+0x26],0xff if ( lemm.is_gone ) { [0x49]++; goto label1; } -0000193A 7506 jnz 0x1942 // -0000193C FE064900 inc byte [0x49] // -00001940 EBD9 jmp short 0x191b // -00001942 F744080380 test word [si+0x8],0x8003 if ( lemm->state.raw & (s_exploding2 | s_splatting | s_exploding) == 0 ) { -00001947 7504 jnz 0x194d lemm.expl_countdown = 79; -00001949 C644204F mov byte [si+0x20],0x4f } -0000194D FE064900 inc byte [0x49] [0x49]++; +00001930 807C2000 cmp byte [si+0x20],0x0 if ( lemm.expl_countdown == 0 ) { +00001934 7517 jnz 0x194d // +00001936 807C26FF cmp byte [si+0x26],0xff if ( lemm.is_gone ) { nuke_i++; goto lbl_nuke_all; } +0000193A 7506 jnz 0x1942 // +0000193C FE064900 inc byte [0x49] // +00001940 EBD9 jmp short 0x191b // +00001942 F744080380 test word [si+0x8],0x8003 if ( lemm->state.raw & (s_exploding | s_splatting | s_exploding_spe) == 0 ) { +00001947 7504 jnz 0x194d lemm.expl_countdown = 79; +00001949 C644204F mov byte [si+0x20],0x4f } + } +0000194D FE064900 inc byte [0x49] nuke_i++; 00001951 C3 ret return; 00001952 C606480000 mov byte [0x48],0x0 // (cf 0000191E) @@ -2893,14 +2897,14 @@ label1: 0000195C C3 ret // lbl_walking: -0000195D 8A4428 mov al,[si+0x28] lemm.spr_frame = (lemm.spr_frame + 1) % 8; +0000195D 8A4428 mov al,[si+0x28] lemm->spr_frame = (lemm->spr_frame + 1) % 8; 00001960 FEC0 inc al // 00001962 2407 and al,0x7 // 00001964 884428 mov [si+0x28],al // -00001967 8A4427 mov al,[si+0x27] lemm.x_effective += lemm.direction; +00001967 8A4427 mov al,[si+0x27] lemm->x_effective += lemm->direction; 0000196A 98 cbw // (cbw == Convert Byte to Word) 0000196B 0104 add [si],ax // -0000196D 833C10 cmp word [si],byte +0x10 if ( lemm.x_effective<16 || lemm.x_effective>=LEVEL_WIDTH ) goto change_dir_and_next; +0000196D 833C10 cmp word [si],byte +0x10 if ( lemm->x_effective<16 || lemm->x_effective>=LEVEL_WIDTH ) goto change_dir_and_next; 00001970 7D03 jnl 0x1975 // 00001972 E9E600 jmp word 0x1a5b // 00001975 813C8006 cmp word [si],0x680 // @@ -2908,13 +2912,13 @@ lbl_walking: 0000197B E9DD00 jmp word 0x1a5b // 0000197E E8FA38 call word 0x527b vga_mem_read_prepare_registers(); 00001981 8B6C02 mov bp,[si+0x2] // -00001984 268A05 mov al,[es:di] if ( is_solid(lemm.x_effective, lemm.y_effective) ) goto walker_check_above_terrain; +00001984 268A05 mov al,[es:di] if ( is_solid(lemm->x_effective, lemm->y_effective) ) goto walker_check_above_terrain; 00001987 22C4 and al,ah // 00001989 7574 jnz 0x19ff // for (i=0; i<3; i++) { -0000198B 45 inc bp lemm.y_effective++; -0000198C 033E0400 add di,[0x4] if ( is_solid(lemm.x_effective, lemm.y_effective) ) break; +0000198B 45 inc bp lemm->y_effective++; +0000198C 033E0400 add di,[0x4] if ( is_solid(lemm->x_effective, lemm->y_effective) ) break; 00001990 268A05 mov al,[es:di] // 00001993 22C4 and al,ah // 00001995 7555 jnz 0x19ec // @@ -2942,31 +2946,31 @@ lbl_walking: 000019CC C6442303 mov byte [si+0x23],0x3 lemm->falldist = 3; 000019D0 C74404F8FF mov word [si+0x4],0xfff8 lemm->x_spr_offset = -8; 000019D5 C74406F6FF mov word [si+0x6],0xfff6 lemm->y_spr_offset = -10; -000019DA C6442904 mov byte [si+0x29],0x4 lemm->draw_hint = 4; +000019DA C6442904 mov byte [si+0x29],0x4 lemm->draw_hint = hint_falling; 000019DE A12B00 mov ax,[0x2b] // 000019E1 894414 mov [si+0x14],ax lemm->ptr2 = [0x2b]; # -000019E4 C6442A00 mov byte [si+0x2a],0x0 //??? +000019E4 C6442A00 mov byte [si+0x2a],0x0 lemm->draw_trick1 = FALSE; 000019E8 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; } 000019EC 896C02 mov [si+0x2],bp // -000019EF 81FDB400 cmp bp,0xb4 if ( lemm.y_effective >= 180 ) { -000019F3 7D03 jnl 0x19f8 lemm.is_gone=true; goto next_lemming; +000019EF 81FDB400 cmp bp,0xb4 if ( lemm->y_effective >= 180 ) { +000019F3 7D03 jnl 0x19f8 lemm->is_gone=true; goto next_lemming; } 000019F5 E906FF jmp word 0x18fe goto check_this_and_go_next_lemming; -000019F8 C64426FF mov byte [si+0x26],0xff // ( lemm.is_gone=true; goto next_lemming; ) +000019F8 C64426FF mov byte [si+0x26],0xff // ( lemm->is_gone=true; goto next_lemming; ) 000019FC E902FF jmp word 0x1901 // jumped from various places, but "inlined" in C comments walker_check_above_terrain: 000019FF E8B863 call word 0x7dba // nop(); //FIXME : rewrite with temp var because bp is reused (or not) after jumps -00001A02 2B3E0400 sub di,[0x4] if ( ! is_solid(lemm.x_effective, lemm.y_effective - 1) -00001A06 268A05 mov al,[es:di] || ! is_solid(lemm.x_effective, lemm.y_effective - 2) -00001A09 22C4 and al,ah || ! is_solid(lemm.x_effective, lemm.y_effective - 3) ) { +00001A02 2B3E0400 sub di,[0x4] if ( ! is_solid(lemm->x_effective, lemm->y_effective - 1) +00001A06 268A05 mov al,[es:di] || ! is_solid(lemm->x_effective, lemm->y_effective - 2) +00001A09 22C4 and al,ah || ! is_solid(lemm->x_effective, lemm->y_effective - 3) ) { 00001A0B 7454 jz 0x1a61 goto walker_adjust_y; 00001A0D 4D dec bp } -00001A0E 2B3E0400 sub di,[0x4] if ( ! is_solid(lemm.x_effective, lemm.y_effective - 4) -00001A12 268A05 mov al,[es:di] || ! is_solid(lemm.x_effective, lemm.y_effective - 5) -00001A15 22C4 and al,ah || ! is_solid(lemm.x_effective, lemm.y_effective - 6) ) { +00001A0E 2B3E0400 sub di,[0x4] if ( ! is_solid(lemm->x_effective, lemm->y_effective - 4) +00001A12 268A05 mov al,[es:di] || ! is_solid(lemm->x_effective, lemm->y_effective - 5) +00001A15 22C4 and al,ah || ! is_solid(lemm->x_effective, lemm->y_effective - 6) ) { 00001A17 7448 jz 0x1a61 goto become_ascender; 00001A19 4D dec bp } 00001A1A 2B3E0400 sub di,[0x4] // @@ -2998,7 +3002,7 @@ walker_check_above_terrain: 00001A59 7537 jnz 0x1a92 // change_dir_and_next: -00001A5B F65C27 neg byte [si+0x27] lemm.direction = - lemm.direction; +00001A5B F65C27 neg byte [si+0x27] lemm->direction = - lemm->direction; 00001A5E E99DFE jmp word 0x18fe goto check_this_and_go_next_lemming; walker_adjust_y: @@ -3025,49 +3029,52 @@ become_ascender: 00001A92 C6442800 mov byte [si+0x28],0x0 00001A96 C7440A0000 mov word [si+0xa],0x0 00001A9B C7440C9A03 mov word [si+0xc],0x39a -00001AA0 834C0820 or word [si+0x8],byte +0x20 +00001AA0 834C0820 or word [si+0x8],byte +0x20 lemm->state.bits.s_climbing = 1; 00001AA4 C744104800 mov word [si+0x10],0x48 00001AA9 C744123000 mov word [si+0x12],0x30 00001AAE C74404F8FF mov word [si+0x4],0xfff8 00001AB3 C74406F4FF mov word [si+0x6],0xfff4 00001AB8 A12D00 mov ax,[0x2d] 00001ABB 894414 mov [si+0x14],ax -00001ABE C6442AFF mov byte [si+0x2a],0xff +00001ABE C6442AFF mov byte [si+0x2a],0xff lemm->draw_trick1 = TRUE; 00001AC2 C6442908 mov byte [si+0x29],0x8 -00001AC6 E935FE jmp word 0x18fe goto check_this_and_go_next_lemming; +00001AC6 E935FE jmp word 0x18fe goto check_this_and_go_next_lemming; lbl_falling: -00001AC9 8A4428 mov al,[si+0x28] -00001ACC FEC0 inc al -00001ACE 2403 and al,0x3 -00001AD0 884428 mov [si+0x28],al -00001AD3 807C2310 cmp byte [si+0x23],0x10 -00001AD7 7642 jna 0x1b1b -00001AD9 807C2500 cmp byte [si+0x25],0x0 -00001ADD 743C jz 0x1b1b -00001ADF C744080004 mov word [si+0x8],0x400 -00001AE4 C7440A0000 mov word [si+0xa],0x0 -00001AE9 C7440CAA0B mov word [si+0xc],0xbaa -00001AEE C744108000 mov word [si+0x10],0x80 -00001AF3 C744126000 mov word [si+0x12],0x60 -00001AF8 C6442800 mov byte [si+0x28],0x0 -00001AFC C7440E0000 mov word [si+0xe],0x0 -00001B01 C74406F0FF mov word [si+0x6],0xfff0 -00001B06 C6442908 mov byte [si+0x29],0x8 -00001B0A A13700 mov ax,[0x37] -00001B0D 894414 mov [si+0x14],ax -00001B10 C6442AFF mov byte [si+0x2a],0xff -00001B14 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; -00001B18 E9E3FD jmp word 0x18fe goto check_this_and_go_next_lemming; -00001B1B E85D37 call word 0x527b -00001B1E 8B6C02 mov bp,[si+0x2] -00001B21 268A05 mov al,[es:di] -00001B24 22C4 and al,ah -00001B26 753E jnz 0x1b66 +00001AC9 8A4428 mov al,[si+0x28] lemm->spr_frame = (lemm->spr_frame + 1) % 4; +00001ACC FEC0 inc al // +00001ACE 2403 and al,0x3 // +00001AD0 884428 mov [si+0x28],al // +00001AD3 807C2310 cmp byte [si+0x23],0x10 if ( lemm->falldist >= 16 && lemm->cap_floater ) { +00001AD7 7642 jna 0x1b1b // +00001AD9 807C2500 cmp byte [si+0x25],0x0 // +00001ADD 743C jz 0x1b1b // +00001ADF C744080004 mov word [si+0x8],0x400 lemm->state.raw = s_floating; +00001AE4 C7440A0000 mov word [si+0xa],0x0 # +00001AE9 C7440CAA0B mov word [si+0xc],0xbaa lemm->spr_data_ptr = 0xbaa; +00001AEE C744108000 mov word [si+0x10],0x80 # +00001AF3 C744126000 mov word [si+0x12],0x60 # +00001AF8 C6442800 mov byte [si+0x28],0x0 lemm->spr_frame = 0; +00001AFC C7440E0000 mov word [si+0xe],0x0 lemm->floattime_dble = 0; +00001B01 C74406F0FF mov word [si+0x6],0xfff0 lemm->y_spr_offset = -16; +00001B06 C6442908 mov byte [si+0x29],0x8 lemm->draw_hint = hint_special1; +00001B0A A13700 mov ax,[0x37] // +00001B0D 894414 mov [si+0x14],ax lemm->ptr2 = [0x37]; +00001B10 C6442AFF mov byte [si+0x2a],0xff lemm->draw_trick1 = TRUE; +00001B14 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; +00001B18 E9E3FD jmp word 0x18fe goto check_this_and_go_next_lemming; + } +00001B1B E85D37 call word 0x527b vga_mem_read_prepare_registers(); +00001B1E 8B6C02 mov bp,[si+0x2] // +00001B21 268A05 mov al,[es:di] if ( is_solid(lemm->x_effective, lemm->y_effective) ) goto 0x1b66; +00001B24 22C4 and al,ah // +00001B26 753E jnz 0x1b66 // + 00001B28 45 inc bp 00001B29 81FDB400 cmp bp,0xb4 00001B2D 7C03 jl 0x1b32 -00001B2F E9C6FE jmp word 0x19f8 lemm.is_gone=true; goto next_lemming; +00001B2F E9C6FE jmp word 0x19f8 lemm->is_gone=true; goto next_lemming; + 00001B32 033E0400 add di,[0x4] 00001B36 268A05 mov al,[es:di] 00001B39 22C4 and al,ah @@ -3075,7 +3082,7 @@ lbl_falling: 00001B3D 45 inc bp 00001B3E 81FDB400 cmp bp,0xb4 00001B42 7C03 jl 0x1b47 -00001B44 E9B1FE jmp word 0x19f8 lemm.is_gone=true; goto next_lemming; +00001B44 E9B1FE jmp word 0x19f8 lemm->is_gone=true; goto next_lemming; 00001B47 033E0400 add di,[0x4] 00001B4B 268A05 mov al,[es:di] 00001B4E 22C4 and al,ah @@ -3086,11 +3093,11 @@ lbl_falling: 00001B5A 81FDB400 cmp bp,0xb4 00001B5E 7D03 jnl 0x1b63 00001B60 E99BFD jmp word 0x18fe goto check_this_and_go_next_lemming; -00001B63 E992FE jmp word 0x19f8 lemm.is_gone=true; goto next_lemming; +00001B63 E992FE jmp word 0x19f8 lemm->is_gone=true; goto next_lemming; 00001B66 896C02 mov [si+0x2],bp 00001B69 807C233C cmp byte [si+0x23],0x3c 00001B6D 764D jna 0x1bbc -00001B6F C744080100 mov word [si+0x8],0x1 +00001B6F C744080100 mov word [si+0x8],0x1 lemm->state.raw = s_splatting; 00001B74 C7440A0000 mov word [si+0xa],0x0 00001B79 C7440C2A0C mov word [si+0xc],0xc2a 00001B7E C744105A00 mov word [si+0x10],0x5a @@ -3101,7 +3108,7 @@ lbl_falling: 00001B94 C6442900 mov byte [si+0x29],0x0 00001B98 A12B00 mov ax,[0x2b] 00001B9B 894414 mov [si+0x14],ax -00001B9E C6442A00 mov byte [si+0x2a],0x0 +00001B9E C6442A00 mov byte [si+0x2a],0x0 lemm->draw_trick1 = TRUE; 00001BA2 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; 00001BA6 803E0820FF cmp byte [0x2008],0xff 00001BAB 750C jnz 0x1bb9 @@ -3121,7 +3128,7 @@ lbl_falling: 00001BE3 C6442909 mov byte [si+0x29],0x9 00001BE7 A12B00 mov ax,[0x2b] 00001BEA 894414 mov [si+0x14],ax -00001BED C6442A00 mov byte [si+0x2a],0x0 +00001BED C6442A00 mov byte [si+0x2a],0x0 lemm->draw_trick1 = FALSE; 00001BF1 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; 00001BF5 E906FD jmp word 0x18fe goto check_this_and_go_next_lemming; lbl_splatting: @@ -3173,7 +3180,7 @@ lbl_dying: 00001C61 7503 jnz 0x1c66 } 00001C63 E992FD jmp word 0x19f8 // 00001C66 E998FC jmp word 0x1901 goto next_lemming; -lbl_exploding: +lbl_exploding_spe: 00001C69 8A4428 mov al,[si+0x28] 00001C6C FEC0 inc al 00001C6E 884428 mov [si+0x28],al @@ -3262,7 +3269,7 @@ lbl_digging: 00001D3C 8B6C02 mov bp,[si+0x2] 00001D3F 81FDB400 cmp bp,0xb4 00001D43 7C03 jl 0x1d48 -00001D45 E9B0FC jmp word 0x19f8 lemm.is_gone=true; goto next_lemming; +00001D45 E9B0FC jmp word 0x19f8 lemm->is_gone=true; goto next_lemming; 00001D48 E84B60 call word 0x7d96 00001D4B 7543 jnz 0x1d90 00001D4D 836408EF and word [si+0x8],byte -0x11 @@ -3278,7 +3285,7 @@ lbl_digging: 00001D7B C6442904 mov byte [si+0x29],0x4 00001D7F A12B00 mov ax,[0x2b] 00001D82 894414 mov [si+0x14],ax -00001D85 C6442A00 mov byte [si+0x2a],0x0 +00001D85 C6442A00 mov byte [si+0x2a],0x0 lemm->draw_trick1 = FALSE; 00001D89 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; 00001D8D E96EFB jmp word 0x18fe goto check_this_and_go_next_lemming; 00001D90 8B04 mov ax,[si] @@ -3319,7 +3326,7 @@ lbl_digging: 00001DF6 C6442909 mov byte [si+0x29],0x9 00001DFA A12B00 mov ax,[0x2b] 00001DFD 894414 mov [si+0x14],ax -00001E00 C6442A00 mov byte [si+0x2a],0x0 +00001E00 C6442A00 mov byte [si+0x2a],0x0 lemm->draw_trick1 = FALSE; 00001E04 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; 00001E08 E9F3FA jmp word 0x18fe goto check_this_and_go_next_lemming; 00001E0B FF34 push word [si] @@ -3387,7 +3394,7 @@ lbl_climbing: 00001EB2 C6442904 mov byte [si+0x29],0x4 00001EB6 A12B00 mov ax,[0x2b] 00001EB9 894414 mov [si+0x14],ax -00001EBC C6442A00 mov byte [si+0x2a],0x0 +00001EBC C6442A00 mov byte [si+0x2a],0x0 lemm->draw_trick1 = FALSE; 00001EC0 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; 00001EC4 8A4427 mov al,[si+0x27] 00001EC7 F6D8 neg al @@ -3444,7 +3451,7 @@ lbl_climb_ending: 00001F6E C6442909 mov byte [si+0x29],0x9 00001F72 A12B00 mov ax,[0x2b] 00001F75 894414 mov [si+0x14],ax -00001F78 C6442A00 mov byte [si+0x2a],0x0 +00001F78 C6442A00 mov byte [si+0x2a],0x0 lemm->draw_trick1 = FALSE; 00001F7C 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; 00001F80 8B6C02 mov bp,[si+0x2] 00001F83 E9DBFA jmp word 0x1a61 @@ -3547,7 +3554,7 @@ lbl_building: 00002085 C6442909 mov byte [si+0x29],0x9 00002089 A12B00 mov ax,[0x2b] 0000208C 894414 mov [si+0x14],ax -0000208F C6442A00 mov byte [si+0x2a],0x0 +0000208F C6442A00 mov byte [si+0x2a],0x0 lemm->draw_trick1 = FALSE; 00002093 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; 00002097 8B6C02 mov bp,[si+0x2] 0000209A E9C4F9 jmp word 0x1a61 @@ -3562,7 +3569,7 @@ lbl_building: 000020C4 C6442908 mov byte [si+0x29],0x8 000020C8 A12B00 mov ax,[0x2b] 000020CB 894414 mov [si+0x14],ax -000020CE C6442A00 mov byte [si+0x2a],0x0 +000020CE C6442A00 mov byte [si+0x2a],0x0 lemm->draw_trick1 = FALSE; 000020D2 80642401 and byte [si+0x24],0x1 // 000020D6 804C2480 or byte [si+0x24],0x80 lemm->flags1.walk_pause_for_shruggling = 1; 000020DA 8B6C02 mov bp,[si+0x2] @@ -3586,10 +3593,10 @@ lbl_blocking: 0000211B C6442909 mov byte [si+0x29],0x9 0000211F A12B00 mov ax,[0x2b] 00002122 894414 mov [si+0x14],ax -00002125 C6442A00 mov byte [si+0x2a],0x0 -00002129 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; +00002125 C6442A00 mov byte [si+0x2a],0x0 lemm->draw_trick1 = FALSE; +00002129 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; 0000212D E80300 call word 0x2133 -00002130 E9CEF7 jmp word 0x1901 goto next_lemming; +00002130 E9CEF7 jmp word 0x1901 goto next_lemming; 00002133 8B04 mov ax,[si] 00002135 8B5C02 mov bx,[si+0x2] 00002138 83E804 sub ax,byte +0x4 @@ -3692,9 +3699,9 @@ lbl_bashing: 0000221D C6442909 mov byte [si+0x29],0x9 00002221 A12B00 mov ax,[0x2b] 00002224 894414 mov [si+0x14],ax -00002227 C6442A00 mov byte [si+0x2a],0x0 -0000222B 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; -0000222F E9CFF6 jmp word 0x1901 goto next_lemming; +00002227 C6442A00 mov byte [si+0x2a],0x0 lemm->draw_trick1 = FALSE; +0000222B 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; +0000222F E9CFF6 jmp word 0x1901 goto next_lemming; 00002232 8A4427 mov al,[si+0x27] 00002235 98 cbw 00002236 0104 add [si],ax @@ -3732,7 +3739,7 @@ lbl_bashing: 0000229F C6442904 mov byte [si+0x29],0x4 000022A3 A12B00 mov ax,[0x2b] 000022A6 894414 mov [si+0x14],ax -000022A9 C6442A00 mov byte [si+0x2a],0x0 +000022A9 C6442A00 mov byte [si+0x2a],0x0 lemm->draw_trick1 = FALSE; 000022AD 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; 000022B1 816408FFFD and word [si+0x8],0xfdff 000022B6 E945F6 jmp word 0x18fe goto check_this_and_go_next_lemming; @@ -3748,7 +3755,7 @@ lbl_bashing: 000022E3 C6442909 mov byte [si+0x29],0x9 000022E7 A12B00 mov ax,[0x2b] 000022EA 894414 mov [si+0x14],ax -000022ED C6442A00 mov byte [si+0x2a],0x0 +000022ED C6442A00 mov byte [si+0x2a],0x0 lemm->draw_trick1 = FALSE; 000022F1 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; 000022F5 E906F6 jmp word 0x18fe goto check_this_and_go_next_lemming; 000022F8 8B04 mov ax,[si] @@ -3857,7 +3864,7 @@ lbl_floating: 00002408 C6442909 mov byte [si+0x29],0x9 0000240C A12B00 mov ax,[0x2b] 0000240F 894414 mov [si+0x14],ax -00002412 C6442A00 mov byte [si+0x2a],0x0 +00002412 C6442A00 mov byte [si+0x2a],0x0 lemm->draw_trick1 = FALSE; 00002416 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; 0000241A E9E1F4 jmp word 0x18fe goto check_this_and_go_next_lemming; 0000241D 817C02B400 cmp word [si+0x2],0xb4 @@ -3919,7 +3926,7 @@ lbl_mining: 000024BB C6442904 mov byte [si+0x29],0x4 000024BF A12B00 mov ax,[0x2b] 000024C2 894414 mov [si+0x14],ax -000024C5 C6442A00 mov byte [si+0x2a],0x0 +000024C5 C6442A00 mov byte [si+0x2a],0x0 lemm->draw_trick1 = FALSE; 000024C9 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; 000024CD 816408FFF7 and word [si+0x8],0xf7ff 000024D2 E929F4 jmp word 0x18fe goto check_this_and_go_next_lemming; @@ -3964,7 +3971,7 @@ lbl_mining: 00002550 C6442904 mov byte [si+0x29],0x4 00002554 A12B00 mov ax,[0x2b] 00002557 894414 mov [si+0x14],ax -0000255A C6442A00 mov byte [si+0x2a],0x0 +0000255A C6442A00 mov byte [si+0x2a],0x0 lemm->draw_trick1 = FALSE; 0000255E 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; 00002562 816408FFF7 and word [si+0x8],0xf7ff 00002567 E994F3 jmp word 0x18fe goto check_this_and_go_next_lemming; @@ -4012,7 +4019,7 @@ lbl_mining: 000025D9 C6442909 mov byte [si+0x29],0x9 000025DD A12B00 mov ax,[0x2b] 000025E0 894414 mov [si+0x14],ax -000025E3 C6442A00 mov byte [si+0x2a],0x0 +000025E3 C6442A00 mov byte [si+0x2a],0x0 lemm->draw_trick1 = FALSE; 000025E7 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; 000025EB E910F3 jmp word 0x18fe goto check_this_and_go_next_lemming; 000025EE 803E0820FF cmp byte [0x2008],0xff @@ -4023,41 +4030,43 @@ lbl_mining: 000025FF CD61 int 0x61 00002601 EBAC jmp short 0x25af +lbl_exploding: +00002603 8A4428 mov al,[si+0x28] lemm->spr_frame = (lemm->spr_frame + 1) % 8; +00002606 FEC0 inc al // +00002608 240F and al,0xf // +0000260A 884428 mov [si+0x28],al // +0000260D 755D jnz 0x266c if ( lemm->spr_frame == 0 ) { +0000260F 834C0802 or word [si+0x8],byte +0x2 lemm->state.bits.s_exploding_spe = 1; +00002613 C7440A0800 mov word [si+0xa],0x8 # +00002618 C7440C0B18 mov word [si+0xc],0x180b lemm->spr_data_ptr = 0x180b; +0000261D C744108002 mov word [si+0x10],0x280 # +00002622 C74412E001 mov word [si+0x12],0x1e0 # +00002627 C6442800 mov byte [si+0x28],0x0 lemm->spr_frame = 0; +0000262B C74406E7FF mov word [si+0x6],0xffe7 lemm->x_spr_offset = -25; +00002630 C74404F0FF mov word [si+0x4],0xfff0 lemm->y_spr_offset = -16; +00002635 C6442900 mov byte [si+0x29],0x0 lemm->draw_hint = 0; +00002639 A13900 mov ax,[0x39] // +0000263C 894414 mov [si+0x14],ax lemm->ptr2 = *[0x39]; # +0000263F C6442A00 mov byte [si+0x2a],0x0 lemm->draw_trick1 = FALSE; +00002643 C644220F mov byte [si+0x22],0xf # +00002647 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; +0000264B 803E0820FF cmp byte [0x2008],0xff if ( [0x2008] == 0xff && [0x20ff] != 0x3) { +00002650 750C jnz 0x265e // +00002652 F606FF2003 test byte [0x20ff],0x3 // +00002657 7405 jz 0x265e // +00002659 B80C04 mov ax,0x40c // +0000265C CD61 int 0x61 INT 61h, AH=04h, AL=0ch ?? + } +0000265E F744080400 test word [si+0x8],0x4 if ( lemm.flags.s_falling ) [si+0x22] = 0x0; # +00002663 7404 jz 0x2669 // +00002665 C6442200 mov byte [si+0x22],0x0 // +00002669 E995F2 jmp word 0x1901 goto next_lemming; + } lbl_exploding2: -00002603 8A4428 mov al,[si+0x28] -00002606 FEC0 inc al -00002608 240F and al,0xf -0000260A 884428 mov [si+0x28],al -0000260D 755D jnz 0x266c goto lbl_exploding2; -0000260F 834C0802 or word [si+0x8],byte +0x2 -00002613 C7440A0800 mov word [si+0xa],0x8 -00002618 C7440C0B18 mov word [si+0xc],0x180b -0000261D C744108002 mov word [si+0x10],0x280 -00002622 C74412E001 mov word [si+0x12],0x1e0 -00002627 C6442800 mov byte [si+0x28],0x0 -0000262B C74406E7FF mov word [si+0x6],0xffe7 -00002630 C74404F0FF mov word [si+0x4],0xfff0 -00002635 C6442900 mov byte [si+0x29],0x0 -00002639 A13900 mov ax,[0x39] -0000263C 894414 mov [si+0x14],ax -0000263F C6442A00 mov byte [si+0x2a],0x0 -00002643 C644220F mov byte [si+0x22],0xf -00002647 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; -0000264B 803E0820FF cmp byte [0x2008],0xff -00002650 750C jnz 0x265e -00002652 F606FF2003 test byte [0x20ff],0x3 -00002657 7405 jz 0x265e -00002659 B80C04 mov ax,0x40c -0000265C CD61 int 0x61 -0000265E F744080400 test word [si+0x8],0x4 -00002663 7404 jz 0x2669 -00002665 C6442200 mov byte [si+0x22],0x0 -00002669 E995F2 jmp word 0x1901 goto next_lemming; -lbl_exploding3: -0000266C 3C05 cmp al,0x5 -0000266E 7507 jnz 0x2677 -00002670 803E4800FF cmp byte [0x48],0xff -00002675 7500 jnz 0x2677 +0000266C 3C05 cmp al,0x5 if ( al != 5 || nuke_all_in_progress != TRUE ) { nop(); } // WTF +0000266E 7507 jnz 0x2677 // +00002670 803E4800FF cmp byte [0x48],0xff // +00002675 7500 jnz 0x2677 // 00002677 E8012C call word 0x527b 0000267A 8B6C02 mov bp,[si+0x2] 0000267D 268A05 mov al,[es:di] @@ -4098,7 +4107,7 @@ lbl_anim_but_no_move: 000026DF C6442909 mov byte [si+0x29],0x9 lemm->draw_hint=0x9; 000026E3 A12B00 mov ax,[0x2b] lemm->ptr2 = [0x2b]; 000026E6 894414 mov [si+0x14],ax // -000026E9 C6442A00 mov byte [si+0x2a],0x0 //??? +000026E9 C6442A00 mov byte [si+0x2a],0x0 lemm->draw_trick1 = FALSE; 000026ED 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; 000026F1 8064247F and byte [si+0x24],0x7f // (redundant) 000026F5 E906F2 jmp word 0x18fe goto check_this_and_go_next_lemming; @@ -4107,61 +4116,67 @@ lbl_anim_but_no_move: void commit_suicide() { /* From move_lemmings() */ 000026F8 B001 mov al,0x1 000026FA FE4C20 dec byte [si+0x20] lemm.expl_countdown--; -000026FD 7555 jnz 0x2754 if ( lemm.expl_countdown == 0 ) { -000026FF F744080454 test word [si+0x8],0x5404 if ( lemm->state.raw == 0x5404 ) { //WTF?? # -00002704 7551 jnz 0x2757 // -00002706 814C080080 or word [si+0x8],0x8000 lemm->state.bits.s_exploding2 = 1; -0000270B C7440A0800 mov word [si+0xa],0x8 // ??? # -00002710 C7440C3B15 mov word [si+0xc],0x153b lemm.spr_data_ptr = 0x153b; # -00002715 C744105A00 mov word [si+0x10],0x5a // ??? -0000271A C744123C00 mov word [si+0x12],0x3c // ??? -0000271F C6442800 mov byte [si+0x28],0x0 lemm.spr_frame = 0; -00002723 C74404F8FF mov word [si+0x4],0xfff8 lemm.x_spr_offset = -8; -00002728 C74406F6FF mov word [si+0x6],0xfff6 lemm.y_spr_offset = -10; -0000272D C6442900 mov byte [si+0x29],0x0 lemm.draw_hint = 0; -00002731 A12B00 mov ax,[0x2b] // -00002734 894414 mov [si+0x14],ax lemm.ptr2 = *[0x2b]; # -00002737 C6442A00 mov byte [si+0x2a],0x0 // ??? -0000273B 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; -0000273F 803E0820FF cmp byte [0x2008],0xff if ( [0x2008] == 0xff && [0x20ff] != 0x3) { -00002744 750C jnz 0x2752 // -00002746 F606FF2003 test byte [0x20ff],0x3 // -0000274B 7405 jz 0x2752 // -0000274D B80504 mov ax,0x405 // -00002750 CD61 int 0x61 INT 61h, AH=04h, AL=05h ?? - } +000026FD 7555 jnz 0x2754 if ( lemm.expl_countdown != 0 ) return 0; + +000026FF F744080454 test word [si+0x8],0x5404 if ( !( lemm->state.bits.s_dying || + lemm->state.bits.s_drawning || + lemm->state.bits.s_floating || + lemm->state.bits.s_falling + ) { +00002704 7551 jnz 0x2757 // +00002706 814C080080 or word [si+0x8],0x8000 lemm->state.bits.s_exploding = 1; +0000270B C7440A0800 mov word [si+0xa],0x8 // ??? # +00002710 C7440C3B15 mov word [si+0xc],0x153b lemm->spr_data_ptr = 0x153b; # +00002715 C744105A00 mov word [si+0x10],0x5a // ??? +0000271A C744123C00 mov word [si+0x12],0x3c // ??? +0000271F C6442800 mov byte [si+0x28],0x0 lemm->spr_frame = 0; +00002723 C74404F8FF mov word [si+0x4],0xfff8 lemm->x_spr_offset = -8; +00002728 C74406F6FF mov word [si+0x6],0xfff6 lemm->y_spr_offset = -10; +0000272D C6442900 mov byte [si+0x29],0x0 lemm->draw_hint = 0; +00002731 A12B00 mov ax,[0x2b] // +00002734 894414 mov [si+0x14],ax lemm->ptr2 = *[0x2b]; # +00002737 C6442A00 mov byte [si+0x2a],0x0 lemm->draw_trick1 = FALSE; +0000273B 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; +0000273F 803E0820FF cmp byte [0x2008],0xff if ( [0x2008] == 0xff && [0x20ff] != 0x3) { +00002744 750C jnz 0x2752 // +00002746 F606FF2003 test byte [0x20ff],0x3 // +0000274B 7405 jz 0x2752 // +0000274D B80504 mov ax,0x405 // +00002750 CD61 int 0x61 INT 61h, AH=04h, AL=05h ?? + } 00002752 32C0 xor al,al +00002754 22C0 and al,al // +00002756 C3 ret return 1; } else { -00002754 22C0 and al,al // -00002756 C3 ret // + //DUPLICATE CODE from 0000260F -00002757 834C0802 or word [si+0x8],byte +0x2 lemm->state.bits.s_exploding = 1; +00002757 834C0802 or word [si+0x8],byte +0x2 lemm->state.bits.s_exploding_spe = 1; 0000275B C7440A0800 mov word [si+0xa],0x8 # -00002760 C7440C0B18 mov word [si+0xc],0x180b # +00002760 C7440C0B18 mov word [si+0xc],0x180b lemm->spr_data_ptr = 0x180b; 00002765 C744108002 mov word [si+0x10],0x280 # 0000276A C74412E001 mov word [si+0x12],0x1e0 # -0000276F C6442800 mov byte [si+0x28],0x0 lemm.spr_frame = 0; -00002773 C74406E7FF mov word [si+0x6],0xffe7 lemm.x_spr_offset = -25; -00002778 C74404F0FF mov word [si+0x4],0xfff0 lemm.y_spr_offset = -16; -0000277D C6442900 mov byte [si+0x29],0x0 lemm.draw_hint = 0; -00002781 A13900 mov ax,[0x39] // -00002784 894414 mov [si+0x14],ax lemm.ptr2 = *[0x39]; # -00002787 C6442A00 mov byte [si+0x2a],0x0 # +0000276F C6442800 mov byte [si+0x28],0x0 lemm->spr_frame = 0; +00002773 C74406E7FF mov word [si+0x6],0xffe7 lemm->x_spr_offset = -25; +00002778 C74404F0FF mov word [si+0x4],0xfff0 lemm->y_spr_offset = -16; +0000277D C6442900 mov byte [si+0x29],0x0 lemm->draw_hint = 0; +00002781 A13900 mov ax,[0x39] // +00002784 894414 mov [si+0x14],ax lemm->ptr2 = *[0x39]; # +00002787 C6442A00 mov byte [si+0x2a],0x0 lemm->draw_trick1 = FALSE; 0000278B C644220F mov byte [si+0x22],0xf # -0000278F 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; -00002793 803E0820FF cmp byte [0x2008],0xff if ( [0x2008] == 0xff && [0x20ff] != 0x3) { -00002798 750C jnz 0x27a6 // -0000279A F606FF2003 test byte [0x20ff],0x3 // -0000279F 7405 jz 0x27a6 // -000027A1 B80C04 mov ax,0x40c // -000027A4 CD61 int 0x61 INT 61h, AH=04h, AL=0ch ?? - } -000027A6 F744080400 test word [si+0x8],0x4 if ( lemm.flags.s_falling ) [si+0x22] = 0x0 # -000027AB 7404 jz 0x27b1 // -000027AD C6442200 mov byte [si+0x22],0x0 // +0000278F 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; +00002793 803E0820FF cmp byte [0x2008],0xff if ( [0x2008] == 0xff && [0x20ff] != 0x3) { +00002798 750C jnz 0x27a6 // +0000279A F606FF2003 test byte [0x20ff],0x3 // +0000279F 7405 jz 0x27a6 // +000027A1 B80C04 mov ax,0x40c // +000027A4 CD61 int 0x61 INT 61h, AH=04h, AL=0ch ?? + } +000027A6 F744080400 test word [si+0x8],0x4 if ( lemm.flags.s_falling ) [si+0x22] = 0x0 # +000027AB 7404 jz 0x27b1 // +000027AD C6442200 mov byte [si+0x22],0x0 // } 000027B1 32C0 xor al,al -000027B3 C3 ret return 0; //(al==0) +000027B3 C3 ret return 0; } void process_if_in_special_zone() { @@ -4237,8 +4252,8 @@ lbl_on_exit: 0000285D C6442900 mov byte [si+0x29],0x0 00002861 A12F00 mov ax,[0x2f] 00002864 894414 mov [si+0x14],ax -00002867 C6442AFF mov byte [si+0x2a],0xff -0000286B 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; +00002867 C6442AFF mov byte [si+0x2a],0xff lemm->draw_trick1 = TRUE; +0000286B 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; 0000286F 803E0820FF cmp byte [0x2008],0xff 00002874 740C jz 0x2882 00002876 F606FF2001 test byte [0x20ff],0x1 @@ -4300,8 +4315,8 @@ lbl_on_exit: 0000291D C6442900 mov byte [si+0x29],0x0 00002921 A12B00 mov ax,[0x2b] 00002924 894414 mov [si+0x14],ax -00002927 C6442A00 mov byte [si+0x2a],0x0 -0000292B 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; +00002927 C6442A00 mov byte [si+0x2a],0x0 lemm->draw_trick1 = FALSE; +0000292B 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; 0000292F 803E0820FF cmp byte [0x2008],0xff 00002934 750C jnz 0x2942 00002936 F606FF2003 test byte [0x20ff],0x3 @@ -4323,7 +4338,7 @@ lbl_on_exit: 00002974 C6442900 mov byte [si+0x29],0x0 00002978 A13B00 mov ax,[0x3b] 0000297B 894414 mov [si+0x14],ax -0000297E C6442AFF mov byte [si+0x2a],0xff +0000297E C6442AFF mov byte [si+0x2a],0xff lemm->draw_trick1 = TRUE; 00002982 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; 00002986 803E0820FF cmp byte [0x2008],0xff 0000298B 750C jnz 0x2999 @@ -4384,7 +4399,7 @@ lbl_on_exit: 00002A2D C6442904 mov byte [si+0x29],0x4 00002A31 A12B00 mov ax,[0x2b] 00002A34 894414 mov [si+0x14],ax -00002A37 C6442A00 mov byte [si+0x2a],0x0 +00002A37 C6442A00 mov byte [si+0x2a],0x0 lemm->draw_trick1 = FALSE; 00002A3B 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; 00002A3F FE064000 inc byte [0x40] lemm_spawned_count++; 00002A43 C3 ret return; @@ -4441,7 +4456,7 @@ lbl_apply_exploder: 00002ABA 7441 jz 0x2afd // 00002ABC 807C2000 cmp byte [si+0x20],0x0 // 00002AC0 753B jnz 0x2afd // -00002AC2 F7440803C0 test word [si+0x8],0xc003 if ( lemm->state.raw & (s_exploding2 | s_dying | s_exploding | s_splatting) !=0 ) +00002AC2 F7440803C0 test word [si+0x8],0xc003 if ( lemm->state.raw & (s_exploding | s_dying | s_exploding_spe | s_splatting) !=0 ) 00002AC7 7534 jnz 0x2afd return; 00002AC9 FE0E6D00 dec byte [0x6d] sk_bomber--; 00002ACD C6066F0000 mov byte [0x6f],0x0 sk_bomber_tag=0; @@ -4490,7 +4505,7 @@ lbl_apply_digger_no_check: 00002B4D A13500 mov ax,[0x35] 00002B50 894414 mov [si+0x14],ax 00002B53 C6441F08 mov byte [si+0x1f],0x8 -00002B57 C6442AFF mov byte [si+0x2a],0xff +00002B57 C6442AFF mov byte [si+0x2a],0xff lemm->draw_trick1 = TRUE; 00002B5B 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; 00002B5F E974FF jmp word 0x2ad6 goto check_after_skill_apply; @@ -4518,7 +4533,7 @@ lbl_apply_climber: 00002B91 7418 jz 0x2bab // 00002B93 F6442401 test byte [si+0x24],0x1 if ( lemm->flags1.cap_climber != 0 ) return; 00002B97 7512 jnz 0x2bab // -00002B99 F744080301 test word [si+0x8],0x103 if ( lemm->state & ( s_blocking | s_splatting | s_exploding ) != 0 ) return; +00002B99 F744080301 test word [si+0x8],0x103 if ( lemm->state & ( s_blocking | s_splatting | s_exploding_spe ) != 0 ) return; 00002B9E 750B jnz 0x2bab // 00002BA0 FE0E6700 dec byte [0x67] sk_climber--; 00002BA4 804C2401 or byte [si+0x24],0x1 lemm->flags1.cap_climber = 1; @@ -4548,7 +4563,7 @@ lbl_apply_builder: 00002BF6 C744124E00 mov word [si+0x12],0x4e //??? 00002BFB C6442910 mov byte [si+0x29],0x10 lemm->draw_hint=0x10; 00002BFF A13300 mov ax,[0x33] //??? -00002C02 C6442AFF mov byte [si+0x2a],0xff //??? +00002C02 C6442AFF mov byte [si+0x2a],0xff lemm->draw_trick1 = TRUE; 00002C06 894414 mov [si+0x14],ax lemm->ptr2=*[0x33]; 00002C09 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; 00002C0D E9C6FE jmp word 0x2ad6 goto check_after_skill_apply; @@ -4672,7 +4687,7 @@ lbl_apply_blocker: 00002D42 C74406F6FF mov word [si+0x6],0xfff6 00002D47 A12B00 mov ax,[0x2b] 00002D4A 894414 mov [si+0x14],ax -00002D4D C6442A00 mov byte [si+0x2a],0x0 +00002D4D C6442A00 mov byte [si+0x2a],0x0 lemm->draw_trick1 = FALSE; 00002D51 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; 00002D55 56 push si 00002D56 1E push ds @@ -4751,7 +4766,7 @@ lbl_apply_basher: 00002E12 C744105000 mov word [si+0x10],0x50 00002E17 C744123C00 mov word [si+0x12],0x3c 00002E1C C6442920 mov byte [si+0x29],0x20 -00002E20 C6442AFF mov byte [si+0x2a],0xff +00002E20 C6442AFF mov byte [si+0x2a],0xff lemm->draw_trick1 = TRUE; 00002E24 A13100 mov ax,[0x31] 00002E27 894414 mov [si+0x14],ax 00002E2A 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; @@ -4771,7 +4786,7 @@ lbl_apply_floater: 00002E4D 741D jz 0x2e6c // 00002E4F 807C2500 cmp byte [si+0x25],0x0 // 00002E53 7517 jnz 0x2e6c // -00002E55 F744080301 test word [si+0x8],0x103 if ( lemm.state & (s_blocking|s_splatting|s_exploding) != 0 ) return; +00002E55 F744080301 test word [si+0x8],0x103 if ( lemm.state & (s_blocking|s_splatting|s_exploding_spe) != 0 ) return; 00002E5A 7510 jnz 0x2e6c // 00002E5C C64425FF mov byte [si+0x25],0xff lemm.cap_floater = TRUE; 00002E60 FE0E6A00 dec byte [0x6a] sk_floater--; @@ -4827,7 +4842,7 @@ lbl_apply_miner_no_check: 00002EF3 C6442918 mov byte [si+0x29],0x18 00002EF7 A13300 mov ax,[0x33] 00002EFA 894414 mov [si+0x14],ax -00002EFD C6442AFF mov byte [si+0x2a],0xff +00002EFD C6442AFF mov byte [si+0x2a],0xff lemm->draw_trick1 = TRUE; 00002F01 80642401 and byte [si+0x24],0x1 lemm->flags1.walk_pause_for_shruggling = 0; 00002F05 FF4402 inc word [si+0x2] 00002F08 E9CBFB jmp word 0x2ad6 goto check_after_skill_apply; @@ -5743,7 +5758,7 @@ try_other_candidate_for_mining: 000038A5 2AC4 sub al,ah 000038A7 3C05 cmp al,0x5 000038A9 7FE3 jg 0x388e -000038AB C6064800FF mov byte [0x48],0xff +000038AB C6064800FF mov byte [0x48],0xff nuke_all_in_progress = TRUE; 000038B0 A04000 mov al,[0x40] 000038B3 A24400 mov [0x44],al 000038B6 EBD6 jmp short 0x388e @@ -10995,12 +11010,13 @@ try_other_candidate_for_mining: 0000655B 7403 jz 0x6560 0000655D 024529 add al,[di+0x29] 00006560 32E4 xor ah,ah -00006562 807D2AFF cmp byte [di+0x2a],0xff -00006566 7408 jz 0x6570 -00006568 D1E0 shl ax,1 -0000656A D1E0 shl ax,1 -0000656C D1E0 shl ax,1 -0000656E 03C3 add ax,bx +00006562 807D2AFF cmp byte [di+0x2a],0xff if ( [di+0x2a] == FALSE ) ax = 8*ax+bx; +00006566 7408 jz 0x6570 // +00006568 D1E0 shl ax,1 // +0000656A D1E0 shl ax,1 // +0000656C D1E0 shl ax,1 // +0000656E 03C3 add ax,bx // + 00006570 52 push dx 00006571 8B4D10 mov cx,[di+0x10] 00006574 F7E1 mul cx @@ -11024,7 +11040,7 @@ try_other_candidate_for_mining: 0000659B D1EA shr dx,1 0000659D D1EA shr dx,1 0000659F 8B4D06 mov cx,[di+0x6] -000065A2 FF7514 push word [di+0x14] push lemm.ptr2; +000065A2 FF7514 push word [di+0x14] push lemm->ptr2; 000065A5 8A4520 mov al,[di+0x20] 000065A8 8B7D02 mov di,[di+0x2] 000065AB 03F9 add di,cx -- cgit v1.2.3