Skip to content

Commit

Permalink
VITA: Analog mouse support, menu updates
Browse files Browse the repository at this point in the history
- added analog mouse support
- new menu items in misc menu:
	shader choice (default: sharp_bilinear_simple)I
	choice which analog stick to use for mouse
- disabled broken gp2x stylus mode and mouse emu mode
- L/R are mouse buttons now
- screen movement switched from L+R+DPAD to START+DPAD
- START does not switch input modes anymore (mouse is always enabled)
- updated Readme.txt with new Vita control scheme
- fixed misc menu entries for shader and analog mouse
- updated Readme.txt
- make custom controls menu more snappy
  • Loading branch information
rsn8887 committed Dec 21, 2016
1 parent 48c831e commit bc49ce5
Show file tree
Hide file tree
Showing 9 changed files with 294 additions and 23 deletions.
31 changes: 26 additions & 5 deletions Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,29 @@ F11 - change input method
Please put kickstarts files in android/data/pandora.uae4all.sdl/kickstarts directory.
Files must be named as kick13.rom kick20.rom kick31.rom

VITA controls:

L+R+dpad up down - Change Screen vertical position
Start - toggle between gp2x style mouse mode, joystick mode and stylus mode (stylus mode not working yet). Press multiple times to change behaviour between the three modes.
Select - toggle menu
Vita Controls:

A=square
B=circle
X=cross
Y=triangle

Vita controls:

Select = toggle menu
Start+dpad = move screen
right analog stick = analog mouse (can switch this to left in menu)
left analog stick = acts as amiga joystick

Only when custom controls are off:
L/R=mousebuttons
R+Square = CTRL
R+Circle = LALT
R+Cross = HELP
L+Square = left mouse
L+Circle = right mouse
R+dpad = arrow keys

When custom mouse controls are on:
Dpad = digital mouse
Triangle = slow mouse down
2 changes: 1 addition & 1 deletion src/gp2x/gp2x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ int flashLED;

int gp2xMouseEmuOn=0;
int gp2xButtonRemappingOn=0;
#ifndef PANDORA
#if !defined(PANDORA) && !defined(__PSP2__)
int hasGp2xButtonRemapping=1;
#endif
int GFXVIDINFO_HEIGHT=240;
Expand Down
20 changes: 15 additions & 5 deletions src/gp2x/menu/menu_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ int visibleAreaWidth = 320;

int saveMenu_n_savestate = 0;

#ifdef __PSP2__
int mainMenu_leftStickMouse = 0;
#endif

// The following params in use, but can't be changed with gui
int mainMenu_autosave = DEFAULT_AUTOSAVE;
Expand All @@ -100,16 +103,16 @@ int mainMenu_button2 = GP2X_BUTTON_A;
int mainMenu_autofireButton1 = GP2X_BUTTON_B;
int mainMenu_jump = -1;

#ifdef __PSP2__
int mainMenu_shader = 5;
#endif

// The following params not in use, but stored to write them back to the config file
int gp2xClockSpeed = -1;
int mainMenu_scanlines = 0;
int mainMenu_enableScreenshots = DEFAULT_ENABLESCREENSHOTS;
int mainMenu_enableScripts = DEFAULT_ENABLESCRIPTS;

#ifdef __PSP2__
int mainMenu_shader = 0;
#endif

#ifdef ANDROIDSDL
int mainMenu_onScreen = 1;
int mainMenu_onScreen_textinput = 1;
Expand Down Expand Up @@ -187,7 +190,6 @@ void SetDefaultMenuSettings(int general)
mainMenu_CPU_speed = 0;

mainMenu_cpuSpeed = 600;

mainMenu_joyConf = 0;
mainMenu_joyPort = 0;
mainMenu_autofireRate = 8;
Expand Down Expand Up @@ -217,6 +219,11 @@ void SetDefaultMenuSettings(int general)
mainMenu_frameskip = 0;
mainMenu_autofire = DEFAULT_AUTOFIRE;

