mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 16:29:24 +02:00
+ 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:
parent
93be8bba50
commit
6f874eefa6
@ -66,11 +66,27 @@ procedure PrintHexWord(const w: word);
|
|||||||
procedure Ink(colour: Byte);
|
procedure Ink(colour: Byte);
|
||||||
procedure Paper(colour: Byte);
|
procedure Paper(colour: Byte);
|
||||||
procedure GotoXY(X, Y: Byte);
|
procedure GotoXY(X, Y: Byte);
|
||||||
|
function ReadKey: Char;
|
||||||
|
function KeyPressed: Boolean;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
var
|
var
|
||||||
save_iy: Word; public name 'FPC_SAVE_IY';
|
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;
|
procedure fpc_InitializeUnits;[public,alias:'FPC_INITIALIZEUNITS']; compilerproc;
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user