Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 May 2015 00:20:12 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r387239 - in head/emulators: . ppsspp ppsspp/files
Message-ID:  <201505240020.t4O0KC5h094690@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Sun May 24 00:20:11 2015
New Revision: 387239
URL: https://svnweb.freebsd.org/changeset/ports/387239

Log:
  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)

Added:
  head/emulators/ppsspp/
  head/emulators/ppsspp/Makefile   (contents, props changed)
  head/emulators/ppsspp/distinfo   (contents, props changed)
  head/emulators/ppsspp/files/
  head/emulators/ppsspp/files/patch-CMakeLists.txt   (contents, props changed)
  head/emulators/ppsspp/files/patch-Common_CPUDetect.cpp   (contents, props changed)
  head/emulators/ppsspp/files/patch-Common_FileUtil.cpp   (contents, props changed)
  head/emulators/ppsspp/files/patch-Common_MemArena.cpp   (contents, props changed)
  head/emulators/ppsspp/files/patch-Common_MemoryUtil.cpp
     - copied, changed from r387191, head/emulators/dolphin-emu/files/patch-Source-Core-Common-Src-MemoryUtil.cpp
  head/emulators/ppsspp/files/patch-Common_StdMutex.h   (contents, props changed)
  head/emulators/ppsspp/files/patch-Common_Swap.h   (contents, props changed)
  head/emulators/ppsspp/files/patch-Core_FileSystems_tlzrc.cpp   (contents, props changed)
  head/emulators/ppsspp/files/patch-Core_HLE_ReplaceTables.cpp   (contents, props changed)
  head/emulators/ppsspp/files/patch-Core_HLE_sceRtc.cpp   (contents, props changed)
  head/emulators/ppsspp/files/patch-Core_Loaders.cpp   (contents, props changed)
  head/emulators/ppsspp/files/patch-Core_MIPS_JitCommon_JitCommon.cpp   (contents, props changed)
  head/emulators/ppsspp/files/patch-Core_MIPS_fake_FakeJit.cpp   (contents, props changed)
  head/emulators/ppsspp/files/patch-Core_MemMap.cpp   (contents, props changed)
  head/emulators/ppsspp/files/patch-GPU_GLES_TextureScaler.cpp   (contents, props changed)
  head/emulators/ppsspp/files/patch-Qt_PPSSPP.pro   (contents, props changed)
  head/emulators/ppsspp/files/patch-Qt_Platform_linux.pri   (contents, props changed)
  head/emulators/ppsspp/files/patch-Qt_Settings.pri   (contents, props changed)
  head/emulators/ppsspp/files/patch-UI_NativeApp.cpp   (contents, props changed)
  head/emulators/ppsspp/files/patch-native_base_basictypes.h   (contents, props changed)
  head/emulators/ppsspp/files/patch-native_ext_cityhash_city.cpp   (contents, props changed)
  head/emulators/ppsspp/files/patch-native_ext_stb__vorbis_stb__vorbis.c   (contents, props changed)
  head/emulators/ppsspp/files/patch-native_file_file__util.cpp   (contents, props changed)
  head/emulators/ppsspp/files/patch-native_net_http__client.h   (contents, props changed)
  head/emulators/ppsspp/files/patch-native_net_http__headers.cpp   (contents, props changed)
  head/emulators/ppsspp/files/patch-native_net_http__server.cpp   (contents, props changed)
  head/emulators/ppsspp/files/patch-native_net_resolve.cpp   (contents, props changed)
  head/emulators/ppsspp/pkg-descr   (contents, props changed)
  head/emulators/ppsspp/pkg-plist   (contents, props changed)
Modified:
  head/emulators/Makefile

Modified: head/emulators/Makefile
==============================================================================
--- head/emulators/Makefile	Sun May 24 00:15:58 2015	(r387238)
+++ head/emulators/Makefile	Sun May 24 00:20:11 2015	(r387239)
@@ -109,6 +109,7 @@
     SUBDIR += pcsxr
     SUBDIR += pearpc
     SUBDIR += pipelight
+    SUBDIR += ppsspp
     SUBDIR += q4wine
     SUBDIR += qemu
     SUBDIR += qemu-devel

