1
0
Fork 0

Added funcs to get joystick values

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@690
This commit is contained in:
Ulf Wohlers 2003-02-24 16:29:10 +00:00
parent 30819de412
commit 8e1c9a736b
2 changed files with 30 additions and 0 deletions

View file

@ -24,3 +24,10 @@ void JOYSTICK_Move_X(Bitu which,float x);
void JOYSTICK_Move_Y(Bitu which,float y);
bool JOYSTICK_IsEnabled(Bitu which);
bool JOYSTICK_GetButton(Bitu which, Bitu num);
float JOYSTICK_GetMove_X(Bitu which);
float JOYSTICK_GetMove_Y(Bitu which);

View file

@ -90,6 +90,29 @@ void JOYSTICK_Move_Y(Bitu which,float y) {
}
}
bool JOYSTICK_IsEnabled(Bitu which)
{
if (which<2) return stick[which].enabled;
return false;
};
bool JOYSTICK_GetButton(Bitu which, Bitu num)
{
if ((which<2) && (num<2)) return stick[which].button[num];
return false;
}
float JOYSTICK_GetMove_X(Bitu which)
{
if (which<2) return stick[which].xpos;
return 0.0f;
}
float JOYSTICK_GetMove_Y(Bitu which)
{
if (which<2) return stick[which].ypos;
return 0.0f;
};
void JOYSTICK_Init(Section* sec) {
IO_RegisterReadHandler(0x201,read_p201,"JOYSTICK");