[dolphin-emu] 05/16: Drop all patches

James Cowgill jcowgill-guest at moszumanska.debian.org
Thu Sep 10 21:31:26 UTC 2015


This is an automated email from the git hooks/post-receive script.

jcowgill-guest pushed a commit to branch experimental
in repository dolphin-emu.

commit f1ef00349c26c87bb725cc2c72dfa915a37e3d04
Author: James Cowgill <james410 at cowgill.org.uk>
Date:   Sun Sep 6 00:37:34 2015 +0100

    Drop all patches
    
    All patches (or alternate solutions) applied upstream.
---
 debian/patches/01_fixes-for-gcc-4.9.patch          |  22 -
 debian/patches/02_fixes-for-libav-10.patch         |  53 --
 debian/patches/03_fixes-for-polarssl-1.3.patch     | 191 ------
 debian/patches/04_use-polarssl-aes.patch           | 256 -------
 debian/patches/05_remove-powerpcdisasm.patch       |  62 --
 debian/patches/06_fix-findminiupnpc-warnings.patch |  24 -
 debian/patches/07_cmake-sfml-fixes.patch           |  27 -
 debian/patches/08_sfml-use-2.1.patch               | 755 ---------------------
 debian/patches/09_arm-use-gl.patch                 |  16 -
 debian/patches/10_include_findx11.patch            |  19 -
 debian/patches/series                              |  10 -
 11 files changed, 1435 deletions(-)

