ReC98/th05/main/bullet
nmlgc 0dcd0b8136 [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-20 23:50:00 +01:00
..
b4ball.hpp [Maintenance] Move all features exclusive to MAIN.EXE to a main/ subdirectory 2020-04-15 20:58:01 +02:00
b4balls_add.asm [Maintenance] Move all features exclusive to MAIN.EXE to a main/ subdirectory 2020-04-15 20:58:01 +02:00
b4balls_render.asm [Maintenance] Rename all old *_X and *_Y constants to *_LEFT and *_TOP 2020-08-28 15:14:22 +02:00
b6ball.hpp [Maintenance] Move all features exclusive to MAIN.EXE to a main/ subdirectory 2020-04-15 20:58:01 +02:00
b6balls_add_update.asm [Maintenance] Move all features exclusive to MAIN.EXE to a main/ subdirectory 2020-04-15 20:58:01 +02:00
b6balls_render.asm [Maintenance] Rename all old *_X and *_Y constants to *_LEFT and *_TOP 2020-08-28 15:14:22 +02:00
curve.hpp [Maintenance] Declare distinct types for screen, VRAM, and TRAM coordinates 2020-08-28 14:53:30 +02:00
curve[bss].asm [Maintenance] Move all features exclusive to MAIN.EXE to a main/ subdirectory 2020-04-15 20:58:01 +02:00
curvebullets_add.asm [Maintenance] Move all features exclusive to MAIN.EXE to a main/ subdirectory 2020-04-15 20:58:01 +02:00
curvebullets_render.asm [Maintenance] Rename all old *_X and *_Y constants to *_LEFT and *_TOP 2020-08-28 15:14:22 +02:00
patnum_for_angle.asm [Maintenance] Reimplement TASM's ARG directive for `MOV BX, SP` functions 2021-02-20 23:50:00 +01:00
pattypes.h [Reverse-engineering] [th05] Difficulty- and rank-based bullet pattern tuning 2020-08-16 21:40:33 +02:00
pattypes.inc [Maintenance] Move all features exclusive to MAIN.EXE to a main/ subdirectory 2020-04-15 20:58:01 +02:00
pellet_r[bss].asm [Reverse-engineering] [th05] Bullets: Pellet delay cloud render list 2020-08-28 15:31:02 +02:00
sword.hpp [Maintenance] [th05] Yumeko's blades are actually swords, as stated in OMAKE.TXT 2020-09-30 18:12:53 +02:00
swords_add_update.asm [Maintenance] [th05] Yumeko's blades are actually swords, as stated in OMAKE.TXT 2020-09-30 18:12:53 +02:00
swords_render.asm [Maintenance] [th05] Yumeko's blades are actually swords, as stated in OMAKE.TXT 2020-09-30 18:12:53 +02:00
tune.cpp [Reverse-engineering] [th05] Difficulty- and rank-based bullet pattern tuning 2020-08-16 21:40:33 +02:00
update_patnum.asm [Maintenance] Move all features exclusive to MAIN.EXE to a main/ subdirectory 2020-04-15 20:58:01 +02:00