ReC98/th04/main/player
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
..
bomb.hpp [Reverse-engineering] General bomb-related globals 2020-08-28 15:03:03 +02:00
bomb[bss].asm [Reverse-engineering] General bomb-related globals 2020-08-28 15:03:03 +02:00
bombanim.cpp [Reverse-engineering] [th04] Bombs: Star animation structure 2020-08-28 15:04:39 +02:00
bombanim[bss].asm [Reverse-engineering] [th04] Bombs: Star animation structure 2020-08-28 15:04:39 +02:00
invalidate.asm [Maintenance] Move all features exclusive to MAIN.EXE to a main/ subdirectory 2020-04-15 20:58:01 +02:00
move.asm [Maintenance] Move all features exclusive to MAIN.EXE to a main/ subdirectory 2020-04-15 20:58:01 +02:00
option[bss].asm [Maintenance] [th04/th05] Assemble 16-bit .ASM files case-sensitively 2020-05-03 23:56:08 +02:00
player.h [Maintenance] Move all features exclusive to MAIN.EXE to a main/ subdirectory 2020-04-15 20:58:01 +02:00
player.inc [Maintenance] Move all features exclusive to MAIN.EXE to a main/ subdirectory 2020-04-15 20:58:01 +02:00
pos[bss].asm [Maintenance] [th04/th05] Assemble 16-bit .ASM files case-sensitively 2020-05-03 23:56:08 +02:00
pos_update_and_clamp.asm [Maintenance] Move all features exclusive to MAIN.EXE to a main/ subdirectory 2020-04-15 20:58:01 +02:00
render.asm [Maintenance] Rename all old *_X and *_Y constants to *_LEFT and *_TOP 2020-08-28 15:14:22 +02:00
shot.hpp [Maintenance] Consistently express angle literals in signed hex format 2020-10-02 14:48:54 +02:00
shot_laser.asm [Reverse-engineering] [th04] Player shots: Option laser blitting 2020-09-17 22:25:11 +02:00
shot_laser[data].asm [Reverse-engineering] [th04] Player shots: Option laser blitting 2020-09-17 22:25:11 +02:00
shot_levels[data].asm [Maintenance] Move all features exclusive to MAIN.EXE to a main/ subdirectory 2020-04-15 20:58:01 +02:00
shot_velocity.asm [Maintenance] Reimplement TASM's ARG directive for `MOV BX, SP` functions 2021-02-20 23:50:00 +01:00
shot_velocity[data].asm [Maintenance] Move all features exclusive to MAIN.EXE to a main/ subdirectory 2020-04-15 20:58:01 +02:00
shots[bss].asm [Maintenance] Move all features exclusive to MAIN.EXE to a main/ subdirectory 2020-04-15 20:58:01 +02:00
shots_add.asm [Maintenance] Move all features exclusive to MAIN.EXE to a main/ subdirectory 2020-04-15 20:58:01 +02:00
shots_add[bss].asm [Maintenance] Move all features exclusive to MAIN.EXE to a main/ subdirectory 2020-04-15 20:58:01 +02:00
shots_alive[bss].asm [Maintenance] Declare the "no valid point" constant (-999) in a single place 2020-08-19 19:32:37 +02:00