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}
|
{$endif}
|
||||||
|
|
||||||
var
|
var
|
||||||
Hlt, ASCII, Verbose: boolean; //Halt, ASCII, and verbose flags
|
Hlt, Verbose: boolean; //Halt, ASCII, and verbose flags
|
||||||
Op, Regs: 0 .. $f; //Opcode
|
Op, Regs: 0 .. $f; //Opcode
|
||||||
X, Y: 0 .. 3; //Register arguments
|
X, Y: 0 .. 3; //Register arguments
|
||||||
Addr, IP, RP: word; //Immediate or address argument and instruction and return pointers
|
Addr, IP, RP: word; //Immediate or address argument and instruction and return pointers
|
||||||
|
@ -87,42 +87,22 @@ begin
|
||||||
wait;
|
wait;
|
||||||
{$endif}
|
{$endif}
|
||||||
//Read a keypress
|
//Read a keypress
|
||||||
repeat
|
|
||||||
Ch := ReadKey;
|
Ch := ReadKey;
|
||||||
//Check for non-ASCII keys
|
//Handle non-character keys
|
||||||
if Ch = ansichar (0) then begin
|
if Ch = ansichar (0) then begin
|
||||||
//Non-ASCII
|
|
||||||
if keypressed then begin
|
if keypressed then begin
|
||||||
Scan := ReadKey;
|
Scan := ReadKey;
|
||||||
//The delete key inserts the delete character
|
//The delete key inserts the delete character
|
||||||
if Scan = ansichar ($53) then begin
|
if Scan = ansichar ($53) then Ch := ansichar ($7f);
|
||||||
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);
|
|
||||||
end;
|
end;
|
||||||
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
|
if keypressed then begin
|
||||||
Scan := ReadKey;
|
|
||||||
Scan := ReadKey;
|
|
||||||
Scan := ReadKey;
|
|
||||||
Ch := ansichar (0);
|
Ch := ansichar (0);
|
||||||
|
repeat
|
||||||
|
scan := ReadKey;
|
||||||
|
until keypressed = false;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
//Process the keypress
|
//Process the keypress
|
||||||
|
|
|
@ -100,10 +100,10 @@ of RAM respectively instead and the speed limitations can be removed
|
||||||
with the argument -dfast.
|
with the argument -dfast.
|
||||||
|
|
||||||
Input and output are handled by an emulated glass teletype terminal with
|
Input and output are handled by an emulated glass teletype terminal with
|
||||||
local echo. Note that of the control characters only bell, backspace,
|
local echo. Of the control characters only bell, backspace, line feed,
|
||||||
line feed, and carriage return are used by the terminal, and the
|
and carriage return are used by the terminal. The backspace and delete
|
||||||
backspace and delete keys are tied to their respective characters and
|
characters are tied to their respective keys, and non-character keys
|
||||||
non-character keys to null.
|
input null.
|
||||||
|
|
||||||
In Linux the emulator can be compiled with support for a character
|
In Linux the emulator can be compiled with support for a character
|
||||||
printer and an emulated punched tape reader and punch with the arguments
|
printer and an emulated punched tape reader and punch with the arguments
|
||||||
|
|
Loading…
Reference in New Issue