From a302c3f3b7229359d1ac257b65f8f9468f7d89e1 Mon Sep 17 00:00:00 2001 From: Steven Voges Date: Sun, 3 Sep 2023 00:35:08 +0700 Subject: games/mupen64plus-rsp-parallel: Added (RSP Plugin for mupen64plus). Signed-off-by: Willy Sudiarto Raharjo --- games/mupen64plus-rsp-parallel/9586367.patch | 22 ++++ games/mupen64plus-rsp-parallel/README | 4 + games/mupen64plus-rsp-parallel/fix-build.patch | 47 +++++++++ .../mupen64plus-rsp-parallel.SlackBuild | 113 +++++++++++++++++++++ .../mupen64plus-rsp-parallel.info | 10 ++ games/mupen64plus-rsp-parallel/slack-desc | 19 ++++ 6 files changed, 215 insertions(+) create mode 100644 games/mupen64plus-rsp-parallel/9586367.patch create mode 100644 games/mupen64plus-rsp-parallel/README create mode 100644 games/mupen64plus-rsp-parallel/fix-build.patch create mode 100644 games/mupen64plus-rsp-parallel/mupen64plus-rsp-parallel.SlackBuild create mode 100644 games/mupen64plus-rsp-parallel/mupen64plus-rsp-parallel.info create mode 100644 games/mupen64plus-rsp-parallel/slack-desc (limited to 'games') diff --git a/games/mupen64plus-rsp-parallel/9586367.patch b/games/mupen64plus-rsp-parallel/9586367.patch new file mode 100644 index 000000000000..511ca5ac7dd7 --- /dev/null +++ b/games/mupen64plus-rsp-parallel/9586367.patch @@ -0,0 +1,22 @@ +From 95863671a332886c01e60a148821c7b9bf94dea7 Mon Sep 17 00:00:00 2001 +From: Logan McNaughton <848146+loganmc10@users.noreply.github.com> +Date: Sun, 24 Jul 2022 09:00:25 -0600 +Subject: [PATCH] Fix undefined behavior in LUI + +--- + rsp_jit.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rsp_jit.cpp b/rsp_jit.cpp +index 372319c..a0e1c36 100644 +--- a/rsp_jit.cpp ++++ b/rsp_jit.cpp +@@ -1422,7 +1422,7 @@ void CPU::jit_instruction(jit_state_t *_jit, uint32_t pc, uint32_t instr, + unsigned rt = (instr >> 16) & 31; + NOP_IF_RT_ZERO(); + int16_t imm = int16_t(instr); +- regs.immediate_mips_register(_jit, rt, imm << 16); ++ regs.immediate_mips_register(_jit, rt, uint16_t(imm) << 16); + regs.unlock_mips_register(rt); + break; + } diff --git a/games/mupen64plus-rsp-parallel/README b/games/mupen64plus-rsp-parallel/README new file mode 100644 index 000000000000..a6f39ca19dac --- /dev/null +++ b/games/mupen64plus-rsp-parallel/README @@ -0,0 +1,4 @@ +Parallel RSP is a fast RSP LLE plugin for mupen64plus + +Note that this plugin will only work with RDP plugins that can +interpret LLE, such as mupen64plus-video-parallel. diff --git a/games/mupen64plus-rsp-parallel/fix-build.patch b/games/mupen64plus-rsp-parallel/fix-build.patch new file mode 100644 index 000000000000..d9364eb24339 --- /dev/null +++ b/games/mupen64plus-rsp-parallel/fix-build.patch @@ -0,0 +1,47 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +@@ -6,10 +6,23 @@ + + set(NAME_PLUGIN_M64P "mupen64plus-rsp-parallel") + +-include_directories(../mupen64plus-core/src/api) ++include_directories(/usr/include/mupen64plus) + add_definitions(-DM64P_PLUGIN_API) + add_definitions(-DPARALLEL_INTEGRATION) + ++execute_process ( ++ COMMAND sh -c "/lib/ld-linux-x86-64.so.2 --help | grep -c 'x86-64-v3 (supported, searched)'" ++ OUTPUT_VARIABLE level3_support ++) ++ ++if (${level3_support} GREATER 0 ) ++ message("x86-64-v3 microarchitecture is supported, using newer CPU optimizations") ++ set(MARCH_OPTION "x86-64-v3") ++elseif(${level3_support} EQUAL 0) ++ message("x86-64-v3 microarchitecture is NOT supported, fallbacking to v2") ++ set(MARCH_OPTION "x86-64-v2") ++endif() ++ + # check for INTERPROCEDURAL_OPTIMIZATION support + if((${CMAKE_VERSION} VERSION_EQUAL 3.9) OR (${CMAKE_VERSION} VERSION_GREATER 3.9)) + cmake_policy(SET CMP0069 NEW) +@@ -76,7 +89,7 @@ + target_include_directories(${NAME_PLUGIN_M64P} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + target_include_directories(${NAME_PLUGIN_M64P} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/arch/simd/rsp) + target_include_directories(${NAME_PLUGIN_M64P} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/api) +-target_compile_options(${NAME_PLUGIN_M64P} PRIVATE ${PARALLEL_RSP_CXX_FLAGS} -march=x86-64-v3) ++target_compile_options(${NAME_PLUGIN_M64P} PRIVATE ${PARALLEL_RSP_CXX_FLAGS} -march=${MARCH_OPTION}) + + option(PARALLEL_RSP_BAKED_LIGHTNING "Use built-in Lightning." ON) + +@@ -97,8 +110,8 @@ + target_sources(lightning PRIVATE win32/mman/sys/mman.c) + target_include_directories(lightning PRIVATE win32/mman) + endif() +- target_compile_options(lightning PRIVATE -march=x86-64-v3) +- target_link_options(lightning PRIVATE -march=x86-64-v3) ++ target_compile_options(lightning PRIVATE -march=${MARCH_OPTION}) ++ target_link_options(lightning PRIVATE -march=${MARCH_OPTION}) + endif() +-target_link_options(${NAME_PLUGIN_M64P} PRIVATE -march=x86-64-v3) ++target_link_options(${NAME_PLUGIN_M64P} PRIVATE -march=${MARCH_OPTION}) + target_link_libraries(${NAME_PLUGIN_M64P} PUBLIC lightning) diff --git a/games/mupen64plus-rsp-parallel/mupen64plus-rsp-parallel.SlackBuild b/games/mupen64plus-rsp-parallel/mupen64plus-rsp-parallel.SlackBuild new file mode 100644 index 000000000000..95b3f1304f8e --- /dev/null +++ b/games/mupen64plus-rsp-parallel/mupen64plus-rsp-parallel.SlackBuild @@ -0,0 +1,113 @@ +#!/bin/bash + +# Slackware build script for mupen64plus-rsp-parallel + +# Copyright 2023 Steven Voges +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=mupen64plus-rsp-parallel +SRCNAM=parallel-rsp +VERSION=${VERSION:-20221126_4cf680b} +SRCVER=${SRCVER:-4cf680bbbda082b32723ef9f8da6a8120803c19c} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +elif [ "$ARCH" = "aarch64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $SRCNAM-$SRCVER +tar xvf $CWD/$SRCNAM-$SRCVER.tar.gz +cd $SRCNAM-$SRCVER + +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +patch -p1 < $CWD/fix-build.patch +patch -p1 < $CWD/9586367.patch +sed -i "4i #include " rsp_disasm.hpp + +mkdir -p build +cd build + cmake \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=Release .. + make + install -Dm 755 $PRGNAM.so $PKG/usr/lib$LIBDIRSUFFIX/mupen64plus/$PRGNAM.so +cd .. + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a \ + CREDITS.txt LICENSE LICENSE.LESSER LICENSE.MIT \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/games/mupen64plus-rsp-parallel/mupen64plus-rsp-parallel.info b/games/mupen64plus-rsp-parallel/mupen64plus-rsp-parallel.info new file mode 100644 index 000000000000..bddd647ddc06 --- /dev/null +++ b/games/mupen64plus-rsp-parallel/mupen64plus-rsp-parallel.info @@ -0,0 +1,10 @@ +PRGNAM="mupen64plus-rsp-parallel" +VERSION="20221126_4cf680b" +HOMEPAGE="https://github.com/Mastergatto/parallel-rsp" +DOWNLOAD="https://github.com/Mastergatto/parallel-rsp/archive/4cf680bbbda082b32723ef9f8da6a8120803c19c/parallel-rsp-4cf680bbbda082b32723ef9f8da6a8120803c19c.tar.gz" +MD5SUM="a69df56f52a85ef59633366da71efeed" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="mupen64plus-nightly" +MAINTAINER="Steven Voges" +EMAIL="svoges.sbo@gmail.com" diff --git a/games/mupen64plus-rsp-parallel/slack-desc b/games/mupen64plus-rsp-parallel/slack-desc new file mode 100644 index 000000000000..f1fef11e2966 --- /dev/null +++ b/games/mupen64plus-rsp-parallel/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +mupen64plus-rsp-parallel: mupen64plus-rsp-parallel (RSP plugin for mupen64plus) +mupen64plus-rsp-parallel: +mupen64plus-rsp-parallel: Parallel RSP is a fast RSP LLE plugin for mupen64plus +mupen64plus-rsp-parallel: +mupen64plus-rsp-parallel: Homepage: https://github.com/Mastergatto/parallel-rsp +mupen64plus-rsp-parallel: +mupen64plus-rsp-parallel: +mupen64plus-rsp-parallel: +mupen64plus-rsp-parallel: +mupen64plus-rsp-parallel: +mupen64plus-rsp-parallel: -- cgit v1.2.3