type
TIOStruct = record
IoAddr: DWORD;
Reserved1: DWORD;
pBuffer: Pointer;
NumBYTEs: DWORD;
Reserved4: DWORD;
Reserved5: DWORD;
Reserved6: DWORD;
Reserved7: DWORD;
end;
function InPortB(Port: DWORD): Byte;
var
Value : BYTE;
io : TIOStruct;
begin
Value := 0;
io.IoAddr := Port;
io.Reserved1 := 0;
io.pBuffer := Pointer(@Value);
io.NumBYTEs := sizeof(BYTE);
io.Reserved4 := 1;
io.Reserved5 := 0;
io.Reserved6 := 1;
io.Reserved7 := 0;
ZwSystemDebugControl(DebugSysReadIoSpace, @io, sizeof(io), nil, 0, nil);
Result := Value;
end;
procedure OutPortB(Port: DWORD; Value: Byte);
var
io : TIOStruct;
begin
io.IoAddr := Port;
io.Reserved1 := 0;
io.pBuffer := Pointer(@Value);
io.NumBYTEs := sizeof(BYTE);
io.Reserved4 := 1;
io.Reserved5 := 0;
io.Reserved6 := 1;
io.Reserved7 := 0;
ZwSystemDebugControl(DebugSysWriteIoSpace, @io, sizeof(io), nil, 0, nil);
end;
procedure KbcWait4IBE;
var
dwRegVal : DWORD;
begin
dwRegVal := 0;
while (dwRegVal and $00000001 = 1) do
begin
dwRegVal := InPortB(KBC_KEY_CMD);
end;
end;
procedure KeyDown(vKeyCoad: Cardinal); &nb