#ifdef __PSP2__
mainMenu_shader = 5;
mainMenu_leftStickMouse = 0;
#endif

// The following params can't be changed in gui
skipintro = DEFAULT_SKIPINTRO;
mainMenu_autosave = DEFAULT_AUTOSAVE;
Expand Down Expand Up @@ -801,6 +808,8 @@ int saveconfig(int general)
#ifdef __PSP2__
snprintf((char*)buffer, 255, "shader=%d\n",mainMenu_shader);
fputs(buffer,f);
snprintf((char*)buffer, 255, "leftstickmouse=%d\n",mainMenu_leftStickMouse);
fputs(buffer,f);
#endif
snprintf((char*)buffer, 255, "showstatus=%d\n",mainMenu_showStatus);
fputs(buffer,f);
Expand Down Expand Up @@ -1101,6 +1110,7 @@ void loadconfig(int general)
#endif
#ifdef __PSP2__
fscanf(f,"shader=%d\n",&mainMenu_shader);
fscanf(f,"leftstickmouse=%d\n",&mainMenu_leftStickMouse);
#endif
fscanf(f,"showstatus=%d\n",&mainMenu_showStatus);
fscanf(f,"mousemultiplier=%d\n",&mainMenu_mouseMultiplier );
Expand Down
5 changes: 5 additions & 0 deletions src/gp2x/menu/menu_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,8 @@ extern int mainMenu_vsync;
#endif
extern char custom_kickrom[256];
#endif

#ifdef __PSP2__
extern int mainMenu_leftStickMouse;
extern int mainMenu_shader;
#endif
3 changes: 2 additions & 1 deletion src/gp2x/menu/menu_controls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,10 +449,11 @@ static int key_controlsMenu(int *c)
static int delay=0;
int left=0, right=0, up=0, down=0, hit0=0, hit1=0;
SDL_Event event;
#ifndef __PSP2__ // this can be snappy on Vita no need to worry about touch
delay ++;
if (delay<5) return end;
delay=0;

