+ added keyboard input functions (ReadKey and KeyPressed) to the ZX Spectrum. Now you can start having fun! :)

git-svn-id: branches/z80@44902 -
This commit is contained in:
nickysn 2020-04-21 01:16:04 +00:00
parent 93be8bba50
commit 6f874eefa6

View File

@ -66,11 +66,27 @@ procedure PrintHexWord(const w: word);
procedure Ink(colour: Byte);
procedure Paper(colour: Byte);
procedure GotoXY(X, Y: Byte);
function ReadKey: Char;
function KeyPressed: Boolean;
implementation
var
save_iy: Word; public name 'FPC_SAVE_IY';
LastKey: Char absolute 23560;
function ReadKey: Char;
begin
repeat
ReadKey:=LastKey;
until ReadKey<>#0;
LastKey:=#0;
end;
function KeyPressed: Boolean;
begin
KeyPressed:=LastKey<>#0;
end;
procedure fpc_InitializeUnits;[public,alias:'FPC_INITIALIZEUNITS']; compilerproc;
begin