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)
|