ReC98/th05/main
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
..
boss [Maintenance] Complete the master.hpp transition 2021-01-30 19:22:29 +01:00
bullet [Maintenance] Reimplement TASM's ARG directive for `MOV BX, SP` functions 2021-02-20 23:50:00 +01:00
enemy [Reverse-engineering] [th04/th05] Stage enemy structure 2020-05-03 23:21:30 +02:00
hud [Reverse-engineering] [th02/th04/th05] HUD: Bar colors 2020-08-28 16:21:13 +02:00
item [Maintenance] Move all features exclusive to MAIN.EXE to a main/ subdirectory 2020-04-15 20:58:01 +02:00
player [Maintenance] Start a C++ master.lib header file 2020-11-02 21:12:59 +01:00
pointnum [Maintenance] Rename all old *_X and *_Y constants to *_LEFT and *_TOP 2020-08-28 15:14:22 +02:00
stage [Maintenance] Consistently express angle literals in signed hex format 2020-10-02 14:48:54 +02:00
custom.h [Maintenance] Move all features exclusive to MAIN.EXE to a main/ subdirectory 2020-04-15 20:58:01 +02:00
custom[bss].asm [Maintenance] [th05] Yumeko's blades are actually swords, as stated in OMAKE.TXT 2020-09-30 18:12:53 +02:00
laser_render_hittest.asm [Maintenance] Declare distinct types for pixel and VRAM sizes 2020-08-28 14:53:33 +02:00
lasers[bss].asm [Maintenance] Move all features exclusive to MAIN.EXE to a main/ subdirectory 2020-04-15 20:58:01 +02:00
lasers_control.asm [Maintenance] Move all features exclusive to MAIN.EXE to a main/ subdirectory 2020-04-15 20:58:01 +02:00
lasers_render[bss].asm [Maintenance] Move all features exclusive to MAIN.EXE to a main/ subdirectory 2020-04-15 20:58:01 +02:00
lasers_update_render.asm [Maintenance] Consistently express angle literals in signed hex format 2020-10-02 14:48:54 +02:00
playperf.hpp [Maintenance] [th02/th04/th05] Declare more stage and player symbols in C land 2020-05-04 00:03:17 +02:00
playperf_adjust_speed.asm [Maintenance] [th02/th04/th05] Declare more stage and player symbols in C land 2020-05-04 00:03:17 +02:00
select_for_playchar.asm [Maintenance] Move all features exclusive to MAIN.EXE to a main/ subdirectory 2020-04-15 20:58:01 +02:00