aboutsummaryrefslogtreecommitdiff
path: root/src/driver.s
Commit message (Collapse)AuthorAgeFilesLines
* Cancel the take off animation before shuttle changeMiquel Sabaté Solà2026-04-051-2/+10
| | | | | | | Just as it was on the original game, if we cleared the stage right before changing the shuttle kind, then we don't go down again. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Add a table with tile IDs for shuttle partsMiquel Sabaté Solà2026-04-031-12/+16
| | | | | | | | | This will allow us to select the proper shuttle depending on 'Globals::zp_shuttle_kind'. Hence, now only the actual shuttle parts on the CHR file are missing, which is why I left a couple of TODOs on the table itself. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Cycle the kind of shuttle to be usedMiquel Sabaté Solà2026-04-021-0/+5
| | | | | | | | | | 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>
* Remove lowest part of the shuttle from spritesMiquel Sabaté Solà2026-04-021-2/+2
| | | | | | | | | 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>
* Save the high score after game overMiquel Sabaté Solà2026-03-271-1/+1
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Update scores on screenMiquel Sabaté Solà2026-03-251-0/+4
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Use the 'nmi_' prefix for NMI-only functionsMiquel Sabaté Solà2026-03-241-6/+2
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Implement the "take off" animationMiquel Sabaté Solà2026-03-231-20/+283
| | | | | | | | 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>
* Restart the blinking animation after player's deathMiquel Sabaté Solà2026-03-201-2/+8
| | | | | | | | 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>
* Set the proper "game over" flagMiquel Sabaté Solà2026-03-201-2/+4
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Add support for the SUSE coinMiquel Sabaté Solà2026-03-201-2/+6
| | | | | | | | 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>
* Remove stale commentMiquel Sabaté Solà2026-03-191-1/+1
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Use specific variables for cached player's tile coordinatesMiquel Sabaté Solà2026-03-181-2/+0
| | | | | | | | | 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>
* Wait for items to fall before changing screenMiquel Sabaté Solà2026-03-161-10/+18
| | | | | | | | | | | 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>
* Implement falling itemsMiquel Sabaté Solà2026-03-131-1/+2
| | | | | | | | | 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>
* Join 'zp_moved_out' and 'zp_pause_toggle'Miquel Sabaté Solà2026-03-121-19/+28
| | | | | | | 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>
* Initial implementation for itemsMiquel Sabaté Solà2026-03-111-9/+33
| | | | | | | | | | 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>
* Don't skip the title page on a DEV buildMiquel Sabaté Solà2026-03-111-1/+1
| | | | | | | 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>
* Fix a slight misalignment when spreading out bulletsMiquel Sabaté Solà2026-03-111-0/+1
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Apply a correction on enemy movement for PALMiquel Sabaté Solà2026-03-111-0/+12
| | | | | | | | | | 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>
* Add a blinking animation on player selectionMiquel Sabaté Solà2026-03-081-3/+101
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Support reading from the second controllerMiquel Sabaté Solà2026-03-081-1/+1
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* State game over only when all players are deadMiquel Sabaté Solà2026-03-081-2/+3
| | | | | | | 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>
* Initialize 'zp_pause_toggle' before NMI enablementMiquel Sabaté Solà2026-03-071-1/+9
| | | | | | | | | 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>
* Switch the palette for bullets into something more colorfulMiquel Sabaté Solà2026-03-071-1/+1
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Rename scoped variables without being redundantMiquel Sabaté Solà2026-03-061-12/+12
| | | | | | | 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>
* Toggle a "Paused" message on top of the screenMiquel Sabaté Solà2026-03-061-2/+57
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Don't toggle pause from a holded buttonMiquel Sabaté Solà2026-03-061-2/+7
| | | | | | | | | | | If you just holded the Select or Start buttons, it would be forever toggling pause/unpause, which is an unexpected behavior. Fix this by saving which value from the joypad was previously read. With this, whenever the pause timer reaches zero, we can check whether either button is still pressed, and avoid toggling if that is the case. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Add the Game Over screenMiquel Sabaté Solà2026-03-051-1/+12
| | | | | | | This is still missing the support for player 2, but I've left traces about it. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Update lifes left for player 1Miquel Sabaté Solà2026-03-041-0/+8
| | | | | | | The whole handling of player 2 will come whenever I set to implement multi-player for this game. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Add collision with the playerMiquel Sabaté Solà2026-03-041-9/+80
| | | | | | | This allows for explosions to run after making the player to disappear, and it re-runs the entering scene timer. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Add a pool of explosion effectsMiquel Sabaté Solà2026-03-031-0/+32
| | | | | | | For now this only applies to enemies, but it's general enough so it can target any given coordinate, and hence any given object. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Initial iteration of enemy movementMiquel Sabaté Solà2026-02-121-6/+2
| | | | | | | For now only the basic algorithm has been written, but the framework for adding the rest has also been written down. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Simplify allocation for the rest of bulletsMiquel Sabaté Solà2026-02-101-6/+10
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Allocate all enemies on sprite cyclingMiquel Sabaté Solà2026-02-101-3/+36
| | | | | | | 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: add inner movement and facing logicMiquel Sabaté Solà2026-02-101-8/+6
| | | | | | | | | 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>
* Add the __fallthrough__ pseudo-instructionMiquel Sabaté Solà2026-02-031-2/+1
| | | | | | | | 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>
* Initial work on sprite cycling for enemiesMiquel Sabaté Solà2026-02-031-8/+47
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Adapt the code to play well with nasm's asanMiquel Sabaté Solà2025-12-151-10/+10
| | | | | | | 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>
* Add the skeleton code for enemiesMiquel Sabaté Solà2025-05-151-0/+1
| | | | 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>
* Implement the base for moving bulletsMiquel Sabaté Solà2025-05-141-2/+160
| | | | | | | | | | | 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>
* Add the ability to pause the gameMiquel Sabaté Solà2025-04-031-0/+54
| | | | Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* player: First PAL implementationMiquel Sabaté Solà2025-04-021-0/+32
| | | | | | | | | 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>
* Disable the PPU between the title to main screensMiquel Sabaté Solà2025-03-191-2/+24
| | | | | | | 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>
* Add basic vertical movementMiquel Sabaté Solà2025-03-171-1/+29
| | | | | | | Collisions are not quite there yet, and horizontal movement is still to be done. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Add a title and a main screensMiquel Sabaté Solà2025-03-131-0/+28
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>