diff --git a/emulators/Makefile b/emulators/Makefile index e46f7b420ca6..c31b948ba065 100644 --- a/emulators/Makefile +++ b/emulators/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.349 2023/05/20 13:26:51 thorpej Exp $ +# $NetBSD: Makefile,v 1.350 2023/05/29 19:30:47 nia Exp $ # COMMENT= Emulators for other machines and systems @@ -61,6 +61,7 @@ SUBDIR+= dynagen SUBDIR+= dynamips SUBDIR+= e-uae SUBDIR+= emulationstation +SUBDIR+= fbneo SUBDIR+= fceu SUBDIR+= fmsx SUBDIR+= free42 diff --git a/emulators/fbneo/DESCR b/emulators/fbneo/DESCR new file mode 100644 index 000000000000..267065dbcd77 --- /dev/null +++ b/emulators/fbneo/DESCR @@ -0,0 +1,3 @@ +FinalBurn Neo is an emulator for arcade games and select consoles. + +It is based on the emulators FinalBurn and old versions of MAME. diff --git a/emulators/fbneo/Makefile b/emulators/fbneo/Makefile new file mode 100644 index 000000000000..a9e62d3688e1 --- /dev/null +++ b/emulators/fbneo/Makefile @@ -0,0 +1,55 @@ +# $NetBSD: Makefile,v 1.1 2023/05/29 19:30:47 nia Exp $ + +DISTNAME= FBNeo-1.0.0.2 +PKGNAME= ${DISTNAME:tl} +CATEGORIES= emulators +MASTER_SITES= ${MASTER_SITE_GITHUB:=finalburnneo/} +GITHUB_PROJECT= fbneo +GITHUB_TAG= v${PKGVERSION_NOREV} + +MAINTAINER= nia@NetBSD.org +HOMEPAGE= https://github.com/finalburnneo/FBNeo +COMMENT= FinalBurn Neo - the arcade game emulator (SDL2 version) +LICENSE= fbalpha-license + +USE_TOOLS+= gmake perl +MAKE_FILE= makefile + +WRKSRC= ${WRKDIR}/${DISTNAME} + +BUILD_TARGET= sdl2 + +MAKE_FLAGS+= RELEASEBUILD=1 +MAKE_FLAGS+= FORCE_SYSTEM_LIBPNG=1 +MAKE_FLAGS+= INCLUDE_7Z_SUPPORT=1 +MAKE_FLAGS+= PERL=1 + +REPLACE_PERL+= src/dep/scripts/*.pl + +.include "../../mk/bsd.prefs.mk" + +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" +MAKE_FLAGS+= LSB_FIRST=1 +TOOL_DEPENDS+= nasm-[0-9]*:../../devel/nasm +.endif + +LDFLAGS+= -lpng -lz + +MAKE_JOBS_SAFE= no + +INSTALLATION_DIRS+= bin +INSTALLATION_DIRS+= share/applications +INSTALLATION_DIRS+= share/pixmaps + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/fbneo ${DESTDIR}${PREFIX}/bin + ${INSTALL_DATA} ${FILESDIR}/fbneo.desktop ${DESTDIR}${PREFIX}/share/applications + ${INSTALL_DATA} ${WRKSRC}/projectfiles/xcode/Emulator/Assets.xcassets/AppIcon.appiconset/icon_128.png \ + ${DESTDIR}${PREFIX}/share/pixmaps/fbneo.png + +.include "../../devel/SDL2/buildlink3.mk" +.include "../../devel/zlib/buildlink3.mk" +.include "../../graphics/SDL2_image/buildlink3.mk" +.include "../../graphics/png/buildlink3.mk" +.include "../../sysutils/desktop-file-utils/desktopdb.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/emulators/fbneo/PLIST b/emulators/fbneo/PLIST new file mode 100644 index 000000000000..e3fe5bddd82b --- /dev/null +++ b/emulators/fbneo/PLIST @@ -0,0 +1,4 @@ +@comment $NetBSD: PLIST,v 1.1 2023/05/29 19:30:47 nia Exp $ +bin/fbneo +share/applications/fbneo.desktop +share/pixmaps/fbneo.png diff --git a/emulators/fbneo/distinfo b/emulators/fbneo/distinfo new file mode 100644 index 000000000000..c432c8ba953c --- /dev/null +++ b/emulators/fbneo/distinfo @@ -0,0 +1,9 @@ +$NetBSD: distinfo,v 1.1 2023/05/29 19:30:47 nia Exp $ + +BLAKE2s (FBNeo-1.0.0.2.tar.gz) = 53db8d6df7bffe800159d529867168889742523f9db6196972343f9a78a46b35 +SHA512 (FBNeo-1.0.0.2.tar.gz) = 5ba58d89e3f119a3521e9ba4278ca85b818912a11663be3e1aa1ab80a03fc8b76974709232c1dc27f5e5877db251d6878f7c0b9bc9e4ae4ab583a12bd617b98b +Size (FBNeo-1.0.0.2.tar.gz) = 12171430 bytes +SHA1 (patch-makefile) = 94c77fe8b5c8f7b924c507d7b327f9ef25bb3409 +SHA1 (patch-makefile.sdl2) = a41b13f31faccf2e6bb075290f926fb64ca7b1d5 +SHA1 (patch-src_burn_burnint.h) = 1050d2088c17b0763c47fef6a0674b5eb94b7ba6 +SHA1 (patch-src_burner_burner.h) = a09ded507381d6f2bb9d4476813122a53415c01d diff --git a/emulators/fbneo/files/fbneo.desktop b/emulators/fbneo/files/fbneo.desktop new file mode 100644 index 000000000000..fe98f05a23a5 --- /dev/null +++ b/emulators/fbneo/files/fbneo.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Application +Encoding=UTF-8 +Name=FinalBurn Neo +Comment=Arcade game emulator +Icon=fbneo +Exec=fbneo -menu -integerscale -joy +Terminal=false +Categories=Game;Emulator; diff --git a/emulators/fbneo/patches/patch-makefile b/emulators/fbneo/patches/patch-makefile new file mode 100644 index 000000000000..b6c1028829de --- /dev/null +++ b/emulators/fbneo/patches/patch-makefile @@ -0,0 +1,28 @@ +$NetBSD: patch-makefile,v 1.1 2023/05/29 19:30:48 nia Exp $ + +Disable stuff we don't necessarily actually want to assume. + +--- makefile.orig 2021-05-01 20:32:23.000000000 +0000 ++++ makefile +@@ -22,7 +22,7 @@ UNICODE = 1 + #BUILD_A68K = 1 + + # Include x86 Assembly routines +-BUILD_X86_ASM = 1 ++#BUILD_X86_ASM = 1 + + # Include GCC optmisations for your CPU e.g use -march=native. WARNING: This might mean that the generated binaries will not run on other peoples (older) machines! + #BUILD_NATIVE = 1 +@@ -63,10 +63,10 @@ FASTCALL = 1 + PERL = 1 + + # Endianness +-LSB_FIRST = 1 ++#LSB_FIRST = 1 + + # Include png.h from burner.h +-INCLUDE_LIB_PNGH = 1 ++#INCLUDE_LIB_PNGH = 1 + + # Enable CRT resolution switching + # INCLUDE_SWITCHRES = 1 diff --git a/emulators/fbneo/patches/patch-makefile.sdl2 b/emulators/fbneo/patches/patch-makefile.sdl2 new file mode 100644 index 000000000000..81c945ac1dfe --- /dev/null +++ b/emulators/fbneo/patches/patch-makefile.sdl2 @@ -0,0 +1,54 @@ +$NetBSD: patch-makefile.sdl2,v 1.1 2023/05/29 19:30:48 nia Exp $ + +Honour CFLAGS. Disable partial linking (incompatible with PIE). + +Unbundle libpng and zlib. + +--- makefile.sdl2.orig 2021-05-01 20:32:23.000000000 +0000 ++++ makefile.sdl2 +@@ -50,7 +50,7 @@ srcdir = src/ + include makefile.burn_rules + + # Platform stuff +-alldir += burner burner/sdl burner/sdl dep/libs/libpng dep/libs/lib7z dep/libs/zlib intf intf/video \ ++alldir += burner burner/sdl burner/sdl dep/libs/lib7z intf intf/video \ + intf/video/scalers intf/video/sdl intf/audio intf/audio/sdl intf/input intf/input/sdl intf/cd intf/cd/sdl \ + intf/perfcount intf/perfcount/sdl dep/generated + +@@ -58,11 +58,6 @@ depobj += neocdlist.o \ + \ + conc.o cong.o dat.o gamc.o gami.o image.o ioapi.o misc.o sshot.o state.o statec.o unzip.o zipfn.o \ + \ +- adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o gzwrite.o infback.o inffast.o inflate.o inftrees.o \ +- trees.o uncompr.o zutil.o \ +- \ +- png.o pngerror.o pngget.o pngmem.o pngpread.o pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o pngtrans.o pngwio.o \ +- pngwrite.o pngwtran.o pngwutil.o \ + \ + aud_dsp.o aud_interface.o cd_interface.o inp_interface.o interface.o lowpass2.o vid_interface.o \ + vid_softfx.o vid_support.o \ +@@ -183,13 +178,13 @@ AS = nasm + + #LDFLAGS = -static + +-CFLAGS = -O2 -fomit-frame-pointer -Wno-write-strings \ ++CFLAGS += -Wno-write-strings \ + -Wall -Wno-long-long -Wno-sign-compare -Wno-uninitialized -Wno-unused \ + -Wno-conversion -Wno-attributes \ + -Wno-unused-parameter -Wno-unused-value -std=c99 \ + $(PLATFLAGS) $(DEF) $(incdir) + +-CXXFLAGS = -O2 -fomit-frame-pointer -Wno-write-strings \ ++CXXFLAGS += -Wno-write-strings \ + -Wall -W -Wno-long-long \ + -Wunknown-pragmas -Wundef -Wconversion -Wno-missing-braces \ + -Wuninitialized -Wpointer-arith -Winline -Wno-multichar \ +@@ -361,7 +356,7 @@ $(NAME): $(allobj) $(objdir)drivers.o + + else + +-$(NAME): $(allobj) $(objdir)drivers.o ++$(NAME): $(allobj) $(autdrv) + @echo + @echo Linking executable... $(NAME) + @$(LD) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(lib) diff --git a/emulators/fbneo/patches/patch-src_burn_burnint.h b/emulators/fbneo/patches/patch-src_burn_burnint.h new file mode 100644 index 000000000000..268bb005db08 --- /dev/null +++ b/emulators/fbneo/patches/patch-src_burn_burnint.h @@ -0,0 +1,20 @@ +$NetBSD: patch-src_burn_burnint.h,v 1.1 2023/05/29 19:30:48 nia Exp $ + +Teach fbneo about endian on NetBSD. + +--- src/burn/burnint.h.orig 2021-05-01 20:32:23.000000000 +0000 ++++ src/burn/burnint.h +@@ -80,6 +80,13 @@ typedef union { + #define BURN_ENDIAN_SWAP_INT8(x) (x^1) + #define BURN_ENDIAN_SWAP_INT16(x) ({uint16_t tt; __sthbrx(&tt, 0, x); tt;}) + #define BURN_ENDIAN_SWAP_INT32(x) ({uint32_t tt; __stwbrx(&tt, 0, x); tt;}) ++// NetBSD ++#elif defined(__NetBSD__) ++#include ++#define BURN_ENDIAN_SWAP_INT8(x) (x^1) ++#define BURN_ENDIAN_SWAP_INT16(x) (bswap16(x)) ++#define BURN_ENDIAN_SWAP_INT32(x) (bswap32(x)) ++#define BURN_ENDIAN_SWAP_INT64(x) (bswap64(x)) + // gcc/clang + #elif defined(__GNUC__) + #define BURN_ENDIAN_SWAP_INT8(x) (x^1) diff --git a/emulators/fbneo/patches/patch-src_burner_burner.h b/emulators/fbneo/patches/patch-src_burner_burner.h new file mode 100644 index 000000000000..eca1135acee6 --- /dev/null +++ b/emulators/fbneo/patches/patch-src_burner_burner.h @@ -0,0 +1,15 @@ +$NetBSD: patch-src_burner_burner.h,v 1.1 2023/05/29 19:30:48 nia Exp $ + +Make the "FORCE_SYSTEM_LIBPNG" option do the unsurprising thing. + +--- src/burner/burner.h.orig 2021-05-01 20:32:23.000000000 +0000 ++++ src/burner/burner.h +@@ -54,6 +54,8 @@ typedef struct tagIMAGE { + + #if defined (INCLUDE_LIB_PNGH) + #include "png.h" ++#else ++ #include + #endif + + // ---------------------------------------------------------------------------