aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Decrease the capacity of bullets on screenMiquel Sabaté Solà2025-05-151-1/+1
| | | | | | | | | 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>
* partial: Account for frame dropsMiquel Sabaté Solà2025-05-151-1/+22
| | | | | | | | 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>
* Simplify the cycling on the rest of spritesMiquel Sabaté Solà2025-05-151-19/+22
| | | | | | | | | | | | 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>
* Don't touch zp_arg2 on background checksMiquel Sabaté Solà2025-05-141-4/+3
| | | | | | | | 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>
* Implement the base for moving bulletsMiquel Sabaté Solà2025-05-144-2/+467
| | | | | | | | | | | 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>
* reset: Do not zero out RAMMiquel Sabaté Solà2025-05-122-25/+23
| | | | | | | | | | | | | | | | 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>
* Add the ability to pause the gameMiquel Sabaté Solà2025-04-032-2/+61
| | | | Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* title: Allow selecting with the A buttonMiquel Sabaté Solà2025-04-021-1/+1
| | | | Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Implement hoverMiquel Sabaté Solà2025-04-021-0/+12
| | | | | | | | | 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>
* Rename throttle to the proper wordingMiquel Sabaté Solà2025-04-021-19/+19
| | | | Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Full stop when not moving on walking stateMiquel Sabaté Solà2025-04-021-3/+8
| | | | | | | | 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>
* Switch to a throttle state when fallingMiquel Sabaté Solà2025-04-021-0/+22
| | | | | | | 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>
* Adapt velocity constants for PALMiquel Sabaté Solà2025-04-021-13/+9
| | | | | | | | | | | | | | | | | | | 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>
* player: First PAL implementationMiquel Sabaté Solà2025-04-024-7/+91
| | | | | | | | | 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>
* player: Implement background collisionMiquel Sabaté Solà2025-04-012-61/+272
| | | | | | | This adds a first implementation of collision checks between the player and the background. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* title: Fix toggle with the Select buttonMiquel Sabaté Solà2025-03-211-8/+10
| | | | | | | Fixes: b3cb545c6ebc ("player: Update its sprites on heading and throttle") Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* player: Inline the position to screen translationMiquel Sabaté Solà2025-03-201-49/+35
| | | | Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Add walking animationMiquel Sabaté Solà2025-03-202-11/+88
| | | | | | This also corrects a pixel from one of the animations on the chr file. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* player: Add initial code for horizontal motionMiquel Sabaté Solà2025-03-201-15/+92
| | | | Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* player: Update its sprites on heading and throttleMiquel Sabaté Solà2025-03-192-58/+147
| | | | Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* reset: Read the PPU status before the first waitMiquel Sabaté Solà2025-03-191-0/+1
| | | | | | | That is, stick more closely to what the reference reset implementation does. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Disable the PPU between the title to main screensMiquel Sabaté Solà2025-03-194-10/+85
| | | | | | | During other transitions like game over and such it might also be needed to have something similar, but for now this should cut it. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Expanded ground collision to the other platformsMiquel Sabaté Solà2025-03-183-34/+130
| | | | | | This comes with a more general approach to handle background collision. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Add basic vertical movementMiquel Sabaté Solà2025-03-173-1/+347
| | | | | | | Collisions are not quite there yet, and horizontal movement is still to be done. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Support PAL nativelyMiquel Sabaté Solà2025-03-142-5/+27
| | | | | | | Also add a make target specific for a PAL version, even if only the full game will be built, not the development "partial" one. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Add a title and a main screensMiquel Sabaté Solà2025-03-135-55/+355
| | | | | | | | This commit adds the skeleton for having a title and a main screen. For now the title menu doesn't do much, as the selection is simply ignored, but at least it already knows how to cycle between these two states. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Start with a skeleton for the projectMiquel Sabaté Solà2025-03-122-0/+195
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>