home *** CD-ROM | disk | FTP | other *** search
- {--------------------------------------------------------------}
- { GAMETEST }
- { }
- { Machine-code joystick support demo program }
- { }
- { by Jeff Duntemann }
- { Turbo Pascal V5.00 }
- { Last update 8/1/88 }
- { }
- { Nothing complex here. This program USES the GAMEBORD unit, }
- { that contains two assembly-language routines for reading }
- { either of the two joysticks and their associated buttons. }
- { The program polls the stick continually and reports the }
- { status of the buttons and the current coordinates of the }
- { joystick. To end the program, press any key. }
- { }
- { From: COMPLETE TURBO PASCAL 5.0 by Jeff Duntemann }
- { Scott, Foresman & Co., Inc. 1988 ISBN 0-673-38355-5 }
- {--------------------------------------------------------------}
-
- PROGRAM GameTest;
-
- USES Crt,Gamebord;
-
- VAR
- X,Y : INTEGER;
-
- BEGIN
- ClrScr;
- X := 0; Y := 0;
- GotoXY(2,9); Writeln('X Axis Y Axis');
- WHILE NOT KeyPressed DO
- BEGIN
- GotoXY(1,5);
- IF Button(2,1) THEN Writeln('Button 1 pressed!')
- ELSE Writeln('Nothing on 1.....');
- IF Button(2,2) THEN Writeln('Button 2 pressed!')
- ELSE Writeln('Nothing on 2.....');
- Stick(2,X,Y);
- GotoXY(1,10);
- Writeln(X:5,' ',Y:5);
- END;
- END.