desmume 0.9.11 was released in 2015. There was no release of 0.9.12, and 0.9.13 was released in May 2022.
Below diff updates to the latest release which moves us forward by 7 years. The nice thing about the update is a lot of patches go away as they are already integrated upstream. Also the updates switches from sdl1 -> sdl2. The changelog mentions a lot of bug fixes and enhancements too. Appears to continue to work on amd64. There are no consumers so this update should be low risk for release. ok? Index: Makefile =================================================================== RCS file: /cvs/ports/emulators/desmume/Makefile,v retrieving revision 1.33 diff -u -p -u -r1.33 Makefile --- Makefile 21 Sep 2023 13:10:25 -0000 1.33 +++ Makefile 26 Sep 2023 23:49:56 -0000 @@ -2,8 +2,9 @@ USE_WXNEEDED = Yes COMMENT = Nintendo DS emulator -DISTNAME = desmume-0.9.11 -REVISION = 12 +V = 0.9.13 +DISTNAME = desmume-${V} +EXTRACT_SUFX = .tar.xz CATEGORIES = emulators @@ -12,37 +13,36 @@ HOMEPAGE = https://desmume.org/ # GPLv2+ PERMIT_PACKAGE = Yes -WANTLIB += agg c m pthread ${LIBCXX} z GL GLU X11 Xcomposite +WANTLIB += ${COMPILER_LIBCXX} GL GLU SDL2 SoundTouch X11 Xcomposite WANTLIB += Xcursor Xdamage Xext Xfixes Xi Xinerama Xrandr Xrender -WANTLIB += fontconfig freetype gdk_pixbuf-2.0 gio-2.0 -WANTLIB += glib-2.0 gobject-2.0 gthread-2.0 SDL SoundTouch -WANTLIB += atk-1.0 cairo gdk-x11-2.0 gtk-x11-2.0 iconv intl -WANTLIB += pango-1.0 pangocairo-1.0 pangoft2-1.0 zzip -WANTLIB += harfbuzz +WANTLIB += agg atk-1.0 c cairo fontconfig freetype gdk-x11-2.0 +WANTLIB += gdk_pixbuf-2.0 gio-2.0 glib-2.0 gobject-2.0 gthread-2.0 +WANTLIB += gtk-x11-2.0 harfbuzz intl m pango-1.0 pangocairo-1.0 +WANTLIB += pangoft2-1.0 pcap z zzip -SITES = ${SITE_SOURCEFORGE:=desmume/} +SITES = https://github.com/TASEmulators/desmume/releases/download/release_${V:S/./_/g}/ RUN_DEPENDS = devel/desktop-file-utils LIB_DEPENDS = archivers/zziplib \ audio/soundtouch \ - devel/sdl \ + devel/sdl2 \ graphics/agg \ graphics/gdk-pixbuf2 \ x11/gtk+2 -CONFIGURE_ENV += CPPFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include" \ - LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib" - MODULES = textproc/intltool - COMPILER = base-clang ports-gcc +FIX_CRLF_FILES = desmume/src/arm_jit.cpp \ + desmume/src/utils/task.cpp + CONFIGURE_STYLE = gnu -FIX_CRLF_FILES = src/MMU_timing.h \ - src/path.h \ - src/arm_jit.cpp \ - src/utils/AsmJit/core/stringbuilder.h + +CONFIGURE_ENV += CPPFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include" \ + LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib" + +WRKSRC=${WRKDIST}/desmume/src/frontend/posix .include <bsd.port.mk> Index: distinfo =================================================================== RCS file: /cvs/ports/emulators/desmume/distinfo,v retrieving revision 1.4 diff -u -p -u -r1.4 distinfo --- distinfo 19 Apr 2015 04:11:16 -0000 1.4 +++ distinfo 26 Sep 2023 23:49:56 -0000 @@ -1,2 +1,2 @@ -SHA256 (desmume-0.9.11.tar.gz) = OrNLpswAlWYkUCXB3ZS/RJtqG0FtJDh8tC4YPHjjiJY= -SIZE (desmume-0.9.11.tar.gz) = 5359305 +SHA256 (desmume-0.9.13.tar.xz) = VzRFDgwl9ELdRM2mpAQQ/WVHD0/i+h658Le22uItq68= +SIZE (desmume-0.9.13.tar.xz) = 10437780 Index: patches/patch-desmume_src_arm_jit_cpp =================================================================== RCS file: patches/patch-desmume_src_arm_jit_cpp diff -N patches/patch-desmume_src_arm_jit_cpp --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-desmume_src_arm_jit_cpp 26 Sep 2023 23:49:56 -0000 @@ -0,0 +1,18 @@ +BSS is immutable so mark it as mutable so that mprotect RWX works + +see: mimmutable(1) +https://github.com/google/syzkaller/commit/bc009f82ea71c399f19eef28f115ff5cda7be4ba + +Index: desmume/src/arm_jit.cpp +--- desmume/src/arm_jit.cpp.orig ++++ desmume/src/arm_jit.cpp +@@ -205,7 +205,8 @@ static u8 recompile_counts[(1<<26)/16]; + // Reduces memory needed for function pointers. + // FIXME win64 needs this too, x86_32 doesn't + +-DS_ALIGN(4096) static u8 scratchpad[1<<25]; ++DS_ALIGN(4096) static u8 scratchpad[1<<25] ++ __attribute__((section(".openbsd.mutable"))); + static u8 *scratchptr; + + struct ASMJIT_API StaticCodeGenerator : public Context Index: patches/patch-desmume_src_frontend_posix_gtk2_main_cpp =================================================================== RCS file: patches/patch-desmume_src_frontend_posix_gtk2_main_cpp diff -N patches/patch-desmume_src_frontend_posix_gtk2_main_cpp --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-desmume_src_frontend_posix_gtk2_main_cpp 26 Sep 2023 23:49:56 -0000 @@ -0,0 +1,17 @@ +https://forums.desmume.org/viewtopic.php?id=10415 + +Index: desmume/src/frontend/posix/gtk2/main.cpp +--- desmume/src/frontend/posix/gtk2/main.cpp.orig ++++ desmume/src/frontend/posix/gtk2/main.cpp +@@ -3551,6 +3551,11 @@ common_gtk_main( class configured_features *my_config) + + gtk_container_add (GTK_CONTAINER (pVBox), pDrawingArea); + ++ /* Set a black background color for a usable full-screen mode. */ ++ GdkColor color; ++ memset(&color, 0, sizeof(color)); ++ gtk_widget_modify_bg(pDrawingArea, GTK_STATE_NORMAL, &color); ++ + gtk_widget_set_events(pDrawingArea, + GDK_EXPOSURE_MASK | GDK_LEAVE_NOTIFY_MASK | + GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | Index: patches/patch-desmume_src_libretro-common_rthreads_rthreads_c =================================================================== RCS file: patches/patch-desmume_src_libretro-common_rthreads_rthreads_c diff -N patches/patch-desmume_src_libretro-common_rthreads_rthreads_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-desmume_src_libretro-common_rthreads_rthreads_c 26 Sep 2023 23:49:56 -0000 @@ -0,0 +1,14 @@ +OpenBSD does not implement pthread_setname_np + +Index: desmume/src/libretro-common/rthreads/rthreads.c +--- desmume/src/libretro-common/rthreads/rthreads.c.orig ++++ desmume/src/libretro-common/rthreads/rthreads.c +@@ -323,7 +323,7 @@ void sthread_setname(sthread_t *thread, const char *na + // any thread. At the time of this writing (2021/08/30), there is no way to + // set the thread name from a different thread when running an Apple OS. + #if !defined(USE_WIN32_THREADS) && !defined(__APPLE__) +- pthread_setname_np(thread->id, name); ++ pthread_set_name_np(thread->id, name); + #endif + } + Index: patches/patch-desmume_src_utils_task_cpp =================================================================== RCS file: patches/patch-desmume_src_utils_task_cpp diff -N patches/patch-desmume_src_utils_task_cpp --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-desmume_src_utils_task_cpp 26 Sep 2023 23:49:56 -0000 @@ -0,0 +1,14 @@ +OpenBSD does not implement pthread_setname_np + +Index: desmume/src/utils/task.cpp +--- desmume/src/utils/task.cpp.orig ++++ desmume/src/utils/task.cpp +@@ -65,7 +65,7 @@ static void taskProc(void *arg) + #if defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) + if (ctx->needSetThreadName) + { +- pthread_setname_np(ctx->threadName); ++ pthread_set_name_np(ctx->threadName); + ctx->needSetThreadName = false; + } + #endif Index: patches/patch-desmume_src_wifi_cpp =================================================================== RCS file: patches/patch-desmume_src_wifi_cpp diff -N patches/patch-desmume_src_wifi_cpp --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-desmume_src_wifi_cpp 26 Sep 2023 23:49:56 -0000 @@ -0,0 +1,13 @@ +Missing includes for INADDR_ANY + +Index: desmume/src/wifi.cpp +--- desmume/src/wifi.cpp.orig ++++ desmume/src/wifi.cpp +@@ -44,6 +44,7 @@ + #include <string.h> + #include <arpa/inet.h> + #include <sys/socket.h> ++#include <netinet/in.h> + #define socket_t int + #define sockaddr_t struct sockaddr + #define closesocket close Index: patches/patch-src_MMU_timing_h =================================================================== RCS file: patches/patch-src_MMU_timing_h diff -N patches/patch-src_MMU_timing_h --- patches/patch-src_MMU_timing_h 11 Mar 2022 18:59:34 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,19 +0,0 @@ -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 }; Index: patches/patch-src_arm_jit_cpp =================================================================== RCS file: patches/patch-src_arm_jit_cpp diff -N patches/patch-src_arm_jit_cpp --- patches/patch-src_arm_jit_cpp 13 Dec 2022 04:37:09 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,18 +0,0 @@ -BSS is immutable so mark it as mutable so that mprotect RWX works - -see: mimmutable(1) -https://github.com/google/syzkaller/commit/bc009f82ea71c399f19eef28f115ff5cda7be4ba - -Index: src/arm_jit.cpp ---- src/arm_jit.cpp.orig -+++ src/arm_jit.cpp -@@ -198,7 +198,8 @@ static u8 recompile_counts[(1<<26)/16]; - // Reduces memory needed for function pointers. - // FIXME win64 needs this too, x86_32 doesn't - --DS_ALIGN(4096) static u8 scratchpad[1<<25]; -+DS_ALIGN(4096) static u8 scratchpad[1<<25] -+ __attribute__((section(".openbsd.mutable"))); - static u8 *scratchptr; - - struct ASMJIT_API StaticCodeGenerator : public Context Index: patches/patch-src_ctrlssdl_cpp =================================================================== RCS file: patches/patch-src_ctrlssdl_cpp diff -N patches/patch-src_ctrlssdl_cpp --- patches/patch-src_ctrlssdl_cpp 11 Mar 2022 18:59:34 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,26 +0,0 @@ -ports-gcc fix for: -error: invalid operands of types '__gnu_cxx::__enable_if<true, double>::__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; Index: patches/patch-src_gfx3d_cpp =================================================================== RCS file: patches/patch-src_gfx3d_cpp diff -N patches/patch-src_gfx3d_cpp --- patches/patch-src_gfx3d_cpp 11 Mar 2022 18:59:34 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,53 +0,0 @@ -Index: src/gfx3d.cpp ---- src/gfx3d.cpp.orig -+++ src/gfx3d.cpp -@@ -1215,24 +1215,24 @@ static void gfx3d_glNormal(s32 v) - - //apply lighting model - u8 diffuse[3] = { -- (dsDiffuse)&0x1F, -- (dsDiffuse>>5)&0x1F, -- (dsDiffuse>>10)&0x1F }; -+ (u8)( dsDiffuse & 0x1F), -+ (u8)((dsDiffuse >> 5) & 0x1F), -+ (u8)((dsDiffuse >> 10) & 0x1F) }; - - u8 ambient[3] = { -- (dsAmbient)&0x1F, -- (dsAmbient>>5)&0x1F, -- (dsAmbient>>10)&0x1F }; -+ (u8)( dsAmbient & 0x1F), -+ (u8)((dsAmbient >> 5) & 0x1F), -+ (u8)((dsAmbient >> 10) & 0x1F) }; - - u8 emission[3] = { -- (dsEmission)&0x1F, -- (dsEmission>>5)&0x1F, -- (dsEmission>>10)&0x1F }; -+ (u8)( dsEmission & 0x1F), -+ (u8)((dsEmission >> 5) & 0x1F), -+ (u8)((dsEmission >> 10) & 0x1F) }; - - u8 specular[3] = { -- (dsSpecular)&0x1F, -- (dsSpecular>>5)&0x1F, -- (dsSpecular>>10)&0x1F }; -+ (u8)( dsSpecular & 0x1F), -+ (u8)((dsSpecular >> 5) & 0x1F), -+ (u8)((dsSpecular >> 10) & 0x1F) }; - - int vertexColor[3] = { emission[0], emission[1], emission[2] }; - -@@ -1241,9 +1241,9 @@ static void gfx3d_glNormal(s32 v) - if(!((lightMask>>i)&1)) continue; - - u8 _lightColor[3] = { -- (lightColor[i])&0x1F, -- (lightColor[i]>>5)&0x1F, -- (lightColor[i]>>10)&0x1F }; -+ (u8)( lightColor[i] & 0x1F), -+ (u8)((lightColor[i] >> 5) & 0x1F), -+ (u8)((lightColor[i] >> 10) & 0x1F) }; - - //This formula is the one used by the DS - //Reference : http://nocash.emubase.de/gbatek.htm#ds3dpolygonlightparameters Index: patches/patch-src_gtk_main_cpp =================================================================== RCS file: patches/patch-src_gtk_main_cpp diff -N patches/patch-src_gtk_main_cpp --- patches/patch-src_gtk_main_cpp 11 Mar 2022 18:59:34 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,17 +0,0 @@ -https://forums.desmume.org/viewtopic.php?id=10415 - -Index: src/gtk/main.cpp ---- src/gtk/main.cpp.orig -+++ src/gtk/main.cpp -@@ -3131,6 +3131,11 @@ common_gtk_main( class configured_features *my_config) - pDrawingArea = gtk_drawing_area_new(); - gtk_container_add (GTK_CONTAINER (pVBox), pDrawingArea); - -+ /* Set a black background color for a usable full-screen mode. */ -+ GdkColor color; -+ memset(&color, 0, sizeof(color)); -+ gtk_widget_modify_bg(pDrawingArea, GTK_STATE_NORMAL, &color); -+ - gtk_widget_set_events(pDrawingArea, - GDK_EXPOSURE_MASK | GDK_LEAVE_NOTIFY_MASK | - GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | Index: patches/patch-src_path_h =================================================================== RCS file: patches/patch-src_path_h diff -N patches/patch-src_path_h --- patches/patch-src_path_h 13 Dec 2022 04:37:10 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,14 +0,0 @@ -From upstream 8454c93fa37ce9f3c8becc7004a2edddba22f3a1. - -Index: src/path.h ---- src/path.h.orig -+++ src/path.h -@@ -375,7 +375,7 @@ class PathInfo (public) - else if (strchr(strftimeArgs, *p)) - { - char tmp[MAX_PATH]; -- char format[] = { '%', *p, NULL }; -+ char format[] = { '%', *p, '\0' }; - strftime(tmp, MAX_PATH, format, time_struct); - file.append(tmp); - } Index: patches/patch-src_utils_AsmJit_core_stringbuilder_h =================================================================== RCS file: patches/patch-src_utils_AsmJit_core_stringbuilder_h diff -N patches/patch-src_utils_AsmJit_core_stringbuilder_h --- patches/patch-src_utils_AsmJit_core_stringbuilder_h 11 Mar 2022 18:59:34 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,11 +0,0 @@ ---- src/utils/AsmJit/core/stringbuilder.h.orig Tue Apr 14 22:45:30 2015 -+++ src/utils/AsmJit/core/stringbuilder.h Tue Apr 14 22:45:45 2015 -@@ -10,6 +10,8 @@ - #ifndef _ASMJIT_CORE_STRINGBUILDER_H - #define _ASMJIT_CORE_STRINGBUILDER_H - -+#include <cstdarg> -+ - // [Dependencies - AsmJit] - #include "../core/assert.h" - #include "../core/defs.h" Index: patches/patch-src_utils_libfat_directory_cpp =================================================================== RCS file: patches/patch-src_utils_libfat_directory_cpp diff -N patches/patch-src_utils_libfat_directory_cpp --- patches/patch-src_utils_libfat_directory_cpp 11 Mar 2022 18:59:34 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -Index: src/utils/libfat/directory.cpp ---- src/utils/libfat/directory.cpp.orig -+++ src/utils/libfat/directory.cpp -@@ -139,7 +139,7 @@ static size_t _FAT_directory_mbstoucs2 (ucs2_t* dst, c - int bytes; - size_t count = 0; - -- while (count < len-1 && src != '\0') { -+ while (count < len-1 && *src != '\0') { - bytes = mbrtowc (&tempChar, src, MB_CUR_MAX, &ps); - if (bytes > 0) { - *dst = (ucs2_t)tempChar; Index: patches/patch-src_utils_xstring_cpp =================================================================== RCS file: patches/patch-src_utils_xstring_cpp diff -N patches/patch-src_utils_xstring_cpp --- patches/patch-src_utils_xstring_cpp 11 Mar 2022 18:59:34 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,27 +0,0 @@ -Index: src/utils/xstring.cpp ---- src/utils/xstring.cpp.orig -+++ src/utils/xstring.cpp -@@ -277,8 +277,8 @@ std::string BytesToString(const void* data, int len) - { - Base64Table[ input[0] >> 2 ], - Base64Table[ ((input[0] & 0x03) << 4) | (input[1] >> 4) ], -- n<2 ? '=' : Base64Table[ ((input[1] & 0x0F) << 2) | (input[2] >> 6) ], -- n<3 ? '=' : Base64Table[ input[2] & 0x3F ] -+ (unsigned char)(n<2 ? '=' : Base64Table[ ((input[1] & 0x0F) << 2) | (input[2] >> 6) ]), -+ (unsigned char)(n<3 ? '=' : Base64Table[ input[2] & 0x3F ]) - }; - ret.append(output, output+4); - } -@@ -342,9 +342,9 @@ bool StringToBytes(const std::string& str, void* data, - } - unsigned char outpacket[3] = - { -- (converted[0] << 2) | (converted[1] >> 4), -- (converted[1] << 4) | (converted[2] >> 2), -- (converted[2] << 6) | (converted[3]) -+ (unsigned char)((converted[0] << 2) | (converted[1] >> 4)), -+ (unsigned char)((converted[1] << 4) | (converted[2] >> 2)), -+ (unsigned char)((converted[2] << 6) | (converted[3])) - }; - int outlen = (input[2] == '=') ? 1 : (input[3] == '=' ? 2 : 3); - if(outlen > len) outlen = len; Index: patches/patch-src_wifi_cpp =================================================================== RCS file: patches/patch-src_wifi_cpp diff -N patches/patch-src_wifi_cpp --- patches/patch-src_wifi_cpp 11 Mar 2022 18:59:34 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,15 +0,0 @@ -Index: src/wifi.cpp ---- src/wifi.cpp.orig -+++ src/wifi.cpp -@@ -314,9 +314,9 @@ WifiComInterface* wifiCom; - - #if (WIFI_LOGGING_LEVEL >= 1) - #if WIFI_LOG_USE_LOGC -- #define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) LOGC(8, "WIFI: "__VA_ARGS__); -+ #define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) LOGC(8, "WIFI: " __VA_ARGS__); - #else -- #define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) printf("WIFI: "__VA_ARGS__); -+ #define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) printf("WIFI: " __VA_ARGS__); - #endif - #else - #define WIFI_LOG(level, ...) {}