aboutsummaryrefslogtreecommitdiff
path: root/emulators/ppsspp
diff options
context:
space:
mode:
authorJan Beich <jbeich@FreeBSD.org>2017-10-15 01:17:34 +0000
committerJan Beich <jbeich@FreeBSD.org>2017-10-15 01:17:34 +0000
commit8e42bc6858e29b79f72a83ef6aba549891498e4c (patch)
treef2dd3380c8fd481385c639d51564a77cf62ec66a /emulators/ppsspp
parentf15e791b3b0c1822a5e21fd2a8c92955029804b8 (diff)
downloadports-8e42bc6858e29b79f72a83ef6aba549891498e4c.tar.gz
ports-8e42bc6858e29b79f72a83ef6aba549891498e4c.zip
Notes
Diffstat (limited to 'emulators/ppsspp')
-rw-r--r--emulators/ppsspp/Makefile5
-rw-r--r--emulators/ppsspp/distinfo2
-rw-r--r--emulators/ppsspp/files/extra-patch-old-joy88
3 files changed, 56 insertions, 39 deletions
diff --git a/emulators/ppsspp/Makefile b/emulators/ppsspp/Makefile
index 40c9840c5e33..f04cd2786d14 100644
--- a/emulators/ppsspp/Makefile
+++ b/emulators/ppsspp/Makefile
@@ -3,7 +3,7 @@
PORTNAME= ppsspp
DISTVERSIONPREFIX= v
DISTVERSION?= 1.4.2
-PORTREVISION?= 3
+PORTREVISION?= 4
CATEGORIES= emulators
# XXX Get from Debian once #697821 lands
MASTER_SITES= https://bazaar.launchpad.net/~sergio-br2/${PORTNAME}/debian-sdl/download/5/${PORTNAME}.1-20140802045408-dd26dik367ztj5xg-8/:manpage
@@ -13,6 +13,7 @@ EXTRACT_ONLY= ${DISTFILES:N*\:manpage:C/:.*//}
.if !defined(PKGNAMESUFFIX) || ${PKGNAMESUFFIX:N*-devel}
PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
PATCHFILES= e33acdc5e922.patch:-p1
+PATCHFILES+= ac0052c6af92.patch:-p1
.endif
MAINTAINER= jbeich@FreeBSD.org
@@ -58,7 +59,7 @@ OPTIONS_SLAVE?= SDL
OPTIONS_EXCLUDE:= ${OPTIONS_SINGLE_GUI}
OLDJOY_DESC= Old joystick support with fixed button mappings (deprecated)
-OLDJOY_EXTRA_PATCHES?= ${PATCHDIR}/extra-patch-old-joy
+OLDJOY_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-old-joy
QT5_USE= QT5=qmake_build,buildtools_build,linguisttools_build,gui,opengl,widgets
QT5_CMAKE_BOOL= USING_QT_UI
QT5_VARS= EXENAME=PPSSPPQt
diff --git a/emulators/ppsspp/distinfo b/emulators/ppsspp/distinfo
index 52c7938dacbc..f01bbf561817 100644
--- a/emulators/ppsspp/distinfo
+++ b/emulators/ppsspp/distinfo
@@ -15,3 +15,5 @@ SHA256 (Kingcom-tinyformat-Release-2.0.1-7-gb7f5a22_GH0.tar.gz) = d86b5b45920472
SIZE (Kingcom-tinyformat-Release-2.0.1-7-gb7f5a22_GH0.tar.gz) = 22286
SHA256 (e33acdc5e922.patch) = 26db4fe256c3947193b379ea7d17b0aae59e4339ae3822b53ef40fd6dca07004
SIZE (e33acdc5e922.patch) = 1819
+SHA256 (ac0052c6af92.patch) = 91beb0f70965a433eddb15e1088ab3091beac99e921944fbf79cee16bbb7ee60
+SIZE (ac0052c6af92.patch) = 3078
diff --git a/emulators/ppsspp/files/extra-patch-old-joy b/emulators/ppsspp/files/extra-patch-old-joy
index f6ff4a8ea9c9..e70948bb2861 100644
--- a/emulators/ppsspp/files/extra-patch-old-joy
+++ b/emulators/ppsspp/files/extra-patch-old-joy
@@ -7,10 +7,11 @@ https://github.com/hrydgard/ppsspp/commit/182b9e0fdae3
https://github.com/hrydgard/ppsspp/commit/d6b81236626f
https://github.com/hrydgard/ppsspp/commit/b058b987ad0f
https://github.com/hrydgard/ppsspp/commit/1b699363ca4d
+https://github.com/hrydgard/ppsspp/commit/ac0052c6af92
---- SDL/SDLJoystick.cpp.orig 2017-03-30 12:14:27 UTC
+--- SDL/SDLJoystick.cpp.orig 2017-10-04 19:26:40 UTC
+++ SDL/SDLJoystick.cpp
-@@ -1,12 +1,7 @@
+@@ -1,13 +1,8 @@
#include "SDL/SDLJoystick.h"
#include "Core/Config.h"
-#include "Common/FileUtil.h"
@@ -18,18 +19,20 @@ https://github.com/hrydgard/ppsspp/commit/1b699363ca4d
#include <iostream>
-#include <string>
--
--using namespace std;
+-using namespace std;
+-
static int SDLJoystickEventHandlerWrapper(void* userdata, SDL_Event* event)
{
-@@ -17,65 +12,32 @@ static int SDLJoystickEventHandlerWrappe
+ static_cast<SDLJoystick *>(userdata)->ProcessInput(*event);
+@@ -17,79 +12,30 @@ static int SDLJoystickEventHandlerWrapper(void* userda
SDLJoystick::SDLJoystick(bool init_SDL ) : registeredAsEventHandler(false) {
SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1");
if (init_SDL) {
- SDL_Init(SDL_INIT_JOYSTICK | SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER);
-- }
--
++ SDL_Init(SDL_INIT_JOYSTICK | SDL_INIT_VIDEO);
+ }
+
- const char *dbPath = "gamecontrollerdb.txt";
- cout << "loading control pad mappings from " << dbPath << ": ";
-
@@ -44,52 +47,63 @@ https://github.com/hrydgard/ppsspp/commit/1b699363ca4d
- delete[] mappingData;
- } else {
- cout << "gamecontrollerdb.txt missing" << endl;
-+ SDL_Init(SDL_INIT_JOYSTICK | SDL_INIT_VIDEO);
- }
+- }
- cout << "SUCCESS!" << endl;
- setUpControllers();
-}
-
+-
-void SDLJoystick::setUpControllers() {
int numjoys = SDL_NumJoysticks();
+ SDL_JoystickEventState(SDL_ENABLE);
for (int i = 0; i < numjoys; i++) {
- setUpController(i);
-- }
-- if (controllers.size() > 0) {
-- cout << "pad 1 has been assigned to control pad: " << SDL_GameControllerName(controllers.front()) << endl;
+ joys.push_back(SDL_JoystickOpen(i));
+// printf("Initialized joystick %d: %s",i,SDL_JoystickNameForIndex(i));
+ if(strstr(SDL_JoystickNameForIndex(i),"PLAYSTATION(R)3 Controller"))
+ g_Config.bPS3Controller = true;
}
+- if (controllers.size() > 0) {
+- cout << "pad 1 has been assigned to control pad: " << SDL_GameControllerName(controllers.front()) << endl;
+- }
-}
-void SDLJoystick::setUpController(int deviceIndex) {
-- if (SDL_IsGameController(deviceIndex)) {
-- SDL_GameController *controller = SDL_GameControllerOpen(deviceIndex);
-- if (controller) {
-- if (SDL_GameControllerGetAttached(controller)) {
-- controllers.push_back(controller);
-- controllerDeviceMap[SDL_JoystickInstanceID(SDL_GameControllerGetJoystick(controller))] = deviceIndex;
-- cout << "found control pad: " << SDL_GameControllerName(controller) << ", loading mapping: ";
-- auto mapping = SDL_GameControllerMapping(controller);
-- if (mapping == NULL) {
-- cout << "FAILED" << endl;
-- } else {
-- cout << "SUCCESS, mapping is:" << endl << mapping << endl;
-- }
+- if (!SDL_IsGameController(deviceIndex)) {
+- cout << "Control pad device " << deviceIndex << " not supported by SDL game controller database, attempting to create default mapping..." << endl;
+- int cbGUID = 33;
+- char pszGUID[cbGUID];
+- SDL_Joystick* joystick = SDL_JoystickOpen(deviceIndex);
+- SDL_JoystickGetGUIDString(SDL_JoystickGetGUID(joystick), pszGUID, cbGUID);
+- // create default mapping - this is the PS3 dual shock mapping
+- std::string mapping = string(pszGUID) + "," + string(SDL_JoystickName(joystick)) + ",x:b3,a:b0,b:b1,y:b2,back:b8,guide:b10,start:b9,dpleft:b15,dpdown:b14,dpright:b16,dpup:b13,leftshoulder:b4,lefttrigger:a2,rightshoulder:b6,rightshoulder:b5,righttrigger:a5,leftstick:b7,leftstick:b11,rightstick:b12,leftx:a0,lefty:a1,rightx:a3,righty:a4";
+- if (SDL_GameControllerAddMapping(mapping.c_str()) == 1){
+- cout << "Added default mapping ok" << endl;
+- } else {
+- cout << "Failed to add default mapping" << endl;
+- }
+- SDL_JoystickClose(joystick);
+- }
+- SDL_GameController *controller = SDL_GameControllerOpen(deviceIndex);
+- if (controller) {
+- if (SDL_GameControllerGetAttached(controller)) {
+- controllers.push_back(controller);
+- controllerDeviceMap[SDL_JoystickInstanceID(SDL_GameControllerGetJoystick(controller))] = deviceIndex;
+- cout << "found control pad: " << SDL_GameControllerName(controller) << ", loading mapping: ";
+- auto mapping = SDL_GameControllerMapping(controller);
+- if (mapping == NULL) {
+- //cout << "FAILED" << endl;
+- cout << "Could not find mapping in SDL2 controller database" << endl;
- } else {
-- SDL_GameControllerClose(controller);
+- cout << "SUCCESS, mapping is:" << endl << mapping << endl;
- }
+- } else {
+- SDL_GameControllerClose(controller);
- }
- }
+ if (g_Config.bPS3Controller)
+ fillMappingPS3();
+ else
+ fillMapping();
-+
-+
}
SDLJoystick::~SDLJoystick() {
@@ -103,7 +117,7 @@ https://github.com/hrydgard/ppsspp/commit/1b699363ca4d
}
}
-@@ -84,107 +46,124 @@ void SDLJoystick::registerEventHandler()
+@@ -98,107 +44,124 @@ void SDLJoystick::registerEventHandler() {
registeredAsEventHandler = true;
}
@@ -281,7 +295,8 @@ https://github.com/hrydgard/ppsspp/commit/1b699363ca4d
+ joys[deviceIndex] = SDL_JoystickOpen(deviceIndex);
+ SDL_JoystickEventState(SDL_ENABLE);
+ break;
-+ }
+ }
+- break;
+
+ case SDL_JOYDEVICEREMOVED:
+ {
@@ -291,8 +306,7 @@ https://github.com/hrydgard/ppsspp/commit/1b699363ca4d
+ joys[deviceIndex] = 0;
+ }
+ break;
- }
-- break;
++ }
}
}
@@ -310,7 +324,7 @@ https://github.com/hrydgard/ppsspp/commit/1b699363ca4d
- return it->second;
+ return -1;
}
---- SDL/SDLJoystick.h.orig 2017-03-30 12:14:27 UTC
+--- SDL/SDLJoystick.h.orig 2017-10-04 19:26:40 UTC
+++ SDL/SDLJoystick.h
@@ -1,9 +1,11 @@
#pragma once
@@ -324,7 +338,7 @@ https://github.com/hrydgard/ppsspp/commit/1b699363ca4d
#include "SDL_thread.h"
#endif
-@@ -21,11 +23,119 @@ public:
+@@ -21,11 +23,119 @@ class SDLJoystick{ (public)
void ProcessInput(SDL_Event &event);
private:
@@ -450,9 +464,9 @@ https://github.com/hrydgard/ppsspp/commit/1b699363ca4d
+
+ int getDeviceIndex(int instanceId);
};
---- ext/native/base/PCMain.cpp.orig 2017-03-30 12:14:27 UTC
+--- ext/native/base/PCMain.cpp.orig 2017-10-04 19:26:40 UTC
+++ ext/native/base/PCMain.cpp
-@@ -399,7 +399,7 @@ int main(int argc, char *argv[]) {
+@@ -428,7 +428,7 @@ int main(int argc, char *argv[]) {
NativeGetAppInfo(&app_name, &app_name_nice, &landscape, &version);
bool joystick_enabled = true;