MC INKEY$ replacement

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
Post Reply
User avatar
GCHarder
Posts: 212
Joined: Sat Dec 14, 2013 7:46 pm

MC INKEY$ replacement

Post by GCHarder » Sat Apr 13, 2019 10:16 pm

From "Syntax" magazine
Attachments
MC INKEY$.zip
(3.95 KiB) Downloaded 15 times

User avatar
siggi
Posts: 879
Joined: Thu May 08, 2008 9:30 am
Location: Dauernheim, Germany
Contact:

Re: MC INKEY$ replacement

Post by siggi » Mon Apr 15, 2019 9:15 am

Hi Greg
this is not a real "inkey" function like in BASIC.
The BASIC inkey$ function reads the keyboard "on the fly" and does not wait for a key to be pressed. But this mc stays inside a loop (and does not return) if no key is pressed:

Code: Select all

@Again
	Call Keyboard	;Call ROM scan keybd.
	INC L		;Check for no key press, L=FF
	JR Z Again	;If L=0 then Scan again.
Siggi
My ZX81 web-server: online since 2007
http://zx81-siggi.endoftheinternet.org/index.html

User avatar
mrtinb
Posts: 906
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: MC INKEY$ replacement

Post by mrtinb » Mon Apr 15, 2019 9:40 am

A new "INKEY$" that fixes the problem with pressing Space/Break has to be a MC that does not return to Basic. Because if it returns to Basic, Space will break at any Basic statement.
Martin
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube

Post Reply