[Reverse-engineering] [th04/th05] Player sprite area invalidation
And once again, the TH05 version is un-decompilable. :/ It was pretty
close this time, though, as the entire block between PUSH DI and POP DI
kind of resembles a separate inlined function, in accordance with Turbo
C++'s automatic backup of the DI register, as researched in 7f971a0.
Except that it contains a loop, and Turbo C++ refuses to inline any
function with `do`, `while`, `for`, or `goto`. If it didn't, it would
have totally worked.
Also, yes, C++ class methods are treated identically in this regard.
Oh well. Shot type control functions next, finally!
Completes P0035, funded by zorg.
2019-09-24 18:54:32 +00:00
|
|
|
public VECTOR2_AT
|
2017-01-08 20:01:13 +00:00
|
|
|
vector2_at proc far
|
|
|
|
|
|
|
|
@@angle = word ptr 6
|
|
|
|
@@length = word ptr 8
|
|
|
|
@@origin_y = word ptr 0Ah
|
|
|
|
@@origin_x = word ptr 0Ch
|
|
|
|
@@ret = Point ptr 0Eh
|
|
|
|
|
|
|
|
push bp
|
|
|
|
mov bp, sp
|
|
|
|
push si
|
|
|
|
mov si, word ptr [bp+@@ret]
|
|
|
|
mov bx, [bp+@@angle]
|
|
|
|
if GAME eq 5
|
|
|
|
xor bh, bh
|
|
|
|
endif
|
|
|
|
add bx, bx
|
|
|
|
movsx eax, [bp+@@length]
|
|
|
|
movsx edx, _CosTable8[bx]
|
|
|
|
imul eax, edx
|
|
|
|
sar eax, 8
|
|
|
|
add ax, [bp+@@origin_x]
|
|
|
|
mov [si], ax
|
|
|
|
movsx eax, [bp+@@length]
|
|
|
|
movsx edx, _SinTable8[bx]
|
|
|
|
imul eax, edx
|
|
|
|
sar eax, 8
|
|
|
|
add ax, [bp+@@origin_y]
|
|
|
|
mov [si+2], ax
|
|
|
|
pop si
|
|
|
|
pop bp
|
|
|
|
retf 0Ah
|
|
|
|
vector2_at endp
|