[Reverse-engineering] [th05] Aiming to the player

Yes, this only became a dedicated function in TH05, probably due to all
the custom bullet types.

Part of P0086, funded by [Anonymous] and Blue Bolt.
This commit is contained in:
nmlgc 2020-04-12 18:52:58 +02:00
parent cf68f49803
commit 8098b62285
3 changed files with 353 additions and 417 deletions

View File

@ -0,0 +1,21 @@
public PLAYER_ANGLE_FROM
player_angle_from proc near
@@plus_angle = byte ptr 4
@@y = word ptr 6
@@x = word ptr 8
push bp
mov bp, sp
mov ax, _player_pos.cur.y
sub ax, [bp+@@y]
push ax
mov ax, _player_pos.cur.x
sub ax, [bp+@@x]
push ax
call iatan2
add al, [bp+@@plus_angle]
pop bp
retn 6
player_angle_from endp
nop

View File

@ -0,0 +1,7 @@
#include "th04/main/player/player.h"
// Calculates the angle from ([x], [y]) to the current player position, and
// optionally adds [plus_angle] to the result.
unsigned char pascal near player_angle_from(
Subpixel x, Subpixel y, unsigned char plus_angle = 0
);

File diff suppressed because it is too large Load Diff