; ; Update Z
ret
ENDP UpdateAngles
PROC GetSinCos
; Needed : bx=angle (0..255)
; Returns: ax=Sin bx=Cos
push bx ; Save angle (use as pointer)
shl bx,1 ; Grab a word so bx=bx*2
mov ax,[SinCos + bx] ; Get sine
pop bx ; Restore pointer into bx
push ax ; Save sine on stack
add bx,64 ; Add 64 to get cosine
and bx,11111111b ; Range from 0..255
shl bx,1 ; *2 coz it''s a word
mov ax,[SinCos + bx] ; Get cosine
mov bx,ax ; Save it bx=Cos
pop ax ; Restore ax=Sin
ret
ENDP GetSinCos
PROC SetRotation
; Set sine & cosine of x,y,z
mov bx,[XAngle] ; Grab angle
call GetSinCos ; Get the sine&cosine
mov [Xsin],ax ; Save sin
mov [Xcos],bx ; Save cos
mov bx,[Yangle]
call GetSinCos
mov [Ysin],ax
mov [Ycos],bx
mov bx,[Zangle]
cal