aboutsummaryrefslogtreecommitdiff
path: root/src/jetpac.s
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-04-13 16:34:11 +0200
committerMiquel Sabaté Solà <mssola@mssola.com>2026-04-13 16:34:11 +0200
commitaef156ac6216ed157b06a2872ba051af43317e93 (patch)
treea6daca2bc0353e6b59823bc6bf019362ecb02507 /src/jetpac.s
parentc3c6f3b4469bf9eadff5763fa16dbbbf15637e57 (diff)
downloadjetpac.nes-aef156ac6216ed157b06a2872ba051af43317e93.tar.gz
jetpac.nes-aef156ac6216ed157b06a2872ba051af43317e93.zip
Add sound effects
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'src/jetpac.s')
-rw-r--r--src/jetpac.s12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/jetpac.s b/src/jetpac.s
index f2e28b2..a011a45 100644
--- a/src/jetpac.s
+++ b/src/jetpac.s
@@ -42,6 +42,7 @@
.include "assets.s"
.include "background.s"
.include "prng.s"
+.include "sound.s"
.include "explosions.s"
.include "score.s"
.include "items.s"
@@ -53,6 +54,14 @@
.include "driver.s"
.include "interrupts.s"
+;; Sanity check for some constant values. 'cl65' fails at this, so I'm only
+;; doing the check on 'nasm'.
+.ifdef __NASM__
+ .if Bullets::BULLET_TIMER_VALUE > Sound::BULLET_SFX_FRAME_COUNT
+ .error "Sound::BULLET_SFX_FRAME_COUNT must be smaller than Bullets::BULLET_TIMER_VALUE"
+ .endif
+.endif
+
;; Pretty standard reset function, nothing crazy.
.proc reset
;; Disable interrupts and decimal mode.
@@ -73,6 +82,9 @@
stx PPU::m_mask
stx APU::m_dmc
+ ;; Initialize the APU.
+ jsr Sound::init
+
;; First PPU wait.
bit PPU::m_status
@vblankwait1: