mirror of
https://github.com/Pecusx/scorch_src.git
synced 2026-05-21 21:34:20 +02:00
Delay for first key autorepeat
This commit is contained in:
@@ -26,6 +26,7 @@ TextForegroundColor = $0A
|
|||||||
space = 0 ; space in screencodes
|
space = 0 ; space in screencodes
|
||||||
|
|
||||||
KeyRepeatSpeed = 8 ; (max 127 !!!)
|
KeyRepeatSpeed = 8 ; (max 127 !!!)
|
||||||
|
FirstKeySpeed = 8 ; additional delay for first keypress
|
||||||
|
|
||||||
;character codes for symbols (tank, parachute, etc. )
|
;character codes for symbols (tank, parachute, etc. )
|
||||||
; characters from tanks.fnt (graphics screen)
|
; characters from tanks.fnt (graphics screen)
|
||||||
|
|||||||
+11
-3
@@ -38,8 +38,9 @@
|
|||||||
icl 'definitions.asm'
|
icl 'definitions.asm'
|
||||||
;---------------------------------------------------
|
;---------------------------------------------------
|
||||||
|
|
||||||
FirstZpageVariable = $52
|
FirstZpageVariable = $51
|
||||||
.zpvar DliColorBack .byte = FirstZpageVariable
|
.zpvar DliColorBack .byte = FirstZpageVariable
|
||||||
|
.zpvar FirstKeypressDelay .byte
|
||||||
.zpvar ClearSky .byte ; $ff - Crear sky during drawmountains, 0 - no clear sky
|
.zpvar ClearSky .byte ; $ff - Crear sky during drawmountains, 0 - no clear sky
|
||||||
.zpvar PaddleState .byte ; old state 2nd button for 2 buttons joysticks
|
.zpvar PaddleState .byte ; old state 2nd button for 2 buttons joysticks
|
||||||
.zpvar GradientNr .byte
|
.zpvar GradientNr .byte
|
||||||
@@ -496,10 +497,13 @@ Check2button
|
|||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
.proc WaitForKeyRelease
|
.proc WaitForKeyRelease
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
mva #128-KeyRepeatSpeed pressTimer ; tricky
|
lda #128-KeyRepeatSpeed ; tricky
|
||||||
|
sec
|
||||||
|
sbc FirstKeypressDelay ; tricky 2 :)
|
||||||
|
sta pressTimer
|
||||||
StillWait
|
StillWait
|
||||||
bit pressTimer
|
bit pressTimer
|
||||||
bmi KeyReleased
|
bmi KeyAutoReleased
|
||||||
lda STICK0
|
lda STICK0
|
||||||
and #$0f
|
and #$0f
|
||||||
cmp #$0f
|
cmp #$0f
|
||||||
@@ -520,6 +524,10 @@ StillWait
|
|||||||
beq StillWait
|
beq StillWait
|
||||||
.ENDIF
|
.ENDIF
|
||||||
KeyReleased
|
KeyReleased
|
||||||
|
mva #FirstKeySpeed FirstKeypressDelay
|
||||||
|
rts
|
||||||
|
KeyAutoReleased ; autorepeat
|
||||||
|
mva #0 FirstKeypressDelay
|
||||||
rts
|
rts
|
||||||
.endp
|
.endp
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
|
|||||||
BIN
Binary file not shown.
BIN
Binary file not shown.
Reference in New Issue
Block a user