Добавил:
bagiwow
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Программирование / Курсовые / ЭВТ-1-Arcanoid / Arcanoid / Arcanoid / ARCUNITM
.PAS 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.
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.