Skip to content

Commit

Permalink
rear & indirect front touch, pointer speed, radial scaled deadzone
Browse files Browse the repository at this point in the history
  • Loading branch information
rsn8887 committed Mar 16, 2018
1 parent 54719ae commit c4ea6b3
Show file tree
Hide file tree
Showing 9 changed files with 628 additions and 38 deletions.
3 changes: 3 additions & 0 deletions src/PSP2/main_psp.cpp
Expand Up @@ -57,6 +57,7 @@ using std::string;
#include "user_strings.h"
#include "version.h"
#include "main.h"
#include "psp2_touch.h"

#define Get_String(x) const_cast<char*>(GetString(x))

Expand Down Expand Up @@ -206,6 +207,8 @@ int main(int argc, char **argv)

danzeff_load();

psp2InitTouch();

// Initialize variables
RAMBaseHost = NULL;
ROMBaseHost = NULL;
Expand Down
3 changes: 2 additions & 1 deletion src/PSP2/makefile
Expand Up @@ -14,7 +14,8 @@ OBJS = ../main.o main_psp.o ../prefs.o ../prefs_items.o prefs_psp.o \
../disk.o ../cdrom.o ../scsi.o scsi_psp.o ../video.o \
video_psp.o ../audio.o audio_psp.o ../extfs.o extfs_psp.o \
ftruncate.o ../user_strings.o user_strings_psp.o \
gui_psp.o reqfile.o debugScreen.o danzeff/danzeff.o\
gui_psp.o reqfile.o debugScreen.o danzeff/danzeff.o \
psp2_touch.o \
$(CPUOBJS)

INCLUDES = -I../include -I./include -I. -I../uae_cpu -I../uae_cpu/fpu/softfloat
Expand Down
50 changes: 50 additions & 0 deletions src/PSP2/prefs_editor_psp.cpp
Expand Up @@ -79,6 +79,10 @@ int psp_lcd_aspect = 0; // 4:3
int psp_lcd_border = 1; // default to inverting the data

int psp_60hz_timing = 1; // default to relaxed timing
int psp_rear_touch_enable = 0; // do not use rear touch panel
int psp_indirect_touch_enable = 0; // do not use indirect touch on front panel
int psp_pointer_speed = 3; // indirect touch pointer speed is 1.0
int psp_analog_deadzone = 2; // analog deadzone default is 10%

extern char *psp_floppy_inserted; // String: filename of floppy inserted
extern char *psp_cdrom_inserted; // String: filename of cdrom inserted
Expand Down Expand Up @@ -260,10 +264,36 @@ void psp_create_floppy(void *arg)
{ 0, GUI_END_OF_LIST }
};

struct gui_list psp_pointer_speed_list[] = {
{ "0.25", 0 },
{ "0.50", 1 },
{ "0.75", 2 },
{ "1.00", 3 },
{ "1.25", 4 },
{ "1.50", 5 },
{ "1.75", 6 },
{ "2.00", 7 },
{ 0, GUI_END_OF_LIST }
};

struct gui_list psp_analog_deadzone_list[] = {
{ "5%", 0 },
{ "10%", 1 },
{ "15%", 2 },
{ "20%", 3 },
{ "25%", 4 },
{ "30%", 5 },
{ 0, GUI_END_OF_LIST }
};

struct gui_menu PspLevel[] = {
{ Get_String(STR_PSP_CPU_FREQ), GUI_CENTER | GUI_SELECT, &psp_cpu_speed_list, &psp_cpu_speed, GUI_ENABLED },
{ Get_String(STR_PSP_DISPLAY_ASPECT), GUI_CENTER | GUI_SELECT, &psp_aspect_list, &psp_lcd_aspect, GUI_ENABLED },
{ Get_String(STR_PSP_RELAXED_60HZ), GUI_CENTER | GUI_TOGGLE, &psp_60hz_timing, 0, GUI_ENABLED },
{ Get_String(STR_PSP_REAR_TOUCH), GUI_CENTER | GUI_TOGGLE, &psp_rear_touch_enable, 0, GUI_ENABLED },
{ Get_String(STR_PSP_INDIRECT_TOUCH), GUI_CENTER | GUI_TOGGLE, &psp_indirect_touch_enable, 0, GUI_ENABLED },
{ Get_String(STR_PSP_POINTER_SPEED), GUI_CENTER | GUI_SELECT, &psp_pointer_speed_list, &psp_pointer_speed, GUI_ENABLED },
{ Get_String(STR_PSP_ANALOG_DEADZONE), GUI_CENTER | GUI_SELECT, &psp_analog_deadzone_list, &psp_analog_deadzone, GUI_ENABLED },
{ 0, GUI_END_OF_MENU, 0, 0, 0 } // end of menu
};

