| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The add_to_player() function relied on parameters to be passed on the
'Globals::zp_tmpX' variables, but that's just plain stupid. First,
because these memory addresses are not meant for arguments; but most
importantly, because callers actually needed some of these values before
calling this function. Hence, everything went into chaos and sprites
began to act wrongly in all sorts of random ways.
Moreover, some of the callers also needed a guarantee on either the 'x'
or the 'y' registers. Since this wasn't always feasible, we needed to
store/load these registers' values case by case.
All in all, now add_to_player() accepts only one argument via the 'y'
register (which callers already knew it was going to be messed
with). The value on 'y' has to be set via some helper constants.
As a cherry on top, this not only fixes a nasty bug, but it also makes
things more performant and with less code.
Fixes: 63ef73de3bdd ("Update scores on screen")
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
| |
The fact that unrolling the loop was easier or faster was a plain lie
from my lazyness. Convert it into a proper loop just so we can
experiment with adding more enemies in one screen.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
| |
Some variables had the same name of the scope in their names as
well. Remove this redundancy everywhere.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
|
| |
If we don't do this, then it's possible to incur into a buffer overflow
as the last allocated index is set to the next (out of buffer)
position. Whenever we start over on this function, then it will compare
for a good bullet on this position, and if it's not exactly $FF, then it
will allocate it without problems.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
| |
The address sanitizer from nasm provides quite a few goodies, so let's
adapt the code more to it to benefit from those.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
|
| |
One of the glitches as hinted by commit ae857d302cd6 ("Implement the
base for moving bullets") actually came from the fact that the temporary
screen coordinates were pointing at the first sprite from the pool of
bullets. This commit moves these variables into a memory region where
there won't be any clashes.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
|
|
|
|
|
| |
This fixes any frame drops I have experienced so far. This is not a real
fix since it is more likely that there's some part of the code that is
simply too slow. At some point I should investigate where is that, but
it will probably reappear whenever I start looking into enemies.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
|
|
This establishes a way for bullets to move, be displayed as independent
sprites, cycle these sprites, and check for the collision on the
background.
This is still lacking the collision check with enemies and has some
obvious bugs that will be fixed on the next commits.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|