It works!

This commit is contained in:
Pecusx
2023-10-26 18:50:51 +02:00
parent c8e671ffb8
commit dc60a1dd52
6 changed files with 33 additions and 21 deletions
-1
View File
@@ -402,7 +402,6 @@ ManualShooting
lda #%00000000
sta TestFlightFlag ; set "Test Fight" off
jsr BeforeFire
mva #$00 FastKeyRead
bit escFlag
spl:rts ; keys Esc or O
+19 -11
View File
@@ -54,9 +54,8 @@ AdditionalZPvariables = $20
.zpvar MeteorsRound .byte ; set 7th bit - block meteors in round
FirstZpageVariable = $4f
FirstZpageVariable = $50
.zpvar DliColorBack .byte = FirstZpageVariable
.zpvar FastKeyRead .byte ; 0 - GetKey wait for any key (and generates SFX), $ff - fast GetKey
.zpvar ClearSky .byte ; $ff - Crear sky during drawmountains, 0 - no clear sky
.zpvar PaddleState .byte ; old state 2nd button for 2 buttons joysticks
.zpvar GradientNr .byte
@@ -405,7 +404,7 @@ NoRMT_PALchange
sta JoystickNumber
.IF TARGET = 800 ; second joy button state update only on A800
jsr WaitOneFrame ; is necessary for update shadow registers (PADDL0) in VBI
jmp GetKey.Check2button ; update state second joy button
jmp GetKeyFast.Check2button ; update state second joy button
.ELSE
rts
.ENDIF
@@ -419,6 +418,21 @@ NoRMT_PALchange
;--------------------------------------------------
jsr WaitForKeyRelease
getKeyAfterWait
jsr GetKeyFast
cmp #@kbcode._none
beq getKeyAfterWait
ldy #0
sty ATRACT ; reset atract mode
mvy #sfx_keyclick sfx_effect
rts
.endp
;--------------------------------------------------
.proc GetKeyFast
; returns pressed value in A - no waits for press
; when [ESC] is pressed, escFlag is set
; result: A=keycode ($ff - no key pressed)
;--------------------------------------------------
.IF TARGET = 800
lda SKSTAT
cmp #$ff
@@ -471,8 +485,6 @@ checkSelectKey
lda CONSOL
and #%00000100 ; Option
.ENDIF
bit FastKeyRead
bpl getKeyAfterWait
lda #@kbcode._none
bne getkeyend
OptionPressed
@@ -485,12 +497,8 @@ SelectPressed
JoyButton
lda #@kbcode._ret ; Return key
getkeyend
ldy #0
sty ATRACT ; reset atract mode
bit FastKeyRead
bmi @+
mvy #sfx_keyclick sfx_effect
@ rts
rts
; ----
.IF TARGET = 800 ; Second joy button only on A800
Check2button
lda PADDL0
BIN
View File
Binary file not shown.
+12 -2
View File
@@ -253,8 +253,18 @@ StartAfterSplash
; result: A=keycode
;--------------------------------------------------
jsr WaitForKeyRelease
lda #0
sta escFlag
jsr GetKeyFast
ldy #0
sty escFlag
rts
.endp
;--------------------------------------------------
.proc GetKeyFast
; returns pressed value in A - no wait for press
; when [ESC] is pressed, escFlag is set
; result: A=keycode
;--------------------------------------------------
lda #$ff
rts
.endp
BIN
View File
Binary file not shown.
+2 -7
View File
@@ -1220,12 +1220,9 @@ ContinueToCheckMaxForce2
; $f3 - shift+key
notpressed
mva #$00 FastKeyRead
jsr CheckExitKeys ; Check for O, Esc or Start+Option keys
spl:rts ; exit if pressed 'Exit keys'
mva #$ff FastKeyRead
ldx TankNr ; for optimize
; Select and Option
lda CONSOL
@@ -1235,7 +1232,7 @@ notpressed
tya
and #%00000010
jeq pressedTAB ; Select key
jsr GetKey.getKeyAfterWait
jsr GetKeyFast
and #%10111111 ; SHIFT elimination
cmp #@kbcode._A ; $3f ; A
@@ -1243,7 +1240,6 @@ notpressed
callActivation
; Hide all tanks - after inventory they may have other shapes
jsr ClearTanks
mva #$00 FastKeyRead
jsr DefensivesActivate
jmp afterInventory
@@ -1255,7 +1251,6 @@ callInventory
jsr ClearTanks
;
mva #$ff isInventory
mva #$00 FastKeyRead
jsr Purchase
afterInventory
jsr MakeDarkScreen
@@ -2734,7 +2729,7 @@ notpressed
jsr DrawTankEngine
; enimation ends
jsr GetKey.getKeyAfterWait
jsr GetKeyFast
cmp #@kbcode._left ; $6
jeq pressedLeft
cmp #@kbcode._right ; $7