Quick exit reaction

This commit is contained in:
Pecusx
2023-05-18 20:47:50 +02:00
parent 13a5bd05df
commit 7c482d798c
5 changed files with 84 additions and 23 deletions
+42
View File
@@ -556,8 +556,50 @@ MakeDarkScreen
rts
.endp
;--------------------------------------------------
.proc CheckExitKeys
;--------------------------------------------------
; Checks keyboard and sets appropriate flags for exit procedures
; If START+OPTION is pressed - exit to GameOver screen
; If 'O' key is pressed - displays "Are you sure?" and - exit to GameOver screen
; If 'Esc' key is pressed - displays "Are you sure?" and - exit to Menu screen
; Just setting the right flags!!!
; Select and Option
lda CONSOL
and #%00000101 ; Start + Option
beq QuitToGameover
lda SKSTAT
cmp #$ff
jeq nokeys
cmp #$f7 ; SHIFT
jeq nokeys
lda kbcode
and #%10111111 ; SHIFT elimination
cmp #@kbcode._O ; $08 ; O
bne CheckEsc
jsr AreYouSure
bit escFlag
bpl nokeys
;---O pressed-quit game to game over screen---
QuitToGameover
mva #$40 escFlag
rts
CheckEsc
cmp #@kbcode._esc ; 28 ; ESC
bne nokeys
DisplayAreYouSure
jsr AreYouSure
;---esc pressed-quit game---
nokeys
rts
;
.endp
;--------------------------------------------------
.proc ShellDelay
;--------------------------------------------------
lda CONSOL
and #%00000101 ; Start + Option
bne @+
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+12
View File
@@ -317,6 +317,18 @@ MakeDarkScreen
rts
.endp
;--------------------------------------------------
.proc CheckExitKeys
;--------------------------------------------------
; Checks keyboard and sets appropriate flags for exit procedures
; If START+OPTION is pressed - exit to GameOver screen
; If 'O' key is pressed - displays "Are you sure?" and - exit to GameOver screen
; If 'Esc' key is pressed - displays "Are you sure?" and - exit to Menu screen
; Just setting the right flags!!!
rts
;
.endp
;--------------------------------------------------
.proc ShellDelay
ldx flyDelay
+30 -23
View File
@@ -1098,13 +1098,17 @@ ContinueToCheckMaxForce2
; $f3 - shift+key
notpressed
ldx TankNr ; for optimize
jsr CheckExitKeys ; Check for O, Esc or Start+Option keys
bit escFlag
bmi EscPressed
bvc OnotPressed
EscPressed
rts ; exit if pressed 'Exit keys'
OnotPressed
ldx TankNr ; for optimize
; Select and Option
lda CONSOL
tay
and #%00000101 ; Start + Option
beq QuitToGameover
tya
and #%00000100
beq callActivation ; Option key
tya
@@ -1119,24 +1123,6 @@ notpressed
lda kbcode
and #%10111111 ; SHIFT elimination
cmp #@kbcode._O ; $08 ; O
bne @+
jsr AreYouSure
bit escFlag
bpl notpressed
;---O pressed-quit game to game over screen---
QuitToGameover
mva #$40 escFlag
rts
@
cmp #@kbcode._esc ; 28 ; ESC
bne @+
jsr AreYouSure
bit escFlag
bpl notpressed
;---esc pressed-quit game---
rts
@
cmp #@kbcode._A ; $3f ; A
bne @+
callActivation
@@ -1779,7 +1765,16 @@ nolaserwait
bne nowait ; funky bomb explotes fast ( tracerflag in real is funkyflag :) )
nonowait
jsr shellDelay
;
jsr CheckExitKeys ; Check for O, Esc or Start+Option keys
bit escFlag
bmi EscPressed
bvc OnotPressed
EscPressed
rts ; exit if pressed 'Exit keys'
OnotPressed
ldx TankNr
;
nowait
lda HitFlag
bne Hit
@@ -2113,6 +2108,18 @@ mrLoopi
sta vy+3
jsr ShellDelay
;
phx
jsr CheckExitKeys ; Check for O, Esc or Start+Option keys
bit escFlag
bmi EscPressed
bvc OnotPressed
EscPressed
plx
rts ; exit if pressed 'Exit keys'
OnotPressed
plx
;
MIRVdoNotChangeY