diff --git a/game.asm b/game.asm index 818312b..44e7153 100644 --- a/game.asm +++ b/game.asm @@ -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 diff --git a/scorch.asm b/scorch.asm index 393b15d..f7e0527 100644 --- a/scorch.asm +++ b/scorch.asm @@ -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 diff --git a/scorch.xex b/scorch.xex index 417fc0a..ed7cd73 100644 Binary files a/scorch.xex and b/scorch.xex differ diff --git a/scorchC64.asm b/scorchC64.asm index 2585d42..89eef07 100644 --- a/scorchC64.asm +++ b/scorchC64.asm @@ -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 diff --git a/scorchC64.prg b/scorchC64.prg index f98da4a..3c65015 100644 Binary files a/scorchC64.prg and b/scorchC64.prg differ diff --git a/weapons.asm b/weapons.asm index 52a3a80..87ed9c9 100644 --- a/weapons.asm +++ b/weapons.asm @@ -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