2 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
3 SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
4 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
5 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
6 IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
7 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
8 FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
9 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
10 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
11 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
24 while( !i && !key_inkey() )
25 joy_get_btn_up_cnt(&i, &j);
32 int i, start, stop, frames;
33 short bd1, bd2, bu1, bu2, b, x, y, bt1, bt2;
38 printf( "No joystick detected.\n" );
43 timer_init( 0, NULL );
45 printf( "Displaying joystick button transitions and time...any key leaves.\n" );
53 joy_get_btn_down_cnt( &bd1, &bd2 );
54 joy_get_btn_up_cnt( &bu1, &bu2 );
55 joy_get_btn_time( &bt1, &bt2 );
56 printf( "%d %d %d %d T1:%d T2:%d\n",bd1, bu1, bd2, bu2, bt1, bt2 );
60 printf( "\nPress c to do a deluxe-full-fledged calibration.\n" );
61 printf( "or any other key to just use the cheap method.\n" );
63 if (key_getch() == 'c') {
64 printf( "Move stick to center and press any key.\n" );
68 printf( "Move stick to Upper Left corner and press any key.\n" );
72 printf( "Move stick to Lower Right corner and press any key.\n" );
78 while( !keyd_pressed[KEY_ESC])
82 joy_get_pos( &x, &y );
85 printf( "%d, %d (%d %d)\n", x, y, b & 1, b & 2);
90 printf( "Testing joystick reading speed...\n" );
91 t1 = timer_get_microseconds();
92 joy_get_pos( &x, &y );
93 t2 = timer_get_microseconds();
95 printf( "~ %u æsec per reading using Timer Timing\n", t2 - t1 );
103 for (i=0; i<frames; i++ )
104 joy_get_pos( &x, &y );
108 printf( "~ %d æsec per reading using BIOS ticker as a stopwatch.\n", USECS_PER_READING( start, stop, frames ) );