2019-09-20 19:05:27 +00:00
|
|
|
; ReC98
|
|
|
|
; -----
|
|
|
|
; Types shared between TH04 and TH05
|
|
|
|
|
[Maintenance] Reimplement TASM's ARG directive for `MOV BX, SP` functions
`cPtrSize` is simply the wrong constant for calculating parameter
offsets on the stack, because it corresponds to the memory model's
default distance, not the function's distance. Luckily, ARG has a
RETURNS clause, and if you declare all parameters in there, ARG won't
emit that pesky and unnecessary `ENTER 0, 0` instruction. Big discovery
right there!
Sadly, ARG is unusable for ZUN's silly functions that keep the base
pointer in BX. TASM declares the resulting equates as `[BP+offset]`,
and it's apparently impossible to only get `offset` out of such an
equate later.
So, rather than staying with numbers, let's reimplement ARG for these
functions instead. This way, we can even abstract away the stack clear
size for the `RET` instructions.
It's a bit rough around the edges though, forcing you to explicitly
specify the function distance, and to pass the parameters in reverse
order compared to the C declaration (thankfully, all of these use the
PASCAL calling convention). It also doesn't work with more complex
types yet. But certainly better than numbers.
Part of P0134, funded by [Anonymous].
2021-02-10 11:51:14 +00:00
|
|
|
include th03/arg_bx.inc
|
2019-12-26 16:19:44 +00:00
|
|
|
include th02/score.inc
|
2019-09-20 19:05:27 +00:00
|
|
|
|
|
|
|
; Formats
|
|
|
|
; --------
|
|
|
|
include th04/formats/bb.inc
|
2020-02-22 16:39:23 +00:00
|
|
|
include th04/formats/cfg.inc
|
2020-09-05 14:09:18 +00:00
|
|
|
include th03/formats/cdg.inc
|
2019-09-20 19:05:27 +00:00
|
|
|
include th04/formats/map.inc
|
2019-12-26 16:19:44 +00:00
|
|
|
include th04/formats/scoredat.inc
|
2019-09-20 19:05:27 +00:00
|
|
|
; --------
|
|
|
|
|
2020-04-05 14:17:33 +00:00
|
|
|
include th04/main/player/player.inc
|
2019-09-23 10:23:41 +00:00
|
|
|
|
|
|
|
; Bombs
|
|
|
|
; -----
|
|
|
|
DEATHBOMB_WINDOW = 8
|
|
|
|
; -----
|
|
|
|
|
2019-09-23 10:49:25 +00:00
|
|
|
; Stages
|
|
|
|
; ------
|
2020-01-02 19:55:22 +00:00
|
|
|
MAIN_STAGE_COUNT = 6
|
|
|
|
STAGE_EXTRA = MAIN_STAGE_COUNT
|
2019-09-23 10:49:25 +00:00
|
|
|
STAGE_START_INVINCIBILITY_FRAMES = 64
|
|
|
|
; ------
|
|
|
|
|
|
|
|
; Bosses
|
|
|
|
; ------
|
2020-08-16 14:03:31 +00:00
|
|
|
BOSS_W = 64
|
|
|
|
BOSS_H = 64
|
2019-09-23 10:49:25 +00:00
|
|
|
BOSS_DEFEAT_INVINCIBILITY_FRAMES = 255
|
|
|
|
; ------
|
|
|
|
|
2020-04-05 14:17:33 +00:00
|
|
|
include th02/main/playfld.inc
|
|
|
|
include th02/main/hud/hud.inc
|
2019-09-20 19:05:27 +00:00
|
|
|
include th04/hardware/grcg.inc
|
|
|
|
include th04/hardware/input.inc
|
2019-09-23 15:52:53 +00:00
|
|
|
include th04/math/randring.inc
|
2019-09-20 19:05:27 +00:00
|
|
|
include th04/math/motion.inc
|
2022-03-06 23:28:53 +00:00
|
|
|
include th04/main/hud/overlay.inc
|
2019-12-26 01:06:13 +00:00
|
|
|
include th04/end/end.inc
|