Bodge together a fix for some keyboard-related quirks of the CRT unit in Linux
This commit is contained in:
parent
4f84079543
commit
39e273d575
36
emulator.pas
36
emulator.pas
|
@ -31,7 +31,7 @@ const
|
|||
{$endif}
|
||||
|
||||
var
|
||||
Hlt, ASCII, Verbose: boolean; //Halt, ASCII, and verbose flags
|
||||
Hlt, Verbose: boolean; //Halt, ASCII, and verbose flags
|
||||
Op, Regs: 0 .. $f; //Opcode
|
||||
X, Y: 0 .. 3; //Register arguments
|
||||
Addr, IP, RP: word; //Immediate or address argument and instruction and return pointers
|
||||
|
@ -87,42 +87,22 @@ begin
|
|||
wait;
|
||||
{$endif}
|
||||
//Read a keypress
|
||||
repeat
|
||||
Ch := ReadKey;
|
||||
//Check for non-ASCII keys
|
||||
//Handle non-character keys
|
||||
if Ch = ansichar (0) then begin
|
||||
//Non-ASCII
|
||||
if keypressed then begin
|
||||
Scan := ReadKey;
|
||||
//The delete key inserts the delete character
|
||||
if Scan = ansichar ($53) then begin
|
||||
Ch := ansichar ($7f);
|
||||
ASCII := true;
|
||||
end
|
||||
//Unused function keys insert a null
|
||||
else ASCII := true;
|
||||
end
|
||||
//Null
|
||||
else ASCII := true;
|
||||
end
|
||||
//Other ASCII
|
||||
else ASCII := true;
|
||||
until ASCII = true;
|
||||
//Bodge for the home and end keys
|
||||
if Ch = ansichar ($37) then begin
|
||||
if keypressed then begin
|
||||
Scan := ReadKey;
|
||||
Scan := ReadKey;
|
||||
Scan := ReadKey;
|
||||
Ch := ansichar (0);
|
||||
if Scan = ansichar ($53) then Ch := ansichar ($7f);
|
||||
end;
|
||||
end
|
||||
else if Ch = ansichar ($38) then begin
|
||||
//Bodge for the CRT unit not working perfectly in Linux
|
||||
else if Ch <= ansichar ($7f) then begin
|
||||
if keypressed then begin
|
||||
Scan := ReadKey;
|
||||
Scan := ReadKey;
|
||||
Scan := ReadKey;
|
||||
Ch := ansichar (0);
|
||||
repeat
|
||||
scan := ReadKey;
|
||||
until keypressed = false;
|
||||
end;
|
||||
end;
|
||||
//Process the keypress
|
||||
|
|
|
@ -100,10 +100,10 @@ of RAM respectively instead and the speed limitations can be removed
|
|||
with the argument -dfast.
|
||||
|
||||
Input and output are handled by an emulated glass teletype terminal with
|
||||
local echo. Note that of the control characters only bell, backspace,
|
||||
line feed, and carriage return are used by the terminal, and the
|
||||
backspace and delete keys are tied to their respective characters and
|
||||
non-character keys to null.
|
||||
local echo. Of the control characters only bell, backspace, line feed,
|
||||
and carriage return are used by the terminal. The backspace and delete
|
||||
characters are tied to their respective keys, and non-character keys
|
||||
input null.
|
||||
|
||||
In Linux the emulator can be compiled with support for a character
|
||||
printer and an emulated punched tape reader and punch with the arguments
|
||||
|
|
Loading…
Reference in New Issue