View | Details | Raw Unified | Return to bug 280527 | Differences between
and this patch

Collapse All | Expand All

(-)b/emulators/Makefile (+1 lines)
Lines 6-11 Link Here
6
    SUBDIR += anese
6
    SUBDIR += anese
7
    SUBDIR += aqemu
7
    SUBDIR += aqemu
8
    SUBDIR += aranym
8
    SUBDIR += aranym
9
    SUBDIR += ares
9
    SUBDIR += atari800
10
    SUBDIR += atari800
10
    SUBDIR += bfe
11
    SUBDIR += bfe
11
    SUBDIR += bochs
12
    SUBDIR += bochs
(-)b/emulators/ares/Makefile (+221 lines)
Added Link Here
1
PORTNAME=	ares
2
DISTVERSION=	139.20240809
3
CATEGORIES=	emulators
4
5
MAINTAINER=	bsdcode@disroot.org
6
COMMENT=	Multi-system emulator
7
WWW=		https://github.com/ares-emulator/ares
8
9
LICENSE=	ISCL
10
LICENSE_FILE=	${WRKSRC}/LICENSE
11
12
LIB_DEPENDS=	librashader.so:devel/librashader
13
14
FLAVORS=	gtk3 qt5
15
FLAVOR?=	${FLAVORS:[1]}
16
17
gtk3_LIB_DEPENDS=	libcanberra-gtk3.so:audio/libcanberra-gtk3
18
qt5_PKGNAMESUFFIX=	-qt5
19
20
USES=		compiler:c++17-lang gmake pkgconfig xorg
21
USE_GITHUB=	yes
22
GH_ACCOUNT=	ares-emulator
23
GH_TAGNAME=	a76847d
24
.if ${FLAVOR:U} == gtk3
25
USES+=		gnome
26
USE_GNOME=	gtksourceview3
27
.elif ${FLAVOR:U} == qt5
28
USES+=		qt:5
29
USE_QT=		core gui widgets buildtools:build
30
.endif
31
USE_XORG=	x11 xext xrandr
32
33
MAKEFILE=	GNUmakefile
34
MAKE_ARGS=	compiler=${CC} \
35
		cores= \
36
		librashader=true \
37
		local=false \
38
		lto=false \
39
		prefix=${PREFIX} \
40
		ruby=video.none \
41
		sdl2=false \
42
		symbols=false \
43
		threaded=true
44
.if ${FLAVOR:U} == gtk3
45
MAKE_ARGS+=	hiro=gtk3-se
46
.elif ${FLAVOR:U} == qt5
47
MAKE_ARGS+=	hiro=qt5
48
.endif
49
50
CFLAGS+=	-DLIBRA_RUNTIME_OPENGL
51
52
# https://github.com/ares-emulator/ares/issues/1572
53
.if ${FLAVOR:U} == qt5
54
LTO_UNSAFE=	yes
55
.endif
56
57
CONFLICTS_INSTALL=	ares ares-qt5
58
59
OPTIONS_DEFINE=		DEBUG DOCS NVIDIA OPENMP SHADER
60
OPTIONS_DEFAULT=	A26 ALSA AO CV FC GB GBA GLX MD MS MSX MYVISION N64 NG \
61
			NGP OPENAL OPENMP OSS PCE PERFORMANCE PS1 SDLAUDIO \
62
			SDLINPUT SFC SG SHADER SPEC UDEV UHID WS XLIB XVIDEO
63
OPTIONS_GROUP=		AUDIO CORES INPUT VIDEO
64
OPTIONS_GROUP_AUDIO=	ALSA AO OPENAL OSS PULSEAUDIO SDLAUDIO
65
OPTIONS_GROUP_CORES=	A26 CV FC GB GBA MD MS MSX MYVISION N64 NG NGP PCE PS1 \
66
			SFC SG SPEC WS
