Skip to content

Commit 40162f9

Browse files
authored
Merge pull request #461 from boriel/feature/add_PIP_to_input
Make INPUT to PIP on key pressing
2 parents 381114a + f38fb4b commit 40162f9

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

src/arch/zx48k/library/input.bas

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,29 @@ FUNCTION input(MaxLen AS UINTEGER) AS STRING
4040
REM Wait for a Key Press
4141
LastK = 0
4242
DO LOOP UNTIL LastK <> 0
43+
ASM
44+
PROC
45+
LOCAL PIP
46+
LOCAL NO_CLICK
47+
LOCAL BEEPER
48+
49+
PIP EQU 23609
50+
BEEPER EQU 0x3B5
51+
52+
ld a, (PIP)
53+
or a
54+
jr z, NO_CLICK
55+
push ix
56+
ld e, a
57+
ld d, 0
58+
ld hl, 0x00C8
59+
CALL BEEPER
60+
pop ix
61+
62+
NO_CLICK:
63+
ENDP
64+
65+
END ASM
4366

4467
PRIVATEInputHideCursor()
4568

src/arch/zxnext/library/input.bas

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,29 @@ FUNCTION input(MaxLen AS UINTEGER) AS STRING
4040
REM Wait for a Key Press
4141
LastK = 0
4242
DO LOOP UNTIL LastK <> 0
43+
ASM
44+
PROC
45+
LOCAL PIP
46+
LOCAL NO_CLICK
47+
LOCAL BEEPER
48+
49+
PIP EQU 23609
50+
BEEPER EQU 0x3B5
51+
52+
ld a, (PIP)
53+
or a
54+
jr z, NO_CLICK
55+
push ix
56+
ld e, a
57+
ld d, 0
58+
ld hl, 0x00C8
59+
CALL BEEPER
60+
pop ix
61+
62+
NO_CLICK:
63+
ENDP
64+
65+
END ASM
4366

4467
PRIVATEInputHideCursor()
4568

0 commit comments

Comments
 (0)