mirror of
https://github.com/StewBC/mminer-apple2.git
synced 2025-01-14 04:29:52 +00:00
Artificial delay when in-game music is off
This commit is contained in:
parent
fffac7219e
commit
68e9db4f51
@ -95,22 +95,26 @@ reset:
|
||||
|
||||
lda audioMask ; see if the music is on
|
||||
and #AUDIO_MUSIC
|
||||
bne :+
|
||||
rts ; if not, return
|
||||
bne play
|
||||
|
||||
ldx #0 ; kill approx 6800 cycles (average cycles for playNote when on)
|
||||
:
|
||||
lda #$FF ; calculate a delay
|
||||
sec ; based on how many tiles were rendered
|
||||
sbc tilesRendered ; this lets the music sound
|
||||
cmp #80 ; better, esp. when a level is
|
||||
bcc :+ ; very sparse (SkyLab for example)
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
tay
|
||||
jsr uiDelay::ySet
|
||||
:
|
||||
nop ; 2 cycles
|
||||
nop ; 4
|
||||
nop ; 6
|
||||
nop ; 8
|
||||
nop ; 10
|
||||
nop ; 12
|
||||
nop ; 14
|
||||
nop ; 16
|
||||
nop ; 18
|
||||
nop ; 20
|
||||
nop ; 22
|
||||
dex ; 24 cycles
|
||||
bne :- ; 26 cycles * 256 = 6656 cycles - close enough
|
||||
rts
|
||||
|
||||
play:
|
||||
ldx musicL ; get the index into the in-game music
|
||||
inc musicL ; and advance that index
|
||||
lda inGameMusic, x ; get the note at the index
|
||||
|
Loading…
x
Reference in New Issue
Block a user