type
TBOOTINFO = record
- cyls, legs, vmode, reserve: Int8;
+ cyls, leds, vmode, reserve: Int8;
scrnx, scrny: Int16;
vram: TBytes;
end;
function memfree(mem: TMEMMAN; addr, size: Cardinal): integer;
end;
+ TDesk = class
+ public
+ constructor Create;
+ end;
+
+ TPic = class
+ public
+ constructor Create;
+ procedure inthandler27(var esp: integer);
+ end;
+
TSheet = class
private const
table: array [0 .. 14, 0 .. 2] of Byte = (($00, $00, $00), ($FF, $00, $00),
TConsole = class(TWindow)
private
- fifo: TFifo;
ctl: TCtl;
public
+ fifo: TFifo;
constructor Create(xsize, ysize: integer; title: string; act: integer);
destructor Destroy; override;
end;
x: Boolean;
j: integer;
begin
+ x := false;
for i := 0 to High(task) do
begin
s := task[i];
var
arect: TRect;
begin
- arect:=obj.clip;
- refresh(arect.Left+obj.vx0,arect.Top+obj.vy0,arect.Right+obj.vx0,arect.Bottom+obj.vy0);
+ arect := obj.clip;
+ refresh(arect.Left + obj.vx0, arect.top + obj.vy0, arect.Right + obj.vx0,
+ arect.Bottom + obj.vy0);
end;
procedure TShtCtl.refreshmap(arect: TRect);
constructor TConsole.Create(xsize, ysize: integer; title: string; act: integer);
var
- i, c: integer;
+ i: integer;
s: TTask;
str: string;
begin
clip := rect(cursor_x, 28, cursor_x + 8, 44);
refresh := true;
end;
+ case i of
+ 2:
+ cursor_c := COL8_FFFFFF;
+ 3:
+ begin
+ boxfill8(COL8_000000, cursor_x, 28, cursor_x + 7, 43);
+ cursor_c := -1;
+ end;
+ end;
if (i >= 256) and (i <= 511) then
if i = 8 + 256 then
begin
putfonts8_asc(cursor_x, 28, 1, str);
inc(cursor_x, 8);
end;
+ if cursor_c >= 0 then
+ boxfill8(cursor_c, cursor_x, 28, cursor_x + 7, 43);
boxfill8(cursor_c, cursor_x, 28, cursor_x + 7, 43);
refresh := true;
end;
end;
end;
+{ TPic }
+
+constructor TPic.Create;
+begin
+ io_out8(PIC0_IMR, $FF);
+ io_out8(PIC1_IMR, $FF);
+
+ io_out8(PIC0_ICW1, $11);
+ io_out8(PIC0_ICW2, $20);
+ io_out8(PIC0_ICW3, 1 shl 2);
+ io_out8(PIC0_ICW4, $01);
+
+ io_out8(PIC1_ICW1, $11);
+ io_out8(PIC1_ICW2, $28);
+ io_out8(PIC1_ICW3, 2);
+ io_out8(PIC1_ICW4, $01);
+
+ io_out8(PIC0_IMR, $FB);
+ io_out8(PIC1_IMR, $FF);
+end;
+
+procedure TPic.inthandler27(var esp: integer);
+begin
+ io_out8(PIC0_OCW2, $67);
+end;
+
+{ TDesk }
+
+constructor TDesk.Create;
+begin
+
+end;
+
end.
const
MEMMAN_ADDR = $003C0000;
+ KEYCMD_LED = $ED;
var
binfo: ^TBOOTINFO = Pointer(ADR_BOOTINFO);
mouse: TMouse;
ctl: TCtl;
keyboard: TKeyboard;
- key_to: integer;
- i: SmallInt;
+ key_to, key_shift, key_leds, keycmd_wait: integer;
+ i: integer;
memtest: TMemtest;
memtotal: Cardinal;
memman: ^TMEMMAN = Pointer(MEMMAN_ADDR);
mem: TMem;
+ pic: TPic;
sheet: TShtCtl;
mo, win, cons: TSheet;
s: string;
- fifo: TFifo;
+ fifo, keycmd: TFifo;
mx, my: integer;
begin
+ key_leds := (binfo^.leds shr 4) and 7;
+ keycmd_wait := -1;
+ pic := TPic.Create;
{
TAsmhead.Init;
TAsmhead.Boot;
}
fifo := TFifo.Create(128);
+ keycmd := TFifo.Create(32);
keyboard := TKeyboard.Create(fifo, 216);
key_to := 0;
mouse := TMouse.Create(fifo, 512);
sheet.slide(win, 80, 72);
sheet.updown(mo, 1);
sheet.updown(win, 2);
- // sprintf
sheet.screen.putfonts8_asc_sht(0, 32, s);
sheet.refresh(0, 0, 80, 16);
+ keycmd.Put(KEYCMD_LED);
+ keycmd.Put(key_leds);
while True do
begin
+ if (keycmd.Status > 0) and (keycmd_wait < 0) then
+ begin
+ keycmd_wait := keycmd.Get;
+ keyboard.wait_KBC_sendready;
+ io_out8(TKeyboard.PORT_KEYDAT, keycmd_wait);
+ end;
io_cli;
if fifo.Status = 0 then
io_stihlt
key_to := 1;
sheet.updown(win, 0);
sheet.updown(cons, 1);
+ cons.cursor_c:=-1;
+ (cons as TConsole).fifo.Put(2);
end
else
begin
key_to := 0;
sheet.updown(win, 1);
sheet.updown(cons, 0);
+ cons.cursor_c:=COL8_000000;
+ TConsole(cons).fifo.Put(3);
end;
end;
- win.clip:=Rect(0,0,win.bxsize,21);
- cons.clip:=Rect(0,0,cons.bxsize,21);
+ win.clip := Rect(0, 0, win.bxsize, 21);
+ cons.clip := Rect(0, 0, cons.bxsize, 21);
sheet.refresh(win);
sheet.refresh(cons);
case i of
;
256 + $3A:
begin
- key_leds = key_leds * key_leds * key_leds * key_leds;
- fifo.Put(KEYCMD_LED);
- fifo.Put(key_leds);
+ key_leds := key_leds * key_leds * key_leds * key_leds;
+ keycmd.Put(KEYCMD_LED);
+ keycmd.Put(key_leds);
end;
256 + $45:
begin
key_leds := key_leds * key_leds;
- fifo.Put(KEYCMD_LED);
- fifo.Put(key_leds);
+ keycmd.Put(KEYCMD_LED);
+ keycmd.Put(key_leds);
end;
256 + $46:
begin
- fifo.Put(KEYCMD_LED);
- fifo.Put(key_leds);
+ keycmd.Put(KEYCMD_LED);
+ keycmd.Put(key_leds);
end;
256 + $FA:
keycmd_wait := -1;
end;
win.boxfill8(win.cursor_c, win.cursor_x, 28, win.cursor_x + 8, 44);
end
- else if (i >= 512) and (i <= 711) then
+ else if (i >= 512) and (i <= 767) then
begin
if mouse.decode(i) <> 0 then
begin
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.refresh(0, 64, 56, 80);
end;
sheet.refresh(0, 0, 80, 16);
+ end
+ else if i <= 1 then
+ begin
+
end;
end;
end;
finally
+ pic.Free;
fifo.Free;
+ keycmd.Free;
sheet.Free;
win.Free;
mo.Free;
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/>
- <ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
+ <ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
</Deployment>
<Platforms>
<Platform value="Android">False</Platform>