67
OPTIONS_GROUP_INPUT=	SDLINPUT UDEV UHID XLIB
68
OPTIONS_GROUP_VIDEO=	GLX XVIDEO
69
OPTIONS_SINGLE=		PROFILE
70
OPTIONS_SINGLE_PROFILE=	ACCURACY PERFORMANCE
71
72
A26_DESC=		Atari 2600
73
ACCURACY_DESC=		Slower but more accurate
74
CV_DESC=		ColecoVision
75
FC_DESC=		NES / Famicom
76
GBA_DESC=		Game Boy Advance
77
GB_DESC=		Game Boy
78
MD_DESC=		Mega Drive / Genesis
79
MSX_DESC=		MSX
80
MS_DESC=		Master System / Mark III
81
MYVISION_DESC=		My Vision
82
N64_DESC=		Nintendo 64
83
NGP_DESC=		Neo Geo Pocket
84
NG_DESC=		Neo Geo (AES/MVS)
85
NVIDIA_DESC=		Apply shader cache workaround (implies ${NVIDIA_IMPLIES})
86
PCE_DESC=		PC-Engine / TurboGrafx
87
PERFORMANCE_DESC=	Faster but less accurate
88
PROFILE_DESC=
89
PS1_DESC=		PlayStation
90
SDLAUDIO_DESC=		${SDL_DESC}
91
SDLINPUT_DESC=		${SDL_DESC}
92
SFC_DESC=		SNES / Super Famicom
93
SG_DESC=		SG-1000
94
SHADER_DESC=		Build with shader support
95
SPEC_DESC=		ZX Spectrum
96
UDEV_DESC=		UDEV input support
97
UHID_DESC=		UHID input support
98
VIDEO_DESC=
99
WS_DESC=		WonderSwan
100
XLIB_DESC=		XLIB input support
101
102
A26_MAKE_ARGS=	cores+=a26
103
104
ACCURACY_MAKE_ARGS=	profile=accuracy
105
106
ALSA_LIB_DEPENDS=	libasound.so:audio/alsa-lib
107
ALSA_MAKE_ARGS=		ruby+=audio.alsa
108
109
AO_LIB_DEPENDS=	libao.so:audio/libao
110
AO_MAKE_ARGS=	ruby+=audio.ao
111
112
CV_MAKE_ARGS=	cores+=cv
113
114
DEBUG_MAKE_ARGS=	build=debug
115
DEBUG_MAKE_ARGS_OFF=	build=release
116
117
FC_MAKE_ARGS=	cores+=fc
118
119
GBA_MAKE_ARGS=	cores+=gba
120
121
GB_MAKE_ARGS=	cores+=gb
122
123
GLX_USES=	gl
124
GLX_USE=	GL=egl
125
GLX_MAKE_ARGS=	ruby+=video.glx
126
127
MD_MAKE_ARGS=	cores+=md
128
129
MSX_MAKE_ARGS=	cores+=msx
130
131
MS_MAKE_ARGS=	cores+=ms
132
133
MYVISION_MAKE_ARGS=	cores+=myvision
134
135
N64_RUN_DEPENDS=	${LOCALBASE}/lib/libvulkan.so:graphics/vulkan-loader
136
N64_MAKE_ARGS=		cores+=n64 \
137
			vulkan=true
138
N64_MAKE_ARGS_OFF=	vulkan=false
139
N64_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-ares_n64_vulkan_parallel-rdp_util_timer.cpp
140
141
NGP_MAKE_ARGS=	cores+=ngp
142
143
NG_MAKE_ARGS=	cores+=ng
144
145
NVIDIA_IMPLIES=		N64
146
NVIDIA_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-ares_n64_vulkan_parallel-rdp_vulkan_device.cpp
147
148
OPENAL_USES=		openal
149
OPENAL_MAKE_ARGS=	ruby+=audio.openal
150
151
OPENMP_MAKE_ARGS=	openmp=true
152
OPENMP_MAKE_ARGS_OFF=	openmp=false
153
154
OSS_MAKE_ARGS=	ruby+=audio.oss
155
156
PCE_MAKE_ARGS=	cores+=pce
157
158
PERFORMANCE_MAKE_ARGS=	profile=performance
159
160
PS1_MAKE_ARGS=	cores+=ps1
161
162
PULSEAUDIO_LIB_DEPENDS=	libpulse-simple.so:audio/pulseaudio \
163
			libpulse.so:audio/pulseaudio
164
PULSEAUDIO_MAKE_ARGS=	ruby+=audio.pulseaudio \
165
			ruby+=audio.pulseaudiosimple