Added: head/emulators/ppsspp/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/Makefile	Sun May 24 00:20:11 2015	(r387239)
@@ -0,0 +1,110 @@
+# $FreeBSD$
+
+PORTNAME=	ppsspp
+PORTVERSION=	1.0.1
+DISTVERSIONPREFIX=	v
+CATEGORIES=	emulators
+.ifndef GITHUB_GROUPS
+MASTER_SITES=	https://codeload.github.com/${GH_ACCOUNT}/${PORTNAME}-lang/tar.gz/52c757e?dummy=/:lang \
+		https://codeload.github.com/${GH_ACCOUNT}/native/tar.gz/52ce9c1?dummy=/:native \
+		https://codeload.github.com/Kingcom/armips/tar.gz/a0b878f?dummy=/:ext_armips
+DISTFILES=	${DISTNAME}${EXTRACT_SUFX}:DEFAULT \
+		${GH_ACCOUNT}-${PORTNAME}-lang-52c757e_GH${_GITHUB_REV}${EXTRACT_SUFX}:lang \
+		${GH_ACCOUNT}-native-52ce9c1_GH${_GITHUB_REV}${EXTRACT_SUFX}:native \
+		Kingcom-armips-a0b878f_GH${_GITHUB_REV}${EXTRACT_SUFX}:ext_armips
+.endif
+
+PATCH_SITES=	https://projects.archlinux.org/svntogit/community.git/plain/trunk/
+PATCHFILES=	${PORTNAME}-ffmpeg.patch?id=f2b9251:-p1
+
+MAINTAINER=	jbeich@FreeBSD.org
+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
+
+USE_GITHUB=	yes
+.ifndef GITHUB_GROUPS
+GH_ACCOUNT=	hrydgard
+.else # XXX D2608 version, groups are converted to paths later
+GH_ACCOUNT=	hrydgard:DEFAULT,lang,native Kingcom:ext_armips
+GH_PROJECT=	${PORTNAME}-lang:lang native:native armips:ext_armips
+GH_TAGNAME=	52c757e:lang 52ce9c1:native a0b878f:ext_armips
+.endif
+
+USES=		compiler:c++11-lib pkgconfig
+USE_GL=		glu
+USE_SDL=	sdl2 # joystick
+QMAKE_SOURCE_PATH=	${WRKSRC}/Qt/PPSSPPQt.pro
+QMAKE_ARGS=	CONFIG+="system_ffmpeg" LREL_TOOL="${LRELEASE}"
+NINJA_VERBOSE=	yes
+INSTALLS_ICONS=	yes
+
+OPTIONS_DEFAULT=QT5
+OPTIONS_SINGLE=	GUI
+OPTIONS_SINGLE_GUI=	QT4 QT5 SDL
+
+QT4_USES=	qmake:outsource
+QT4_USE=	QT4=qmake_build,moc_build,rcc_build,uic_build,linguisttools_build,gui,opengl
+QT5_USES=	qmake:outsource
+QT5_USE=	QT5=qmake_build,buildtools_build,linguisttools_build,gui,opengl,widgets
+SDL_USES=	cmake:outsource ninja
+SDL_LDFLAGS=	-L${LOCALBASE}/lib # ffmpeg
+
+.include <bsd.port.options.mk>
+
+.if ! ${PORT_OPTIONS:MQT*}
+PORTDATA+=	assets ${PORTNAME}
+.endif
+
+post-extract:
+.ifndef GITHUB_GROUPS
+	@${RMDIR} ${WRKSRC}/lang
+	@${MV} ${WRKDIR}/${PORTNAME}-lang-52c757e ${WRKSRC}/lang
+	@${RMDIR} ${WRKSRC}/native
+	@${MV} ${WRKDIR}/native-52ce9c1 ${WRKSRC}/native
+	@${RMDIR} ${WRKSRC}/ext/armips
+	@${MV} ${WRKDIR}/armips-a0b878f ${WRKSRC}/ext/armips
+.else # XXX D2608 version
+# Convert USE_GITHUB groups to git-submodule(1) paths
+.for group in ${GH_PROJECT:C/.*://}
+	@${RMDIR} ${WRKSRC}/${group:S,_,/,g}
+	@${MV} ${WRKSRC_${group}} ${WRKSRC}/${group:S,_,/,g}
+.endfor
+.endif
+
+post-patch:
+	@${REINPLACE_CMD} -e 's,/usr/share,${PREFIX}/share,' \
+		${WRKSRC}/UI/NativeApp.cpp
+	@${REINPLACE_CMD} -e '/find_package(Git)/d' \
+		-e 's/"unknown"/"${GH_TAGNAME}"/' \
+		-e 's/^\(VERSION =\).*/\1 ${GH_TAGNAME}/' \
+		${WRKSRC}/git-version.cmake \
+		${WRKSRC}/Qt/Settings.pri
+
+do-install:
+.if ! ${PORT_OPTIONS:MQT*}
+# cmake doesn't pack assets into the app unlike qmake
+# XXX Convert to ${PORTDATA:N${PORTNAME}} once fmake is EOL
+	(cd ${INSTALL_WRKSRC} && ${COPYTREE_SHARE} \
+		"${PORTDATA:Nppsspp}" ${STAGEDIR}${DATADIR})
+# Install the app alongside assets to avoid warnings with GetExeDirectory()
+	${INSTALL_PROGRAM} ${INSTALL_WRKSRC}/${PORTNAME:tu}* \
+		${STAGEDIR}${DATADIR}/${PORTNAME}
+	${LN} -sf ${DATADIR}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
+.else
+	${INSTALL_PROGRAM} ${INSTALL_WRKSRC}/${PORTNAME} \
+		${STAGEDIR}${PREFIX}/bin
+.endif
+	${INSTALL_DATA} ${WRKSRC}/debian/${PORTNAME}.desktop \
+		${STAGEDIR}${DESKTOPDIR}
+	${INSTALL_DATA} ${WRKSRC}/debian/${PORTNAME}.1 \
+		${STAGEDIR}${MAN1PREFIX}/man/man1
+	(cd ${WRKSRC}/assets/unix-icons && ${COPYTREE_SHARE} \
+		"hicolor" ${STAGEDIR}${PREFIX}/share/icons)
+	${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/scalable/apps
+	${INSTALL_DATA} ${WRKSRC}/assets/unix-icons/icon-512.svg \
+		${STAGEDIR}${PREFIX}/share/icons/hicolor/scalable/apps/${PORTNAME}.svg
+
+.include <bsd.port.mk>

Added: head/emulators/ppsspp/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/distinfo	Sun May 24 00:20:11 2015	(r387239)
@@ -0,0 +1,10 @@
+SHA256 (hrydgard-ppsspp-v1.0.1_GH0.tar.gz) = e2d656671301a13e13f94c0a3021eaacacc9428fa9df60307b16ed5b4498812c
+SIZE (hrydgard-ppsspp-v1.0.1_GH0.tar.gz) = 14199883
+SHA256 (hrydgard-ppsspp-lang-52c757e_GH0.tar.gz) = 9f9c97e1d506645f68dfb7fbd6c380be0bb66d23f56a33251bb50ac95b498e8a
+SIZE (hrydgard-ppsspp-lang-52c757e_GH0.tar.gz) = 193165
+SHA256 (hrydgard-native-52ce9c1_GH0.tar.gz) = 2d3fbcc0685046326f21158892c235a1dcd4770d1cfedd29da0e06daa9c2ce5e
+SIZE (hrydgard-native-52ce9c1_GH0.tar.gz) = 1393991
+SHA256 (Kingcom-armips-a0b878f_GH0.tar.gz) = 64623bbddda609f9692904e6b6823b1d2d4dd0149349f2be9edcc600bf12bafa
+SIZE (Kingcom-armips-a0b878f_GH0.tar.gz) = 136535
+SHA256 (ppsspp-ffmpeg.patch?id=f2b9251) = 4d60b99f9e6fe1bb81b2b1b648845f9e76289ba824fcb5e53f2117d0319e086d
+SIZE (ppsspp-ffmpeg.patch?id=f2b9251) = 6304

Added: head/emulators/ppsspp/files/patch-CMakeLists.txt
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/files/patch-CMakeLists.txt	Sun May 24 00:20:11 2015	(r387239)
@@ -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")

Added: head/emulators/ppsspp/files/patch-Common_CPUDetect.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/files/patch-Common_CPUDetect.cpp	Sun May 24 00:20:11 2015	(r387239)
@@ -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__)

Added: head/emulators/ppsspp/files/patch-Common_FileUtil.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/files/patch-Common_FileUtil.cpp	Sun May 24 00:20:11 2015	(r387239)
@@ -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

Added: head/emulators/ppsspp/files/patch-Common_MemArena.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/files/patch-Common_MemArena.cpp	Sun May 24 00:20:11 2015	(r387239)
@@ -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);

