mirror of
https://github.com/Pecusx/scorch_src.git
synced 2026-05-20 22:33:43 +02:00
Keyboard autorepeat added #141
This commit is contained in:
@@ -25,6 +25,8 @@ TextBackgroundColor = $02 ; REAL constans - use: LDA #TextBackgroundColor
|
|||||||
TextForegroundColor = $0A
|
TextForegroundColor = $0A
|
||||||
space = 0 ; space in screencodes
|
space = 0 ; space in screencodes
|
||||||
|
|
||||||
|
KeyRepeatSpeed = 15 ; (max 127 !!!)
|
||||||
|
|
||||||
;character codes for symbols (tank, parachute, etc. )
|
;character codes for symbols (tank, parachute, etc. )
|
||||||
char_parachute_______ = $02
|
char_parachute_______ = $02
|
||||||
char_flag____________ = $1e
|
char_flag____________ = $1e
|
||||||
|
|||||||
+11
-6
@@ -26,7 +26,7 @@
|
|||||||
;---------------------------------------------------
|
;---------------------------------------------------
|
||||||
icl 'definitions.asm'
|
icl 'definitions.asm'
|
||||||
;---------------------------------------------------
|
;---------------------------------------------------
|
||||||
|
.zpvar DliColorBack .byte = $63
|
||||||
.zpvar xdraw .word = $64 ;variable X for plot
|
.zpvar xdraw .word = $64 ;variable X for plot
|
||||||
.zpvar ydraw .word ;variable Y for plot (like in Atari Basic - Y=0 in upper right corner of the screen)
|
.zpvar ydraw .word ;variable Y for plot (like in Atari Basic - Y=0 in upper right corner of the screen)
|
||||||
.zpvar xbyte .word
|
.zpvar xbyte .word
|
||||||
@@ -1674,22 +1674,27 @@ getkeyend
|
|||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
.proc WaitForKeyRelease
|
.proc WaitForKeyRelease
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
|
mva #128-KeyRepeatSpeed pressTimer ; tricky
|
||||||
|
StillWait
|
||||||
|
bit pressTimer
|
||||||
|
bmi KeyReleased
|
||||||
lda STICK0
|
lda STICK0
|
||||||
and #$0f
|
and #$0f
|
||||||
cmp #$0f
|
cmp #$0f
|
||||||
bne WaitForKeyRelease
|
bne StillWait
|
||||||
lda STRIG0
|
lda STRIG0
|
||||||
beq WaitForKeyRelease
|
beq StillWait
|
||||||
.IF TARGET = 800
|
.IF TARGET = 800
|
||||||
lda SKSTAT
|
lda SKSTAT
|
||||||
cmp #$ff
|
cmp #$ff
|
||||||
bne WaitForKeyRelease
|
bne StillWait
|
||||||
lda CONSOL
|
lda CONSOL
|
||||||
and #%00000110 ; Select and Option only
|
and #%00000110 ; Select and Option only
|
||||||
cmp #%00000110
|
cmp #%00000110
|
||||||
bne WaitForKeyRelease
|
bne StillWait
|
||||||
rts
|
|
||||||
.ENDIF
|
.ENDIF
|
||||||
|
KeyReleased
|
||||||
|
rts
|
||||||
.endp
|
.endp
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
.proc IsKeyPressed ; A=0 - yes , A>0 - no
|
.proc IsKeyPressed ; A=0 - yes , A>0 - no
|
||||||
|
|||||||
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -414,8 +414,6 @@ ResultX
|
|||||||
;ResultY .DS 1
|
;ResultY .DS 1
|
||||||
ResultOfTankNr
|
ResultOfTankNr
|
||||||
.DS 1
|
.DS 1
|
||||||
DliColorBack
|
|
||||||
.ds 1
|
|
||||||
|
|
||||||
;----------------------------------------------------
|
;----------------------------------------------------
|
||||||
;PutChar4x4
|
;PutChar4x4
|
||||||
|
|||||||
+1
-1
@@ -1419,7 +1419,7 @@ pressedSpace
|
|||||||
lda #0
|
lda #0
|
||||||
sta ATRACT ; reset atract mode
|
sta ATRACT ; reset atract mode
|
||||||
sta pressTimer ; reset
|
sta pressTimer ; reset
|
||||||
jsr WaitForKeyRelease
|
jsr WaitForKeyRelease.StillWait
|
||||||
lda pressTimer
|
lda pressTimer
|
||||||
cmp #25 ; 1/2s
|
cmp #25 ; 1/2s
|
||||||
bcc fire
|
bcc fire
|
||||||
|
|||||||
Reference in New Issue
Block a user