166
167
SDLAUDIO_USES=		sdl
168
SDLAUDIO_USE=		SDL=sdl2
169
SDLAUDIO_MAKE_ARGS=	ruby+=audio.sdl \
170
			sdl2=true
171
172
SDLINPUT_USES=		sdl
173
SDLINPUT_USE=		SDL=sdl2
174
SDLINPUT_MAKE_ARGS=	ruby+=input.sdl \
175
			sdl2=true
176
177
SFC_MAKE_ARGS=	cores+=sfc
178
179
SG_MAKE_ARGS=	cores+=sg
180
181
SHADER_RUN_DEPENDS=	${LOCALBASE}/${_SHADERS}/bilinear.slangp:games/libretro-shaders-slang
182
SHADER_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-desktop-ui_desktop-ui.cpp
183
184
SPEC_MAKE_ARGS=	cores+=spec
185
186
UDEV_LIB_DEPENDS=	libudev.so:devel/libudev-devd
187
UDEV_MAKE_ARGS=		ruby+=input.udev
188
189
UHID_MAKE_ARGS=	ruby+=input.uhid
190
191
WS_MAKE_ARGS=	cores+=ws
192
193
XLIB_MAKE_ARGS=	ruby+=input.xlib
194
195
XVIDEO_USE=		XORG=xv
196
XVIDEO_MAKE_ARGS=	ruby+=video.xvideo
197
198
_SHADERS=	share/libretro/shaders/shaders_slang
199
200
post-patch-SHADER-on:
201
	${REINPLACE_CMD} 's|@@SHADERS@@|${PREFIX}/${_SHADERS}/|g' \
202
		${WRKSRC}/desktop-ui/desktop-ui.cpp
203
204
do-install:
205
	${INSTALL_PROGRAM} ${WRKSRC}/desktop-ui/out/ares \
206
		${STAGEDIR}${PREFIX}/bin
207
	${INSTALL_DATA} ${WRKSRC}/desktop-ui/resource/ares.desktop \
208
		${STAGEDIR}${PREFIX}/share/applications
