| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
In preparation to having multiple kinds of shuttles as in the original
game, introduce the 'Globals::zp_shuttle_kind' variable, which is just a
helper value by masking out the 'Globals::zp_level' variable. This in
turn will be the index for selecting which tile IDs for each shuttle
part.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
| |
On the sprites tileset, the lowest part of the shuttle is not needed
since that is only used as a sprite on take off, but then the firing
variant should be picked instead. Remove it from the CHR file and update
tile IDs.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
| |
The shuttle should be reassembled every 4 stages, not 8. I did not
remember well how this worked and I jumped ahead with the conveniency of
the 'Globals::zp_level_kind' variable.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
| |
While playtesting I found the given timer's value a bit too much.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
| |
This is the animation that is done after clearing a stage. Moreover, and
for the first time since I started development, now we can move into the
next level as intended from the game's design.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
That is, our PRNG algorithm is so stupid that sometimes it cycles into
the same value multiple times. While play testing, sometimes we were so
unlucky that we got all enemies on the same Y screen coordinate.
As funny as these situations can be, this shouldn't happen, so I have
introduced an (awesomely named) function that makes a harder effort at
finding a unique random number.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
| |
I believe this case was broken since the very beginning when I
implemented it in commit b891997ab597 ("Add a blinking animation on
player selection").
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
| |
Moreover, add a "!" character at the end.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
| |
Some of the functions being called from within will in fact tamper with
this value. Hence, use the free 'Globals::zp_arg3' variable.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
| |
Setting 'Globals::zp_tmp0' with it is potentially dangerous given how
volatile this temporary memory address is.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
| |
This is a coin that appears after going through a first cycle of levels
and that allows the player to get a different game over screen than
usual.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
| |
Fuel tanks follow a different logic than regular items, in which they
should be delivered almost instantaniously whenever they are
needed. Hence, a new (much shorter/snappier) timer is provided for fuel
tanks alone.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
| |
Set a more realistic value for the timer for non-dev builds.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In my infinite wisdom, in order to compute the high byte of the 16-bit
timer I masked away the most significant byte, but then shifted right
only for a nibble instead of a full byte. This went mostly unnoticed as
the value I'm setting for the timer actually falls below of what a byte
can represent and, thus, the high byte was always zero. But this was
noticeable when I was testing larger numbers which, unsurprisingly,
turned out to be _huge_.
Fix this by shifting right a full byte instead of a mere nibble.
Fixes: cf3a0c963225 ("Implement falling items")
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
| |
The format of buffers are somewhat stable now, so we can expand the
documentation to write down what I've finally settled on.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
| |
Before this commit we were using the zp_argX variables, but this can go
wrong, and more so considering other functions like background collision
checking also use these variables. All in all, since we have plenty of
RAM to spare, let's just allocate a new set of bytes just for that.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
| |
Collisions are based on this, so we better not forget updating these
values.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
|
| |
We were abusing on tile collision for this, and it wasn't
exact. Not only that, but if the player was fast enough, sometimes the
item wouldn't drop as the accelaration would pass through that
zone. Avoid that by simply using regular screen coordinates, which
aren't too hard to check in this case.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
More specifically, whenever the player dies and we need to reset the
screen, wait for items to fall in the same way as we do for explosions
to disappear.
This also brought with it some other changes like removing sprite reset
on screen initialization.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
|
| |
Just like in the original, the shuttle turns purple for each fuel
tank. That being said, due to the restriction from the NES/Famicom on
updating background tile attributes, a "half-filled" strategy is being
used here to convey the same idea for a total of 6 fuel tanks to be
delivered.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
| |
Every now and then an item will fall and, as in the original game, a
fuel tank will be delivered whenever needed. There are still some things
left out for later changes, like picking up items mid-air, or background
effects for the rocket being filled with fuel.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
| |
It was wasteful, and it was there just because of my lazyness. Let's be
a bit less careless.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
|
| |
This now only supports the appearance of shuttle parts and the fact that
the player can collect them at a very specific order and drop them so to
stack up the final shuttle.
This is of course just the skeleton and there's a bunch of TODO's left.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
| |
Just bumping up timers is enough, and we don't get weird "this does not
load _exactly_ as the final game" situations.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
| |
This is just a minor fix for an overstep from commit
270d60d58d3e ("Rename scoped variables without being redundant").
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
|
| |
We cannot just "inc"/"dec" for enemy movement, but we have to apply an
overstep on PAL every 5 frames in order to be equivalent to the NTSC
version. This has been abstracted away on a macro that just does
"inc"/"dec" on NTSC, but does this proper "adc"/"sbc" instructions with
a helper memory region which is updated every 5 frames.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
| |
This was just fixed on nasm, so it's no longer needed.
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>
|
| |
|
|
|
|
|
| |
This is a bit contrary to the original game, where each player would get
its own "Game over" event.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
| |
Also give it a dummy value on start and initialize it properly after the
player's selection on the title screen.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
| |
Otherwise we might randomly get weird scenarios like the title screen
not showing up properly.
Fixes: bc99212539f6 ("Toggle a "Paused" message on top of the screen")
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
| |
The zp_player_tile_* variables fit perfectly with the space that is left
in the $0x memory region. This allows for a more contiguous
space (e.g. on $Cx) for other elements to come (e.g. items).
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>
|
| |
|
|
|
|
|
| |
This way it feels more like a swarm of enemies and you don't have any
resting time.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|