Copied and modified: head/emulators/ppsspp/files/patch-Common_MemoryUtil.cpp (from r387191, head/emulators/dolphin-emu/files/patch-Source-Core-Common-Src-MemoryUtil.cpp)
==============================================================================
--- head/emulators/dolphin-emu/files/patch-Source-Core-Common-Src-MemoryUtil.cpp	Sat May 23 23:20:33 2015	(r387191, copy source)
+++ head/emulators/ppsspp/files/patch-Common_MemoryUtil.cpp	Sun May 24 00:20:11 2015	(r387239)
@@ -1,7 +1,7 @@
---- Source/Core/Common/Src/MemoryUtil.cpp.orig	2012-09-20 13:12:50.000000000 +0200
-+++ Source/Core/Common/Src/MemoryUtil.cpp	2012-09-20 13:12:43.000000000 +0200
-@@ -33,6 +33,13 @@
- #define round_page(x) ((((unsigned long)(x)) + PAGE_MASK) & ~(PAGE_MASK))
+--- 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__)
@@ -11,15 +11,14 @@
 +#include <sys/resource.h>
 +#endif
 +
- // This is purposely not a full wrapper for virtualalloc/mmap, but it
- // provides exactly the primitive operations that Dolphin needs.
- 
-@@ -50,7 +57,23 @@
- 	// effect of discarding already mapped pages that happen to be in the
- 	// requested virtual memory range (such as the emulated RAM, sometimes).
- 	if (low && (!map_hint))
-+	{
- 		map_hint = (char*)round_page(512*1024*1024); /* 0.5 GB rounded up to the next page */
+ #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.
@@ -34,7 +33,15 @@
 +		        PanicAlert("Failed to lower maximum data segment size");
 +		}
 +#endif
