Skip to content

Commit

Permalink
Vita: -fix autofire for ply #2 w/o custom controls
Browse files Browse the repository at this point in the history
  • Loading branch information
rsn8887 committed Jul 20, 2017
1 parent c747b53 commit d99badb
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 5 deletions.
4 changes: 4 additions & 0 deletions Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ Square = Backspace
Triangle = Toggle Shift

CHANGELOG:
1.51

-fix autofire for ply #2 w/o custom controls

1.50

- fix analog deadzone (broken in last release)
Expand Down
33 changes: 29 additions & 4 deletions src/od-joy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ extern int lAnalogX;
extern int lAnalogY;
extern int mainMenu_leftStickMouse;
extern int mainMenu_deadZone;
int delay2=0; // for 2nd player non-custom autofire
#endif

extern char launchDir[300];
Expand Down Expand Up @@ -548,10 +549,34 @@ void read_joystick(int nr, unsigned int *dir, int *button)
top = 1;
else if (dpadDown[1])
bot = 1;
if ((mainMenu_button1==GP2X_BUTTON_B && buttonA[1]) || (mainMenu_button1==GP2X_BUTTON_X && buttonX[1]) || (mainMenu_button1==GP2X_BUTTON_Y && buttonY[1]))
*button |= 0x01;
if (buttonB[1])
*button |= (0x01 << 1);
if (
(mainMenu_autofire & switch_autofire & delay2>mainMenu_autofireRate)
||
(
(
(mainMenu_autofireButton1==GP2X_BUTTON_B && buttonA[1])
||
(mainMenu_autofireButton1==GP2X_BUTTON_X && buttonX[1])
||
(mainMenu_autofireButton1==GP2X_BUTTON_Y && buttonY[1])
)
& delay2>mainMenu_autofireRate
)
)
{
if(!buttonB[1])
*button=1;
delay2=0;
*button |= (buttonB[1] & 1) << 1;
}
else
{
if ((mainMenu_button1==GP2X_BUTTON_B && buttonA[1]) || (mainMenu_button1==GP2X_BUTTON_X && buttonX[1]) || (mainMenu_button1==GP2X_BUTTON_Y && buttonY[1]))
*button |= 0x01;
if (buttonB[1])
*button |= (0x01 << 1);
delay2++;
}
}
#endif //__PSP2__
// normal joystick movement
Expand Down
2 changes: 1 addition & 1 deletion src/psp2/psp2_shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Created by cpasjuste on 18/12/16.
//

// use https://github.com/frangarcj/vita2dlib/commits/fbo
// use https://github.com/frangarcj/vita2dlib/tree/fbo
// and https://github.com/frangarcj/vita-shader-collection/releases

#include <sysconfig.h>
Expand Down

0 comments on commit d99badb

Please sign in to comment.