| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
The previous commit only tackled the first enemy, this one handles the
"rest_o_enemies" code flow, which was entirely missing.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
| |
Enemies now have the ability to be displayed on screen, face at the
direction that they were assigned to at random during initialization
time, and they also have a timer that dictates some inner movement,
similarly as it happened in the original game.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
| |
If we passed the --strict flag to nasm, then we want the statistics from
the full build, not the one specific to PAL systems.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
| |
The 'nasm' assembler now implements this, which is quite
convenient. Define also a fake macro for it when the assembler is not
'nasm' just to bridge the gaps.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
| |
Some sprites like enemies and objects are meant to appear maximum at a
certain Y coordinate. Increase that as the former could mean sprites
going on about the scores, whereas that shouldn't be possible.
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>
|
| |
|
|
|
|
|
| |
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>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
|
| |
This fixes commit 6e274fb50251 ("partial: Account for frame drops") in
the sense that the accounting of frame drops should _never_ affect
production binaries. Even if the two instructions would've never been
reached if PARTIAL=0, they would still be included in the final binary,
which is not necessary.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
| |
And let it pass the --strict and --stats parameters to the underlying
nasm command.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
| |
The randomness comes from a pre-computed table of "random" numbers. This
is of course the most simple technique you can come across a code base
for the NES/Famicom, but for the purposes of this game is good enough
and (most importantly) fast.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
|
|
|
|
|
|
| |
At first I thought that I could save up some space and then mirror the
sprite horizontally, but it actually makes things easier to have the UFO
enemy in its entirety as it makes initialization and moving the object
easier. This is indeed possible because we have plenty of room left on
the CHR bank.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.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>
|
| |
|
|
|
|
| |
Possibly not an issue, but it's better to be safe than sorry.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
|
|
|
|
|
| |
This is for now just a variable that will be set during initialization,
and that it can be influenced through the `LEVEL` make variable. Both
the level and the level "kind" notions are used tracking, at least,
which kind of enemy wave we have to send.
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>
|
| |
|
|
|
|
|
|
| |
Define tracing variables when PARTIAL=1, which is only on a development
environment. This way we can detect whether we are dropping frames or
not.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
After all sprites have been properly put through the cycle, there is an
amount of sprites which are just leftovers and need to be reset to an
out of screen position. The loop that did this was unnecessarily complex
and we could just rely on the 'y' register wrapping around.
This has the benefit that is less error prone, even if there's still
some glitches which most probably come from by-one errors and such.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
|
|
|
|
| |
This was a leftover from a previous implementation and is no longer
needed. Moreover, I have also added a comment clarifying that the 'y'
register is preserved.
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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is usually done so the programmer can forget about initializing in
the future, but it not only hides programming mistakes, but we are also
resetting memory addresses which are never to be used by this simple
game. Hence, just skip resetting RAM altogether.
Last but not least, sprite initialization in `reset` code has also been
optimized so instead of around 2000 cycles it takes half of that. This
is done by only touching the first byte of the four bytes for a sprite
in OAM, which is enough for hiding random sprites and the cost of extra
`inx` instructions is far cheaper than all the extra `sta` to absolute
address with X-index from the old code.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
|
|
| |
See: 132b7b1cc807 ("Rename throttle to the proper wording")
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
|
|
|
|
|
| |
This is a way to stop vertical velocity mid-air, which is something I
did not know you could do until I read the original manual. The down
arrow has been picked since it was the same choice of the original game
when played on joystick.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
|
|
|
|
| |
Before this commit the same logic as in throttle state was applied in
which acceleration was applied. This brings back the logic more closely
to the original game.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
|
|
|
| |
As it's done in the original game, switch to a throttle state when
falling off a platform.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In 2f140cfb7ea7 ("player: First PAL implementation") the rate of
acceleration was adapted for PAL. Now the values for velocities have
been adapted as well, in a way that we get (virtually) the same
experience in PAL and in NTSC.
This has been done by moving the velocity constants into configurable
values, which are then picked up by a new bin/values.rb script. This
script allows us to write the constants in plain floating point numbers,
does the conversion to fixed point numbers as expected, and it also does
the same for PAL by applying the proper NTSC to PAL conversion.
As a cherry on top, some values have also been tuned to match the
original game more closely, even if some more fine tuning might still be
needed here and there.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
|
|
|
|
|
| |
The steps by which a player increases its current velocity to reach the
target one has been adapted on PAL, so every five frames it takes an
extra step compared to NTSC. This at least brings PAL to grow its values
at the same rate as NTSC.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
|
|
|
| |
This adds a first implementation of collision checks between the player
and the background.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
|
|
|
| |
Fixes: b3cb545c6ebc ("player: Update its sprites on heading and
throttle")
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
|
|
| |
This also corrects a pixel from one of the animations on the chr file.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
|
|
|
| |
That is, stick more closely to what the reference reset implementation
does.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
| |
|
|
|
|
|
| |
Partial builds always are on NTSC, so no need to clutter the output with
it.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|