JTEST.C
上传用户:lllw2006
上传日期:2007-01-05
资源大小:39k
文件大小:5k
- /*
- ** Test program for joystick library.
- **
- ** This file is part of:
- **
- ** Joystick Library for Dos.
- ** Version: 1.1
- **
- ** Last modified: June 15th, 1997
- **
- ** (C) 1997 Simone Zanella Productions.
- **
- ** E-mail: szanella@dsi.unive.it
- ** zanella@prometeo.it
- **
- ** Web: http://www.dsi.unive.it/~szanella/index.htm
- ** http://members.tripod.com/~szanella/index.htm
- **
- ** Changes from version 1.0:
- **
- ** - added support for 4 and 6 buttons joysticks;
- ** - added command line parameter mode;
- ** - changed calibration to manual, to avoid incompatibilities and
- ** to get a faster reading;
- ** - calibration is now saved to JTEST.JC, in JTEST.EXE directory;
- ** - removed tolerances.
- **
- ** --------------------------------------------------------
- **
- ** This is freeware: use it as you like, but ALWAYS include
- ** the original author's name in the docs of your program.
- **
- ** --------------------------------------------------------
- */
- #include <conio.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include "joystick.h"
- #ifndef __BORLANDC__
- #define min(a, b) (((a) < (b)) ? (a) : (b))
- #define max(a, b) (((a) > (b)) ? (a) : (b))
- #endif
- static int mode = JOY_2BUTTONS;
- void printstatus(unsigned char jready, unsigned int j0, unsigned int j1)
- {
- /* Show status for both joysticks */
- char l[13][26];
- unsigned char j, o, ln;
- unsigned int jflags;
- strcpy(l[0], "