TIP: Click on subject to list as thread! ANSI
echo: cis.languages
to: TONY CAPPELLINI 76370,2104 (X)
from: Bruce MacKenzie 71725,376
date: 1990-05-27 23:54:03
subject: #3870-#C and JOoysticks

#: 3886 S3/Languages
    27-May-90  23:54:03
Sb: #3870-#C and JOoysticks
Fm: Bruce MacKenzie 71725,376
To: TONY CAPPELLINI 76370,2104 (X)

Tony,
 If you have no assembly experience then I can see that you might have a bit of
trouble figuring out an _os9() call.  Here's the source of a function that will
read the joystick status:

 #include 

 _gs_joy(path,joy,but,x,y)

 int path,joy,*but,*x,*y;

 {
      struct registers r;

      r.rg_a=path;
      r.rg_b=SS_JOY;
      r.rg_x=joy;
      if(_os9(I_GETSTT,&r)==-1)
           return -1;
      *but=(int)r.rg_a;
      *x=r.rg_x;
      *y=r.rg_y;
      return 0;
 }

The parameters are:

  path = path number to a window or to term.  Be sure not to pass a FILE
         pointer.  ie use fileno(stdin) and not stdin here.
  joy  = 0 for right joystick. 1 for left joystick.
  but  = pointer to an integer to receive the button status.  Returns:
         0 for none, 1 for button 1 down, 2 for button 2 down, 3 for both
         buttons down
         x   =x value (0 to 63)
         y   = y value (0 to 63)

There is 1 Reply.

SOURCE: compuserve via textfiles.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.