Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
46
Добавлен:
10.12.2013
Размер:
1.09 Кб
Скачать
unit ArcUnitM;
interface
procedure Init(var ButtonCount,ErrorCode:byte);
procedure GetMouseXY(var x,y:integer;var LeftButton,RightButton,ThirdButton:boolean);
procedure SetMouseXY(x,y:word);
Implementation
uses DOS,CRT;
var
ErrCode,ButtonCount,Count:byte;
LeftButton,RightButton,ThirdButton:boolean;
regs:registers;

procedure Init(var ButtonCount,ErrorCode:byte);
begin
ClrScr;
with regs do begin
ax:=$0000;
intr($33,regs);
if ax = $FFFF then ErrorCode:=0 else ErrorCode:=1;
ButtonCount:=bx;
end;
end;
procedure GetMouseXY(var x,y:integer;var LeftButton,RightButton,ThirdButton:boolean);
var ButtonCode:byte;
begin
with regs do begin
ax:=$0003;
intr($33,regs);
X:=CX;
Y:=DX;
ButtonCode:=bx;
end;
LeftButton:=(ButtonCode and 1) = 1;
RightButton:=(ButtonCode and 2) = 2;
ThirdButton:=(ButtonCode and 4) = 4;
end;
procedure SetMouseXY(x,y:word);
begin
with regs do begin
ax:=$0004;
cx:=x;
dx:=y;
intr($33,regs);
end;
end;
end.
Соседние файлы в папке Arcanoid