[Decompilation] [th05] Yuuka's shot control functions

Ooh, shot position being determined by RNG at lower shot levels? That's
some RNG manipulation TAS potential right there! Maybe.

Part of P0037, funded by zorg.
This commit is contained in:
nmlgc 2019-10-12 16:57:14 +02:00
parent db4de240e9
commit da27eb4c31
4 changed files with 298 additions and 963 deletions

View File

@ -95,7 +95,7 @@ $**
bin\th05\player.obj: th05\player.asm
bin\th05\hud_bar.obj: th05\hud_bar.asm
bin\th05\scoreupd.obj: th04\scoreupd.asm
bin\th05\main.exe: bin\th05\main.obj bin\th05\player.obj bin\th05\hud_bar.obj bin\th05\scoreupd.obj th05\main012.cpp
bin\th05\main.exe: bin\th05\main.obj th05\p_yuuka.cpp bin\th05\player.obj bin\th05\hud_bar.obj bin\th05\scoreupd.obj th05\main012.cpp
$(CC) $(CFLAGS) -ml -3 -Z -DGAME=5 -nbin\th05\ -eMAIN.EXE @&&|
$**
|

View File

@ -1,3 +1,20 @@
## Local variables
| | |
|-|-|
| `DX` | First 8-bit variable declared *if no other function is called* |
| `[bp-1]` | First 8-bit variable declared *otherwise* |
| `SI` | First 16-bit variable declared |
| `DI` | Second 16-bit variable declared |
Example:
| ASM | Declaration sequence in C |
|----------|---------------------------|
| `SI` | `int near *var_1;` |
| `[bp-1]` | `char var_2;` |
| `[bp-2]` | `char var_3;` |
## Signedness
| | |
@ -31,6 +48,11 @@ case it's part of an arithmetic expression that was promoted to `int`.
* Multiple cases with the same offset in the table, to code that doesn't
return? Code was compiled with `-O`
## Pushing byte arguments to functions
Borland C++ just pushes the entire word. Will cause IDA to mis-identify
certain local variables as `word`s when they aren't.
## Inlining
Always worth a try to get rid of a potential macro. Some edge cases don't
@ -70,6 +92,8 @@ barely more readable than assembly (or even less so), with tons of inline ASM
and register pseudovariables. However, it's futile to even try if the function
contains one of the following:
<a id="clobbering-di"></a>
* A reference to the `DI` register. In that case, Turbo C++ always inserts a
`PUSH DI` at the beginning (before the `MOV BX, SP`), and a `POP DI` before
returning.

265
th05/p_yuuka.cpp Normal file
View File

