One of the most annoying things about the ZX81 is that when you BASIC program is running anytime you press the SPACE key
it will cause a BREAK your BASIC program.
I've been working on this for awhile and I've come up with a method to be able to disable or enable the BREAK key at will.
When the BREAK key is disabled you can actually read the SPACE and "£" keys with INKEY$ !!!
The method consists of copying a small portion of the ROM, and making some of POKEs.
Creating the machine code is pretty painless since most of it is just a copy of the ROM.
Code: Select all
1 REM [70 characters]
10 FOR A=1644 TO 1709
20 POKE 14870+A,PEEK A
30 NEXT A
RUN
DELETE Lines 10 thru 30
enter as direct commands
POKE 16510,0
POKE 16569,24
POKE 16580,195
POKE 16581,174
POKE 16582,6
Code: Select all
10 RAND USR 16521 ' start (use again after any INPUT command)
20 POKE 16569,24 ' to disable BREAK key
1000 POKE 16569,56 ' to enable BREAK key
However, you WILL need to call the USR again after any INPUT command.
Here is a demo program
Code: Select all
0 REM machine code from above
10 RAND USR 16521
20 POKE 16569,24
30 PRINT "BREAK KEY IS DISABLED."
40 PAUSE 120
50 FOR A=1 TO 300
60 PRINT "A";
70 NEXT A
80 POKE 16569,56
90 PRINT "BREAK KEY IS ENABLED."
100 PAUSE 120
110 FOR A=1 TO 300
120 PRINT "X";
130 NEXT A
Press SHIFT-Q to stop.
NOTE line 30 is a SHIFT-Q inside quotes.
Code: Select all
0 REM machine code from above
10 RAND USR 16521
20 LET A$=INKEY$
30 IF A$="" THEN GOTO 20
40 IF INKEY$ = """" THEN STOP
50 PRINT A$;
60 IF INKEY$<>"" THEN GOTO 60
70 GOTO 20
Please let me know if you try this and if it works or doesn't work.
Bean