Fix broken Mouse input implementation (init/update was never hooked up? caused crash when attempting to use)

This commit is contained in:
rainwarrior 2016-04-23 03:01:32 +00:00
parent c7868caea5
commit 870e17e265
3 changed files with 16 additions and 8 deletions

View File

@ -431,6 +431,7 @@ void FCEUD_UpdateInput()
case SI_SNES: case SI_SNES:
UpdateGamepad(true); UpdateGamepad(true);
break; break;
case SI_MOUSE: mouse=true; break;
case SI_ARKANOID: mouse=true; break; case SI_ARKANOID: mouse=true; break;
case SI_ZAPPER: mouse=true; break; case SI_ZAPPER: mouse=true; break;
case SI_POWERPADA: case SI_POWERPADA:
@ -515,6 +516,9 @@ void InitInputPorts(bool fourscore)
case SI_ZAPPER: case SI_ZAPPER:
InputDPtr=MouseData; InputDPtr=MouseData;
break; break;
case SI_MOUSE:
InputDPtr=MouseData;
break;
case SI_SNES: case SI_SNES:
InputDPtr=snespad_return; InputDPtr=snespad_return;
break; break;

View File

@ -62,6 +62,7 @@ extern INPUTC *FCEU_InitZapper(int w);
extern INPUTC *FCEU_InitPowerpadA(int w); extern INPUTC *FCEU_InitPowerpadA(int w);
extern INPUTC *FCEU_InitPowerpadB(int w); extern INPUTC *FCEU_InitPowerpadB(int w);
extern INPUTC *FCEU_InitArkanoid(int w); extern INPUTC *FCEU_InitArkanoid(int w);
extern INPUTC *FCEU_InitMouse(int w);
extern INPUTCFC *FCEU_InitArkanoidFC(void); extern INPUTCFC *FCEU_InitArkanoidFC(void);
extern INPUTCFC *FCEU_InitSpaceShadow(void); extern INPUTCFC *FCEU_InitSpaceShadow(void);
@ -470,6 +471,9 @@ static void SetInputStuff(int port)
case SI_POWERPADB: case SI_POWERPADB:
joyports[port].driver=FCEU_InitPowerpadB(port); joyports[port].driver=FCEU_InitPowerpadB(port);
break; break;
case SI_MOUSE:
joyports[port].driver=FCEU_InitMouse(port);
break;
case SI_NONE: case SI_NONE:
joyports[port].driver=&DummyJPort; joyports[port].driver=&DummyJPort;
break; break;