-+	}
- #endif
- 	void* ptr = mmap(map_hint, size, PROT_READ | PROT_WRITE | PROT_EXEC,
- 		MAP_ANON | MAP_PRIVATE
+ 	}
+ 	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;

Added: head/emulators/ppsspp/files/patch-Common_StdMutex.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/files/patch-Common_StdMutex.h	Sun May 24 00:20:11 2015	(r387239)
@@ -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>

Added: head/emulators/ppsspp/files/patch-Common_Swap.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/files/patch-Common_Swap.h	Sun May 24 00:20:11 2015	(r387239)
@@ -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); }

Added: head/emulators/ppsspp/files/patch-Core_FileSystems_tlzrc.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/files/patch-Core_FileSystems_tlzrc.cpp	Sun May 24 00:20:11 2015	(r387239)
@@ -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"
+ 

Added: head/emulators/ppsspp/files/patch-Core_HLE_ReplaceTables.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/files/patch-Core_HLE_ReplaceTables.cpp	Sun May 24 00:20:11 2015	(r387239)
@@ -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.

Added: head/emulators/ppsspp/files/patch-Core_HLE_sceRtc.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/files/patch-Core_HLE_sceRtc.cpp	Sun May 24 00:20:11 2015	(r387239)
@@ -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;

Added: head/emulators/ppsspp/files/patch-Core_Loaders.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/files/patch-Core_Loaders.cpp	Sun May 24 00:20:11 2015	(r387239)
@@ -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:")) {

Added: head/emulators/ppsspp/files/patch-Core_MIPS_JitCommon_JitCommon.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/files/patch-Core_MIPS_JitCommon_JitCommon.cpp	Sun May 24 00:20:11 2015	(r387239)
@@ -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;
+ }

Added: head/emulators/ppsspp/files/patch-Core_MIPS_fake_FakeJit.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/files/patch-Core_MIPS_fake_FakeJit.cpp	Sun May 24 00:20:11 2015	(r387239)
@@ -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;
+ }

Added: head/emulators/ppsspp/files/patch-Core_MemMap.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/files/patch-Core_MemMap.cpp	Sun May 24 00:20:11 2015	(r387239)
@@ -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;
+ 		}