@ -0,0 +1,265 @@
/* ReC98
* -----
* Yuuka's shot control functions
*/
#pragma codeseg main_01_TEXT
extern "C" {
#include "th05/th05.hpp"
#define cycle _AL
#define YUUKA_INNER_L4 \
switch(sai.i - 1) { \
case 0: sai.angle = 186; break; \
case 1: sai.angle = 192; shot->pos.cur.x -= 8; break; \
case 2: sai.angle = 192; shot->pos.cur.x += 8; break; \
case 3: sai.angle = 198; break; \
} \
shot->damage = 7;
#define YUUKA_INNER_L5 \
switch(sai.i - 1) { \
case 0: sai.angle = 180; break; \
case 1: sai.angle = 186; break; \
case 2: sai.angle = 192; break; \
case 3: sai.angle = 198; break; \
case 4: sai.angle = 204; break; \
} \
shot->damage = 7;
void pascal near shot_yuuka_l2(void)
{
SHOT_FUNC_INIT(1, SC_3X, SC_1X, i += 2);
while(( shot = shots_add() ) != NULL) {
if(sai.i == 1) {
sai.angle = randring_angle(15, 184);
shot->damage = 9;
} else {
if(sai.i == 3) { shot->from_option_l(); sai.angle = 184; }
else/*i == 2*/ { shot->from_option_r(); sai.angle = 200; }
shot->set_option_sprite_and_damage(6);
}
shot_velocity_set(&shot->pos.velocity, sai.angle);
if(sai.next() <= 0) {
break;
}
}
}
void pascal near shot_yuuka_l3(void)
{
SHOT_FUNC_INIT(2, SC_3X, SC_2X, add_secondary(2));
char option_only = cycle & SC_3X;
while(( shot = shots_add() ) != NULL) {
if(sai.i <= 2) {
if(sai.i == 2) { shot->pos.cur.x -= 8; }
else/*i == 1*/ { shot->pos.cur.x += 8; }
shot->damage = 8;
} else {
if(sai.i == 4) {
shot->from_option_l();
sai.angle = 184;
} else {
shot->from_option_r();
sai.angle = 200;
if(option_only == 0) {
sai.i = 1;
}
}
shot->set_option_sprite_and_damage(6);
shot_velocity_set(&shot->pos.velocity, sai.angle);
}
if(sai.next() <= 0) {
break;
}
}
}
void pascal near shot_yuuka_l4(void)
{
SHOT_FUNC_INIT(3, SC_3X, SC_2X, add_secondary(2));
char option_only = cycle & SC_3X;
while(( shot = shots_add() ) != NULL) {
if(sai.i <= 3) {
if(sai.i == 3) {
sai.angle = 180;
}
shot->damage = 7;
sai.angle += 6;
} else {
if(sai.i == 5) {
shot->from_option_l();
sai.angle = randring_angle(7, 180);
} else {
shot->from_option_r();
sai.angle = randring_angle(7, 196);
if(option_only == 0) {
sai.i = 1;
}
}
shot->pos.velocity.y = 2;
shot->set_option_sprite_and_damage(6);
}
shot_velocity_set(&shot->pos.velocity, sai.angle);
if(sai.next() <= 0) {
break;
}
}
}
void pascal near shot_yuuka_l5(void)
{
SHOT_FUNC_INIT(3, SC_3X, SC_2X, add_secondary(4));
char option_only = cycle & SC_3X;
while(( shot = shots_add() ) != NULL) {
if(sai.i <= 3) {
shot->damage = 7;
if(sai.i == 3) {
sai.angle = 180;
}
sai.angle += 6;
} else {
switch(sai.i - 4u) {
case 0:
if(option_only == 0) {
sai.i = 1;
}
shot->from_option_l(); sai.angle = 178; break;
case 1: shot->from_option_r(); sai.angle = 206; break;
case 2: shot->from_option_l(); sai.angle = 186; break;
case 3: shot->from_option_r(); sai.angle = 198; break;
}
shot->set_option_sprite_and_damage(6);
}
shot_velocity_set(&shot->pos.velocity, sai.angle);
if(sai.next() <= 0) {
break;
}
}
}
void pascal near shot_yuuka_l6(void)
{
SHOT_FUNC_INIT(4, SC_3X, SC_2X, add_secondary(4));
char option_only = cycle & SC_3X;
while(( shot = shots_add() ) != NULL) {
if(sai.i <= 4) {
YUUKA_INNER_L4;
} else {
switch(sai.i - 5u) {
case 0: shot->from_option_l(); sai.angle = 176;
if(option_only == 0) {
sai.i = 1;
}
break;
case 1: shot->from_option_r(); sai.angle = 208; break;
case 2: shot->from_option_l(); sai.angle = 184; break;
case 3: shot->from_option_r(); sai.angle = 200; break;
}
shot->set_option_sprite_and_damage(6);
}
shot_velocity_set(&shot->pos.velocity, sai.angle);
if(sai.next() <= 0) {
break;
}
}
}
void pascal near shot_yuuka_l7(void)
{
SHOT_FUNC_INIT(4, SC_3X, SC_2X, add_secondary(6));
char option_only = cycle & SC_3X;
while(( shot = shots_add() ) != NULL) {
if(sai.i <= 4) {
YUUKA_INNER_L4;
} else {
switch(sai.i - 5u) {
case 0: shot->from_option_l(); sai.angle = 176;
if(option_only == 0) {
sai.i = 1;
}
break;
case 1: shot->from_option_r(); sai.angle = 208; break;
case 2: shot->from_option_l(); sai.angle = 183; break;
case 3: shot->from_option_r(); sai.angle = 201; break;
case 4: shot->from_option_l(); sai.angle = 190; break;
case 5: shot->from_option_r(); sai.angle = 194; break;
}
shot->set_option_sprite_and_damage(6);
}
shot_velocity_set(&shot->pos.velocity, sai.angle);
if(sai.next() <= 0) {
break;
}
}
}
void pascal near shot_yuuka_l8(void)
{
SHOT_FUNC_INIT(5, SC_3X, SC_2X, add_secondary(6));
char option_only = cycle & SC_3X;
while(( shot = shots_add() ) != NULL) {
if(sai.i <= 5) {
YUUKA_INNER_L5;
} else {
switch(sai.i - 6u) {
case 0: shot->from_option_l(); sai.angle = 176;
if(option_only == 0) {
sai.i = 1;
}
break;
case 1: shot->from_option_r(); sai.angle = 208; break;
case 2: shot->from_option_l(); sai.angle = 183; break;
case 3: shot->from_option_r(); sai.angle = 201; break;
case 4: shot->from_option_l(); sai.angle = 190; break;
case 5: shot->from_option_r(); sai.angle = 194; break;
}
shot->set_option_sprite_and_damage(6);
}
shot_velocity_set(&shot->pos.velocity, sai.angle);
if(sai.next() <= 0) {
break;
}
}
}
void pascal near shot_yuuka_l9(void)
{
SHOT_FUNC_INIT(5, SC_3X, SC_2X, add_secondary(8));
char option_only = cycle & SC_3X;
while(( shot = shots_add() ) != NULL) {
if(sai.i <= 5) {
YUUKA_INNER_L5;
} else {
switch(sai.i - 6u) {
case 0: shot->from_option_l(); sai.angle = 168;
if(option_only == 0) {
sai.i = 1;
}
break;
case 1: shot->from_option_r(); sai.angle = 216; break;
case 2: shot->from_option_l(); sai.angle = 176; break;
case 3: shot->from_option_r(); sai.angle = 208; break;
case 4: shot->from_option_l(); sai.angle = 184; break;
case 5: shot->from_option_r(); sai.angle = 200; break;
case 6: shot->from_option_l(); sai.angle = 193; break;
case 7: shot->from_option_r(); sai.angle = 191; break;
}
shot->set_option_sprite_and_damage(6);
}
shot_velocity_set(&shot->pos.velocity, sai.angle);
if(sai.next() <= 0) {
break;
}
}
}
}