diff --git a/debian/patches/01_fixes-for-gcc-4.9.patch b/debian/patches/01_fixes-for-gcc-4.9.patch
deleted file mode 100644
index 0726ee4..0000000
--- a/debian/patches/01_fixes-for-gcc-4.9.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-Description: Fix redeclaration of _mm_shuffle_epi8 in GCC 4.9
- Backported from upstream commit.
-Author: James Cowgill <james410 at cowgill.org.uk>
-Author: Ryan Houdek <Sonicadvance1 at gmail.com>
-Applied-Upstream: https://github.com/dolphin-emu/dolphin/commit/7c1ac441f633220365d0feef3871f891e7ed7a43
-
---- a/Source/Core/Common/Src/CommonFuncs.h
-+++ b/Source/Core/Common/Src/CommonFuncs.h
-@@ -30,7 +30,12 @@ struct ArraySizeImpl : public std::exten
- #define b32(x)  (b16(x) | (b16(x) >>16) )
- #define ROUND_UP_POW2(x)	(b32(x - 1) + 1)
- 
--#if defined __GNUC__ && !defined __SSSE3__ && !defined _M_GENERIC
-+#ifndef __GNUC_PREREQ
-+	#define __GNUC_PREREQ(a, b) 0
-+#endif
-+
-+#if (defined __GNUC__ && !__GNUC_PREREQ(4,9))  \
-+	&& !defined __SSSE3__ && !defined _M_GENERIC
- #include <emmintrin.h>
- static __inline __m128i __attribute__((__always_inline__))
- _mm_shuffle_epi8(__m128i a, __m128i mask)
diff --git a/debian/patches/02_fixes-for-libav-10.patch b/debian/patches/02_fixes-for-libav-10.patch
deleted file mode 100644
index 5d265f5..0000000
--- a/debian/patches/02_fixes-for-libav-10.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-Description: Copy avcodec_encode_video from libav so it compiles with newer versions.
- Will not be needed in next dolphin version.
-Author: Brandon Barnes <winterknight at nerdshack.com>
-Forwarded: not-needed
-
---- a/Source/Core/VideoCommon/Src/AVIDump.cpp
-+++ b/Source/Core/VideoCommon/Src/AVIDump.cpp
-@@ -243,6 +243,45 @@ bool AVIDump::Start(int w, int h)
- 	return CreateFile();
- }
- 
-+#if (LIBAVCODEC_VERSION_MAJOR >= 55)
-+
-+#define CODEC_ID_FFV1 AV_CODEC_ID_FFV1
-+
-+// Shamelessly copied from libav-9.13 utils.c
-+int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
-+                                             const AVFrame *pict)
-+{
-+    AVPacket pkt;
-+    int ret, got_packet = 0;
-+
-+    if (buf_size < FF_MIN_BUFFER_SIZE) {
-+        av_log(avctx, AV_LOG_ERROR, "buffer smaller than minimum size\n");
-+        return -1;
-+    }
-+
-+    av_init_packet(&pkt);
-+    pkt.data = buf;
-+    pkt.size = buf_size;
-+
-+    ret = avcodec_encode_video2(avctx, &pkt, pict, &got_packet);
-+    if (!ret && got_packet && avctx->coded_frame) {
-+        avctx->coded_frame->pts       = pkt.pts;
-+        avctx->coded_frame->key_frame = !!(pkt.flags & AV_PKT_FLAG_KEY);
-+    }
-+
-+    /* free any side data since we cannot return it */
-+    if (pkt.side_data_elems > 0) {
-+        int i;
-+        for (i = 0; i < pkt.side_data_elems; i++)
-+            av_free(pkt.side_data[i].data);
-+        av_freep(&pkt.side_data);
-+        pkt.side_data_elems = 0;
-+    }
-+
-+    return ret ? ret : pkt.size;
-+}
-+#endif
-+
- bool AVIDump::CreateFile()
- {
- 	AVCodec *codec = NULL;
diff --git a/debian/patches/03_fixes-for-polarssl-1.3.patch b/debian/patches/03_fixes-for-polarssl-1.3.patch
deleted file mode 100644
index 76f440c..0000000
--- a/debian/patches/03_fixes-for-polarssl-1.3.patch
+++ /dev/null
@@ -1,191 +0,0 @@
-Description: Update to PolarSSL 1.3 API
-Author: James Cowgill <james410 at cowgill.org.uk>
-Author: Tillmann Karras <tilkax at gmail.com>
-Applied-Upstream: https://github.com/dolphin-emu/dolphin/commit/33beaf20f3c511bf2c6b751366b38b3eb023aad7
-
---- a/CMakeTests/FindPolarSSL.cmake
-+++ b/CMakeTests/FindPolarSSL.cmake
-@@ -31,23 +31,23 @@ if (POLARSSL_FOUND)
- 	check_cxx_source_compiles("
- 	#include <polarssl/net.h>
- 	#include <polarssl/ssl.h>
--	#include <polarssl/havege.h>
-+	#include <polarssl/entropy.h>
- 	int main()
- 	{
--	ssl_context ctx;
--	ssl_session session;
--	havege_state hs;
-+		ssl_context ctx;
-+		ssl_session session;
-+		entropy_context entropy;
- 
--	ssl_init(&ctx);
--	havege_init(&hs);
--	ssl_set_rng(&ctx, havege_random, &hs);
--	ssl_set_session(&ctx, &session);
-+		ssl_init(&ctx);
-+		entropy_init(&entropy);
-+		ssl_set_rng(&ctx, entropy_func, &entropy);
-+		ssl_set_session(&ctx, &session);
- 
--	ssl_close_notify(&ctx);
--	ssl_session_free(&session);
--	ssl_free(&ctx);
-+		ssl_close_notify(&ctx);
-+		ssl_session_free(&session);
-+		ssl_free(&ctx);
- 
--	return 0;
-+		return 0;
- 	}"
- 	POLARSSL_WORKS)
- 
---- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp
-+++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp
-@@ -28,12 +28,12 @@ CWII_IPC_HLE_Device_net_ssl::~CWII_IPC_H
- 			ssl_session_free(&_SSL[i].session);
- 			ssl_free(&_SSL[i].ctx);
- 
--			x509_free(&_SSL[i].cacert);
--			x509_free(&_SSL[i].clicert);
-+			x509_crt_free(&_SSL[i].cacert);
-+			x509_crt_free(&_SSL[i].clicert);
- 
- 			memset(&_SSL[i].ctx, 0, sizeof(ssl_context));
- 			memset(&_SSL[i].session, 0, sizeof(ssl_session));
--			memset(&_SSL[i].hs, 0, sizeof(havege_state));
-+			memset(&_SSL[i].entropy, 0, sizeof(entropy_context));
- 			memset(_SSL[i].hostname, 0, NET_SSL_MAX_HOSTNAME_LEN);
- 
- 			_SSL[i].active = false;
-@@ -147,13 +147,12 @@ bool CWII_IPC_HLE_Device_net_ssl::IOCtlV
- 				goto _SSL_NEW_ERROR;
- 			}
- 
--			havege_init(&_SSL[sslID].hs);
--			ssl_set_rng(&_SSL[sslID].ctx, havege_random, &_SSL[sslID].hs);
-+			entropy_init(&_SSL[sslID].entropy);
-+			ssl_set_rng(&_SSL[sslID].ctx, entropy_func, &_SSL[sslID].entropy);
- 
- 			// For some reason we can't use TLSv1.2, v1.1 and below are fine!
- 			ssl_set_max_version(&_SSL[sslID].ctx, SSL_MAJOR_VERSION_3, SSL_MINOR_VERSION_2);
- 
--			ssl_set_ciphersuites(&_SSL[sslID].ctx, ssl_default_ciphersuites);
- 			ssl_set_session(&_SSL[sslID].ctx, &_SSL[sslID].session);
- 
- 			ssl_set_endpoint(&_SSL[sslID].ctx, SSL_IS_CLIENT);
-@@ -192,12 +191,12 @@ _SSL_NEW_ERROR:
- 			ssl_session_free(&_SSL[sslID].session);
- 			ssl_free(&_SSL[sslID].ctx);
- 
--			x509_free(&_SSL[sslID].cacert);
--			x509_free(&_SSL[sslID].clicert);
-+			x509_crt_free(&_SSL[sslID].cacert);
-+			x509_crt_free(&_SSL[sslID].clicert);
- 
- 			memset(&_SSL[sslID].ctx, 0, sizeof(ssl_context));
- 			memset(&_SSL[sslID].session, 0, sizeof(ssl_session));
--			memset(&_SSL[sslID].hs, 0, sizeof(havege_state));
-+			memset(&_SSL[sslID].entropy, 0, sizeof(entropy_context));
- 			memset(_SSL[sslID].hostname, 0, NET_SSL_MAX_HOSTNAME_LEN);
- 
- 			_SSL[sslID].active = false;
-@@ -231,7 +230,7 @@ _SSL_NEW_ERROR:
- 		int sslID = Memory::Read_U32(BufferOut) - 1;
- 		if (SSLID_VALID(sslID))
- 		{
--			int ret = x509parse_crt_der(
-+			int ret = x509_crt_parse_der(
- 				&_SSL[sslID].cacert,
- 				Memory::GetPointer(BufferOut2),
- 				BufferOutSize2);
-@@ -268,23 +267,23 @@ _SSL_NEW_ERROR:
- 		if (SSLID_VALID(sslID))
- 		{
- 			std::string cert_base_path(File::GetUserPath(D_WIIUSER_IDX));
--			int ret = x509parse_crtfile(&_SSL[sslID].clicert, (cert_base_path + "clientca.pem").c_str());
--			int rsa_ret = x509parse_keyfile(&_SSL[sslID].rsa, (cert_base_path + "clientcakey.pem").c_str(), NULL);
--			if (ret || rsa_ret)
-+			int ret = x509_crt_parse_file(&_SSL[sslID].clicert, (cert_base_path + "clientca.pem").c_str());
-+			int pk_ret = pk_parse_keyfile(&_SSL[sslID].pk, (cert_base_path + "clientcakey.pem").c_str(), NULL);
-+			if (ret || pk_ret)
- 			{
--				x509_free(&_SSL[sslID].clicert);
--				rsa_free(&_SSL[sslID].rsa);
--				memset(&_SSL[sslID].clicert, 0, sizeof(x509_cert));
--				memset(&_SSL[sslID].rsa, 0, sizeof(rsa_context));
-+				x509_crt_free(&_SSL[sslID].clicert);
-+				pk_free(&_SSL[sslID].pk);
-+				memset(&_SSL[sslID].clicert, 0, sizeof(x509_crt));
-+				memset(&_SSL[sslID].pk, 0, sizeof(pk_context));
- 				Memory::Write_U32(SSL_ERR_FAILED, _BufferIn);
- 			}
- 			else
- 			{
--				ssl_set_own_cert(&_SSL[sslID].ctx, &_SSL[sslID].clicert, &_SSL[sslID].rsa);
-+				ssl_set_own_cert(&_SSL[sslID].ctx, &_SSL[sslID].clicert, &_SSL[sslID].pk);
- 				Memory::Write_U32(SSL_OK, _BufferIn);
- 			}
- 
--			INFO_LOG(WII_IPC_SSL, "IOCTLV_NET_SSL_SETBUILTINCLIENTCERT = (%d, %d)", ret, rsa_ret);
-+			INFO_LOG(WII_IPC_SSL, "IOCTLV_NET_SSL_SETBUILTINCLIENTCERT = (%d, %d)", ret, pk_ret);
- 		}
- 		else
- 		{
-@@ -306,10 +305,10 @@ _SSL_NEW_ERROR:
- 		int sslID = Memory::Read_U32(BufferOut) - 1;
- 		if (SSLID_VALID(sslID))
- 		{
--			x509_free(&_SSL[sslID].clicert);
--			rsa_free(&_SSL[sslID].rsa);
--			memset(&_SSL[sslID].clicert, 0, sizeof(x509_cert));
--			memset(&_SSL[sslID].rsa, 0, sizeof(rsa_context));
-+			x509_crt_free(&_SSL[sslID].clicert);
-+			pk_free(&_SSL[sslID].pk);
-+			memset(&_SSL[sslID].clicert, 0, sizeof(x509_crt));
-+			memset(&_SSL[sslID].pk, 0, sizeof(pk_context));
- 
- 			ssl_set_own_cert(&_SSL[sslID].ctx, NULL, NULL);
- 			Memory::Write_U32(SSL_OK, _BufferIn);
-@@ -328,10 +327,10 @@ _SSL_NEW_ERROR:
- 		{
- 			std::string cert_base_path(File::GetUserPath(D_WIIUSER_IDX));
- 
--			int ret = x509parse_crtfile(&_SSL[sslID].cacert, (cert_base_path + "rootca.pem").c_str());
-+			int ret = x509_crt_parse_file(&_SSL[sslID].cacert, (cert_base_path + "rootca.pem").c_str());
- 			if (ret)
- 			{
--				x509_free(&_SSL[sslID].clicert);
-+				x509_crt_free(&_SSL[sslID].clicert);
- 				Memory::Write_U32(SSL_ERR_FAILED, _BufferIn);
- 			}
- 			else
---- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net_ssl.h
-+++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net_ssl.h
-@@ -7,9 +7,9 @@
- 
- #include "WII_IPC_HLE_Device.h"
- 
-+#include <polarssl/entropy.h>
- #include <polarssl/net.h>
- #include <polarssl/ssl.h>
--#include <polarssl/havege.h>
- 
- #define NET_SSL_MAX_HOSTNAME_LEN 256
- #define NET_SSL_MAXINSTANCES 4
-@@ -57,10 +57,10 @@ enum SSL_IOCTL
- typedef struct {
- 	ssl_context ctx;
- 	ssl_session session;
--	havege_state hs;
--	x509_cert cacert;
--	x509_cert clicert;
--	rsa_context rsa;
-+	entropy_context entropy;
-+	x509_crt cacert;
-+	x509_crt clicert;
-+	pk_context pk;
- 	int sockfd;
- 	char hostname[NET_SSL_MAX_HOSTNAME_LEN];
- 	bool active;
diff --git a/debian/patches/04_use-polarssl-aes.patch b/debian/patches/04_use-polarssl-aes.patch
deleted file mode 100644
index 20dbb46..0000000
--- a/debian/patches/04_use-polarssl-aes.patch
+++ /dev/null
@@ -1,256 +0,0 @@
-Description: Use PolarSSL's AES implementation instead of OpenSSL
- Backported from upstream commit.
-Author: James Cowgill <james410 at cowgill.org.uk>
-Author: Ryan Houdek <Sonicadvance1 at gmail.com>
-Applied-Upstream: https://github.com/dolphin-emu/dolphin/commit/8e73e8ae5fad7f1f893832fcaf14b04e5e052795
-
---- a/Source/Core/Common/CMakeLists.txt
-+++ b/Source/Core/Common/CMakeLists.txt
-@@ -24,8 +24,6 @@ set(SRCS	Src/BreakPoints.cpp
- 			Src/x64ABI.cpp
- 			Src/x64Analyzer.cpp
- 			Src/x64Emitter.cpp
--			Src/Crypto/aes_cbc.cpp
--			Src/Crypto/aes_core.cpp
- 			Src/Crypto/bn.cpp
- 			Src/Crypto/ec.cpp)
- 
---- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp
-+++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp
-@@ -38,7 +38,7 @@
- #include "../PowerPC/PowerPC.h"
- #include "../VolumeHandler.h"
- #include "FileUtil.h"
--#include "Crypto/aes.h"
-+#include <polarssl/aes.h>
- #include "ConfigManager.h"
- 
- #include "../Boot/Boot_DOL.h"
-@@ -859,10 +859,10 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32
- 			u8* newIV		= Memory::GetPointer(Buffer.PayloadBuffer[0].m_Address);
- 			u8* destination	= Memory::GetPointer(Buffer.PayloadBuffer[1].m_Address);
- 
--			AES_KEY AESKey;
--			AES_set_encrypt_key(keyTable[keyIndex], 128, &AESKey);
-+			aes_context AES_ctx;
-+			aes_setkey_enc(&AES_ctx, keyTable[keyIndex], 128);
- 			memcpy(newIV, IV, 16);
--			AES_cbc_encrypt(source, destination, size, &AESKey, newIV, AES_ENCRYPT);
-+			aes_crypt_cbc(&AES_ctx, AES_ENCRYPT, size, newIV, source, destination);
- 
- 			_dbg_assert_msg_(WII_IPC_ES, keyIndex == 6, "IOCTL_ES_ENCRYPT: Key type is not SD, data will be crap");
- 		}
-@@ -877,10 +877,10 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32
- 			u8* newIV		= Memory::GetPointer(Buffer.PayloadBuffer[0].m_Address);
- 			u8* destination	= Memory::GetPointer(Buffer.PayloadBuffer[1].m_Address);
- 
--			AES_KEY AESKey;
--			AES_set_decrypt_key(keyTable[keyIndex], 128, &AESKey);
-+			aes_context AES_ctx;
-+			aes_setkey_dec(&AES_ctx, keyTable[keyIndex], 128);
- 			memcpy(newIV, IV, 16);
--			AES_cbc_encrypt(source, destination, size, &AESKey, newIV, AES_DECRYPT);
-+			aes_crypt_cbc(&AES_ctx, AES_DECRYPT, size, newIV, source, destination);
- 
- 			_dbg_assert_msg_(WII_IPC_ES, keyIndex == 6, "IOCTL_ES_DECRYPT: Key type is not SD, data will be crap");
- 		}
---- a/Source/Core/DiscIO/Src/NANDContentLoader.cpp
-+++ b/Source/Core/DiscIO/Src/NANDContentLoader.cpp
-@@ -6,7 +6,7 @@
- 
- #include <algorithm>
- #include <cctype>
--#include "Crypto/aes.h"
-+#include <polarssl/aes.h>
- #include "MathUtil.h"
- #include "FileUtil.h"
- #include "Log.h"
-@@ -286,10 +286,10 @@ bool CNANDContentLoader::Initialize(cons
- }
- void CNANDContentLoader::AESDecode(u8* _pKey, u8* _IV, u8* _pSrc, u32 _Size, u8* _pDest)
- {
--	AES_KEY AESKey;
-+	aes_context AES_ctx;
- 
--	AES_set_decrypt_key(_pKey, 128, &AESKey);
--	AES_cbc_encrypt(_pSrc, _pDest, _Size, &AESKey, _IV, AES_DECRYPT);
-+	aes_setkey_dec(&AES_ctx, _pKey, 128);
-+	aes_crypt_cbc(&AES_ctx, AES_DECRYPT, _Size, _IV, _pSrc, _pDest);
- }
- 
- void CNANDContentLoader::GetKeyFromTicket(u8* pTicket, u8* pTicketKey)
---- a/Source/Core/DiscIO/Src/VolumeCreator.cpp
-+++ b/Source/Core/DiscIO/Src/VolumeCreator.cpp
-@@ -4,7 +4,7 @@
- 
- #include <vector>
- 
--#include "Crypto/aes.h"
-+#include <polarssl/aes.h>
- 
- #include "VolumeCreator.h"
- 
-@@ -183,11 +183,11 @@ static IVolume* CreateVolumeFromCryptedW
- 			memset(IV, 0, 16);
- 			_rReader.Read(rPartition.Offset + 0x44c, 8, IV);
- 
--			AES_KEY AES_KEY;
--			AES_set_decrypt_key((Korean ? g_MasterKeyK : g_MasterKey), 128, &AES_KEY);
-+			aes_context AES_ctx;
-+			aes_setkey_dec(&AES_ctx, (Korean ? g_MasterKeyK : g_MasterKey), 128);
- 
- 			u8 VolumeKey[16];
--			AES_cbc_encrypt(SubKey, VolumeKey, 16, &AES_KEY, IV, AES_DECRYPT);
-+			aes_crypt_cbc(&AES_ctx, AES_DECRYPT, 16, IV, SubKey, VolumeKey);
- 
- 			// -1 means the caller just wanted the partition with matching type
- 			if ((int)_VolumeNum == -1 || i == _VolumeNum)
---- a/Source/Core/DiscIO/Src/VolumeWiiCrypted.cpp
-+++ b/Source/Core/DiscIO/Src/VolumeWiiCrypted.cpp
-@@ -18,7 +18,8 @@ CVolumeWiiCrypted::CVolumeWiiCrypted(IBl
- 	dataOffset(0x20000),
- 	m_LastDecryptedBlockOffset(-1)
- {
--	AES_set_decrypt_key(_pVolumeKey, 128, &m_AES_KEY);
-+	m_AES_ctx = new aes_context;
-+	aes_setkey_dec(m_AES_ctx, _pVolumeKey, 128);
- 	m_pBuffer = new u8[0x8000];
- }
- 
-@@ -29,6 +30,8 @@ CVolumeWiiCrypted::~CVolumeWiiCrypted()
- 	m_pReader = NULL;
- 	delete[] m_pBuffer;
- 	m_pBuffer = NULL;
-+	delete m_AES_ctx;
-+	m_AES_ctx = NULL;
- }
- 
- bool CVolumeWiiCrypted::RAWRead( u64 _Offset, u64 _Length, u8* _pBuffer ) const
-@@ -67,7 +70,7 @@ bool CVolumeWiiCrypted::Read(u64 _ReadOf
- 		if (m_LastDecryptedBlockOffset != Block)
- 		{
- 			memcpy(IV, m_pBuffer + 0x3d0, 16);
--			AES_cbc_encrypt(m_pBuffer + 0x400, m_LastDecryptedBlock, 0x7C00, &m_AES_KEY, IV, AES_DECRYPT);
-+			aes_crypt_cbc(m_AES_ctx, AES_DECRYPT, 0x7C00, IV, m_pBuffer + 0x400, m_LastDecryptedBlock);
- 
- 			m_LastDecryptedBlockOffset = Block;
- 		}
-@@ -250,7 +253,8 @@ bool CVolumeWiiCrypted::CheckIntegrity()
- 			NOTICE_LOG(DISCIO, "Integrity Check: fail at cluster %d: could not read metadata", clusterID);
- 			return false;
- 		}
--		AES_cbc_encrypt(clusterMDCrypted, clusterMD, 0x400, &m_AES_KEY, IV, AES_DECRYPT);
-+		aes_crypt_cbc(m_AES_ctx, AES_DECRYPT, 0x400, IV, clusterMDCrypted, clusterMD);
-+
- 
- 		// Some clusters have invalid data and metadata because they aren't
- 		// meant to be read by the game (for example, holes between files). To
---- a/Source/Core/DiscIO/Src/VolumeWiiCrypted.h
-+++ b/Source/Core/DiscIO/Src/VolumeWiiCrypted.h
-@@ -7,7 +7,7 @@
- 
- #include "Volume.h"
- #include "Blob.h"
--#include "Crypto/aes.h"
-+#include <polarssl/aes.h>
- 
- // --- this volume type is used for encrypted Wii images ---
- 
-@@ -38,7 +38,7 @@ private:
- 	IBlobReader* m_pReader;
- 
- 	u8* m_pBuffer;
--	AES_KEY m_AES_KEY;
-+	aes_context* m_AES_ctx;
- 
- 	u64 m_VolumeOffset;
- 	u64 dataOffset;
---- a/Source/Core/DolphinWX/Src/MemoryCards/WiiSaveCrypted.cpp
-+++ b/Source/Core/DolphinWX/Src/MemoryCards/WiiSaveCrypted.cpp
-@@ -78,7 +78,7 @@ CWiiSaveCrypted::CWiiSaveCrypted(const c
- 
- 	if (!TitleID) // Import
- 	{
--		AES_set_decrypt_key(SDKey, 128, &m_AES_KEY);
-+		aes_setkey_dec(&m_AES_ctx, SDKey, 128);
- 			b_valid = true;
- 			ReadHDR();
- 			ReadBKHDR();
-@@ -95,7 +95,7 @@ CWiiSaveCrypted::CWiiSaveCrypted(const c
- 	}
- 	else
- 	{
--		AES_set_encrypt_key(SDKey, 128, &m_AES_KEY);
-+		aes_setkey_enc(&m_AES_ctx, SDKey, 128);
- 		
- 		if (getPaths(true))
- 		{
-@@ -133,7 +133,7 @@ void CWiiSaveCrypted::ReadHDR()
- 	}
- 	fpData_bin.Close();
- 
--	AES_cbc_encrypt((const u8*)&_encryptedHeader, (u8*)&_header, HEADER_SZ, &m_AES_KEY, SD_IV, AES_DECRYPT);
-+	aes_crypt_cbc(&m_AES_ctx, AES_DECRYPT, HEADER_SZ, SD_IV, (const u8*)&_encryptedHeader, (u8*)&_header);
- 	u32 bannerSize = Common::swap32(_header.hdr.BannerSize);
- 	if ((bannerSize < FULL_BNR_MIN) || (bannerSize > FULL_BNR_MAX) ||
- 		(((bannerSize - BNR_SZ) % ICON_SZ) != 0))
-@@ -197,7 +197,7 @@ void CWiiSaveCrypted::WriteHDR()
- 	md5((u8*)&_header, HEADER_SZ, md5_calc);
- 	memcpy(_header.hdr.Md5, md5_calc, 0x10);
- 
--	AES_cbc_encrypt((const unsigned char *)&_header, (u8*)&_encryptedHeader, HEADER_SZ, &m_AES_KEY, SD_IV, AES_ENCRYPT);
-+	aes_crypt_cbc(&m_AES_ctx, AES_ENCRYPT, HEADER_SZ, SD_IV, (const u8*)&_header, (u8*)&_encryptedHeader);
- 	
- 	File::IOFile fpData_bin(encryptedSavePath, "wb");
- 	if (!fpData_bin.WriteBytes(&_encryptedHeader, HEADER_SZ))
-@@ -332,7 +332,7 @@ void CWiiSaveCrypted::ImportWiiSaveFiles
- 				
- 				
- 				memcpy(IV, _tmpFileHDR.IV, 0x10);
--				AES_cbc_encrypt((const unsigned char *)&_encryptedData[0], &_data[0], RoundedFileSize, &m_AES_KEY, IV, AES_DECRYPT);
-+				aes_crypt_cbc(&m_AES_ctx, AES_DECRYPT, RoundedFileSize, IV, (const u8*)&_encryptedData[0], &_data[0]);
- 	
- 				if (!File::Exists(fullFilePath) || AskYesNoT("%s already exists, overwrite?", fullFilePath.c_str()))
- 				{
-@@ -421,7 +421,7 @@ void CWiiSaveCrypted::ExportWiiSaveFiles
- 				b_valid = false;
- 			}
- 
--			AES_cbc_encrypt((const u8*)&_data[0], &_encryptedData[0], _roundedfileSize, &m_AES_KEY, tmpFileHDR.IV, AES_ENCRYPT);
-+			aes_crypt_cbc(&m_AES_ctx, AES_ENCRYPT, _roundedfileSize, tmpFileHDR.IV, (const u8*)&_data[0], &_encryptedData[0]);
- 			
- 			File::IOFile fpData_bin(encryptedSavePath, "ab");
- 			if (!fpData_bin.WriteBytes(&_encryptedData[0], _roundedfileSize))
---- a/Source/Core/DolphinWX/Src/MemoryCards/WiiSaveCrypted.h
-+++ b/Source/Core/DolphinWX/Src/MemoryCards/WiiSaveCrypted.h
-@@ -6,8 +6,8 @@
- #define _WII_SAVE_CRYPTED
- 
- #include "StringUtil.h"
--#include "Crypto/aes.h"
- #include "Crypto/tools.h"
-+#include <polarssl/aes.h>
- #include "polarssl/md5.h"
- 
- // --- this is used for encrypted Wii save files
-@@ -35,8 +35,7 @@ private:
- 	bool getPaths(bool forExport = false);
- 	void ScanForFiles(std::string savDir, std::vector<std::string>&FilesList, u32 *_numFiles, u32 *_sizeFiles);
- 
--
--	AES_KEY m_AES_KEY;
-+	aes_context m_AES_ctx;
- 	u8 SD_IV[0x10];
- 	std::vector<std::string> FilesList;
- 
---- a/Source/Core/Core/Src/ec_wii.cpp
-+++ b/Source/Core/Core/Src/ec_wii.cpp
-@@ -10,7 +10,7 @@
- #include <stdio.h>
- #include <string.h>
- #include "Common.h"
--#include "Crypto/aes.h"
-+#include <polarssl/aes.h>
- #include "polarssl/sha1.h"
- #include "Crypto/tools.h"
- #include "FileUtil.h"
diff --git a/debian/patches/05_remove-powerpcdisasm.patch b/debian/patches/05_remove-powerpcdisasm.patch
deleted file mode 100644
index 5659335..0000000
--- a/debian/patches/05_remove-powerpcdisasm.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-Description: Disable non-free PowerPC disassembler
- Replace disassembler code with an empty stub.
- Upstream have a new version which is free, but it's too big to backport.
-Author: Brandon Barnes <winterknight at nerdshack.com>
-Forwarded: not-needed
-
---- /dev/null
-+++ b/Externals/Bochs_disasm/PowerPCDisasm.cpp
-@@ -0,0 +1,13 @@
-+/**
-+* This is a do-nothing stub to replace the PowerPC Disassembler module written
-+* by Frank Willie
-+* Copyright (c) 2013 Brandon Barnes <winterknight at nerdshack.com>
-+* This file is public domain
-+*/
-+
-+#include <stdio.h>
-+
-+void DisassembleGekko(unsigned int unused1, unsigned int unused2, char * dest, int max_size)
-+{
-+	snprintf(dest, max_size, "(not supported)\t(not supported)");
-+}
---- /dev/null
-+++ b/Externals/Bochs_disasm/PowerPCDisasm.h
-@@ -0,0 +1,13 @@
-+/**
-+* This is a do-nothing stub to replace the PowerPC Disassembler module written
-+* by Frank Willie
-+* Copyright (c) 2013 Brandon Barnes <winterknight at nerdshack.com>
-+* This file is public domain
-+*/
-+
-+#ifndef _POWERPC_DISASM
-+#define _POWERPC_DISASM
-+
-+void DisassembleGekko(unsigned int, unsigned int, char * dest, int max_size);
-+
-+#endif
---- a/Source/Core/DolphinWX/Src/Debugger/RegisterView.cpp
-+++ b/Source/Core/DolphinWX/Src/Debugger/RegisterView.cpp
-@@ -11,9 +11,6 @@
- 
- // F-zero 80005e60 wtf??
- 
--extern const char* GetGPRName(unsigned int index);
--extern const char* GetFPRName(unsigned int index);
--
- static const char *special_reg_names[] = {
- 	"PC", "LR", "CTR", "CR", "FPSCR", "MSR", "SRR0", "SRR1", "Exceptions", "Int Mask", "Int Cause",
- };
-@@ -43,9 +40,9 @@ wxString CRegTable::GetValue(int row, in
- 	{
- 		switch (col)
- 		{
--		case 0: return StrToWxStr(GetGPRName(row));
-+		case 0: return wxEmptyString;
- 		case 1: return wxString::Format(wxT("%08x"), GPR(row));
--		case 2: return StrToWxStr(GetFPRName(row));
-+		case 2: return wxEmptyString;
- 		case 3: return wxString::Format(wxT("%016llx"), riPS0(row));
- 		case 4: return wxString::Format(wxT("%016llx"), riPS1(row));
- 		default: return wxEmptyString;
diff --git a/debian/patches/06_fix-findminiupnpc-warnings.patch b/debian/patches/06_fix-findminiupnpc-warnings.patch
deleted file mode 100644
index 67b13b1..0000000
--- a/debian/patches/06_fix-findminiupnpc-warnings.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-Description: Fix FindMiniupnpc.cmake warnings
-Author: Tillmann Karras <tilkax at gmail.com>
-Applied-Upstream: https://github.com/dolphin-emu/dolphin/commit/269e2aefa79075cca3b4ea63812456549ddc0867
-
---- a/CMakeTests/FindMiniupnpc.cmake
-+++ b/CMakeTests/FindMiniupnpc.cmake
-@@ -128,7 +128,7 @@ IF (NOT MINIUPNPC_VERSION_1_7_OR_HIGHER)
- 	   static struct IGDdatas data;
- 	   int main()
- 	   {
--	   char externalIP[16]     = "";
-+	   char externalIP[16]     = \"\";
- 	   UPNP_GetExternalIPAddress(urls.controlURL, data.first.servicetype, externalIP);
- 
- 	   return 0;
-@@ -148,7 +148,7 @@ IF (NOT MINIUPNPC_VERSION_1_7_OR_HIGHER)
- 		static struct IGDdatas data;
- 		int main()
- 		{
--		char externalIP[16]     = "";
-+		char externalIP[16]     = \"\";
- 		UPNP_GetExternalIPAddress(urls.controlURL, data.servicetype, externalIP);
- 
- 		return 0;
diff --git a/debian/patches/07_cmake-sfml-fixes.patch b/debian/patches/07_cmake-sfml-fixes.patch
deleted file mode 100644
index 3de51e7..0000000
--- a/debian/patches/07_cmake-sfml-fixes.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Description: Add info so that package links SFML successfully with newer gcc versions.
- Incorporated into SFML patch submitted upstream by James Cowgill
-Author: Brandon Barnes <winterknight at nerdshack.com>
-Forwarded: https://github.com/dolphin-emu/dolphin/pull/1522
-Applied-Upstream: https://github.com/dolphin-emu/dolphin/commit/a93f86330ec4d8fec4010074ee5a8aa2102776cd
-
---- a/Source/Core/Core/CMakeLists.txt
-+++ b/Source/Core/Core/CMakeLists.txt
-@@ -220,7 +220,7 @@ if(_M_ARM)
- 			Src/PowerPC/JitArm32/JitArm_LoadStoreFloating.cpp)
- endif()
- 
--set(LIBS bdisasm inputcommon videosoftware sfml-network)
-+set(LIBS bdisasm inputcommon videosoftware sfml-network sfml-system)
- 
- if(NOT USE_GLES OR USE_GLES3)
- 	set(LIBS ${LIBS} videoogl)
---- a/Source/Core/DolphinWX/CMakeLists.txt
-+++ b/Source/Core/DolphinWX/CMakeLists.txt
-@@ -11,6 +11,7 @@ set(LIBS	core
- 			audiocommon
- 			z
- 			sfml-network
-+			sfml-system
- 			${GTK2_LIBRARIES})
- 
- if(NOT ANDROID)
diff --git a/debian/patches/08_sfml-use-2.1.patch b/debian/patches/08_sfml-use-2.1.patch
deleted file mode 100644
index 1b57efd..0000000
--- a/debian/patches/08_sfml-use-2.1.patch
+++ /dev/null
@@ -1,755 +0,0 @@
-Description: Use SFML 2.1 instead of SFML 1.6.
- A modified version updated to use C++11 was forwarded upstream by James Cowgill.
-Author: Brandon Barnes <winterknight at nerdshack.com>
-Forwarded: https://github.com/dolphin-emu/dolphin/pull/1522
-Applied-Upstream: https://github.com/dolphin-emu/dolphin/commit/a93f86330ec4d8fec4010074ee5a8aa2102776cd
-
---- a/Source/Core/Core/Src/NetPlayClient.cpp
-+++ b/Source/Core/Core/Src/NetPlayClient.cpp
-@@ -65,19 +65,18 @@ NetPlayClient::NetPlayClient(const std::
- 
- 	is_connected = false;
- 
--	// why is false successful? documentation says true is
--	if (0 == m_socket.Connect(port, address, 5))
-+	if (m_socket.connect(address, port, sf::seconds(5)) == sf::Socket::Done)
- 	{
- 		// send connect message
- 		sf::Packet spac;
- 		spac << NETPLAY_VERSION;
- 		spac << netplay_dolphin_ver;
- 		spac << name;
--		m_socket.Send(spac);
-+		m_socket.send(spac);
- 
- 		sf::Packet rpac;
- 		// TODO: make this not hang
--		m_socket.Receive(rpac);
-+		m_socket.receive(rpac);
- 		MessageId error;
- 		rpac >> error;
- 
-@@ -99,7 +98,7 @@ NetPlayClient::NetPlayClient(const std::
- 				PanicAlertT("The server sent an unknown error message!");
- 				break;
- 			}
--			m_socket.Close();
-+			m_socket.disconnect();
- 		}
- 		else
- 		{
-@@ -119,7 +118,7 @@ NetPlayClient::NetPlayClient(const std::
- 			//PanicAlertT("Connection successful: assigned player id: %d", m_pid);
- 			is_connected = true;
- 
--			m_selector.Add(m_socket);
-+			m_selector.add(m_socket);
- 			m_thread = std::thread(std::mem_fun(&NetPlayClient::ThreadFunc), this);
- 		}
- 	}
-@@ -273,7 +272,7 @@ unsigned int NetPlayClient::OnData(sf::P
- 			spac << ping_key;
- 
- 			std::lock_guard<std::recursive_mutex> lks(m_crit.send);
--			m_socket.Send(spac);
-+			m_socket.send(spac);
- 		}
- 		break;
- 
-@@ -306,10 +305,10 @@ void NetPlayClient::ThreadFunc()
- {
- 	while (m_do_loop)
- 	{
--		if (m_selector.Wait(0.01f))
-+		if (m_selector.wait(sf::milliseconds(10)))
- 		{
- 			sf::Packet rpac;
--			switch (m_socket.Receive(rpac))
-+			switch (m_socket.receive(rpac))
- 			{
- 			case sf::Socket::Done :
- 				OnData(rpac);
-@@ -327,7 +326,7 @@ void NetPlayClient::ThreadFunc()
- 		}
- 	}
- 
--	m_socket.Close();
-+	m_socket.disconnect();
- 
- 	return;
- }
-@@ -383,7 +382,7 @@ void NetPlayClient::SendChatMessage(cons
- 	spac << msg;
- 
- 	std::lock_guard<std::recursive_mutex> lks(m_crit.send);
--	m_socket.Send(spac);
-+	m_socket.send(spac);
- }
- 
- // called from ---CPU--- thread
-@@ -396,7 +395,7 @@ void NetPlayClient::SendPadState(const P
- 	spac << np.nHi << np.nLo;
- 
- 	std::lock_guard<std::recursive_mutex> lks(m_crit.send);
--	m_socket.Send(spac);
-+	m_socket.send(spac);
- }
- 
- // called from ---GUI--- thread
-@@ -411,7 +410,7 @@ bool NetPlayClient::StartGame(const std:
- 	spac << (char *)&g_NetPlaySettings;
- 
- 	std::lock_guard<std::recursive_mutex> lks(m_crit.send);
--	m_socket.Send(spac);
-+	m_socket.send(spac);
- 
- 	if (m_is_running)
- 	{
-@@ -619,7 +618,7 @@ void NetPlayClient::Stop()
- 	{
- 		sf::Packet spac;
- 		spac << (MessageId)NP_MSG_STOP_GAME;
--		m_socket.Send(spac);
-+		m_socket.send(spac);
- 	}
- }
- 
---- a/Source/Core/Core/Src/NetPlayClient.h
-+++ b/Source/Core/Core/Src/NetPlayClient.h
-@@ -101,9 +101,9 @@ protected:
- 	NetWiimote		m_wiimote_input[4];
- 
- 	NetPlayUI*		m_dialog;
--	sf::SocketTCP	m_socket;
-+	sf::TcpSocket	m_socket;
- 	std::thread		m_thread;
--	sf::Selector<sf::SocketTCP>		m_selector;
-+	sf::SocketSelector		m_selector;
- 
- 	std::string		m_selected_game;
- 	volatile bool	m_is_running;
---- a/Source/Core/DolphinWX/Src/GeckoCodeDiag.cpp
-+++ b/Source/Core/DolphinWX/Src/GeckoCodeDiag.cpp
-@@ -160,20 +160,20 @@ void CodeConfigPanel::DownloadCodes(wxCo
- 	}
- 
- 	sf::Http::Request req;
--	req.SetURI("/txt.php?txt=" + gameid);
-+	req.setUri("/txt.php?txt=" + gameid);
- 
- 	sf::Http http;
--	http.SetHost("geckocodes.org");
-+	http.setHost("geckocodes.org");
- 
--	const sf::Http::Response resp = http.SendRequest(req, 5.0f);
-+	const sf::Http::Response resp = http.sendRequest(req, sf::seconds(5));
- 
--	if (sf::Http::Response::Ok == resp.GetStatus())
-+	if (sf::Http::Response::Ok == resp.getStatus())
- 	{
- 		// temp vector containing parsed codes
- 		std::vector<GeckoCode>	gcodes;
- 
- 		// parse the codes
--		std::istringstream ss(resp.GetBody());
-+		std::istringstream ss(resp.getBody());
- 
- 		// debug
- 		//PanicAlert("File size is %i bytes.", ss.str().size());
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -574,12 +574,12 @@ if(LIBUSB_FOUND)
- endif(LIBUSB_FOUND)
- 
- set(SFML_FIND_VERSION TRUE)
--set(SFML_FIND_VERSION_MAJOR 1)
--set(SFML_FIND_VERSION_MINOR 5)
-+set(SFML_FIND_VERSION_MAJOR 2)
-+set(SFML_FIND_VERSION_MINOR 1)
- if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT ANDROID)
- 	include(FindSFML OPTIONAL)
- endif()
--if(SFML_FOUND AND NOT SFML_VERSION_MAJOR) # SFML 1.x doesn't define SFML_VERSION_MAJOR
-+if(SFML_FOUND AND SFML_VERSION_MAJOR) # SFML 1.x doesn't define SFML_VERSION_MAJOR
- 	message("Using shared SFML")
- else()
- 	message("Using static SFML ${SFML_FIND_VERSION_MAJOR}.${SFML_FIND_VERSION_MINOR} from Externals")
---- a/Source/Core/Core/Src/HW/EXI_DeviceGecko.h
-+++ b/Source/Core/Core/Src/HW/EXI_DeviceGecko.h
-@@ -12,15 +12,15 @@
- #include <queue>
- 
- class GeckoSockServer
--	: public sf::SocketTCP
-+	: public sf::TcpSocket
- {
- public:
- 	GeckoSockServer();
- 	~GeckoSockServer();
--	bool GetAvailableSock(sf::SocketTCP &sock_to_fill);
-+	bool GetAvailableSock(sf::TcpSocket * sock_to_fill);
- 
- 	// Client for this server object
--	sf::SocketTCP client;
-+	sf::TcpSocket * client;
- 	void ClientThread();
- 	std::thread clientThread;
- 	std::mutex transfer_lock;
-@@ -38,7 +38,7 @@ private:
- 	static u16							server_port;
- 	static volatile bool				server_running;
- 	static std::thread					connectionThread;
--	static std::queue<sf::SocketTCP>	waiting_socks;
-+	static std::queue<sf::TcpSocket *>	waiting_socks;
- 	static std::mutex					connection_lock;
- };
- 
---- a/Source/Core/Core/Src/NetPlayServer.cpp
-+++ b/Source/Core/Core/Src/NetPlayServer.cpp
-@@ -10,7 +10,7 @@ NetPlayServer::~NetPlayServer()
- 	{
- 		m_do_loop = false;
- 		m_thread.join();
--		m_socket.Close();
-+		m_socket.close();
- 	}
- 
- #ifdef USE_UPNP
-@@ -25,11 +25,11 @@ NetPlayServer::~NetPlayServer()
- NetPlayServer::NetPlayServer(const u16 port) : is_connected(false), m_is_running(false)
- {
- 	memset(m_pad_map, -1, sizeof(m_pad_map));
--	if (m_socket.Listen(port))
-+	if (m_socket.listen(port) == sf::Socket::Done)
- 	{
- 		is_connected = true;
- 		m_do_loop = true;
--		m_selector.Add(m_socket);
-+		m_selector.add(m_socket);
- 		m_thread = std::thread(std::mem_fun(&NetPlayServer::ThreadFunc), this);
- 	}
- }
-@@ -58,16 +58,13 @@ void NetPlayServer::ThreadFunc()
- 		}
- 
- 		// check which sockets need attention
--		const unsigned int num = m_selector.Wait(0.01f);
--		for (unsigned int i=0; i<num; ++i)
-+		if (m_selector.wait(sf::milliseconds(10)))
- 		{
--			sf::SocketTCP ready_socket = m_selector.GetSocketReady(i);
--
- 			// listening socket
--			if (ready_socket == m_socket)
-+			if (m_selector.isReady(m_socket))
- 			{
--				sf::SocketTCP accept_socket;
--				m_socket.Accept(accept_socket);
-+				sf::TcpSocket * accept_socket = new sf::TcpSocket;
-+				m_socket.accept(*accept_socket);
- 
- 				unsigned int error;
- 				{
-@@ -80,29 +77,46 @@ void NetPlayServer::ThreadFunc()
- 					sf::Packet spac;
- 					spac << (MessageId)error;
- 					// don't need to lock, this client isn't in the client map
--					accept_socket.Send(spac);
-+					accept_socket->send(spac);
- 
- 					// TODO: not sure if client gets the message if i close right away
--					accept_socket.Close();
-+					// Above comment regards sfml 1.6
-+					accept_socket->disconnect();
-+					delete accept_socket;
-+				}
-+				else
-+				{
-+					m_clients.push_back(accept_socket);
- 				}
- 			}
- 			// client socket
- 			else
- 			{
- 				sf::Packet rpac;
--				switch (ready_socket.Receive(rpac))
--				{
--				case sf::Socket::Done :
--					// if a bad packet is received, disconnect the client
--					if (0 == OnData(rpac, ready_socket))
--						break;
- 
--				//case sf::Socket::Disconnected :
--				default :
-+				for (std::list<sf::TcpSocket *>::iterator it = m_clients.begin(); it != m_clients.end(); it++)
-+				{
-+					sf::TcpSocket * client = *it;
-+					if (m_selector.isReady(*client))
- 					{
--					std::lock_guard<std::recursive_mutex> lkg(m_crit.game);
--					OnDisconnect(ready_socket);
--					break;
-+						switch (client->receive(rpac))
-+						{
-+						case sf::Socket::Done :
-+							// if a bad packet is received, disconnect the client
-+							if (0 == OnData(rpac, client))
-+								break;
-+
-+						//case sf::Socket::Disconnected :
-+						default :
-+							{
-+							std::lock_guard<std::recursive_mutex> lkg(m_crit.game);
-+							OnDisconnect(client);
-+							delete *it;
-+							*it = NULL;
-+//							m_clients.erase(it);
-+							break;
-+							}
-+						}
- 					}
- 				}
- 			}
-@@ -111,22 +125,23 @@ void NetPlayServer::ThreadFunc()
- 
- 	// close listening socket and client sockets
- 	{
--	std::map<sf::SocketTCP, Client>::reverse_iterator
-+	std::map<sf::TcpSocket *, Client>::reverse_iterator
- 		i = m_players.rbegin(),
- 		e = m_players.rend();
- 	for ( ; i!=e; ++i)
--		i->second.socket.Close();
-+		i->second.socket->disconnect();
-+//		delete i->second.socket;
- 	}
- 
- 	return;
- }
- 
- // called from ---NETPLAY--- thread
--unsigned int NetPlayServer::OnConnect(sf::SocketTCP& socket)
-+unsigned int NetPlayServer::OnConnect(sf::TcpSocket * socket)
- {
- 	sf::Packet rpac;
- 	// TODO: make this not hang / check if good packet
--	socket.Receive(rpac);
-+	socket->receive(rpac);
- 
- 	std::string npver;
- 	rpac >> npver;
-@@ -173,36 +188,36 @@ unsigned int NetPlayServer::OnConnect(sf
- 	SendToClients(spac);
- 
- 	// send new client success message with their id
--	spac.Clear();
-+	spac.clear();
- 	spac << (MessageId)0;
- 	spac << player.pid;
--	socket.Send(spac);
-+	socket->send(spac);
- 
- 	// send new client the selected game
- 	if (m_selected_game != "")
- 	{
--		spac.Clear();
-+		spac.clear();
- 		spac << (MessageId)NP_MSG_CHANGE_GAME;
- 		spac << m_selected_game;
--		socket.Send(spac);
-+		socket->send(spac);
- 	}
- 
- 	// send the pad buffer value
--	spac.Clear();
-+	spac.clear();
- 	spac << (MessageId)NP_MSG_PAD_BUFFER;
- 	spac << (u32)m_target_buffer_size;
--	socket.Send(spac);
-+	socket->send(spac);
- 
- 	// sync values with new client
--	std::map<sf::SocketTCP, Client>::const_iterator
-+	std::map<sf::TcpSocket *, Client>::const_iterator
- 		i,
- 		e = m_players.end();
- 	for (i = m_players.begin(); i!=e; ++i)
- 	{
--		spac.Clear();
-+		spac.clear();
- 		spac << (MessageId)NP_MSG_PLAYER_JOIN;
- 		spac << i->second.pid << i->second.name << i->second.revision;
--		socket.Send(spac);
-+		socket->send(spac);
- 	}
- 
- 	} // unlock send
-@@ -217,13 +232,13 @@ unsigned int NetPlayServer::OnConnect(sf
- 	
- 
- 	// add client to selector/ used for receiving
--	m_selector.Add(socket);
-+	m_selector.add(*socket);
- 
- 	return 0;
- }
- 
- // called from ---NETPLAY--- thread
--unsigned int NetPlayServer::OnDisconnect(sf::SocketTCP& socket)
-+unsigned int NetPlayServer::OnDisconnect(sf::TcpSocket * socket)
- {
- 	if (m_is_running)
- 	{
-@@ -244,7 +259,7 @@ unsigned int NetPlayServer::OnDisconnect
- 	spac << (MessageId)NP_MSG_PLAYER_LEAVE;
- 	spac << pid;
- 
--	m_selector.Remove(socket);
-+	m_selector.remove(*socket);
- 	
- 	std::lock_guard<std::recursive_mutex> lkp(m_crit.players);
- 	m_players.erase(m_players.find(socket));
-@@ -304,7 +319,7 @@ void NetPlayServer::AdjustPadBufferSize(
- }
- 
- // called from ---NETPLAY--- thread
--unsigned int NetPlayServer::OnData(sf::Packet& packet, sf::SocketTCP& socket)
-+unsigned int NetPlayServer::OnData(sf::Packet& packet, sf::TcpSocket * socket)
- {
- 	MessageId mid;
- 	packet >> mid;
-@@ -477,14 +492,15 @@ bool NetPlayServer::StartGame(const std:
- // called from multiple threads
- void NetPlayServer::SendToClients(sf::Packet& packet, const PlayerId skip_pid)
- {
--	std::map<sf::SocketTCP, Client>::iterator
-+	std::map<sf::TcpSocket *, Client>::iterator
- 		i = m_players.begin(),
- 		e = m_players.end();
- 	for ( ; i!=e; ++i)
- 		if (i->second.pid && (i->second.pid != skip_pid))
--			i->second.socket.Send(packet);
-+			i->second.socket->send(packet);
- }
- 
-+
- #ifdef USE_UPNP
- #include <miniwget.h>
- #include <miniupnpc.h>
-@@ -508,7 +524,7 @@ void NetPlayServer::TryPortmapping(u16 p
- // UPnP thread: try to map a port
- void NetPlayServer::mapPortThread(const u16 port)
- {
--	std::string ourIP = sf::IPAddress::GetLocalAddress().ToString();
-+	std::string ourIP = sf::IpAddress::getLocalAddress().toString();
- 
- 	if (!m_upnp_inited)
- 		if (!initUPnP())
---- a/Source/Core/Core/Src/NetPlayServer.h
-+++ b/Source/Core/Core/Src/NetPlayServer.h
-@@ -53,15 +53,15 @@ private:
- 		std::string		name;
- 		std::string		revision;
- 
--		sf::SocketTCP	socket;
-+		sf::TcpSocket * socket;
- 		u32 ping;
- 		u32 current_game;
- 	};
- 
- 	void SendToClients(sf::Packet& packet, const PlayerId skip_pid = 0);
--	unsigned int OnConnect(sf::SocketTCP& socket);
--	unsigned int OnDisconnect(sf::SocketTCP& socket);
--	unsigned int OnData(sf::Packet& packet, sf::SocketTCP& socket);
-+	unsigned int OnConnect(sf::TcpSocket * socket);
-+	unsigned int OnDisconnect(sf::TcpSocket * socket);
-+	unsigned int OnData(sf::Packet& packet, sf::TcpSocket * socket);
- 	void UpdatePadMapping();
- 
- 	NetSettings     m_settings;
-@@ -75,7 +75,7 @@ private:
- 	unsigned int	m_target_buffer_size;
- 	PadMapping      m_pad_map[4];
- 
--	std::map<sf::SocketTCP, Client>	m_players;
-+	std::map<sf::TcpSocket *, Client>	m_players;
- 
- 	struct
- 	{
-@@ -86,9 +86,11 @@ private:
- 
- 	std::string m_selected_game;
- 
--	sf::SocketTCP m_socket;
-+	sf::TcpListener m_socket;
- 	std::thread m_thread;
--	sf::Selector<sf::SocketTCP> m_selector;
-+
-+	sf::SocketSelector m_selector;
-+	std::list<sf::TcpSocket *> m_clients;
- 
- #ifdef USE_UPNP
- 	static void mapPortThread(const u16 port);
---- a/Source/Core/Core/Src/HW/SI_DeviceGBA.cpp
-+++ b/Source/Core/Core/Src/HW/SI_DeviceGBA.cpp
-@@ -10,7 +10,7 @@
- #include <queue>
- 
- static std::thread connectionThread;
--static std::queue<sf::SocketTCP> waiting_socks;
-+static std::queue<sf::TcpSocket *> waiting_socks;
- static std::mutex cs_gba;
- namespace { volatile bool server_running; }
- 
-@@ -22,24 +22,28 @@ void GBAConnectionWaiter()
- 
- 	Common::SetCurrentThreadName("GBA Connection Waiter");
- 
--	sf::SocketTCP server;
-+	sf::TcpListener server;
- 	// "dolphin gba"
--	if (!server.Listen(0xd6ba))
-+	if (!server.listen(0xd6ba))
- 		return;
- 	
--	server.SetBlocking(false);
-+	server.setBlocking(false);
- 	
--	sf::SocketTCP new_client;
- 	while (server_running)
- 	{
--		if (server.Accept(new_client) == sf::Socket::Done)
-+		sf::TcpSocket * new_client = new sf::TcpSocket;
-+		if (server.accept(*new_client) == sf::Socket::Done)
- 		{
- 			std::lock_guard<std::mutex> lk(cs_gba);
- 			waiting_socks.push(new_client);
- 		}
-+		else
-+		{
-+			delete new_client;
-+		}
- 		SLEEP(1);
- 	}
--	server.Close();
-+	server.close();
- 	return;
- }
- 
-@@ -50,7 +54,7 @@ void GBAConnectionWaiter_Shutdown()
- 		connectionThread.join();
- }
- 
--bool GetAvailableSock(sf::SocketTCP& sock_to_fill)
-+bool GetAvailableSock(sf::TcpSocket * sock_to_fill)
- {
- 	bool sock_filled = false;
- 
-@@ -66,7 +70,8 @@ bool GetAvailableSock(sf::SocketTCP& soc
- 	return sock_filled;
- }
- 
--GBASockServer::GBASockServer()
-+GBASockServer::GBASockServer() :
-+	client(NULL)
- {
- 	if (!connectionThread.joinable())
- 		connectionThread = std::thread(GBAConnectionWaiter);
-@@ -74,13 +79,16 @@ GBASockServer::GBASockServer()
- 
- GBASockServer::~GBASockServer()
- {
--	client.Close();
-+	if (client != NULL) {
-+		client->disconnect();
-+		delete client;
-+	}
- }
- 
- // Blocking, since GBA must always send lower byte of REG_JOYSTAT
- void GBASockServer::Transfer(char* si_buffer)
- {
--	if (!client.IsValid())
-+	if (client == NULL)
- 		if (!GetAvailableSock(client))
- 			return;
- 
-@@ -90,9 +98,9 @@ void GBASockServer::Transfer(char* si_bu
- 	u8 cmd = *current_data;
- 
- 	if (cmd == CMD_WRITE)
--		client.Send(current_data, sizeof(current_data));
-+		client->send(current_data, sizeof(current_data));
- 	else
--		client.Send(current_data, 1);
-+		client->send(current_data, 1);
- 
- 	DEBUG_LOG(SERIALINTERFACE, "> command %02x %02x%02x%02x%02x",
- 		(u8)current_data[0], (u8)current_data[1], (u8)current_data[2],
-@@ -100,8 +108,11 @@ void GBASockServer::Transfer(char* si_bu
- 
- 	memset(current_data, 0, sizeof(current_data));
- 	size_t num_received = 0;
--	if (client.Receive(current_data, sizeof(current_data), num_received) == sf::Socket::Disconnected)
--		client.Close();
-+	if (client->receive(current_data, sizeof(current_data), num_received) == sf::Socket::Disconnected) {
-+		client->disconnect();
-+		delete client;
-+		client = NULL;
-+	}
- 
- 	DEBUG_LOG(SERIALINTERFACE, "< %02x%02x%02x%02x%02x",
- 		(u8)current_data[0], (u8)current_data[1], (u8)current_data[2],
---- a/Source/Core/Core/Src/HW/SI_DeviceGBA.h
-+++ b/Source/Core/Core/Src/HW/SI_DeviceGBA.h
-@@ -11,7 +11,7 @@
- 
- void GBAConnectionWaiter_Shutdown();
- 
--class GBASockServer : public sf::SocketTCP
-+class GBASockServer : public sf::TcpSocket
- {
- public:
- 	GBASockServer();
-@@ -28,7 +28,7 @@ private:
- 		CMD_WRITE	= 0x15
- 	};
- 
--	sf::SocketTCP client;
-+	sf::TcpSocket * client;
- 	char current_data[5];
- };
- 
---- a/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp
-+++ b/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp
-@@ -203,8 +203,8 @@ bool Wiimote::Read()
- 	{
- 		if (Core::g_CoreStartupParameter.iBBDumpPort > 0 && index == WIIMOTE_BALANCE_BOARD)
- 		{
--			static sf::SocketUDP Socket;
--			Socket.Send((char*)rpt.data(), rpt.size(), sf::IPAddress::LocalHost, Core::g_CoreStartupParameter.iBBDumpPort);
-+			static sf::UdpSocket Socket;
-+			Socket.send((char*)rpt.data(), rpt.size(), sf::IpAddress::LocalHost, Core::g_CoreStartupParameter.iBBDumpPort);
- 		}
- 
- 		// Add it to queue
-@@ -233,8 +233,8 @@ bool Wiimote::Write()
- 		{
- 			if (Core::g_CoreStartupParameter.iBBDumpPort > 0 && index == WIIMOTE_BALANCE_BOARD)
- 			{
--				static sf::SocketUDP Socket;
--				Socket.Send((char*)rpt.data(), rpt.size(), sf::IPAddress::LocalHost, Core::g_CoreStartupParameter.iBBDumpPort);
-+				static sf::UdpSocket Socket;
-+				Socket.send((char*)rpt.data(), rpt.size(), sf::IpAddress::LocalHost, Core::g_CoreStartupParameter.iBBDumpPort);
- 			}
- 			IOWrite(rpt.data(), rpt.size());
- 			
---- a/Source/Core/Core/Src/HW/EXI_DeviceGecko.cpp
-+++ b/Source/Core/Core/Src/HW/EXI_DeviceGecko.cpp
-@@ -12,11 +12,11 @@ u16							GeckoSockServer::server_port;
- int							GeckoSockServer::client_count;
- std::thread					GeckoSockServer::connectionThread;
- volatile bool				GeckoSockServer::server_running;
--std::queue<sf::SocketTCP>	GeckoSockServer::waiting_socks;
-+std::queue<sf::TcpSocket *>	GeckoSockServer::waiting_socks;
- std::mutex					GeckoSockServer::connection_lock;
- 
- GeckoSockServer::GeckoSockServer()
--	: client_running(false)
-+	: client(NULL), client_running(false)
- {
- 	if (!connectionThread.joinable())
- 		connectionThread = std::thread(GeckoConnectionWaiter);
-@@ -41,11 +41,11 @@ void GeckoSockServer::GeckoConnectionWai
- {
- 	Common::SetCurrentThreadName("Gecko Connection Waiter");
- 
--	sf::SocketTCP server;
-+	sf::TcpListener server;
- 	server_port = 0xd6ec; // "dolphin gecko"
- 	for (int bind_tries = 0; bind_tries <= 10 && !server_running; bind_tries++)
- 	{
--		if (!(server_running = server.Listen(server_port)))
-+		if (!(server_running = server.listen(server_port)))
- 			server_port++;
- 	}
- 
-@@ -56,22 +56,26 @@ void GeckoSockServer::GeckoConnectionWai
- 		StringFromFormat("USBGecko: Listening on TCP port %u", server_port),
- 		5000);
- 
--	server.SetBlocking(false);
-+	server.setBlocking(false);
- 
--	sf::SocketTCP new_client;
- 	while (server_running)
- 	{
--		if (server.Accept(new_client) == sf::Socket::Done)
-+		sf::TcpSocket * new_client = new sf::TcpSocket;
-+		if (server.accept(*new_client) == sf::Socket::Done)
- 		{
- 			std::lock_guard<std::mutex> lk(connection_lock);
- 			waiting_socks.push(new_client);
- 		}
-+		else
-+		{
-+			delete new_client;
-+		}
- 		SLEEP(1);
- 	}
--	server.Close();
-+	server.close();
- }
- 
--bool GeckoSockServer::GetAvailableSock(sf::SocketTCP &sock_to_fill)
-+bool GeckoSockServer::GetAvailableSock(sf::TcpSocket * sock_to_fill)
- {
- 	bool sock_filled = false;
- 
-@@ -103,7 +107,7 @@ void GeckoSockServer::ClientThread()
- 
- 	Common::SetCurrentThreadName("Gecko Client");
- 
--	client.SetBlocking(false);
-+	client->setBlocking(false);
- 
- 	while (client_running)
- 	{
-@@ -116,7 +120,7 @@ void GeckoSockServer::ClientThread()
- 		char data[128];
- 		std::size_t got = 0;
- 		
--		if (client.Receive(&data[0], ArraySize(data), got) == sf::Socket::Disconnected)
-+		if (client->receive(&data[0], ArraySize(data), got) == sf::Socket::Disconnected)
- 			client_running = false;
- 		
- 		if (got != 0)
-@@ -133,7 +137,7 @@ void GeckoSockServer::ClientThread()
- 			std::vector<char> packet(send_fifo.begin(), send_fifo.end());
- 			send_fifo.clear();
- 			
--			if (client.Send(&packet[0], packet.size()) == sf::Socket::Disconnected)
-+			if (client->send(&packet[0], packet.size()) == sf::Socket::Disconnected)
- 				client_running = false;
- 		}
- 		}	// unlock transfer
-@@ -142,7 +146,9 @@ void GeckoSockServer::ClientThread()
- 			Common::YieldCPU();
- 	}
- 
--	client.Close();
-+	client->disconnect();
-+	delete client;
-+	client = NULL;
- }
- 
- void CEXIGecko::ImmReadWrite(u32 &_uData, u32 _uSize)
-@@ -150,7 +156,7 @@ void CEXIGecko::ImmReadWrite(u32 &_uData
- 	// We don't really care about _uSize
- 	(void)_uSize;
- 
--	if (!client.IsValid())
-+	if (client == NULL)
- 		GetAvailableSock(client);
- 
- 	switch (_uData >> 28)
diff --git a/debian/patches/09_arm-use-gl.patch b/debian/patches/09_arm-use-gl.patch
deleted file mode 100644
index a9bee39..0000000
--- a/debian/patches/09_arm-use-gl.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-Description: Don't force use of GLES on ARM
-Author: James Cowgill <james410 at cowgill.org.uk>
-Applied-Upstream: https://github.com/dolphin-emu/dolphin/commit/839df31347cd1331c5426c2eae549371d7ae160f
----
-This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -118,8 +118,6 @@ if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^a
- 	add_definitions(-marm -march=armv7-a)
- 	add_definitions(-D_M_ARM=1)
- 	add_definitions(-D_M_GENERIC=1)
--	# Set generic options so you don't have to pass anything to cmake to build ARM
--	set(USE_GLES 1)
- endif()
- 
- if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "mips")
diff --git a/debian/patches/10_include_findx11.patch b/debian/patches/10_include_findx11.patch
deleted file mode 100644
index 79d4e8f..0000000
--- a/debian/patches/10_include_findx11.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Description: Include FindX11.cmake manually after changes in CMake 3.2
-Author: Maxime Gauduin <alucryd at gmail.com>
-Bug-Debian: https://bugs.debian.org/793572
-Forwarded: not-needed
-Applied-Upstream: https://github.com/dolphin-emu/dolphin/commit/148ce85b26925e38ced2f196475086eb7884fb62
----
-This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -413,8 +413,7 @@ if(NOT ANDROID)
- 			add_definitions(-DHAVE_WAYLAND=0)
- 		endif(USE_WAYLAND AND WAYLAND_FOUND)
- 
--		# Note: We do not need to explicitly check for X11 as it is done in the cmake
--		# FindOpenGL module on linux.
-+		include(FindX11)
- 		if(USE_X11 AND X11_FOUND)
- 			set(USE_X11 1)
- 			add_definitions(-DHAVE_X11=1)
diff --git a/debian/patches/series b/debian/patches/series
deleted file mode 100644
index 1c9a272..0000000
--- a/debian/patches/series
+++ /dev/null
@@ -1,10 +0,0 @@
-01_fixes-for-gcc-4.9.patch
-02_fixes-for-libav-10.patch
-03_fixes-for-polarssl-1.3.patch
-04_use-polarssl-aes.patch
-05_remove-powerpcdisasm.patch
-06_fix-findminiupnpc-warnings.patch
-07_cmake-sfml-fixes.patch
-08_sfml-use-2.1.patch
-09_arm-use-gl.patch
-10_include_findx11.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/dolphin-emu.git



More information about the Pkg-games-commits mailing list