Added: head/emulators/ppsspp/files/patch-GPU_GLES_TextureScaler.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/files/patch-GPU_GLES_TextureScaler.cpp	Sun May 24 00:20:11 2015	(r387239)
@@ -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

Added: head/emulators/ppsspp/files/patch-Qt_PPSSPP.pro
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/files/patch-Qt_PPSSPP.pro	Sun May 24 00:20:11 2015	(r387239)
@@ -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), :)

Added: head/emulators/ppsspp/files/patch-Qt_Platform_linux.pri
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/files/patch-Qt_Platform_linux.pri	Sun May 24 00:20:11 2015	(r387239)
@@ -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

Added: head/emulators/ppsspp/files/patch-Qt_Settings.pri
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/files/patch-Qt_Settings.pri	Sun May 24 00:20:11 2015	(r387239)
@@ -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)

Added: head/emulators/ppsspp/files/patch-UI_NativeApp.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/files/patch-UI_NativeApp.cpp	Sun May 24 00:20:11 2015	(r387239)
@@ -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/"));

Added: head/emulators/ppsspp/files/patch-native_base_basictypes.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/files/patch-native_base_basictypes.h	Sun May 24 00:20:11 2015	(r387239)
@@ -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);}

Added: head/emulators/ppsspp/files/patch-native_ext_cityhash_city.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/files/patch-native_ext_cityhash_city.cpp	Sun May 24 00:20:11 2015	(r387239)
@@ -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)

Added: head/emulators/ppsspp/files/patch-native_ext_stb__vorbis_stb__vorbis.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/files/patch-native_ext_stb__vorbis_stb__vorbis.c	Sun May 24 00:20:11 2015	(r387239)
@@ -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
+ 

Added: head/emulators/ppsspp/files/patch-native_file_file__util.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/files/patch-native_file_file__util.cpp	Sun May 24 00:20:11 2015	(r387239)
@@ -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
+ 

Added: head/emulators/ppsspp/files/patch-native_net_http__client.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/files/patch-native_net_http__client.h	Sun May 24 00:20:11 2015	(r387239)
@@ -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

Added: head/emulators/ppsspp/files/patch-native_net_http__headers.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/files/patch-native_net_http__headers.cpp	Sun May 24 00:20:11 2015	(r387239)
@@ -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) {

Added: head/emulators/ppsspp/files/patch-native_net_http__server.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/files/patch-native_net_http__server.cpp	Sun May 24 00:20:11 2015	(r387239)
@@ -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

Added: head/emulators/ppsspp/files/patch-native_net_resolve.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/files/patch-native_net_resolve.cpp	Sun May 24 00:20:11 2015	(r387239)
@@ -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>

Added: head/emulators/ppsspp/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/pkg-descr	Sun May 24 00:20:11 2015	(r387239)
@@ -0,0 +1,11 @@
+PPSSPP is a HLE ("high level emulation") emulator, it simulates the
+PSP OS as seen by the game rather than the full hardware. A program
+running on the PSP OS can send raw display lists to the graphics
+chips, but can't access the flash controller or the Media Engine
+directly, instead it has to go through libraries and the PSP OS
+kernel. We simply simulate these. This is a lot of work though, the
+PSP OS is large and has plenty of functionality so achieving 100%
+compatibility is difficult bordering on the impossible. We can get
+close though.
+
+WWW: http://www.ppsspp.org/

Added: head/emulators/ppsspp/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/pkg-plist	Sun May 24 00:20:11 2015	(r387239)
@@ -0,0 +1,13 @@
+bin/ppsspp
+man/man1/ppsspp.1.gz
+share/applications/ppsspp.desktop
+share/icons/hicolor/128x128/apps/ppsspp.png
+share/icons/hicolor/16x16/apps/ppsspp.png
+share/icons/hicolor/24x24/apps/ppsspp.png
+share/icons/hicolor/256x256/apps/ppsspp.png
+share/icons/hicolor/32x32/apps/ppsspp.png
+share/icons/hicolor/48x48/apps/ppsspp.png
+share/icons/hicolor/512x512/apps/ppsspp.png
+share/icons/hicolor/64x64/apps/ppsspp.png
+share/icons/hicolor/96x96/apps/ppsspp.png
+share/icons/hicolor/scalable/apps/ppsspp.svg



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505240020.t4O0KC5h094690>