TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: DANIEL HEBBERD
from: JOE DUNFORD
date: 1997-09-18 07:06:00
subject: Joystick

DH>How do i use a joystick through BIOS calls ?
DH>a mouse for example is regs.x.dx and stuff ...
DH>is there a joystick BIOS call ?
You bet.
Following code quoted from Tricks of the Game Programming Gurus, ISBN
0-672-30507-0.
unsigned int Joystick_Bios (unsigned char stick)
{
//BIOS version of joystick read
union _REGS inregs, outregs;
inregs.h.ah=0x84; // This is joystick function 84h.
inregs.x.dx=0x01; // This is read joystick sub func 1
_int86 (0x15,&inregs,&outregs);
switch (stick)
 {
  case JOYSTICK_1_X:
    {
     return (outregs.x.ax);
    }
    break;
  case JOYSTICK_1_Y:
    {
     return (outregs.x.bx);
    }
    break;
  case JOYSTICK_2_X:
    return (outregs.x.cx); break;
  case JOYSTICK_2_Y:
    return (outregs.x.dx); break;
  default:
    break;
 } // end switch
return;
}
I would prefer just to give you the info on the BIOS calls, but I don't
have anything on me. This will have to do... ;)
___
 þ SLMR 2.1a þ Lets make tapes of ourselves and sell them to whales.
--- Maximus 3.01
---------------
* Origin: C+Net BBS. Programming & Networking. (1:342/1017)

SOURCE: echomail via exec-pc

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™.