View File

@ -16235,968 +16235,14 @@ table_13BF3 dw loc_13B38
dw loc_13B6D
dw loc_13B79
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
shot_yuuka_l2 proc near
var_2 = word ptr -2
enter 2, 0
push si
mov byte ptr [bp+var_2+1], 1
call shot_cycle_init
test al, 9
jz short loc_13C74
test al, 8
jz short loc_13C6B
mov al, byte ptr [bp+var_2+1]
add al, 2
mov byte ptr [bp+var_2+1], al
jmp short loc_13C6B
; ---------------------------------------------------------------------------
loc_13C1D:
cmp byte ptr [bp+var_2+1], 1
jnz short loc_13C33
push 0Fh
call randring1_next16_and
add al, 0B8h
mov byte ptr [bp+var_2], al
mov byte ptr [si+10h], 9
jmp short loc_13C55
; ---------------------------------------------------------------------------
loc_13C33:
cmp byte ptr [bp+var_2+1], 3
jnz short loc_13C44
sub word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0B8h
jmp short loc_13C4D
; ---------------------------------------------------------------------------
loc_13C44:
add word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0C8h
loc_13C4D:
mov byte ptr [si+0Eh], 16h
mov byte ptr [si+10h], 6
loc_13C55:
lea ax, [si+0Ah]
push ax
push [bp+var_2]
call shot_velocity_set
mov al, byte ptr [bp+var_2+1]
add al, 0FFh
mov byte ptr [bp+var_2+1], al
or al, al
jbe short loc_13C74
loc_13C6B:
call shots_add
mov si, ax
or ax, ax
jnz short loc_13C1D
loc_13C74:
pop si
leave
retn
shot_yuuka_l2 endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
shot_yuuka_l3 proc near
var_3 = byte ptr -3
var_2 = word ptr -2
enter 4, 0
push si
mov byte ptr [bp+var_2+1], 2
call shot_cycle_init
test al, 3
jz short loc_13CFF
test al, 2
jz short loc_13C8F
add byte ptr [bp+var_2+1], 2
loc_13C8F:
and al, 1
mov [bp+var_3], al
jmp short loc_13CF6
; ---------------------------------------------------------------------------
loc_13C96:
cmp byte ptr [bp+var_2+1], 2
ja short loc_13CB4
cmp byte ptr [bp+var_2+1], 2
jnz short loc_13CA9
sub word ptr [si+2], 80h
jmp short loc_13CAE
; ---------------------------------------------------------------------------
loc_13CA9:
add word ptr [si+2], 80h
loc_13CAE:
mov byte ptr [si+10h], 8
jmp short loc_13CEA
; ---------------------------------------------------------------------------
loc_13CB4:
cmp byte ptr [bp+var_2+1], 4
jnz short loc_13CC5
sub word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0B8h
jmp short loc_13CD8
; ---------------------------------------------------------------------------
loc_13CC5:
add word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0C8h
cmp [bp+var_3], 0
jnz short loc_13CD8
mov byte ptr [bp+var_2+1], 1
loc_13CD8:
mov byte ptr [si+0Eh], 16h
mov byte ptr [si+10h], 6
lea ax, [si+0Ah]
push ax
push [bp+var_2]
call shot_velocity_set
loc_13CEA:
mov al, byte ptr [bp+var_2+1]
add al, 0FFh
mov byte ptr [bp+var_2+1], al
or al, al
jbe short loc_13CFF
loc_13CF6:
call shots_add
mov si, ax
or ax, ax
jnz short loc_13C96
loc_13CFF:
pop si
leave
retn
shot_yuuka_l3 endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
shot_yuuka_l4 proc near
var_3 = byte ptr -3
var_2 = word ptr -2
enter 4, 0
push si
mov byte ptr [bp+var_2+1], 3
call shot_cycle_init
test al, 3
jz loc_13D9D
test al, 2
jz short loc_13D1C
add byte ptr [bp+var_2+1], 2
loc_13D1C:
and al, 1
mov [bp+var_3], al
jmp short loc_13D94
; ---------------------------------------------------------------------------
loc_13D23:
cmp byte ptr [bp+var_2+1], 3
ja short loc_13D41
cmp byte ptr [bp+var_2+1], 3
jnz short loc_13D33
mov byte ptr [bp+var_2], 0B4h
loc_13D33:
mov byte ptr [si+10h], 7
mov al, byte ptr [bp+var_2]
add al, 6
mov byte ptr [bp+var_2], al
jmp short loc_13D7E
; ---------------------------------------------------------------------------
loc_13D41:
cmp byte ptr [bp+var_2+1], 5
jnz short loc_13D58
sub word ptr [si+2], 180h
push 7
call randring1_next16_and
add al, 0B4h
mov byte ptr [bp+var_2], al
jmp short loc_13D71
; ---------------------------------------------------------------------------
loc_13D58:
add word ptr [si+2], 180h
push 7
call randring1_next16_and
add al, 0C4h ; 'A'
mov byte ptr [bp+var_2], al
cmp [bp+var_3], 0
jnz short loc_13D71
mov byte ptr [bp+var_2+1], 1
loc_13D71:
mov word ptr [si+0Ch], 20h ; ' '
mov byte ptr [si+0Eh], 16h
mov byte ptr [si+10h], 6
loc_13D7E:
lea ax, [si+0Ah]
push ax
push [bp+var_2]
call shot_velocity_set
mov al, byte ptr [bp+var_2+1]
add al, 0FFh
mov byte ptr [bp+var_2+1], al
or al, al
jbe short loc_13D9D
loc_13D94:
call shots_add
mov si, ax
or ax, ax
jnz short loc_13D23
loc_13D9D:
pop si
leave
retn
shot_yuuka_l4 endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
shot_yuuka_l5 proc near
var_3 = byte ptr -3
var_2 = word ptr -2
enter 4, 0
push si
mov byte ptr [bp+var_2+1], 3
call shot_cycle_init
test al, 3
jz loc_13E53
test al, 2
jz short loc_13DBA
add byte ptr [bp+var_2+1], 4
loc_13DBA:
and al, 1
mov [bp+var_3], al
jmp loc_13E48
; ---------------------------------------------------------------------------
loc_13DC2:
cmp byte ptr [bp+var_2+1], 3
ja short loc_13DE0
mov byte ptr [si+10h], 7
cmp byte ptr [bp+var_2+1], 3
jnz short loc_13DD6
mov byte ptr [bp+var_2], 0B4h
loc_13DD6:
mov al, byte ptr [bp+var_2]
add al, 6
mov byte ptr [bp+var_2], al
jmp short loc_13E32
; ---------------------------------------------------------------------------
loc_13DE0:
mov al, byte ptr [bp+var_2+1]
mov ah, 0
sub ax, 4
mov bx, ax
cmp bx, 3
ja short loc_13E2A
add bx, bx
jmp cs:table_13E57[bx]
loc_13DF6:
cmp [bp+var_3], 0
jnz short loc_13E00
mov byte ptr [bp+var_2+1], 1
loc_13E00:
sub word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0B2h
jmp short loc_13E2A
; ---------------------------------------------------------------------------
loc_13E0B:
add word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0CEh
jmp short loc_13E2A
; ---------------------------------------------------------------------------
loc_13E16:
sub word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0BAh
jmp short loc_13E2A
; ---------------------------------------------------------------------------
loc_13E21:
add word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0C6h
loc_13E2A:
mov byte ptr [si+0Eh], 16h
mov byte ptr [si+10h], 6
loc_13E32:
lea ax, [si+0Ah]
push ax
push [bp+var_2]
call shot_velocity_set
mov al, byte ptr [bp+var_2+1]
add al, 0FFh
mov byte ptr [bp+var_2+1], al
or al, al
jbe short loc_13E53
loc_13E48:
call shots_add
mov si, ax
or ax, ax
jnz loc_13DC2
loc_13E53:
pop si
leave
retn
shot_yuuka_l5 endp
; ---------------------------------------------------------------------------
db 0
table_13E57 dw loc_13DF6
dw loc_13E0B
dw loc_13E16
dw loc_13E21
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
shot_yuuka_l6 proc near
var_3 = byte ptr -3
var_2 = word ptr -2
enter 4, 0
push si
mov byte ptr [bp+var_2+1], 4
call shot_cycle_init
test al, 3
jz loc_13F34
test al, 2
jz short loc_13E79
add byte ptr [bp+var_2+1], 4
loc_13E79:
and al, 1
mov [bp+var_3], al
jmp loc_13F29
; ---------------------------------------------------------------------------
loc_13E81:
cmp byte ptr [bp+var_2+1], 4
ja short loc_13EC1
mov al, byte ptr [bp+var_2+1]
mov ah, 0
dec ax
mov bx, ax
cmp bx, 3
ja short loc_13EBB
add bx, bx
jmp cs:table_13F40[bx]
loc_13E9B:
mov byte ptr [bp+var_2], 0BAh
jmp short loc_13EBB
; ---------------------------------------------------------------------------
loc_13EA1:
mov byte ptr [bp+var_2], 0C0h
sub word ptr [si+2], 80h
jmp short loc_13EBB
; ---------------------------------------------------------------------------
loc_13EAC:
mov byte ptr [bp+var_2], 0C0h
add word ptr [si+2], 80h
jmp short loc_13EBB
; ---------------------------------------------------------------------------
loc_13EB7:
mov byte ptr [bp+var_2], 0C6h
loc_13EBB:
mov byte ptr [si+10h], 7
jmp short loc_13F13
; ---------------------------------------------------------------------------
loc_13EC1:
mov al, byte ptr [bp+var_2+1]
mov ah, 0
sub ax, 5
mov bx, ax
cmp bx, 3
ja short loc_13F0B
add bx, bx
jmp cs:table_13F38[bx]
loc_13ED7:
sub word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0B0h
cmp [bp+var_3], 0
jnz short loc_13F0B
mov byte ptr [bp+var_2+1], 1
jmp short loc_13F0B
; ---------------------------------------------------------------------------
loc_13EEC:
add word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0D0h
jmp short loc_13F0B
; ---------------------------------------------------------------------------
loc_13EF7:
sub word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0B8h
jmp short loc_13F0B
; ---------------------------------------------------------------------------
loc_13F02:
add word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0C8h
loc_13F0B:
mov byte ptr [si+0Eh], 16h
mov byte ptr [si+10h], 6
loc_13F13:
lea ax, [si+0Ah]
push ax
push [bp+var_2]
call shot_velocity_set
mov al, byte ptr [bp+var_2+1]
add al, 0FFh
mov byte ptr [bp+var_2+1], al
or al, al
jbe short loc_13F34
loc_13F29:
call shots_add
mov si, ax
or ax, ax
jnz loc_13E81
loc_13F34:
pop si
leave
retn
shot_yuuka_l6 endp
; ---------------------------------------------------------------------------
db 0
table_13F38 dw loc_13ED7
dw loc_13EEC
dw loc_13EF7
dw loc_13F02
table_13F40 dw loc_13E9B
dw loc_13EA1
dw loc_13EAC
dw loc_13EB7
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
shot_yuuka_l7 proc near
var_3 = byte ptr -3
var_2 = word ptr -2
enter 4, 0
push si
mov byte ptr [bp+var_2+1], 4
call shot_cycle_init
test al, 3
jz loc_14033
test al, 2
jz short loc_13F62
add byte ptr [bp+var_2+1], 6
loc_13F62:
and al, 1
mov [bp+var_3], al
jmp loc_14028
; ---------------------------------------------------------------------------
loc_13F6A:
cmp byte ptr [bp+var_2+1], 4
ja short loc_13FAA
mov al, byte ptr [bp+var_2+1]
mov ah, 0
dec ax
mov bx, ax
cmp bx, 3
ja short loc_13FA4
add bx, bx
jmp cs:table_14042[bx]
loc_13F84:
mov byte ptr [bp+var_2], 0BAh
jmp short loc_13FA4
; ---------------------------------------------------------------------------
loc_13F8A:
mov byte ptr [bp+var_2], 0C0h
sub word ptr [si+2], 80h
jmp short loc_13FA4
; ---------------------------------------------------------------------------
loc_13F95:
mov byte ptr [bp+var_2], 0C0h
add word ptr [si+2], 80h
jmp short loc_13FA4
; ---------------------------------------------------------------------------
loc_13FA0:
mov byte ptr [bp+var_2], 0C6h
loc_13FA4:
mov byte ptr [si+10h], 7
jmp short loc_14012
; ---------------------------------------------------------------------------
loc_13FAA:
mov al, byte ptr [bp+var_2+1]
mov ah, 0
sub ax, 5
mov bx, ax
cmp bx, 5
ja short loc_1400A
add bx, bx
jmp cs:table_14036[bx]
loc_13FC0:
sub word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0B0h
cmp [bp+var_3], 0
jnz short loc_1400A
mov byte ptr [bp+var_2+1], 1
jmp short loc_1400A
; ---------------------------------------------------------------------------
loc_13FD5:
add word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0D0h
jmp short loc_1400A
; ---------------------------------------------------------------------------
loc_13FE0:
sub word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0B7h
jmp short loc_1400A
; ---------------------------------------------------------------------------
loc_13FEB:
add word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0C9h
jmp short loc_1400A
; ---------------------------------------------------------------------------
loc_13FF6:
sub word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0BEh
jmp short loc_1400A
; ---------------------------------------------------------------------------
loc_14001:
add word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0C2h
loc_1400A:
mov byte ptr [si+0Eh], 16h
mov byte ptr [si+10h], 6
loc_14012:
lea ax, [si+0Ah]
push ax
push [bp+var_2]
call shot_velocity_set
mov al, byte ptr [bp+var_2+1]
add al, 0FFh
mov byte ptr [bp+var_2+1], al
or al, al
jbe short loc_14033
loc_14028:
call shots_add
mov si, ax
or ax, ax
jnz loc_13F6A
loc_14033:
pop si
leave
retn
shot_yuuka_l7 endp
; ---------------------------------------------------------------------------
table_14036 dw loc_13FC0
dw loc_13FD5
dw loc_13FE0
dw loc_13FEB
dw loc_13FF6
dw loc_14001
table_14042 dw loc_13F84
dw loc_13F8A
dw loc_13F95
dw loc_13FA0
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
shot_yuuka_l8 proc near
var_3 = byte ptr -3
var_2 = word ptr -2
enter 4, 0
push si
mov byte ptr [bp+var_2+1], 5
call shot_cycle_init
test al, 3
jz loc_14131
test al, 2
jz short loc_14064
add byte ptr [bp+var_2+1], 6
loc_14064:
and al, 1
mov [bp+var_3], al
jmp loc_14126
; ---------------------------------------------------------------------------
loc_1406C:
cmp byte ptr [bp+var_2+1], 5
ja short loc_140A8
mov al, byte ptr [bp+var_2+1]
mov ah, 0
dec ax
mov bx, ax
cmp bx, 4
ja short loc_140A2
add bx, bx
jmp cs:table_14141[bx]
loc_14086:
mov byte ptr [bp+var_2], 0B4h
jmp short loc_140A2
; ---------------------------------------------------------------------------
loc_1408C:
mov byte ptr [bp+var_2], 0BAh
jmp short loc_140A2
; ---------------------------------------------------------------------------
loc_14092:
mov byte ptr [bp+var_2], 0C0h
jmp short loc_140A2
; ---------------------------------------------------------------------------
loc_14098:
mov byte ptr [bp+var_2], 0C6h
jmp short loc_140A2
; ---------------------------------------------------------------------------
loc_1409E:
mov byte ptr [bp+var_2], 0CCh
loc_140A2:
mov byte ptr [si+10h], 7
jmp short loc_14110
; ---------------------------------------------------------------------------
loc_140A8:
mov al, byte ptr [bp+var_2+1]
mov ah, 0
sub ax, 6
mov bx, ax
cmp bx, 5
ja short loc_14108
add bx, bx
jmp cs:table_14135[bx]
loc_140BE:
sub word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0B0h
cmp [bp+var_3], 0
jnz short loc_14108
mov byte ptr [bp+var_2+1], 1
jmp short loc_14108
; ---------------------------------------------------------------------------
loc_140D3:
add word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0D0h
jmp short loc_14108
; ---------------------------------------------------------------------------
loc_140DE:
sub word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0B7h
jmp short loc_14108
; ---------------------------------------------------------------------------
loc_140E9:
add word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0C9h
jmp short loc_14108
; ---------------------------------------------------------------------------
loc_140F4:
sub word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0BEh
jmp short loc_14108
; ---------------------------------------------------------------------------
loc_140FF:
add word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0C2h
loc_14108:
mov byte ptr [si+0Eh], 16h
mov byte ptr [si+10h], 6
loc_14110:
lea ax, [si+0Ah]
push ax
push [bp+var_2]
call shot_velocity_set
mov al, byte ptr [bp+var_2+1]
add al, 0FFh
mov byte ptr [bp+var_2+1], al
or al, al
jbe short loc_14131
loc_14126:
call shots_add
mov si, ax
or ax, ax
jnz loc_1406C
loc_14131:
pop si
leave
retn
shot_yuuka_l8 endp
; ---------------------------------------------------------------------------
db 0
table_14135 dw loc_140BE
dw loc_140D3
dw loc_140DE
dw loc_140E9
dw loc_140F4
dw loc_140FF
table_14141 dw loc_14086
dw loc_1408C
dw loc_14092
dw loc_14098
dw loc_1409E
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
shot_yuuka_l9 proc near
var_3 = byte ptr -3
var_2 = word ptr -2
enter 4, 0
push si
mov byte ptr [bp+var_2+1], 5
call shot_cycle_init
test al, 3
jz loc_14248
test al, 2
jz short loc_14165
add byte ptr [bp+var_2+1], 8
loc_14165:
and al, 1
mov [bp+var_3], al
jmp loc_1423D
; ---------------------------------------------------------------------------
loc_1416D:
cmp byte ptr [bp+var_2+1], 5
ja short loc_141A9
mov al, byte ptr [bp+var_2+1]
mov ah, 0
dec ax
mov bx, ax
cmp bx, 4
ja short loc_141A3
add bx, bx
jmp cs:table_1425B[bx]
loc_14187:
mov byte ptr [bp+var_2], 0B4h
jmp short loc_141A3
; ---------------------------------------------------------------------------
loc_1418D:
mov byte ptr [bp+var_2], 0BAh
jmp short loc_141A3
; ---------------------------------------------------------------------------
loc_14193:
mov byte ptr [bp+var_2], 0C0h
jmp short loc_141A3
; ---------------------------------------------------------------------------
loc_14199:
mov byte ptr [bp+var_2], 0C6h
jmp short loc_141A3
; ---------------------------------------------------------------------------
loc_1419F:
mov byte ptr [bp+var_2], 0CCh
loc_141A3:
mov byte ptr [si+10h], 7
jmp short loc_14227
; ---------------------------------------------------------------------------
loc_141A9:
mov al, byte ptr [bp+var_2+1]
mov ah, 0
sub ax, 6
mov bx, ax
cmp bx, 7
ja short loc_1421F
add bx, bx
jmp cs:table_1424B[bx]
loc_141BF:
sub word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0A8h
cmp [bp+var_3], 0
jnz short loc_1421F
mov byte ptr [bp+var_2+1], 1
jmp short loc_1421F
; ---------------------------------------------------------------------------
loc_141D4:
add word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0D8h
jmp short loc_1421F
; ---------------------------------------------------------------------------
loc_141DF:
sub word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0B0h
jmp short loc_1421F
; ---------------------------------------------------------------------------
loc_141EA:
add word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0D0h
jmp short loc_1421F
; ---------------------------------------------------------------------------
loc_141F5:
sub word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0B8h
jmp short loc_1421F
; ---------------------------------------------------------------------------
loc_14200:
add word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0C8h
jmp short loc_1421F
; ---------------------------------------------------------------------------
loc_1420B:
sub word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0C1h
jmp short loc_1421F
; ---------------------------------------------------------------------------
loc_14216:
add word ptr [si+2], 180h
mov byte ptr [bp+var_2], 0BFh
loc_1421F:
mov byte ptr [si+0Eh], 16h
mov byte ptr [si+10h], 6
loc_14227:
lea ax, [si+0Ah]
push ax
push [bp+var_2]
call shot_velocity_set
mov al, byte ptr [bp+var_2+1]
add al, 0FFh
mov byte ptr [bp+var_2+1], al
or al, al
jbe short loc_14248
loc_1423D:
call shots_add
mov si, ax
or ax, ax
jnz loc_1416D
loc_14248:
pop si
leave
retn
shot_yuuka_l9 endp
; ---------------------------------------------------------------------------
table_1424B dw loc_141BF
dw loc_141D4
dw loc_141DF
dw loc_141EA
dw loc_141F5
dw loc_14200
dw loc_1420B
dw loc_14216
table_1425B dw loc_14187
dw loc_1418D
dw loc_14193
dw loc_14199
dw loc_1419F
db 0
SHOT_YUUKA_L2 procdesc pascal near
SHOT_YUUKA_L3 procdesc pascal near
SHOT_YUUKA_L4 procdesc pascal near
SHOT_YUUKA_L5 procdesc pascal near
SHOT_YUUKA_L6 procdesc pascal near
SHOT_YUUKA_L7 procdesc pascal near
SHOT_YUUKA_L8 procdesc pascal near
SHOT_YUUKA_L9 procdesc pascal near
PLAYER_INVALIDATE procdesc pascal near
PLAYER_MOVE procdesc pascal near \
input:word