1
0
Fork 0

Add beta2 patch: enable full joystick remapping

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2747
This commit is contained in:
Sebastian Strohhäcker 2007-01-10 15:01:15 +00:00
parent 7d57a8d5e5
commit e529cae446
5 changed files with 586 additions and 227 deletions

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: joystick.h,v 1.9 2007-01-08 19:45:37 qbix79 Exp $ */
/* $Id: joystick.h,v 1.10 2007-01-10 15:00:38 c2woody Exp $ */
#ifndef DOSBOX_JOYSTICK_H
#define DOSBOX_JOYSTICK_H
void JOYSTICK_Enable(Bitu which,bool enabled);
@ -37,6 +37,7 @@ float JOYSTICK_GetMove_Y(Bitu which);
enum JoystickType {
JOY_NONE,
JOY_AUTO,
JOY_2AXIS,
JOY_4AXIS,
JOY_FCS,

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: dosbox.cpp,v 1.106 2007-01-08 20:10:34 qbix79 Exp $ */
/* $Id: dosbox.cpp,v 1.107 2007-01-10 15:00:38 c2woody Exp $ */
#include <stdlib.h>
#include <stdarg.h>
@ -400,18 +400,19 @@ void DOSBOX_Init(void) {
"disney -- Enable Disney Sound Source emulation.\n"
);
secprop=control->AddSection_prop("bios",&BIOS_Init,false);//done
MSG_Add("BIOS_CONFIGFILE_HELP",
"joysticktype -- Type of joystick to emulate: none, 2axis, 4axis,\n"
" fcs (Thrustmaster) ,ch (CH Flightstick).\n"
secprop=control->AddSection_prop("joystick",&BIOS_Init,false);//done
MSG_Add("JOYSTICK_CONFIGFILE_HELP",
"joysticktype -- Type of joystick to emulate: auto (default), none,\n"
" 2axis (supports two joysticks), 4axis,\n"
" fcs (Thrustmaster), ch (CH Flightstick).\n"
" none disables joystick emulation.\n"
" 2axis is the default and supports two joysticks.\n"
" auto chooses emulation depending on real joystick(s).\n"
);
secprop->AddInitFunction(&INT10_Init);
secprop->AddInitFunction(&MOUSE_Init); //Must be after int10 as it uses CurMode
secprop->AddInitFunction(&JOYSTICK_Init);
secprop->Add_string("joysticktype","2axis");
secprop->Add_string("joysticktype","auto");
// had to rename these to serial due to conflicts in config
secprop=control->AddSection_prop("serial",&SERIAL_Init,true);

File diff suppressed because it is too large Load diff

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: sdlmain.cpp,v 1.125 2007-01-08 19:45:40 qbix79 Exp $ */
/* $Id: sdlmain.cpp,v 1.126 2007-01-10 15:01:15 c2woody Exp $ */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
@ -1183,14 +1183,12 @@ static Bit8u raltstate = SDL_KEYUP;
void GFX_Events() {
SDL_Event event;
#if defined (REDUCE_JOYSTICK_POLLING)
if (sdl.num_joysticks>0) {
static int poll_delay=0;
int time=SDL_GetTicks();
if (time-poll_delay>20) {
poll_delay=time;
SDL_JoystickUpdate();
MAPPER_UpdateJoysticks();
}
static int poll_delay=0;
int time=SDL_GetTicks();
if (time-poll_delay>20) {
poll_delay=time;
if (sdl.num_joysticks>0) SDL_JoystickUpdate();
MAPPER_UpdateJoysticks();
}
#endif
while (SDL_PollEvent(&event)) {

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: joystick.cpp,v 1.15 2007-01-08 19:45:40 qbix79 Exp $ */
/* $Id: joystick.cpp,v 1.16 2007-01-10 15:01:15 c2woody Exp $ */
#include <string.h>
#include "dosbox.h"
@ -146,11 +146,13 @@ public:
Section_prop * section=static_cast<Section_prop *>(configuration);
const char * type=section->Get_string("joysticktype");
if (!strcasecmp(type,"none")) joytype=JOY_NONE;
else if (!strcasecmp(type,"false")) joytype=JOY_NONE;
else if (!strcasecmp(type,"auto")) joytype=JOY_AUTO;
else if (!strcasecmp(type,"2axis")) joytype=JOY_2AXIS;
else if (!strcasecmp(type,"4axis")) joytype=JOY_4AXIS;
else if (!strcasecmp(type,"fcs")) joytype=JOY_FCS;
else if (!strcasecmp(type,"ch")) joytype=JOY_CH;
else joytype=JOY_2AXIS;
else joytype=JOY_AUTO;
ReadHandler.Install(0x201,read_p201,IO_MB);
WriteHandler.Install(0x201,write_p201,IO_MB);
stick[0].enabled=false;