From f8858857868377fa8d3cffd62bf3cd9a08b16319 Mon Sep 17 00:00:00 2001 From: cwen Date: Thu, 8 Aug 2019 17:11:24 +0000 Subject: [PATCH] desmume: fix with ports-gcc by adding some additional type casting. While here, move HOMEPAGE to https. tweaks and OK sthen@, maintainer timeout --- emulators/desmume/Makefile | 10 +++++-- .../desmume/patches/patch-src_MMU_timing_h | 21 ++++++++++++++ .../desmume/patches/patch-src_ctrlssdl_cpp | 28 +++++++++++++++++++ 3 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 emulators/desmume/patches/patch-src_MMU_timing_h create mode 100644 emulators/desmume/patches/patch-src_ctrlssdl_cpp diff --git a/emulators/desmume/Makefile b/emulators/desmume/Makefile index e8f45a8d98c..395ddf831b2 100644 --- a/emulators/desmume/Makefile +++ b/emulators/desmume/Makefile @@ -1,15 +1,15 @@ -# $OpenBSD: Makefile,v 1.24 2019/07/12 20:46:08 sthen Exp $ +# $OpenBSD: Makefile,v 1.25 2019/08/08 17:11:24 cwen Exp $ USE_WXNEEDED = Yes COMMENT = Nintendo DS emulator DISTNAME = desmume-0.9.11 -REVISION = 7 +REVISION = 8 CATEGORIES = emulators -HOMEPAGE = http://desmume.org/ +HOMEPAGE = https://desmume.org/ MAINTAINER = Anthony J. Bentley @@ -44,4 +44,8 @@ COMPILER = base-clang ports-gcc CONFIGURE_STYLE = gnu +# Some files needing patches have DOS line endings, removing them. +post-extract: + @cd ${WRKSRC} && perl -i -pe 's/\r$$//' src/MMU_timing.h + .include diff --git a/emulators/desmume/patches/patch-src_MMU_timing_h b/emulators/desmume/patches/patch-src_MMU_timing_h new file mode 100644 index 00000000000..6fb8ce3a3b4 --- /dev/null +++ b/emulators/desmume/patches/patch-src_MMU_timing_h @@ -0,0 +1,21 @@ +$OpenBSD: patch-src_MMU_timing_h,v 1.1 2019/08/08 17:11:24 cwen Exp $ + +ports-gcc fix for: +error: enumerator value for 'BLOCKMASK' is not an integer constant +From: +https://sourceforge.net/p/desmume/bugs/1570/ + +Index: src/MMU_timing.h +--- src/MMU_timing.h.orig ++++ src/MMU_timing.h +@@ -155,8 +155,8 @@ class CacheController (private) + enum { ASSOCIATIVITY = 1 << ASSOCIATIVESHIFT }; + enum { BLOCKSIZE = 1 << BLOCKSIZESHIFT }; + enum { TAGSHIFT = SIZESHIFT - ASSOCIATIVESHIFT }; +- enum { TAGMASK = (u32)(~0 << TAGSHIFT) }; +- enum { BLOCKMASK = ((u32)~0 >> (32 - TAGSHIFT)) & (u32)(~0 << BLOCKSIZESHIFT) }; ++ enum { TAGMASK = (u32)(~0U << TAGSHIFT) }; ++ enum { BLOCKMASK = ((u32)~0U >> (32 - TAGSHIFT)) & (u32)(~0U << BLOCKSIZESHIFT) }; + enum { WORDSIZE = sizeof(u32) }; + enum { WORDSPERBLOCK = (1 << BLOCKSIZESHIFT) / WORDSIZE }; + enum { DATAPERWORD = WORDSIZE * ASSOCIATIVITY }; diff --git a/emulators/desmume/patches/patch-src_ctrlssdl_cpp b/emulators/desmume/patches/patch-src_ctrlssdl_cpp new file mode 100644 index 00000000000..483fec36620 --- /dev/null +++ b/emulators/desmume/patches/patch-src_ctrlssdl_cpp @@ -0,0 +1,28 @@ +$OpenBSD: patch-src_ctrlssdl_cpp,v 1.1 2019/08/08 17:11:24 cwen Exp $ + +ports-gcc fix for: +error: invalid operands of types '__gnu_cxx::__enable_if::__type {aka double}' and 'int' to binary 'operator>>' +From: +https://sourceforge.net/p/desmume/bugs/1570/ + +Index: src/ctrlssdl.cpp +--- src/ctrlssdl.cpp.orig ++++ src/ctrlssdl.cpp +@@ -200,7 +200,7 @@ u16 get_joy_key(int index) { + break; + case SDL_JOYAXISMOTION: + /* Dead zone of 50% */ +- if( (abs(event.jaxis.value) >> 14) != 0 ) ++ if( ((u32)abs(event.jaxis.value) >> 14) != 0 ) + { + key = ((event.jaxis.which & 15) << 12) | JOY_AXIS << 8 | ((event.jaxis.axis & 127) << 1); + if (event.jaxis.value > 0) { +@@ -370,7 +370,7 @@ do_process_joystick_events( u16 *keypad, SDL_Event *ev + Note: button constants have a 1bit offset. */ + case SDL_JOYAXISMOTION: + key_code = ((event->jaxis.which & 15) << 12) | JOY_AXIS << 8 | ((event->jaxis.axis & 127) << 1); +- if( (abs(event->jaxis.value) >> 14) != 0 ) ++ if( ((u32)abs(event->jaxis.value) >> 14) != 0 ) + { + if (event->jaxis.value > 0) + key_code |= 1;