2019-09-23 15:24:45 +00:00
|
|
|
include th02/player/player.inc
|
2019-11-16 16:11:48 +00:00
|
|
|
PLAYER_MOVE_MARGIN_LEFT = 8
|
|
|
|
PLAYER_MOVE_MARGIN_TOP = 8
|
|
|
|
PLAYER_MOVE_MARGIN_RIGHT = 8
|
|
|
|
PLAYER_MOVE_MARGIN_BOTTOM = 16
|
2019-09-23 15:24:45 +00:00
|
|
|
PLAYER_OPTION_W = 16
|
|
|
|
PLAYER_OPTION_H = 16
|
2019-10-07 19:51:11 +00:00
|
|
|
PLAYER_OPTION_DISTANCE = (PLAYER_W / 2) + (PLAYER_OPTION_W / 2)
|
2019-09-23 15:24:45 +00:00
|
|
|
|
2019-10-08 20:08:37 +00:00
|
|
|
; Shots
|
|
|
|
; -----
|
2019-11-16 17:21:36 +00:00
|
|
|
SHOT_W = 16
|
|
|
|
SHOT_H = 16
|
|
|
|
|
2019-10-08 20:08:37 +00:00
|
|
|
; Shots are always fired for multiples of this number of frames, even if
|
|
|
|
; INPUT_SHOT is held for a shorter amount of time.
|
|
|
|
SHOT_CYCLE_FRAMES = 18
|
|
|
|
; Set shot_time to this value to block shots from being fired this frame.
|
|
|
|
SHOT_BLOCKED_FOR_THIS_FRAME = 0FFh
|
|
|
|
; -----
|
|
|
|
|
2019-09-23 10:23:41 +00:00
|
|
|
MISS_ANIM_FRAMES = 32
|
|
|
|
MISS_ANIM_FLASH_AT = 28
|
|
|
|
MISS_ANIM_EXPLODE_UNTIL = 31
|
2019-09-23 10:49:25 +00:00
|
|
|
|
2019-09-23 15:24:45 +00:00
|
|
|
MISS_EXPLOSION_COUNT = 8
|
|
|
|
MISS_EXPLOSION_W = 48
|
|
|
|
MISS_EXPLOSION_H = 48
|
[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
|
|
|
MISS_EXPLOSION_RADIUS_VELOCITY = (7 shl 4)
|
|
|
|
MISS_EXPLOSION_ANGLE_VELOCITY = 8
|
2019-09-23 15:24:45 +00:00
|
|
|
|
|
|
|
MISS_EXPLOSION_CLIP macro clip_label
|
|
|
|
cmp _drawpoint.y, ((PLAYFIELD_TOP - (MISS_EXPLOSION_H / 2)) shl 4)
|
|
|
|
jl short clip_label
|
|
|
|
; Yes, the next two are incorrect
|
|
|
|
cmp _drawpoint.y, ((PLAYFIELD_BOTTOM - 8) shl 4)
|
|
|
|
jge short clip_label
|
|
|
|
cmp _drawpoint.x, ((PLAYFIELD_LEFT - 40) shl 4)
|
|
|
|
jl short clip_label
|
|
|
|
cmp _drawpoint.x, ((PLAYFIELD_RIGHT - (MISS_EXPLOSION_W / 2)) shl 4)
|
|
|
|
jge short clip_label
|
|
|
|
endm
|
|
|
|
|
2019-09-23 10:49:25 +00:00
|
|
|
MISS_INVINCIBILITY_FRAMES = 192
|