Pause BASIC, and wait for key press without using INKEY$

Hardware Hacking, Programming and Game Solutions/Cheats
Post Reply
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Pause BASIC, and wait for key press without using INKEY$

Post by zephyr »

This routine allows you to pause BASIC, and wait for a key press without using the INKEY$ function. The machine code routine is position independent, and DOS compatible. Three bytes ($00D5 - $00D7) are used by the program as follows.

POKE213,0 (default) = Wait for key press
POKE213,1 (or any other value other than zero) = Wait for key press with flashing cursor

POKE214,ASC("Q") = Exit only when the "Q" key is pressed

PEEK(215) = ASCII code of last key pressed

N/B The example program below pokes the machine code into the cassette buffer. It could be overwritten if you were to load a program from cassette. To get round this, simply alter line 80 (CoCo 90) to poke in the machine code anywhere you like.

Dragon

Code: Select all

10 'PAUSE V1.0
20 'FOR THE DRAGON 32/64
30 'BY STEPHEN J WOOLHAM
40 '***************************
50 'BASIC EXAMPLE PROGRAM
60 '***************************
70 MC$="0DD52703BDBBB5BDBBE527F40DD6270491D626EC97D739"
80 X=1:FOR I=458 TO 480:POKE I,VAL("&H"+MID$(MC$,X,2)):X=X+2:NEXT
90 EXEC458
CoCo

Code: Select all

10 'PAUSE V1.0
20 'FOR TANDY COLOR COMPUTER
30 'MODELS 1, 2, AND 3
40 'BY STEPHEN J WOOLHAM
50 '***************************
60 'BASIC EXAMPLE PROGRAM
70 '***************************
80 MC$="0DD52703BDA199AD9FA00027F30DD6270491D626EB97D739"
90 X=1:FOR I=458 TO 481:POKE I,VAL("&H"+MID$(MC$,X,2)):X=X+2:NEXT
100 EXEC458
Post Reply