vram: TBytes;
end;
- TFIFO8 = record
+ TFIFO32 = record
buf: array of UInt32;
p, q, size, free, flags: integer;
end;
TFifo = class
private
- fifo: TFIFO8;
+ fifo: TFIFO32;
public
constructor Create(size: integer);
destructor Destroy; override;
- function Put(data: Byte): integer;
+ function Put(data: integer): integer;
function Get: SmallInt;
function Status: integer;
end;
end;
TKeyboard = class(TDevice)
+ const
+ cursor_c = COL8_FFFFFF;
private
keydata: integer;
+ procedure make_table(const keys1, keys2: array of const);
public
+ keytable0, keytable1: array [$00 .. $80] of Byte;
+ cursor_x: integer;
constructor Create(fifo: TFifo; data0: integer);
procedure inthandler21(var esp: integer); override;
end;
fifo.q := 0;
end;
-function TFifo.Put(data: Byte): integer;
+function TFifo.Put(data: integer): integer;
begin
if fifo.free = 0 then
begin
wait_KBC_sendready;
io_out8(PORT_KEYCMD, KEYCMD_WRITE_MODE);
wait_KBC_sendready;
- io_out8(PORT_KEYDAT, KBC_MODE)
+ io_out8(PORT_KEYDAT, KBC_MODE);
+ make_table([0, 0, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '^',
+ $08, 0, 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '@', '[', $0A, 0,
+ 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ';', ':', 0, 0, ']', 'Z', 'X',
+ 'C', 'V', 'B', 'N', 'M', ',', '.', '/', 0, '*', 0, ' ', 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, '7', '8', '9', '-', '4', '5', '6', '+', '1', '2', '3',
+ '0', '.', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, $5C, 0, 0, 0, 0, 0, 0, 0, 0, 0, $5C, 0, 0],
+ [0, 0, '!', $22, '#', '$', '%', '&', $27, '(', ')', '~', '=', '~', $08, 0,
+ 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '`', '{', $0A, 0, 'A',
+ 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', '+', '*', 0, 0, '}', 'Z', 'X', 'C',
+ 'V', 'B', 'N', 'M', '<', '>', '?', 0, '*', 0, ' ', 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, '7', '8', '9', '-', '4', '5', '6', '+', '1', '2', '3', '0',
+ '.', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, '_', 0, 0, 0, 0, 0, 0, 0, 0, 0, '|', 0, 0]);
end;
procedure TKeyboard.inthandler21(var esp: integer);
fifo.Put(i + keydata);
end;
+procedure TKeyboard.make_table(const keys1, keys2: array of const);
+var
+ i: integer;
+begin
+ for i := 0 to High(keys1) do
+ keytable0[i] := keys1[i].VType;
+ for i := 0 to High(keys2) do
+ keytable1[i] := keys2[i].VType;
+end;
+
end.
System.Classes,
bootpack in 'bootpack.pas',
asmhead in 'asmhead.pas',
- graphic in 'graphic.pas';
+ graphic in 'graphic.pas',
+ timer in 'timer.pas',
+ func in 'func.pas';
const
MEMMAN_ADDR = $003C0000;
var
binfo: ^TBOOTINFO = Pointer(ADR_BOOTINFO);
mouse: TMouse;
+ ctl: TCtl;
keyboard: TKeyboard;
i: SmallInt;
memtest: TMemtest;
fifo := TFifo.Create(128);
keyboard := TKeyboard.Create(fifo, 216);
mouse := TMouse.Create(fifo, 512);
- sheet := TShtCtl.Create(binfo^.scrnx,binfo^.scrny);
+ ctl := TCtl.Create(fifo);
+ sheet := TShtCtl.Create(binfo^.scrnx, binfo^.scrny);
mo := TCursor.Create(16, 16, 99);
win := TWindow.Create(160, 68, 'Window', -1);
try
while True do
begin
io_cli;
- if fifo.Status + fifo.Status = 0 then
+ if fifo.Status = 0 then
io_stihlt
else
begin
- if fifo.Status <> 0 then
- begin
- i := fifo.Get;
- io_sti;
- // sprintf
- sheet.screen.boxfill8(COL8_008484, 0, 16, 15, 31);
- sheet.screen.putfonts8_asc_sht(0, 16, s);
- sheet.refresh(0, 16, 16, 32);
- end
- else if fifo.Status <> 0 then
+ i := fifo.Get;
+ io_sti;
+ if (i >= 256) and (i <= 511) then
+ with keyboard do
+ begin
+ if i >= $54 + 256 then
+ if (keytable0[i - 256] <> 0) and (cursor_x < 144) then
+ begin
+ s[1] := Char(keytable0[i - 256]);
+ win.putfonts8_asc_sht(cursor_x, 28, s);
+ inc(cursor_x, 8);
+ end;
+ if (i <= 256 + $0E) and (cursor_x > 8) then
+ begin
+ win.putfonts8_asc_sht(cursor_x, 28, ' ');
+ dec(cursor_x, 8);
+ end;
+ win.boxfill8(cursor_c, cursor_x, 28, cursor_x + 8, 44);
+ end
+ else if (i >= 512) and (i <= 711) then
begin
- i := fifo.Get;
- io_sti;
if mouse.decode(i) <> 0 then
begin
// sprontf
mx := 0;
if my < 0 then
my := 0;
- if mx > binfo^.scrnx - 1 then
- mx := binfo^.scrnx - 1;
- if my > binfo^.scrny - 1 then
- my := binfo^.scrny - 1;
+ if mx > sheet.screen.bxsize - 1 then
+ mx := sheet.screen.bxsize - 1;
+ if my > sheet.screen.bysize - 1 then
+ my := sheet.screen.bysize - 1;
// sprintf
sheet.screen.boxfill8(COL8_008484, 0, 0, 78, 15);
sheet.screen.putfonts8_asc_sht(0, 0, s);
sheet.refresh(0, 0, 80, 16);
sheet.slide(mo, mx, my);
end;
+ if fifo.Status <> 0 then
+ begin
+ i := fifo.Get;
+ io_sti;
+ sheet.screen.putfonts8_asc_sht(0, 64, '10sec');
+ sheet.refresh(0, 64, 56, 80);
+ end;
sheet.refresh(0, 0, 80, 16);
end;
end;