diff options
| author | Miquel Sabaté Solà <mssola@mssola.com> | 2026-03-16 22:08:46 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <mssola@mssola.com> | 2026-03-16 22:08:46 +0100 |
| commit | 3a4ae1f5ef956ff243b80610e0ca00085edba0e5 (patch) | |
| tree | c4df5696c4e11d0c06eb7eb204e8a9faf5b6a905 /src | |
| parent | b701e5fc34351a727a217542c60f22beda7681e7 (diff) | |
| download | jetpac.nes-3a4ae1f5ef956ff243b80610e0ca00085edba0e5.tar.gz jetpac.nes-3a4ae1f5ef956ff243b80610e0ca00085edba0e5.zip | |
Avoid a jmp by moving update_sprites()
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/player.s | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/player.s b/src/player.s index fa649c6..5060e87 100644 --- a/src/player.s +++ b/src/player.s @@ -238,7 +238,24 @@ @do_update_sprites: ;; And with that, update all the sprites with the information we have ;; collected (i.e. heading, thrust, coordinates). - JAL update_sprites + __fallthrough__ update_sprites + .endproc + + .proc update_sprites + ;; It's just an update of coordinates or something more? + lda #%00000100 + and zp_state + beq @update_coordinates + + jsr update_player_tiles + + ;; Clear out `update` flag. + lda zp_state + and #%11111011 + sta zp_state + + @update_coordinates: + JAL update_sprites_coordinates .endproc ;; Updates the `zp_velocity_y` and the `zp_position_y` depending on whether @@ -703,23 +720,6 @@ rts .endproc - .proc update_sprites - ;; It's just an update of coordinates or something more? - lda #%00000100 - and zp_state - beq @update_coordinates - - jsr update_player_tiles - - ;; Clear out `update` flag. - lda zp_state - and #%11111011 - sta zp_state - - @update_coordinates: - JAL update_sprites_coordinates - .endproc - ;; Update the tiles used for the player's sprites. This includes which tile ;; IDs to use on each slot, and also the attributes to be used, as the ;; heading affects whether things are to be flipped horizontally or not. |
