2002-07-27 13:08:48 +00:00
|
|
|
/*
|
2021-01-14 18:29:34 +00:00
|
|
|
* Copyright (C) 2002-2021 The DOSBox Team
|
2002-07-27 13:08:48 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2004-08-04 09:12:57 +00:00
|
|
|
* GNU General Public License for more details.
|
2002-07-27 13:08:48 +00:00
|
|
|
*
|
2019-01-25 14:09:58 +00:00
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2002-07-27 13:08:48 +00:00
|
|
|
*/
|
|
|
|
|
2005-06-13 14:48:02 +00:00
|
|
|
#ifndef DOSBOX_JOYSTICK_H
|
|
|
|
#define DOSBOX_JOYSTICK_H
|
2021-01-23 04:32:35 +01:00
|
|
|
|
|
|
|
#include "dosbox.h"
|
|
|
|
|
2021-09-26 13:18:43 -07:00
|
|
|
void JOYSTICK_Enable(uint8_t which, bool enabled);
|
2002-07-27 13:08:48 +00:00
|
|
|
|
2021-09-26 13:18:43 -07:00
|
|
|
void JOYSTICK_Button(uint8_t which, int num, bool pressed);
|
2002-07-27 13:08:48 +00:00
|
|
|
|
2021-09-26 13:18:43 -07:00
|
|
|
// takes in the joystick axis absolute value from -32768 to 32767
|
|
|
|
void JOYSTICK_Move_X(uint8_t which, int16_t x_val);
|
|
|
|
void JOYSTICK_Move_Y(uint8_t which, int16_t y_val);
|
2002-07-27 13:08:48 +00:00
|
|
|
|
2021-09-26 13:18:43 -07:00
|
|
|
bool JOYSTICK_IsEnabled(uint8_t which);
|
2003-01-07 18:12:41 +00:00
|
|
|
|
2021-09-26 13:18:43 -07:00
|
|
|
bool JOYSTICK_GetButton(uint8_t which, int num);
|
2003-02-24 16:29:10 +00:00
|
|
|
|
2021-09-26 13:18:43 -07:00
|
|
|
// returns a percentage from -1.0 to +1.0 along the axis
|
|
|
|
double JOYSTICK_GetMove_X(uint8_t which);
|
|
|
|
double JOYSTICK_GetMove_Y(uint8_t which);
|
2005-06-13 14:48:02 +00:00
|
|
|
|
2021-02-10 15:37:14 -08:00
|
|
|
void JOYSTICK_ParseConfiguredType();
|
|
|
|
|
2005-06-13 14:48:02 +00:00
|
|
|
enum JoystickType {
|
2021-02-10 15:41:09 -08:00
|
|
|
JOY_UNSET,
|
2021-07-23 11:40:35 -07:00
|
|
|
JOY_DISABLED, // joystick subsystem is fully disabled (won't even query)
|
|
|
|
JOY_NONE, // joystick subsystem will be available for mapping only
|
2007-01-10 15:01:15 +00:00
|
|
|
JOY_AUTO,
|
2005-06-13 14:48:02 +00:00
|
|
|
JOY_2AXIS,
|
|
|
|
JOY_4AXIS,
|
2007-08-12 10:23:36 +00:00
|
|
|
JOY_4AXIS_2,
|
2005-06-13 14:48:02 +00:00
|
|
|
JOY_FCS,
|
|
|
|
JOY_CH
|
|
|
|
};
|
|
|
|
|
|
|
|
extern JoystickType joytype;
|
2007-02-22 08:44:07 +00:00
|
|
|
extern bool button_wrapping_enabled;
|
2021-01-23 04:32:35 +01:00
|
|
|
|
2005-06-13 14:48:02 +00:00
|
|
|
#endif
|