From ccf320971efe9b11f7b7722b2ee2642a10303203 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Wed, 25 Mar 2026 01:03:17 +0100 Subject: Add support for adding scores MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- src/jetpac.s | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/jetpac.s') diff --git a/src/jetpac.s b/src/jetpac.s index 3cf8f0a..b356192 100644 --- a/src/jetpac.s +++ b/src/jetpac.s @@ -42,6 +42,7 @@ .include "background.s" .include "prng.s" .include "explosions.s" +.include "score.s" .include "items.s" .include "player.s" .include "enemies.s" @@ -112,7 +113,14 @@ .endproc .proc main - ;; TODO: high score initialization has to happen here. + ;; Initialize the high score. + lda #0 + sta Score::m_hi + sta Score::m_hi + 1 + sta Score::m_hi + 2 + sta Score::m_hi + 3 + sta Score::m_hi + 4 + sta Score::m_hi + 5 @init: ;; Disable the PPU and zero out variables which shadow PPU registers. @@ -156,6 +164,10 @@ ;; Initialize some variables from the "Game Over" side of the game. jsr Over::init + ;; Initialize the score for both players. Note that initializing the high + ;; score is the first thing we do in main(). + jsr Score::init_players_scores + ;; Initialize variables from the game's driver that need to be set before ;; NMIs start ticking. jsr Driver::init_before_nmi -- cgit v1.2.3