Misc fixes

Misc fixes and cleanup
This commit is contained in:
StewBC 2020-01-16 14:10:14 -08:00
parent a1a6ce8919
commit 1307c2ae66
5 changed files with 21 additions and 19 deletions

View File

@ -39,15 +39,14 @@ explosion:
tax
ldy #$6
jsr playNote
inc audioExplFrame
inc audioExplFrame ; make sure off-screen ticks to end
lda audioExplFrame
cmp #%00000011
bcc :+
stx audioFrame ; turn off the explosion
rts
lda #AUDIO_MOTOR_PLAY
sta audioFrame ; turn off the explosion
:
lda #AUDIO_EXPLOSION
sta audioFrame
rts
bombDrop:
@ -106,7 +105,9 @@ loop:
lda #AUDIO_EXPLOSION ; reset the audio frame (serviced)
and audioFrame ; but keep explosion if it was set
ora #AUDIO_MOTOR_PLAY ; and always add the MOTOR
sta audioFrame
rts
.endproc

View File

@ -41,18 +41,15 @@ preamble: ; bring terrain on-screen with n
wait #$40 ; give the user a moment to get ready
loop:
lda runAudio
lda runAudio ; alternate between game and audio
eor #1
sta runAudio
bne :+
jsr serviceAudio
lda audioFrame
ora #AUDIO_MOTOR_PLAY
sta audioFrame
beq loop
beq :+ ; run the game when runAudio eq 0
jsr serviceAudio ; run the audio
jmp loop ; go back and flip to the game
:
lda playerDead
bne skip
lda playerDead ; check if the input should run
bne skip ; and skip if not
jsr inputGame ; read joystick and move player, check for pause key
cmp #$9b ; check for ESC
@ -60,7 +57,7 @@ loop:
rts ; on ESC, just quit
skip:
lda playerDead ; even on every second frame if the player is dead the world doesn't move
lda playerDead ; if the player is dead the world doesn't move
bne :+
jsr gameWorldMove ; scroll the world
inc bufferDraw ; and move the draw start also
@ -74,7 +71,7 @@ skip:
next:
dec bulletIndex ; Bullets move every frame (2x for 1 world move)
dec bulletIndex ; Bullets move every frame (2x for 1 world move)
dec bulletIndex
draw:
jsr terrainShow ; show terrain 1st because it collides with nothing
@ -156,10 +153,10 @@ win:
sta dangerTickIdx
sta moveHorz
sta moveVert
sta runAudio
sta flipFlop
sta pause
sta fireCoolDown
sta audioFrame
tax ; clear the buffers for tracking objects
:
@ -181,6 +178,9 @@ win:
lda #XSIZE-1 ; place where terrain will start drawing (right hand)
sta terrainOrigin
lda #AUDIO_MOTOR_PLAY ; Init th eaudio-frame with the engine
sta audioFrame
lda #$ff
sta lastInput ; set no keys down all 1's
sta nextStage

View File

@ -70,6 +70,7 @@ store:
lda #$0
sta backLayer ; set back layer to 0
sta audioFrame ; set all audio channels to off (0)
sta numPlayers ; Init initially to 0 (not set for training)
:
sta highScores, x
dex

View File

@ -26,7 +26,7 @@ textStefan: .asciiz " Stefan Wessels, Dec 2019 "
textSupport: .asciiz " Lots of great Apple II "
textOliver: .asciiz " Support from Oliver Schmidt "
textSource: .asciiz " Source on GitHub: "
textGitHub: .asciiz " github.com/StewBC/penetrator "
textGitHub: .asciiz " StewBC/penetrator-apple2 "
textGameOver: .asciiz "********** GAME OVER **********"
; main menu

View File

@ -34,7 +34,7 @@ loopo:
sta zaState
loop:
lda #$10
lda #$08
sta zaCounterH
lda zaState