Expand Down Expand Up @@ -577,6 +607,18 @@ bool PrefsEditor(void)
if (PrefsFindBool("relaxed60hz"))
psp_60hz_timing = PrefsFindBool("relaxed60hz") ? 1 : 0;

if (PrefsFindBool("reartouch"))
psp_rear_touch_enable = PrefsFindBool("reartouch") ? 1 : 0;

if (PrefsFindBool("indirecttouch"))
psp_indirect_touch_enable = PrefsFindBool("indirecttouch") ? 1 : 0;

if (PrefsFindInt32("pointerspeed"))
psp_pointer_speed = PrefsFindInt32("pointerspeed");

if (PrefsFindInt32("analogdeadzone"))
psp_analog_deadzone = PrefsFindInt32("analogdeadzone");

// YEAH!! Do that GUI!!
do_gui(TopLevel, NULL, Get_String(STR_PREFS_ITEM_START));

Expand Down Expand Up @@ -659,6 +701,14 @@ bool PrefsEditor(void)

PrefsReplaceBool("relaxed60hz", psp_60hz_timing ? true : false);

PrefsReplaceBool("reartouch", psp_rear_touch_enable ? true : false);

PrefsReplaceBool("indirecttouch", psp_indirect_touch_enable ? true : false);

PrefsReplaceInt32("pointerspeed", psp_pointer_speed);

PrefsReplaceInt32("analogdeadzone", psp_analog_deadzone);

SavePrefs();

return true;
Expand Down
22 changes: 13 additions & 9 deletions src/PSP2/prefs_psp.cpp
Expand Up @@ -29,15 +29,19 @@

// Platform-specific preferences items
prefs_desc platform_prefs_items[] = {
{"keycodefile", TYPE_STRING, false, "path of keycode translation file"},
{"udpapoint", TYPE_INT32, false, "UDP tunnel access point"},
{"pspspeed", TYPE_INT32, false, "PSP CPU frequency"},
{"psptv", TYPE_BOOLEAN, false, "Use video output"},
{"pspmar", TYPE_INT32, false, "PSP TV monitor aspect ratio"},
{"psplaced", TYPE_BOOLEAN, false, "PSP TV monitor uses interlace"},
{"pspdar", TYPE_INT32, false, "PSP display aspect ratio"},
{"psposcan", TYPE_BOOLEAN, false, "PSP video overscan enable"},
{"relaxed60hz", TYPE_BOOLEAN, false, "Use relaxed timing for 60 Hz IRQ"},
{"keycodefile", TYPE_STRING, false, "path of keycode translation file"},
{"udpapoint", TYPE_INT32, false, "UDP tunnel access point"},
{"pspspeed", TYPE_INT32, false, "PSP CPU frequency"},
{"psptv", TYPE_BOOLEAN, false, "Use video output"},
{"pspmar", TYPE_INT32, false, "PSP TV monitor aspect ratio"},
{"psplaced", TYPE_BOOLEAN, false, "PSP TV monitor uses interlace"},
{"pspdar", TYPE_INT32, false, "PSP display aspect ratio"},
{"psposcan", TYPE_BOOLEAN, false, "PSP video overscan enable"},
{"relaxed60hz", TYPE_BOOLEAN, false, "Use relaxed timing for 60 Hz IRQ"},
{"reartouch", TYPE_BOOLEAN, false, "Enable rear touch panel"},
{"indirecttouch", TYPE_BOOLEAN, false, "Use indirect front touch"},
{"pointerspeed", TYPE_INT32, false, "Mouse pointer speed"},
{"analogdeadzone", TYPE_INT32, false, "Analog joystick deadzone"},
{NULL, TYPE_END, false, NULL} // End of list
};

Expand Down

0 comments on commit c4ea6b3

Please sign in to comment.