#endif
while (SDL_PollEvent(&event) > 0)
{
if (event.type == SDL_KEYDOWN)
Expand Down
110 changes: 109 additions & 1 deletion src/gp2x/menu/menu_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ enum {
#ifdef PANDORA
MENUMISC_PANDORASPEED,
#endif
#ifdef __PSP2__
MENUMISC_LEFTSTICKMOUSE,
#endif
#ifdef ANDROIDSDL
MENUMISC_ONSCREEN,
#endif
Expand All @@ -70,10 +73,27 @@ enum {
MENUMISC_STATUSLINE,
MENUMISC_MOUSEMULTIPLIER,
MENUMISC_STYLUSOFFSET,
#ifdef __PSP2__
MENUMISC_SHADER,
#else
MENUMISC_TAPDELAY,
#endif
MENUMISC_END
};

#ifdef __PSP2__
enum {
SHADER_NONE = 0,
SHADER_LCD3X,
SHADER_AAA,
SHADER_SCALE2X,
SHADER_SHARP_BILINEAR,
SHADER_SHARP_BILINEAR_SIMPLE,
SHADER_FXAA,
NUM_SHADERS, //NUM_SHADERS - 1 is the max allowed number in mainMenu_shader
};
#endif

static void draw_miscMenu(int c)
{
int leftMargin=3;
Expand All @@ -93,6 +113,11 @@ static void draw_miscMenu(int c)
SDL_Rect r;
extern SDL_Surface *text_screen;
char cpuSpeed[8];

#ifdef __PSP2__
char shaderName[25];
#endif

r.x=80-64; r.y=0; r.w=110+64+64; r.h=240;

text_draw_background();
Expand Down Expand Up @@ -191,6 +216,26 @@ static void draw_miscMenu(int c)
write_text(tabstop4-1,menuLine,cpuSpeed);
write_text(tabstop6-1,menuLine,"MHz");
#endif
#ifdef __PSP2__
// MENUMISC_LEFTSTICKMOUSE
menuLine+=2;
write_text(leftMargin,menuLine,"Mouse Control:");
if (mainMenu_leftStickMouse==0)
{
if ((menuMisc!=MENUMISC_LEFTSTICKMOUSE)||(bb))
write_text_inv(tabstop4-1,menuLine,"Right Stick");
else
write_text(tabstop4-1,menuLine,"Right Stick ");
}
else if (mainMenu_leftStickMouse==1)
{
if ((menuMisc!=MENUMISC_LEFTSTICKMOUSE)||(bb))
write_text_inv(tabstop4-1,menuLine,"Left Stick");
else
write_text(tabstop4-1,menuLine,"Left Stick ");
}
#endif

#ifdef ANDROIDSDL
// MENUMISC_ONSCREEN
menuLine+=2;
Expand Down Expand Up @@ -348,7 +393,7 @@ static void draw_miscMenu(int c)
write_text_inv(tabstop9,menuLine,text_str_8px);
else
write_text(tabstop9,menuLine,text_str_8px);

#ifndef __PSP2__
// MENUMISC_TAPDELAY
menuLine+=2;
write_text(leftMargin,menuLine,text_str_tap_delay);
Expand All @@ -367,6 +412,43 @@ static void draw_miscMenu(int c)
write_text_inv(tabstop9,menuLine,text_str_none);
else
write_text(tabstop9,menuLine,text_str_none);
#else
//Shader settings on Vita
//MENUMISC_SHADER
menuLine+=2;
write_text(leftMargin,menuLine,"Shader");

switch (mainMenu_shader)
{
case SHADER_NONE:
snprintf((char*)shaderName, 25, "NONE (perfect 2*)");
break;
case SHADER_LCD3X:
snprintf((char*)shaderName, 25, "LCD3X");
break;
case SHADER_SCALE2X:
snprintf((char*)shaderName, 25, "SCALE2X");
break;
case SHADER_AAA:
snprintf((char*)shaderName, 25, "AAA");
break;
case SHADER_SHARP_BILINEAR:
snprintf((char*)shaderName, 25, "SHARP_BILINEAR");
break;
case SHADER_SHARP_BILINEAR_SIMPLE:
snprintf((char*)shaderName, 25, "SHARP_BILNEAR_SIMPLE");
break;
case SHADER_FXAA:
snprintf((char*)shaderName, 25, "FXAA");
break;
default:
break;
}
if ((menuMisc!=MENUMISC_SHADER)||(bb))
write_text_inv(tabstop3-2,menuLine,shaderName);
else
write_text(tabstop3-2,menuLine,shaderName);
#endif

menuLine++;
write_text(leftMargin,menuLine,text_str_misc_separator);
Expand Down Expand Up @@ -496,6 +578,13 @@ static int key_miscMenu(int *c)
mainMenu_cpuSpeed+=10;
break;
#endif
#ifdef __PSP2__
case MENUMISC_LEFTSTICKMOUSE:
if ((left)||(right))
mainMenu_leftStickMouse = !mainMenu_leftStickMouse;
break;
#endif

#ifdef ANDROIDSDL
case MENUMISC_ONSCREEN:
if ((left)||(right))
Expand Down Expand Up @@ -615,6 +704,24 @@ static int key_miscMenu(int *c)
mainMenu_stylusOffset = 0;
}
break;
#ifdef __PSP2__ //shader choice on VITA
case MENUMISC_SHADER:
if (left)
{
if (mainMenu_shader <= 0)
mainMenu_shader = 0;
else
mainMenu_shader -= 1;
}
else if (right)
{
if (mainMenu_shader >= NUM_SHADERS-1)
mainMenu_shader = NUM_SHADERS-1;
else
mainMenu_shader +=1;
}
break;
#else
case MENUMISC_TAPDELAY:
if (left)
{
Expand All @@ -635,6 +742,7 @@ static int key_miscMenu(int *c)
mainMenu_tapDelay = 10;
}
break;
#endif //__PSP2__
}
}

Expand Down

0 comments on commit bc49ce5

Please sign in to comment.