209
	${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/256x256/apps
210
	${INSTALL_DATA} ${WRKSRC}/desktop-ui/resource/ares.png \
211
		${STAGEDIR}${PREFIX}/share/icons/hicolor/256x256/apps
212
	${MKDIR} ${STAGEDIR}${DATADIR}/Database
213
	(cd ${WRKSRC}/mia/Database && \
214
		${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/Database)
215
216
post-install-DOCS-on:
217
	${MKDIR} ${STAGEDIR}${DOCSDIR}
218
	${INSTALL_DATA} ${WRKSRC}/README.md \
219
		${STAGEDIR}${DOCSDIR}
220
221
.include <bsd.port.mk>
(-)b/emulators/ares/distinfo (+3 lines)
Added Link Here
1
TIMESTAMP = 1723230097
2
SHA256 (ares-emulator-ares-139.20240809-a76847d_GH0.tar.gz) = e1a47c0b8d55214ae4980c7d8248f8024e70b04cfcf7b21cd6a0f0dcd1e3e9b2
3
SIZE (ares-emulator-ares-139.20240809-a76847d_GH0.tar.gz) = 50955748
(-)b/emulators/ares/files/extra-patch-ares_n64_vulkan_parallel-rdp_util_timer.cpp (+13 lines)
Added Link Here
1
https://github.com/Themaister/Granite/pull/135
2
3
--- ares/n64/vulkan/parallel-rdp/util/timer.cpp.orig	2024-07-28 10:49:58 UTC
4
+++ ares/n64/vulkan/parallel-rdp/util/timer.cpp
5
@@ -107,7 +107,7 @@ int64_t get_current_time_nsecs()
6
 	return int64_t(double(li.QuadPart) * static_qpc_freq.inv_freq);
7
 #else
8
 	struct timespec ts = {};
9
-#ifdef ANDROID
10
+#if defined(ANDROID) || defined(__FreeBSD__)
11
 	constexpr auto timebase = CLOCK_MONOTONIC;
12
 #else
13
 	constexpr auto timebase = CLOCK_MONOTONIC_RAW;
(-)b/emulators/ares/files/extra-patch-ares_n64_vulkan_parallel-rdp_vulkan_device.cpp (+13 lines)
Added Link Here
1
https://github.com/Themaister/Granite/issues/133
2
3
--- ares/n64/vulkan/parallel-rdp/vulkan/device.cpp.orig	2024-08-11 00:29:27 UTC
4
+++ ares/n64/vulkan/parallel-rdp/vulkan/device.cpp
5
@@ -874,7 +874,7 @@ void Device::init_workarounds()
6
 		workarounds.emulate_event_as_pipeline_barrier = true;
7
 	}
8
 
9
-	if (ext.driver_id == VK_DRIVER_ID_NVIDIA_PROPRIETARY && gpu_props.driverVersion < VK_VERSION_MAJOR(535))
10
+	if (ext.driver_id == VK_DRIVER_ID_NVIDIA_PROPRIETARY)
11
 	{
12
 		LOGW("Disabling pipeline cache control.\n");
13
 		workarounds.broken_pipeline_cache_control = true;
(-)b/emulators/ares/files/extra-patch-desktop-ui_desktop-ui.cpp (+15 lines)
Added Link Here
1
--- desktop-ui/desktop-ui.cpp.orig	2024-07-28 14:18:09 UTC
2
+++ desktop-ui/desktop-ui.cpp
3
@@ -22,6 +22,12 @@ auto locate(const string& name) -> string {
4
   location = {Path::sharedData(), "ares/", name};
5
   if(inode::exists(location)) return location;
6
 
7
+  // 3a. The thirdparty shaders directory
8
+  if(name == "Shaders/") {
9
+    location = "@@SHADERS@@";
10
+    if(inode::exists(location)) return location;
11
+  }
12
+
13
   // 4. The application bundle resource directory (macOS only)
14
 #if defined(PLATFORM_MACOS)
15
   location = {Path::resources(), name};
(-)b/emulators/ares/files/patch-desktop-ui_GNUmakefile (+22 lines)
Added Link Here
1
--- desktop-ui/GNUmakefile.orig	2024-07-30 10:16:19 UTC
2
+++ desktop-ui/GNUmakefile
3
@@ -7,7 +7,8 @@ librashader	:= true
4
 local := true
5
 lto := true
6
 librashader	:= true
7
-flags += -I. -I.. -I../ares -I../thirdparty -I../thirdparty/librashader/include -DMIA_LIBRARY
8
+flags += -I. -I.. -I../ares -I../thirdparty -DMIA_LIBRARY
9
+flags += ${CFLAGS}
10
 
11
 nall.path := ../nall
12
 include $(nall.path)/GNUmakefile
13
@@ -16,9 +17,6 @@ ifneq ($(filter $(arch),x86 amd64),)
14
   ifeq ($(filter cl,$(compiler)),)
15
     ifeq ($(local),true)
16
       flags += -march=native
17
-    else
18
-      # For official builds, default to x86-64-v2 (Intel Nehalem, AMD Bulldozer) which supports up to SSE 4.2.
19
-      flags += -march=x86-64-v2
20
     endif
21
   endif
22
 endif
(-)b/emulators/ares/files/patch-nall_GNUmakefile (+20 lines)
Added Link Here
1
--- nall/GNUmakefile.orig	2024-08-10 21:36:53 UTC
2
+++ nall/GNUmakefile
3
@@ -169,8 +169,6 @@ ifeq ($(build),debug)
4
   lto = false
5
   ifeq ($(cl),true)
6
     flags += -Od
7
-  else
8
-    flags += -Og
9
   endif
10
   flags += -DBUILD_DEBUG
11
 else ifeq ($(build),stable)
12
@@ -178,7 +176,7 @@ else ifeq ($(build),release)
13
 else ifeq ($(build),minified)
14
   flags += -Os -DBUILD_MINIFIED
15
 else ifeq ($(build),release)
16
-  flags += -O2 -DBUILD_RELEASE
17
+  flags += -DBUILD_RELEASE
18
 else ifeq ($(build),optimized)
19
   ifeq ($(cl),true)
20
     flags += -O2
(-)b/emulators/ares/files/patch-ruby_video_opengl_opengl.hpp (+11 lines)
Added Link Here
1
--- ruby/video/opengl/opengl.hpp.orig	2024-07-28 21:40:16 UTC
2
+++ ruby/video/opengl/opengl.hpp
3
@@ -18,7 +18,7 @@
4
 
5
 #include "bind.hpp"
6
 #include "utility.hpp"
7
-#include "librashader_ld.h"
8
+#include <librashader/librashader_ld.h>
9
 
10
 struct OpenGL;
11
 
(-)b/emulators/ares/pkg-descr (+20 lines)
Added Link Here
1
ares is an open-source multi-system emulator with a focus on accuracy and
2
preservation. It is a descendant of the emulators higan and bsnes. It's source
3
code is structured to be maximally readable and self-documenting.
4
5
ares supports the following systems: Arcade, WonderSwan, WonderSwan Color,
6
Pocket Challenge V2, ColecoVision, PC-Engine / TurboGrafx, SuperGrafx, My
7
Vision, NES / Famicom, Famicom Disk System, SNES / Super Famicom, Satellaview,
8
Sufami Turbo, Nintendo 64, Nintendo 64DD, Game Boy, Game Boy Color, Game Boy
9
Advance, SG-1000, Master System / Mark III, Mega Drive / Genesis, Mega CD, 32X,
10
Game Gear, Neo Geo Pocket, Neo Geo Pocket Color
11
12
ares has experimental support for the following systems: Atari 2600, MSX, MSX2,
13
PC-Engine CD / TurboGrafx CD, ZX Spectrum, Neo Geo (AES/MVS), PlayStation
14
15
ares has all the features one would expect from a great emulator system: native
16
multi-platform UI, dynamic rate control, save states, run-ahead, rewind and
17
fast-forward, pixel shaders, color correction, input multi-mapping, debugger
18
19
ares uses librashader for it's pixel shader engine. This means it is highly
20
compatible with existing slang shaders, e.g. the slang-shaders from libretro.
(-)b/emulators/ares/pkg-message (+35 lines)
Added Link Here
1
[
2
{ type: install
3
  message: <<EOM
4
Users are encouraged to compile the port on their systems with
5
6
    CFLAGS   ?= -O3
7
    CPUTYPE  ?= native
8
    WITH_LTO =  yes
9
10
This can improve the performance of demanding cores like the N64. Currently the
11
QT5 flavor segfaults when the port is compiled with Link-Time Optimization (LTO),
12
see https://github.com/ares-emulator/ares/issues/1572. Because of this the port
13
disables LTO when compiling the QT5 flavor.
14
15
NVIDIA GPU users with versions >= 535 of the x11/nvidia-driver could encounter
16
crashes or freezes while using the N64 core, see
17
https://github.com/ares-emulator/ares/issues/1547 and
18
https://github.com/Themaister/Granite/issues/133. As a workaround either try to
19
compile the port with the NVIDIA option set, or disable the NVIDIA shader disk
20
cache at start with
21
22
    $ __GL_SHADER_DISK_CACHE=0 ares
23
24
The port uses the shaders from games/libretro-shaders-slang by default. Users
25
can curate and utilize their own provided collection of shaders by putting them
26
into the user data directory
27
28
    ${HOME}/.local/share/ares/Shaders/
29
30
ares won't process its own installed shaders if it finds any shaders in the user
31
data directory. Delete or rename the local shaders directory in order to make
32
ares use its own shaders again.
33
EOM
34
}
35
]
(-)b/emulators/ares/pkg-plist (-1 / +13 lines)
Added Link Here
0
- 
1
bin/ares
2
share/applications/ares.desktop
3
%%DATADIR%%/Database/Arcade.bml
4
%%DATADIR%%/Database/BS Memory.bml
5
%%DATADIR%%/Database/Famicom.bml
6
%%DATADIR%%/Database/MSX.bml
7
%%DATADIR%%/Database/MSX2.bml
8
%%DATADIR%%/Database/Neo Geo.bml
9
%%DATADIR%%/Database/Sufami Turbo.bml
10
%%DATADIR%%/Database/Super Famicom Boards.bml
11
%%DATADIR%%/Database/Super Famicom.bml
12
%%PORTDOCS%%%%DOCSDIR%%/README.md
13
share/icons/hicolor/256x256/apps/ares.png

Return to bug 280527