summaryrefslogtreecommitdiff
path: root/emulators/ppsspp/files
diff options
context:
space:
mode:
authorJan Beich <jbeich@FreeBSD.org>2015-05-24 00:20:11 +0000
committerJan Beich <jbeich@FreeBSD.org>2015-05-24 00:20:11 +0000
commit35ddcdf82f693fe8dea3b404265941c6352e7cfc (patch)
tree153d6276eaf3044d848b4bede0a87c336e22fe4c /emulators/ppsspp/files
parent- Move textproc/rubygem-xslt to textproc/rubygem-ruby-xslt (diff)
emulators/ppsspp: add new port
PPSSPP is a PSP emulator written in C++. It translates PSP CPU instructions directly into optimized x86, x64 and ARM machine code, using JIT recompilers (dynarecs). PPSSPP can thus run on quite low-spec hardware, including stronger ARM-based phones and tablets, as long as there's OpenGL ES 2.0 support. http://www.ppsspp.org/development.html Requested by: RyanBram @ PCBSD forums Motivated by: review D2608 (thus .ifdefs)
Diffstat (limited to 'emulators/ppsspp/files')
-rw-r--r--emulators/ppsspp/files/patch-CMakeLists.txt20
-rw-r--r--emulators/ppsspp/files/patch-Common_CPUDetect.cpp21
-rw-r--r--emulators/ppsspp/files/patch-Common_FileUtil.cpp40
-rw-r--r--emulators/ppsspp/files/patch-Common_MemArena.cpp11
-rw-r--r--emulators/ppsspp/files/patch-Common_MemoryUtil.cpp47
-rw-r--r--emulators/ppsspp/files/patch-Common_StdMutex.h17
-rw-r--r--emulators/ppsspp/files/patch-Common_Swap.h18
-rw-r--r--emulators/ppsspp/files/patch-Core_FileSystems_tlzrc.cpp12
-rw-r--r--emulators/ppsspp/files/patch-Core_HLE_ReplaceTables.cpp11
-rw-r--r--emulators/ppsspp/files/patch-Core_HLE_sceRtc.cpp38
-rw-r--r--emulators/ppsspp/files/patch-Core_Loaders.cpp26
-rw-r--r--emulators/ppsspp/files/patch-Core_MIPS_JitCommon_JitCommon.cpp27
-rw-r--r--emulators/ppsspp/files/patch-Core_MIPS_fake_FakeJit.cpp11
-rw-r--r--emulators/ppsspp/files/patch-Core_MemMap.cpp14
-rw-r--r--emulators/ppsspp/files/patch-GPU_GLES_TextureScaler.cpp13
-rw-r--r--emulators/ppsspp/files/patch-Qt_PPSSPP.pro11
-rw-r--r--emulators/ppsspp/files/patch-Qt_Platform_linux.pri12
-rw-r--r--emulators/ppsspp/files/patch-Qt_Settings.pri12
-rw-r--r--emulators/ppsspp/files/patch-UI_NativeApp.cpp12
-rw-r--r--emulators/ppsspp/files/patch-native_base_basictypes.h11
-rw-r--r--emulators/ppsspp/files/patch-native_ext_cityhash_city.cpp11
-rw-r--r--emulators/ppsspp/files/patch-native_ext_stb__vorbis_stb__vorbis.c12
-rw-r--r--emulators/ppsspp/files/patch-native_file_file__util.cpp11
-rw-r--r--emulators/ppsspp/files/patch-native_net_http__client.h14
-rw-r--r--emulators/ppsspp/files/patch-native_net_http__headers.cpp26
-rw-r--r--emulators/ppsspp/files/patch-native_net_http__server.cpp10
-rw-r--r--emulators/ppsspp/files/patch-native_net_resolve.cpp14
27 files changed, 482 insertions, 0 deletions
diff --git a/emulators/ppsspp/files/patch-CMakeLists.txt b/emulators/ppsspp/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..b48e7359efa0
--- /dev/null
+++ b/emulators/ppsspp/files/patch-CMakeLists.txt
@@ -0,0 +1,20 @@
+--- CMakeLists.txt.orig 2015-02-26 20:05:06 UTC
++++ CMakeLists.txt
+@@ -21,6 +21,8 @@ if(CMAKE_SYSTEM_PROCESSOR)
+ if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^armv7")
+ set(ARMV7 ON)
+ endif()
++ elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^amd64")
++ set(X86 ON)
+ elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^x86" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "i.86")
+ set(X86 ON)
+ elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^mips")
+@@ -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()
+- add_definitions(-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D__BSD_VISIBLE=1)
++ add_definitions(-D_XOPEN_SOURCE=700 -D_XOPEN_SOURCE_EXTENDED -D__BSD_VISIBLE=1)
+ add_definitions(-D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64)
+ endif()
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
diff --git a/emulators/ppsspp/files/patch-Common_CPUDetect.cpp b/emulators/ppsspp/files/patch-Common_CPUDetect.cpp
new file mode 100644
index 000000000000..44ebc7c645a6
--- /dev/null
+++ b/emulators/ppsspp/files/patch-Common_CPUDetect.cpp
@@ -0,0 +1,21 @@
+--- Common/CPUDetect.cpp.orig 2015-02-26 20:05:06 UTC
++++ Common/CPUDetect.cpp
+@@ -62,17 +62,7 @@ static unsigned long long _xgetbv(unsign
+ #define _XCR_XFEATURE_ENABLED_MASK 0
+ #endif
+
+-#if defined __FreeBSD__
+-#include <sys/types.h>
+-#include <machine/cpufunc.h>
+-
+-void do_cpuidex(u32 regs[4], u32 cpuid_leaf, u32 ecxval) {
+- __cpuidex((int *)regs, cpuid_leaf, ecxval);
+-}
+-void do_cpuid(u32 regs[4], u32 cpuid_leaf) {
+- __cpuid((int *)regs, cpuid_leaf);
+-}
+-#elif !defined(MIPS)
++#if !defined(MIPS)
+
+ void do_cpuidex(u32 regs[4], u32 cpuid_leaf, u32 ecxval) {
+ #if defined(__i386__) && defined(__PIC__)
diff --git a/emulators/ppsspp/files/patch-Common_FileUtil.cpp b/emulators/ppsspp/files/patch-Common_FileUtil.cpp
new file mode 100644
index 000000000000..3eb8dca62131
--- /dev/null
+++ b/emulators/ppsspp/files/patch-Common_FileUtil.cpp
@@ -0,0 +1,40 @@
+--- Common/FileUtil.cpp.orig 2015-02-26 20:05:06 UTC
++++ Common/FileUtil.cpp
+@@ -35,6 +35,11 @@
+ #include <stdlib.h>
+ #endif
+
++#if defined(__DragonFly__) || defined(__FreeBSD__)
++#include <sys/sysctl.h> // KERN_PROC_PATHNAME
++#include <unistd.h> // getpid
++#endif
++
+ #if defined(__APPLE__)
+ #include <CoreFoundation/CFString.h>
+ #include <CoreFoundation/CFURL.h>
+@@ -703,7 +708,7 @@ const std::string &GetExeDirectory()
+ ExePath = program_path;
+ #endif
+
+-#elif (defined(__APPLE__) && !defined(IOS)) || defined(__linux__)
++#elif (defined(__APPLE__) && !defined(IOS)) || defined(__linux__) || defined(KERN_PROC_PATHNAME)
+ char program_path[4096];
+ uint32_t program_path_size = sizeof(program_path) - 1;
+
+@@ -711,6 +716,16 @@ const std::string &GetExeDirectory()
+ if (readlink("/proc/self/exe", program_path, 4095) > 0)
+ #elif defined(__APPLE__) && !defined(IOS)
+ if (_NSGetExecutablePath(program_path, &program_path_size) == 0)
++#elif defined(KERN_PROC_PATHNAME)
++ int mib[4] = {
++ CTL_KERN,
++ KERN_PROC,
++ KERN_PROC_PATHNAME,
++ getpid()
++ };
++ size_t sz = program_path_size;
++
++ if (sysctl(mib, 4, program_path, &sz, NULL, 0) == 0)
+ #else
+ #error Unmatched ifdef.
+ #endif
diff --git a/emulators/ppsspp/files/patch-Common_MemArena.cpp b/emulators/ppsspp/files/patch-Common_MemArena.cpp
new file mode 100644
index 000000000000..28646cda8c12
--- /dev/null
+++ b/emulators/ppsspp/files/patch-Common_MemArena.cpp
@@ -0,0 +1,11 @@
+--- Common/MemArena.cpp.orig 2015-02-26 20:05:06 UTC
++++ Common/MemArena.cpp
+@@ -189,7 +189,7 @@ void *MemArena::CreateView(s64 offset, s
+ // Do not sync memory to underlying file. Linux has this by default.
+ #ifdef BLACKBERRY
+ MAP_NOSYNCFILE |
+-#elif defined(__FreeBSD__)
++#elif defined(__DragonFly__) || defined(__FreeBSD__)
+ MAP_NOSYNC |
+ #endif
+ ((base == 0) ? 0 : MAP_FIXED), fd, offset);
diff --git a/emulators/ppsspp/files/patch-Common_MemoryUtil.cpp b/emulators/ppsspp/files/patch-Common_MemoryUtil.cpp
new file mode 100644
index 000000000000..beb8e563d611
--- /dev/null
+++ b/emulators/ppsspp/files/patch-Common_MemoryUtil.cpp
@@ -0,0 +1,47 @@
+--- Common/MemoryUtil.cpp.orig 2015-02-26 20:05:06 UTC
++++ Common/MemoryUtil.cpp
+@@ -49,6 +49,13 @@ static SYSTEM_INFO sys_info;
+ #define round_page(x) ((((uintptr_t)(x)) + PAGE_MASK) & ~(PAGE_MASK))
+ #endif
+
++#if defined(__FreeBSD__)
++/* setrlimit(2) */
++#include <sys/types.h>
++#include <sys/time.h>
++#include <sys/resource.h>
++#endif
++
+ #ifdef __SYMBIAN32__
+ #include <e32std.h>
+ #define CODECHUNK_SIZE 1024*1024*20
+@@ -142,6 +149,21 @@ void* AllocateExecutableMemory(size_t si
+ map_hint = (char*)round_page(&hint_location) - 0x20000000; // 0.5gb lower than our approximate location
+ else
+ map_hint = (char*)0x20000000; // 0.5GB mark in memory
++
++#if defined(__FreeBSD__)
++ // XXX Fix maximum data segment size (data + BSS + heap) to 256 MB.
++ // This allows avoiding calling mmap(2) with MAP_FIXED.
++ // On FreeBSD, without lowering this limit, calling mmap(2)
++ // without MAP_FIXED will result in getting an address just
++ // beyond maximum data segment size which will be far beyond
++ // the desired 2 GB.
++ struct rlimit limit;
++ limit.rlim_cur = 0x10000000; // 256 MB
++ limit.rlim_max = 0x10000000;
++ if(setrlimit(RLIMIT_DATA, &limit) != 0) {
++ PanicAlert("Failed to lower maximum data segment size");
++ }
++#endif
+ }
+ else if (exec && (uintptr_t) map_hint > 0xFFFFFFFFULL)
+ {
+@@ -160,7 +182,7 @@ void* AllocateExecutableMemory(size_t si
+ // printf("Mapped executable memory at %p (size %ld)\n", ptr,
+ // (unsigned long)size);
+
+-#if defined(__FreeBSD__)
++#if !defined(_WIN32) && !defined(__SYMBIAN32__)
+ if (ptr == MAP_FAILED)
+ {
+ ptr = NULL;
diff --git a/emulators/ppsspp/files/patch-Common_StdMutex.h b/emulators/ppsspp/files/patch-Common_StdMutex.h
new file mode 100644
index 000000000000..c718e1a34581
--- /dev/null
+++ b/emulators/ppsspp/files/patch-Common_StdMutex.h
@@ -0,0 +1,17 @@
+--- Common/StdMutex.h.orig 2015-02-26 20:05:06 UTC
++++ Common/StdMutex.h
+@@ -4,12 +4,10 @@
+ #define GCC_VER(x,y,z) ((x) * 10000 + (y) * 100 + (z))
+ #define GCC_VERSION GCC_VER(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)
+
+-// Note: __MAC_10_7 is defined on 10.7+.
+-#if (GCC_VERSION >= GCC_VER(4,4,0) && __GXX_EXPERIMENTAL_CXX0X__ || defined(__APPLE__)) \
+-/* GCC 4.4 provides <mutex>, except on these platforms: */ \
+- && !defined(ANDROID) && !defined(__SYMBIAN32__) && !defined(MACGNUSTD)
++#if __cplusplus >= 201103L
+ #include <mutex>
+ #else
++#warning "partial <mutex> implementation"
+
+ // partial <mutex> implementation for win32/pthread
+ #include <algorithm>
diff --git a/emulators/ppsspp/files/patch-Common_Swap.h b/emulators/ppsspp/files/patch-Common_Swap.h
new file mode 100644
index 000000000000..1b3dce6d5d62
--- /dev/null
+++ b/emulators/ppsspp/files/patch-Common_Swap.h
@@ -0,0 +1,18 @@
+--- Common/Swap.h.orig 2015-02-26 20:05:06 UTC
++++ Common/Swap.h
+@@ -71,6 +71,15 @@ inline unsigned long long bswap64(unsign
+ inline unsigned int bswap32(unsigned int x) { return __loadwordbytereverse(0, &x); }
+ inline unsigned short bswap16(unsigned short x) { return __loadshortbytereverse(0, &x); }
+ #endif
++#elif defined(__DragonFly__) || defined(__FreeBSD__) || \
++ defined(__NetBSD__) || defined(__OpenBSD__)
++#include <sys/endian.h>
++# ifdef __OpenBSD__
++#define bswap16 swap16
++#define bswap32 swap32
++#define bswap64 swap64
++#define
++# endif
+ #else
+ // TODO: speedup
+ inline unsigned short bswap16(unsigned short x) { return (x << 8) | (x >> 8); }
diff --git a/emulators/ppsspp/files/patch-Core_FileSystems_tlzrc.cpp b/emulators/ppsspp/files/patch-Core_FileSystems_tlzrc.cpp
new file mode 100644
index 000000000000..050af872053f
--- /dev/null
+++ b/emulators/ppsspp/files/patch-Core_FileSystems_tlzrc.cpp
@@ -0,0 +1,12 @@
+--- Core/FileSystems/tlzrc.cpp.orig 2015-02-26 20:05:06 UTC
++++ Core/FileSystems/tlzrc.cpp
+@@ -22,9 +22,6 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#if !defined(__SYMBIAN32__) && !defined(__MAC_10_6)
+-#include <malloc.h>
+-#endif
+
+ #include "Common.h"
+
diff --git a/emulators/ppsspp/files/patch-Core_HLE_ReplaceTables.cpp b/emulators/ppsspp/files/patch-Core_HLE_ReplaceTables.cpp
new file mode 100644
index 000000000000..82f9c8612c09
--- /dev/null
+++ b/emulators/ppsspp/files/patch-Core_HLE_ReplaceTables.cpp
@@ -0,0 +1,11 @@
+--- Core/HLE/ReplaceTables.cpp.orig 2015-02-26 20:05:06 UTC
++++ Core/HLE/ReplaceTables.cpp
+@@ -1007,6 +1007,8 @@ static int Hook_photokano_download_frame
+ #define JITFUNC(f) (&MIPSComp::Jit::f)
+ #elif defined(MIPS)
+ #define JITFUNC(f) (&MIPSComp::Jit::f)
++#else
++#define JITFUNC(f) (&MIPSComp::FakeJit::f)
+ #endif
+
+ // Can either replace with C functions or functions emitted in Asm/ArmAsm.
diff --git a/emulators/ppsspp/files/patch-Core_HLE_sceRtc.cpp b/emulators/ppsspp/files/patch-Core_HLE_sceRtc.cpp
new file mode 100644
index 000000000000..058a426595f5
--- /dev/null
+++ b/emulators/ppsspp/files/patch-Core_HLE_sceRtc.cpp
@@ -0,0 +1,38 @@
+--- Core/HLE/sceRtc.cpp.orig 2015-02-26 20:05:06 UTC
++++ Core/HLE/sceRtc.cpp
+@@ -459,7 +459,7 @@ static int sceRtcConvertLocalTimeToUTC(u
+ {
+ 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__)
++#if 1 // #else block uses undeclared `timezone'
+ time_t timezone = 0;
+ tm *time = localtime(&timezone);
+ srcTick -= time->tm_gmtoff*1000000ULL;
+@@ -482,7 +482,7 @@ static int sceRtcConvertUtcToLocalTime(u
+ {
+ 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__)
++#if 1 // #else block uses undeclared `timezone'
+ time_t timezone = 0;
+ tm *time = localtime(&timezone);
+ srcTick += time->tm_gmtoff*1000000ULL;
+@@ -1015,7 +1015,7 @@ static int sceRtcFormatRFC2822LocalTime(
+ }
+
+ int tz_seconds;
+-#if defined(__GLIBC__) || defined(BLACKBERRY) || defined(__SYMBIAN32__)
++#if 1 // #else block uses undeclared `timezone'
+ time_t timezone = 0;
+ tm *time = localtime(&timezone);
+ tz_seconds = time->tm_gmtoff;
+@@ -1050,7 +1050,7 @@ static int sceRtcFormatRFC3339LocalTime(
+ }
+
+ int tz_seconds;
+-#if defined(__GLIBC__) || defined(BLACKBERRY) || defined(__SYMBIAN32__)
++#if 1 // #else block uses undeclared `timezone'
+ time_t timezone = 0;
+ tm *time = localtime(&timezone);
+ tz_seconds = time->tm_gmtoff;
diff --git a/emulators/ppsspp/files/patch-Core_Loaders.cpp b/emulators/ppsspp/files/patch-Core_Loaders.cpp
new file mode 100644
index 000000000000..de1062fb80b9
--- /dev/null
+++ b/emulators/ppsspp/files/patch-Core_Loaders.cpp
@@ -0,0 +1,26 @@
+--- Core/Loaders.cpp.orig 2015-02-26 20:05:06 UTC
++++ Core/Loaders.cpp
+@@ -15,6 +15,9 @@
+ // Official git repository and contact information can be found at
+ // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
+
++// XXX ports/193528
++#define _GLIBCXX_USE_C99 1
++
+ #include <algorithm>
+ #include <cstdio>
+
+@@ -310,12 +313,7 @@ HTTPFileLoader::HTTPFileLoader(const std
+ size_pos = header.find_first_not_of(' ', size_pos);
+ }
+ if (size_pos != header.npos) {
+- // TODO: Find a way to get this to work right on Symbian?
+-#ifndef __SYMBIAN32__
+- filesize_ = atoll(&header[size_pos]);
+-#else
+- filesize_ = atoi(&header[size_pos]);
+-#endif
++ filesize_ = std::atoll(&header[size_pos]);
+ }
+ }
+ if (startsWithNoCase(header, "Accept-Ranges:")) {
diff --git a/emulators/ppsspp/files/patch-Core_MIPS_JitCommon_JitCommon.cpp b/emulators/ppsspp/files/patch-Core_MIPS_JitCommon_JitCommon.cpp
new file mode 100644
index 000000000000..85522c710f45
--- /dev/null
+++ b/emulators/ppsspp/files/patch-Core_MIPS_JitCommon_JitCommon.cpp
@@ -0,0 +1,27 @@
+--- Core/MIPS/JitCommon/JitCommon.cpp.orig 2015-02-26 20:05:06 UTC
++++ Core/MIPS/JitCommon/JitCommon.cpp
+@@ -27,8 +27,10 @@
+ namespace MIPSComp {
+ #if defined(ARM)
+ ArmJit *jit;
+-#else
++#elif defined(_M_IX86) || defined(_M_X64) || defined(MIPS)
+ Jit *jit;
++#else
++ FakeJit *jit;
+ #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;
+ }
diff --git a/emulators/ppsspp/files/patch-Core_MIPS_fake_FakeJit.cpp b/emulators/ppsspp/files/patch-Core_MIPS_fake_FakeJit.cpp
new file mode 100644
index 000000000000..426609524329
--- /dev/null
+++ b/emulators/ppsspp/files/patch-Core_MIPS_fake_FakeJit.cpp
@@ -0,0 +1,11 @@
+--- Core/MIPS/fake/FakeJit.cpp.orig 2015-02-26 20:05:06 UTC
++++ Core/MIPS/fake/FakeJit.cpp
+@@ -138,7 +138,7 @@ void FakeJit::RunLoopUntil(u64 globaltic
+ ((void (*)())enterCode)();
+ }
+
+-const u8 *FakeJit::DoFakeJit(u32 em_address, FakeJitBlock *b)
++const u8 *FakeJit::DoJit(u32 em_address, JitBlock *b)
+ {
+ return b->normalEntry;
+ }
diff --git a/emulators/ppsspp/files/patch-Core_MemMap.cpp b/emulators/ppsspp/files/patch-Core_MemMap.cpp
new file mode 100644
index 000000000000..cf5c3bc94b84
--- /dev/null
+++ b/emulators/ppsspp/files/patch-Core_MemMap.cpp
@@ -0,0 +1,14 @@
+--- 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)
+ goto bail;
+ }
diff --git a/emulators/ppsspp/files/patch-GPU_GLES_TextureScaler.cpp b/emulators/ppsspp/files/patch-GPU_GLES_TextureScaler.cpp
new file mode 100644
index 000000000000..aa1c9c390c5e
--- /dev/null
+++ b/emulators/ppsspp/files/patch-GPU_GLES_TextureScaler.cpp
@@ -0,0 +1,13 @@
+--- GPU/GLES/TextureScaler.cpp.orig 2015-02-26 20:05:06 UTC
++++ GPU/GLES/TextureScaler.cpp
+@@ -34,8 +34,8 @@
+ #include <stdlib.h>
+ #include <math.h>
+
+-#if _M_SSE >= 0x402
+-#include <nmmintrin.h>
++#if _M_SSE >= 0x401
++#include <smmintrin.h>
+ #endif
+
+ // Report the time and throughput for each larger scaling operation in the log
diff --git a/emulators/ppsspp/files/patch-Qt_PPSSPP.pro b/emulators/ppsspp/files/patch-Qt_PPSSPP.pro
new file mode 100644
index 000000000000..3453be53e489
--- /dev/null
+++ b/emulators/ppsspp/files/patch-Qt_PPSSPP.pro
@@ -0,0 +1,11 @@
+--- Qt/PPSSPP.pro.orig 2015-02-26 20:05:06 UTC
++++ Qt/PPSSPP.pro
+@@ -91,7 +91,7 @@ mobile_platform {
+ INCLUDEPATH += $$P/Qt $$P/Qt/Debugger
+
+ # Creating translations should be done by Qt, really
+- LREL_TOOL = lrelease
++ isEmpty(LREL_TOOL): LREL_TOOL = lrelease
+ # Grab all possible directories (win32/unix)
+ win32: PATHS = $$split($$(PATH), ;)
+ else: PATHS = $$split($$(PATH), :)
diff --git a/emulators/ppsspp/files/patch-Qt_Platform_linux.pri b/emulators/ppsspp/files/patch-Qt_Platform_linux.pri
new file mode 100644
index 000000000000..dc5f53d8ac48
--- /dev/null
+++ b/emulators/ppsspp/files/patch-Qt_Platform_linux.pri
@@ -0,0 +1,12 @@
+--- Qt/Platform/linux.pri.orig 2015-02-26 20:05:06 UTC
++++ Qt/Platform/linux.pri
+@@ -6,7 +6,8 @@
+ }
+
+ # Executable
+- LIBS += -ldl -lrt
++ LIBS += $$QMAKE_LIBS_DYNLOAD
++ linux-*|hpux-*|solaris-*: LIBS += -lrt
+
+ # Packaging
+ icon16.files = $$P/assets/unix-icons/hicolor/16x16/apps/ppsspp.png
diff --git a/emulators/ppsspp/files/patch-Qt_Settings.pri b/emulators/ppsspp/files/patch-Qt_Settings.pri
new file mode 100644
index 000000000000..45fc45a7e841
--- /dev/null
+++ b/emulators/ppsspp/files/patch-Qt_Settings.pri
@@ -0,0 +1,12 @@
+--- Qt/Settings.pri.orig 2015-02-26 20:05:06 UTC
++++ Qt/Settings.pri
+@@ -12,7 +12,8 @@ RCC_DIR = $$CONFIG_DIR/.rcc/$$TARGET
+ QMAKE_CLEAN += -r $$OBJECTS_DIR $$MOC_DIR $$UI_DIR $$RCC_DIR
+
+ P = $$_PRO_FILE_PWD_/..
+-INCLUDEPATH += $$P/ext/zlib $$P/Common
++INCLUDEPATH += $$P/Common
++contains(QT_CONFIG, no-zlib): INCLUDEPATH += $$P/ext/zlib
+
+ # Work out arch name
+ include(Platform/ArchDetection.pri)
diff --git a/emulators/ppsspp/files/patch-UI_NativeApp.cpp b/emulators/ppsspp/files/patch-UI_NativeApp.cpp
new file mode 100644
index 000000000000..0e6cca63f687
--- /dev/null
+++ b/emulators/ppsspp/files/patch-UI_NativeApp.cpp
@@ -0,0 +1,12 @@
+--- UI/NativeApp.cpp.orig 2015-02-26 20:05:06 UTC
++++ UI/NativeApp.cpp
+@@ -291,7 +291,8 @@ void NativeInit(int argc, const char *ar
+ #elif defined(BLACKBERRY) || defined(IOS)
+ // Packed assets are included in app
+ VFSRegister("", new DirectoryAssetReader(external_directory));
+-#elif defined(__APPLE__) || (defined(__linux__) && !defined(ANDROID))
++#elif defined(__APPLE__) || (defined(__linux__) && !defined(ANDROID)) || \
++ defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ VFSRegister("", new DirectoryAssetReader((File::GetExeDirectory() + "assets/").c_str()));
+ VFSRegister("", new DirectoryAssetReader((File::GetExeDirectory()).c_str()));
+ VFSRegister("", new DirectoryAssetReader("/usr/share/ppsspp/assets/"));
diff --git a/emulators/ppsspp/files/patch-native_base_basictypes.h b/emulators/ppsspp/files/patch-native_base_basictypes.h
new file mode 100644
index 000000000000..0c2f624b03a9
--- /dev/null
+++ b/emulators/ppsspp/files/patch-native_base_basictypes.h
@@ -0,0 +1,11 @@
+--- native/base/basictypes.h.orig 2015-02-23 23:22:58 UTC
++++ native/base/basictypes.h
+@@ -87,7 +87,7 @@ inline uint64 swap64(uint64 _data) {retu
+ inline uint16 swap16(uint16 _data) {return bswap_16(_data);}
+ inline uint32 swap32(uint32 _data) {return bswap_32(_data);}
+ inline uint64 swap64(uint64 _data) {return bswap_64(_data);}
+-#elif defined(__FreeBSD__)
++#elif defined(__DragonFly__) || defined(__FreeBSD__)
+ #include <sys/endian.h>
+ inline uint16 swap16(uint16 _data) {return bswap16(_data);}
+ inline uint32 swap32(uint32 _data) {return bswap32(_data);}
diff --git a/emulators/ppsspp/files/patch-native_ext_cityhash_city.cpp b/emulators/ppsspp/files/patch-native_ext_cityhash_city.cpp
new file mode 100644
index 000000000000..6ec7e348c636
--- /dev/null
+++ b/emulators/ppsspp/files/patch-native_ext_cityhash_city.cpp
@@ -0,0 +1,11 @@
+--- native/ext/cityhash/city.cpp.orig 2015-02-23 23:22:58 UTC
++++ native/ext/cityhash/city.cpp
+@@ -68,7 +68,7 @@ static uint32 UNALIGNED_LOAD32(const cha
+ #define bswap_32(x) BSWAP_32(x)
+ #define bswap_64(x) BSWAP_64(x)
+
+-#elif defined(__FreeBSD__)
++#elif defined(__DragonFly__) || defined(__FreeBSD__)
+ #include <sys/endian.h>
+ #define bswap_32(x) bswap32(x)
+ #define bswap_64(x) bswap64(x)
diff --git a/emulators/ppsspp/files/patch-native_ext_stb__vorbis_stb__vorbis.c b/emulators/ppsspp/files/patch-native_ext_stb__vorbis_stb__vorbis.c
new file mode 100644
index 000000000000..e123418139a9
--- /dev/null
+++ b/emulators/ppsspp/files/patch-native_ext_stb__vorbis_stb__vorbis.c
@@ -0,0 +1,12 @@
+--- native/ext/stb_vorbis/stb_vorbis.c.orig 2015-02-23 23:22:58 UTC
++++ native/ext/stb_vorbis/stb_vorbis.c
+@@ -15,7 +15,8 @@
+ #pragma warning (disable:4996)
+ #pragma warning (disable:4244)
+ #include <malloc.h>
+-#elif !defined(__SYMBIAN32__)
++#elif !defined(__SYMBIAN32__) && !defined(__DragonFly__) && \
++ !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
+ #include <alloca.h>
+ #endif
+
diff --git a/emulators/ppsspp/files/patch-native_file_file__util.cpp b/emulators/ppsspp/files/patch-native_file_file__util.cpp
new file mode 100644
index 000000000000..fd5f0b073ab9
--- /dev/null
+++ b/emulators/ppsspp/files/patch-native_file_file__util.cpp
@@ -0,0 +1,11 @@
+--- native/file/file_util.cpp.orig 2015-02-23 23:22:58 UTC
++++ native/file/file_util.cpp
+@@ -25,7 +25,7 @@
+ #include "file/file_util.h"
+ #include "util/text/utf8.h"
+
+-#if defined(__FreeBSD__) || defined(__APPLE__)
++#if !defined(__linux__) && !defined(__SYMBIAN32__)
+ #define stat64 stat
+ #endif
+
diff --git a/emulators/ppsspp/files/patch-native_net_http__client.h b/emulators/ppsspp/files/patch-native_net_http__client.h
new file mode 100644
index 000000000000..2174632d576a
--- /dev/null
+++ b/emulators/ppsspp/files/patch-native_net_http__client.h
@@ -0,0 +1,14 @@
+--- native/net/http_client.h.orig 2015-02-23 23:22:58 UTC
++++ native/net/http_client.h
+@@ -11,11 +11,8 @@
+ #define NOMINMAX
+ #include <winsock2.h>
+ #else
+-#if defined(__FreeBSD__) || defined(__SYMBIAN32__)
+ #include <netinet/in.h>
+-#else
+ #include <arpa/inet.h>
+-#endif
+ #include <sys/socket.h>
+ #include <netdb.h>
+ #endif
diff --git a/emulators/ppsspp/files/patch-native_net_http__headers.cpp b/emulators/ppsspp/files/patch-native_net_http__headers.cpp
new file mode 100644
index 000000000000..17a0561ca1bf
--- /dev/null
+++ b/emulators/ppsspp/files/patch-native_net_http__headers.cpp
@@ -0,0 +1,26 @@
+--- native/net/http_headers.cpp.orig 2015-02-23 23:22:58 UTC
++++ native/net/http_headers.cpp
+@@ -1,11 +1,5 @@
+ #include "net/http_headers.h"
+
+-#ifdef _WIN32
+-
+-#include <winsock2.h> // for timeval
+-
+-#endif
+-
+ #include <stdio.h>
+ #include <stdlib.h>
+
+@@ -132,11 +126,6 @@ int RequestHeader::ParseHttpHeader(const
+ }
+
+ void RequestHeader::ParseHeaders(int fd) {
+- // Get the request, with a timeout.
+- struct ::timeval tv;
+- tv.tv_sec = 5;
+- tv.tv_usec = 0;
+-
+ int line_count = 0;
+ // Loop through request headers.
+ while (true) {
diff --git a/emulators/ppsspp/files/patch-native_net_http__server.cpp b/emulators/ppsspp/files/patch-native_net_http__server.cpp
new file mode 100644
index 000000000000..fc1e0bb7bbb2
--- /dev/null
+++ b/emulators/ppsspp/files/patch-native_net_http__server.cpp
@@ -0,0 +1,10 @@
+--- native/net/http_server.cpp.orig 2015-02-23 23:22:58 UTC
++++ native/net/http_server.cpp
+@@ -12,6 +12,7 @@
+ #include <sys/types.h> /* socket types */
+ #include <sys/wait.h> /* for waitpid() */
+ #include <arpa/inet.h> /* inet (3) funtions */
++#include <netinet/in.h> /* struct sockaddr_in */
+ #include <unistd.h> /* misc. UNIX functions */
+
+ #endif
diff --git a/emulators/ppsspp/files/patch-native_net_resolve.cpp b/emulators/ppsspp/files/patch-native_net_resolve.cpp
new file mode 100644
index 000000000000..d142215d7a05
--- /dev/null
+++ b/emulators/ppsspp/files/patch-native_net_resolve.cpp
@@ -0,0 +1,14 @@
+--- native/net/resolve.cpp.orig 2015-02-23 23:22:58 UTC
++++ native/net/resolve.cpp
+@@ -14,11 +14,8 @@
+ #undef min
+ #undef max
+ #else
+-#if defined(__FreeBSD__)
+ #include <netinet/in.h>
+-#else
+ #include <arpa/inet.h>
+-#endif
+ #include <netdb.h>
+ #include <sys/socket.h>
+ #include <unistd.h>