- 4INT ----------------------------------------------------- It's interesting -
Msg : 44 of 202 Addr Date
From : Serge Luzin 2:5080/37.105 25.11.97
Subj : Программирование Джойстика
-------------------------------------------------------------------------------
23 Nov 97 you wrote to All:
VK> А не пpобывал ли кто подключить джойстик к пpогpамме?
вот феньку летом писал чтобы проверить сабж, не запуская гамы:
Serge,
The Operator of 2:5080/37.105, also known as 2:5080/37.5
- --- Middle Ural Net, Sverdlovsk region, Russia
--- Middle Ural Net, Sverdlovsk region, Russia
* Origin: (2:5080/37.105)
{> Cut here. FileName= JOYST.PAS }
{ From : Serge Luzin 2:5080/37.105 25.11.97 }
{ Subj : Программирование Джойстика }
{----------------------------------------------}
uses dos, crt;
const
mask: array[1..4] of byte = ($10, $20, $40, $80);
stat: array[boolean] of string[3] = ('On ', 'Off');
var
r: registers;
i: integer;
begin
clrscr;
writeln('Joystick tester, v0.1 by LSA 1997');
repeat
gotoxy(1, 3);
r.ah := $84;
r.dx := 0;
intr($15, r);
for i := 1 to 4 do
writeln('Button ', i:1, ' = ', stat[r.al and mask[i] = mask[i]]);
r.ah := $84;
r.dx := 1;
intr($15, r);
writeln(' A.X = ', r.ax:3);
writeln(' A.Y = ', r.bx:3);
writeln(' B.X = ', r.cx:3);
writeln(' B.Y = ', r.dx:3);
until keypressed;
readkey;
end.
|