diff --git a/Atari/inputs.asm b/Atari/inputs.asm index 44ca61d..39f4415 100644 --- a/Atari/inputs.asm +++ b/Atari/inputs.asm @@ -108,6 +108,17 @@ Check2button rts .endp +;-------------------------------------------------- +.proc WaitForLongPress +;-------------------------------------------------- + lda #0 + sta pressTimer ; reset + jsr WaitForKeyRelease.StillWait + lda pressTimer + cmp #25 ; 1/2s + rts ; if CARRY is set then long press +.endp + ;-------------------------------------------------- .proc WaitForKeyRelease ;-------------------------------------------------- diff --git a/Atari/textproc.asm b/Atari/textproc.asm index 715b48b..87fd262 100644 --- a/Atari/textproc.asm +++ b/Atari/textproc.asm @@ -78,7 +78,7 @@ OptionsMainLoop jsr OptionsInversion - jsr getkey + jsr GetKey bit escFlag spl:rts @@ -124,11 +124,16 @@ OptionsNoLeft OptionsNoRight cmp #@kbcode._ret ; $c ;Return key bne OptionsNoReturn + ; wait for long press + jsr WaitForLongPress + bcs TabPressed ; if long press (fire or Return) +EndOfOptions rts ; options selected OptionsNoReturn cmp #@kbcode._tab ; Tab key bne OptionsNoTab +TabPressed jsr SelectNextGradient OptionsNoTab jmp OptionsMainLoop @@ -409,7 +414,13 @@ ChoosingItemForPurchase cmp #@kbcode._left ; $06 ; cursor left jeq ListChange cmp #@kbcode._ret ; $0c ; Return - sne:rts + bne NoReturn + jsr WaitForLongPress + bcc exitthismenu ; short press + jmp PurchaseWeaponNow ; long press +exitthismenu + rts +NoReturn cmp #@kbcode._up ; $e beq PurchaseKeyUp cmp #@kbcode._down ; $f diff --git a/scorch.xex b/scorch.xex index 434323e..b42b53e 100644 Binary files a/scorch.xex and b/scorch.xex differ diff --git a/weapons.asm b/weapons.asm index 9e3c563..2963738 100644 --- a/weapons.asm +++ b/weapons.asm @@ -1520,12 +1520,9 @@ pressedSpace ;we shoot here!!! lda #0 sta ATRACT ; reset atract mode - sta pressTimer ; reset - jsr WaitForKeyRelease.StillWait - lda pressTimer - cmp #25 ; 1/2s - bcc fire - jmp callInventory + jsr WaitForLongPress + bcc fire ; short press + jmp callInventory ; long press fire RTS .endp