diff options
author | jbeich <jbeich@FreeBSD.org> | 2015-05-28 06:54:08 +0800 |
---|---|---|
committer | jbeich <jbeich@FreeBSD.org> | 2015-05-28 06:54:08 +0800 |
commit | afa2b69c49c7fb453dcaf81968b95d0728ee0828 (patch) | |
tree | ba8c43879626515f264dbd9f3343dcc70d15b788 /emulators | |
parent | c26bfb4d910569fad3d700ef851beb396bf31d6c (diff) | |
download | freebsd-ports-graphics-afa2b69c49c7fb453dcaf81968b95d0728ee0828.tar.gz freebsd-ports-graphics-afa2b69c49c7fb453dcaf81968b95d0728ee0828.tar.zst freebsd-ports-graphics-afa2b69c49c7fb453dcaf81968b95d0728ee0828.zip |
emulators/ppsspp: dogfood some improvements in-review
- Use xdg-open to open links and cheat files
- Change OS name in compat reports: BSD -> FreeBSD
- Minor FakeJit fixes
GitHub: hrydgard/native#272, hrydgard/ppsspp#7772
Diffstat (limited to 'emulators')
-rw-r--r-- | emulators/ppsspp/Makefile | 2 | ||||
-rw-r--r-- | emulators/ppsspp/files/patch-CMakeLists.txt | 6 | ||||
-rw-r--r-- | emulators/ppsspp/files/patch-Common_FileUtil.cpp | 2 | ||||
-rw-r--r-- | emulators/ppsspp/files/patch-Core_HLE_sceRtc.cpp | 8 | ||||
-rw-r--r-- | emulators/ppsspp/files/patch-Core_MIPS_JitCommon_JitCommon.cpp | 20 | ||||
-rw-r--r-- | emulators/ppsspp/files/patch-Core_MemMap.cpp | 17 | ||||
-rw-r--r-- | emulators/ppsspp/files/patch-Core_Reporting.cpp | 28 | ||||
-rw-r--r-- | emulators/ppsspp/files/patch-UI_CwCheatScreen.cpp | 27 | ||||
-rw-r--r-- | emulators/ppsspp/files/patch-UI_DevScreens.cpp | 18 | ||||
-rw-r--r-- | emulators/ppsspp/files/patch-UI_NativeApp.cpp | 2 | ||||
-rw-r--r-- | emulators/ppsspp/files/patch-native_base_PCMain.cpp | 77 |
11 files changed, 175 insertions, 32 deletions
diff --git a/emulators/ppsspp/Makefile b/emulators/ppsspp/Makefile index 6d4f9f38e7d..6c19f4774aa 100644 --- a/emulators/ppsspp/Makefile +++ b/emulators/ppsspp/Makefile @@ -3,6 +3,7 @@ PORTNAME= ppsspp PORTVERSION= 1.0.1 DISTVERSIONPREFIX= v +PORTREVISION= 1 CATEGORIES= emulators .ifndef GITHUB_GROUPS MASTER_SITES= https://codeload.github.com/${GH_ACCOUNT}/${PORTNAME}-lang/tar.gz/52c757e?dummy=/:lang \ @@ -23,6 +24,7 @@ COMMENT= PSP emulator in C++ with dynarec JIT for x86, ARM, MIPS LICENSE= GPLv2 # or any later version LIB_DEPENDS= libavcodec.so:${PORTSDIR}/multimedia/ffmpeg +RUN_DEPENDS= xdg-open:${PORTSDIR}/devel/xdg-utils USE_GITHUB= yes .ifndef GITHUB_GROUPS diff --git a/emulators/ppsspp/files/patch-CMakeLists.txt b/emulators/ppsspp/files/patch-CMakeLists.txt index 2b8e8bfe50f..f18627ac98e 100644 --- a/emulators/ppsspp/files/patch-CMakeLists.txt +++ b/emulators/ppsspp/files/patch-CMakeLists.txt @@ -1,19 +1,17 @@ --- CMakeLists.txt.orig 2015-02-26 20:05:06 UTC +++ CMakeLists.txt -@@ -21,7 +21,11 @@ if(CMAKE_SYSTEM_PROCESSOR) +@@ -21,7 +21,9 @@ if(CMAKE_SYSTEM_PROCESSOR) if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^armv7") set(ARMV7 ON) endif() - elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^x86" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "i.86") -+ elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^amd64") -+ set(X86 ON) + elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^x86" OR + ${CMAKE_SYSTEM_PROCESSOR} MATCHES "^amd64" OR + ${CMAKE_SYSTEM_PROCESSOR} MATCHES "i.86") set(X86 ON) elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^mips") set(MIPS ON) -@@ -250,7 +254,7 @@ if(NOT MSVC) +@@ -250,7 +252,7 @@ if(NOT MSVC) if (NOT CMAKE_C_COMPILER_ID STREQUAL "Intel" AND NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") add_definitions(-Wno-psabi) endif() diff --git a/emulators/ppsspp/files/patch-Common_FileUtil.cpp b/emulators/ppsspp/files/patch-Common_FileUtil.cpp index 3eb8dca6213..74bcbcf1cb4 100644 --- a/emulators/ppsspp/files/patch-Common_FileUtil.cpp +++ b/emulators/ppsspp/files/patch-Common_FileUtil.cpp @@ -4,7 +4,7 @@ #include <stdlib.h> #endif -+#if defined(__DragonFly__) || defined(__FreeBSD__) ++#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +#include <sys/sysctl.h> // KERN_PROC_PATHNAME +#include <unistd.h> // getpid +#endif diff --git a/emulators/ppsspp/files/patch-Core_HLE_sceRtc.cpp b/emulators/ppsspp/files/patch-Core_HLE_sceRtc.cpp index cc230e43833..61c212a5039 100644 --- a/emulators/ppsspp/files/patch-Core_HLE_sceRtc.cpp +++ b/emulators/ppsspp/files/patch-Core_HLE_sceRtc.cpp @@ -5,7 +5,7 @@ u64 srcTick = Memory::Read_U64(tickLocalPtr); // TODO : Let the user select his timezone / daylight saving instead of taking system param ? -#if defined(__GLIBC__) || defined(BLACKBERRY) || defined(__SYMBIAN32__) -+#ifndef _MSC_VER ++#if !defined(_MSC_VER) && !defined(_AIX) && !defined(__sgi) && !defined(__hpux) time_t timezone = 0; tm *time = localtime(&timezone); srcTick -= time->tm_gmtoff*1000000ULL; @@ -19,7 +19,7 @@ u64 srcTick = Memory::Read_U64(tickUTCPtr); // TODO : Let the user select his timezone / daylight saving instead of taking system param ? -#if defined(__GLIBC__) || defined(BLACKBERRY) || defined(__SYMBIAN32__) -+#ifndef _MSC_VER ++#if !defined(_MSC_VER) && !defined(_AIX) && !defined(__sgi) && !defined(__hpux) time_t timezone = 0; tm *time = localtime(&timezone); srcTick += time->tm_gmtoff*1000000ULL; @@ -33,7 +33,7 @@ int tz_seconds; -#if defined(__GLIBC__) || defined(BLACKBERRY) || defined(__SYMBIAN32__) -+#ifndef _MSC_VER ++#if !defined(_MSC_VER) && !defined(_AIX) && !defined(__sgi) && !defined(__hpux) time_t timezone = 0; tm *time = localtime(&timezone); tz_seconds = time->tm_gmtoff; @@ -47,7 +47,7 @@ int tz_seconds; -#if defined(__GLIBC__) || defined(BLACKBERRY) || defined(__SYMBIAN32__) -+#ifndef _MSC_VER ++#if !defined(_MSC_VER) && !defined(_AIX) && !defined(__sgi) && !defined(__hpux) time_t timezone = 0; tm *time = localtime(&timezone); tz_seconds = time->tm_gmtoff; diff --git a/emulators/ppsspp/files/patch-Core_MIPS_JitCommon_JitCommon.cpp b/emulators/ppsspp/files/patch-Core_MIPS_JitCommon_JitCommon.cpp index 85522c710f4..98430c70e93 100644 --- a/emulators/ppsspp/files/patch-Core_MIPS_JitCommon_JitCommon.cpp +++ b/emulators/ppsspp/files/patch-Core_MIPS_JitCommon_JitCommon.cpp @@ -12,16 +12,12 @@ #endif void JitAt() { jit->Compile(currentMIPS->pc); -@@ -95,10 +97,12 @@ const char *ppsspp_resolver(struct ud*, - *offset = addr - (uint64_t)MIPSComp::jit->GetBasePtr(); - return "jitcode"; - } -+#if defined(_M_IX86) || defined(_M_X64) || defined(MIPS) - if (MIPSComp::jit->Asm().IsInSpace((u8 *)(intptr_t)addr)) { - *offset = addr - (uint64_t)MIPSComp::jit->Asm().GetBasePtr(); - return "dispatcher"; - } -+#endif - - return NULL; +@@ -76,7 +78,7 @@ std::vector<std::string> DisassembleArm2 + return lines; } + +-#ifndef ARM ++#if defined(_M_IX86) || defined(_M_X64) + + const char *ppsspp_resolver(struct ud*, + uint64_t addr, diff --git a/emulators/ppsspp/files/patch-Core_MemMap.cpp b/emulators/ppsspp/files/patch-Core_MemMap.cpp index cf5c3bc94b8..24aae019177 100644 --- a/emulators/ppsspp/files/patch-Core_MemMap.cpp +++ b/emulators/ppsspp/files/patch-Core_MemMap.cpp @@ -1,14 +1,11 @@ --- Core/MemMap.cpp.orig 2015-02-26 20:05:06 UTC +++ Core/MemMap.cpp -@@ -194,7 +194,11 @@ static bool Memory_TryBase(u32 flags) { - *view.out_ptr = *views[i - 1].out_ptr; - } else { - *view.out_ptr = (u8*)g_arena.CreateView( -+#ifdef _ARCH_32 - position, view.size, base + (view.virtual_address & MEMVIEW32_MASK)); -+#else -+ position, view.size, base + view.virtual_address); -+#endif - if (!*view.out_ptr) +@@ -185,7 +185,7 @@ static bool Memory_TryBase(u32 flags) { + if (!*view.out_ptr_low) goto bail; } +-#ifdef _M_X64 ++#if defined(_ARCH_64) + *view.out_ptr = (u8*)g_arena.CreateView( + position, view.size, base + view.virtual_address); + #else diff --git a/emulators/ppsspp/files/patch-Core_Reporting.cpp b/emulators/ppsspp/files/patch-Core_Reporting.cpp new file mode 100644 index 00000000000..ac4a7c693b8 --- /dev/null +++ b/emulators/ppsspp/files/patch-Core_Reporting.cpp @@ -0,0 +1,28 @@ +--- Core/Reporting.cpp.orig 2015-02-26 20:05:06 UTC ++++ Core/Reporting.cpp +@@ -189,8 +189,6 @@ namespace Reporting + return "Mac"; + #elif defined(__SYMBIAN32__) + return "Symbian"; +-#elif defined(__FreeBSD__) +- return "BSD"; + #elif defined(BLACKBERRY) + return "Blackberry"; + #elif defined(LOONGSON) +@@ -199,6 +197,16 @@ namespace Reporting + return "Nokia Maemo"; + #elif defined(__linux__) + return "Linux"; ++#elif defined(__Bitrig__) ++ return "Bitrig"; ++#elif defined(__DragonFly__) ++ return "DragonFly"; ++#elif defined(__FreeBSD__) ++ return "FreeBSD"; ++#elif defined(__NetBSD__) ++ return "NetBSD"; ++#elif defined(__OpenBSD__) ++ return "OpenBSD"; + #else + return "Unknown"; + #endif diff --git a/emulators/ppsspp/files/patch-UI_CwCheatScreen.cpp b/emulators/ppsspp/files/patch-UI_CwCheatScreen.cpp new file mode 100644 index 00000000000..bf827970acc --- /dev/null +++ b/emulators/ppsspp/files/patch-UI_CwCheatScreen.cpp @@ -0,0 +1,27 @@ +--- UI/CwCheatScreen.cpp.orig 2015-02-26 20:05:06 UTC ++++ UI/CwCheatScreen.cpp +@@ -72,7 +72,7 @@ void CwCheatScreen::CreateViews() { + leftColumn->Add(new Choice(d->T("Back")))->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack); + //leftColumn->Add(new Choice(k->T("Add Cheat")))->OnClick.Handle(this, &CwCheatScreen::OnAddCheat); + leftColumn->Add(new Choice(k->T("Import Cheats")))->OnClick.Handle(this, &CwCheatScreen::OnImportCheat); +-#if defined(_WIN32) || defined(__APPLE__) || defined(__linux__) ++#if !defined(MOBILE_DEVICE) + leftColumn->Add(new Choice(k->T("Edit Cheat File")))->OnClick.Handle(this, &CwCheatScreen::OnEditCheatFile); + #endif + leftColumn->Add(new Choice(k->T("Enable/Disable All")))->OnClick.Handle(this, &CwCheatScreen::OnEnableAll); +@@ -179,11 +179,11 @@ UI::EventReturn CwCheatScreen::OnEditChe + if (!retval) { + ERROR_LOG(BOOT, "Failed creating notepad process"); + } +-#elif defined(__APPLE__) || defined(__linux__) +-#if defined(__linux__) +- cheatFile = "xdg-open "; +-#elif defined(__APPLE__) ++#elif !defined(MOBILE_DEVICE) ++#if defined(__APPLE__) + cheatFile = "open "; ++#else ++ cheatFile = "xdg-open "; + #endif + cheatFile.append(activeCheatFile); + NOTICE_LOG(BOOT, "Launching %s", cheatFile.c_str()); diff --git a/emulators/ppsspp/files/patch-UI_DevScreens.cpp b/emulators/ppsspp/files/patch-UI_DevScreens.cpp new file mode 100644 index 00000000000..931cd745445 --- /dev/null +++ b/emulators/ppsspp/files/patch-UI_DevScreens.cpp @@ -0,0 +1,18 @@ +--- UI/DevScreens.cpp.orig 2015-02-26 20:05:06 UTC ++++ UI/DevScreens.cpp +@@ -612,12 +612,14 @@ void JitCompareScreen::UpdateDisasm() { + + #if defined(ARM) + std::vector<std::string> targetDis = DisassembleArm2(block->normalEntry, block->codeSize); +-#else ++#elif defined(_M_IX86) || defined(_M_X64) + std::vector<std::string> targetDis = DisassembleX86(block->normalEntry, block->codeSize); + #endif ++#if defined(ARM) || defined(_M_IX86) || defined(_M_X64) + for (size_t i = 0; i < targetDis.size(); i++) { + rightDisasm_->Add(new TextView(targetDis[i])); + } ++#endif + + int numMips = leftDisasm_->GetNumSubviews(); + int numHost = rightDisasm_->GetNumSubviews(); diff --git a/emulators/ppsspp/files/patch-UI_NativeApp.cpp b/emulators/ppsspp/files/patch-UI_NativeApp.cpp index 847da1bd6f5..200ffb22bcd 100644 --- a/emulators/ppsspp/files/patch-UI_NativeApp.cpp +++ b/emulators/ppsspp/files/patch-UI_NativeApp.cpp @@ -1,6 +1,6 @@ --- UI/NativeApp.cpp.orig 2015-02-26 20:05:06 UTC +++ UI/NativeApp.cpp -@@ -295,7 +295,7 @@ void NativeInit(int argc, const char *ar +@@ -291,7 +291,7 @@ void NativeInit(int argc, const char *ar #elif defined(BLACKBERRY) || defined(IOS) // Packed assets are included in app VFSRegister("", new DirectoryAssetReader(external_directory)); diff --git a/emulators/ppsspp/files/patch-native_base_PCMain.cpp b/emulators/ppsspp/files/patch-native_base_PCMain.cpp new file mode 100644 index 00000000000..ac230f5d443 --- /dev/null +++ b/emulators/ppsspp/files/patch-native_base_PCMain.cpp @@ -0,0 +1,77 @@ +--- native/base/PCMain.cpp.orig 2015-02-23 23:22:58 UTC ++++ native/base/PCMain.cpp +@@ -243,53 +243,53 @@ void System_SendMessage(const char *comm + } + + void LaunchBrowser(const char *url) { +-#ifdef _WIN32 ++#if defined(MOBILE_DEVICE) ++ ILOG("Would have gone to %s but LaunchBrowser is not implemented on this platform", url); ++#elif defined(_WIN32) + ShellExecute(NULL, "open", url, NULL, NULL, SW_SHOWNORMAL); +-#elif __linux__ ++#elif defined(__APPLE__) ++ std::string command = std::string("open ") + url; ++ system(command.c_str()); ++#else + std::string command = std::string("xdg-open ") + url; + int err = system(command.c_str()); + if (err) { + ILOG("Would have gone to %s but xdg-utils seems not to be installed", url) + } +-#elif __APPLE__ +- std::string command = std::string("open ") + url; +- system(command.c_str()); +-#else +- ILOG("Would have gone to %s but LaunchBrowser is not implemented on this platform", url); + #endif + } + + void LaunchMarket(const char *url) { +-#ifdef _WIN32 ++#if defined(MOBILE_DEVICE) ++ ILOG("Would have gone to %s but LaunchMarket is not implemented on this platform", url); ++#elif defined(_WIN32) + ShellExecute(NULL, "open", url, NULL, NULL, SW_SHOWNORMAL); +-#elif __linux__ ++#elif defined(__APPLE__) ++ std::string command = std::string("open ") + url; ++ system(command.c_str()); ++#else + std::string command = std::string("xdg-open ") + url; + int err = system(command.c_str()); + if (err) { + ILOG("Would have gone to %s but xdg-utils seems not to be installed", url) + } +-#elif __APPLE__ +- std::string command = std::string("open ") + url; +- system(command.c_str()); +-#else +- ILOG("Would have gone to %s but LaunchMarket is not implemented on this platform", url); + #endif + } + + void LaunchEmail(const char *email_address) { +-#ifdef _WIN32 ++#if defined(MOBILE_DEVICE) ++ ILOG("Would have opened your email client for %s but LaunchEmail is not implemented on this platform", email_address); ++#elif defined(_WIN32) + ShellExecute(NULL, "open", (std::string("mailto:") + email_address).c_str(), NULL, NULL, SW_SHOWNORMAL); +-#elif __linux__ ++#elif defined(__APPLE__) ++ std::string command = std::string("open mailto:") + email_address; ++ system(command.c_str()); ++#else + std::string command = std::string("xdg-email ") + email_address; + int err = system(command.c_str()); + if (err) { + ILOG("Would have gone to %s but xdg-utils seems not to be installed", email_address) + } +-#elif __APPLE__ +- std::string command = std::string("open mailto:") + email_address; +- system(command.c_str()); +-#else +- ILOG("Would have opened your email client for %s but LaunchEmail is not implemented on this platform", email_address); + #endif + } + |