2019-02-25 22:15:16 +00:00
|
|
|
; Searches and returns the next free shot slot, or NULL if there are no more
|
|
|
|
; free ones.
|
|
|
|
|
2019-09-15 16:23:33 +00:00
|
|
|
; shot_t* pascal shots_add(void);
|
|
|
|
public SHOTS_ADD
|
|
|
|
shots_add proc near
|
2019-02-25 22:15:16 +00:00
|
|
|
xor ax, ax
|
|
|
|
|
|
|
|
@@loop:
|
|
|
|
cmp _shot_last_id, SHOT_COUNT
|
|
|
|
jnb short @@ret
|
|
|
|
mov bx, _shot_ptr
|
|
|
|
add _shot_ptr, size shot_t
|
|
|
|
cmp [bx+shot_t.flag], 0
|
|
|
|
jz short @@found
|
|
|
|
inc _shot_last_id
|
|
|
|
jmp short @@loop
|
|
|
|
|
|
|
|
@@found:
|
|
|
|
mov word ptr [bx+shot_t.flag], 1
|
|
|
|
mov eax, player_pos.cur
|
|
|
|
mov dword ptr [bx+shot_t.pos.cur], eax
|
|
|
|
mov dword ptr [bx+shot_t.pos.velocity], (-12 shl 4) shl 16 or (0)
|
|
|
|
mov ax, bx
|
|
|
|
|
|
|
|
@@ret:
|
|
|
|
retn
|
2019-09-15 16:23:33 +00:00
|
|
|
shots_add endp
|