diff --git a/Source/3rdParty/mupen64plus-core/.github/workflows/build.yml b/Source/3rdParty/mupen64plus-core/.github/workflows/build.yml index 81a899db..e9ed56f8 100644 --- a/Source/3rdParty/mupen64plus-core/.github/workflows/build.yml +++ b/Source/3rdParty/mupen64plus-core/.github/workflows/build.yml @@ -3,16 +3,12 @@ name: Core on: push: paths-ignore: - - '**/*.md' - '.{gitattributes,gitignore,travis.yml}' - - 'appveyor.yml,README' + - '*.md,appveyor.yml,README' pull_request: paths-ignore: - - '**/*.md' - '.{gitattributes,gitignore,travis.yml}' - - 'appveyor.yml,README' - schedule: - - cron: '55 14 21 * *' + - '*.md,appveyor.yml,README' workflow_dispatch: jobs: @@ -23,71 +19,39 @@ jobs: matrix: include: - cc: GCC - platform: x64 - bits: 64 + arch: x64 - cc: GCC - platform: x86 - bits: 32 + arch: x86 - cc: Clang - platform: x64 - bits: 64 + arch: x64 - cc: Clang - platform: x86 - bits: 32 - name: Linux / ${{ matrix.cc }} / ${{ matrix.platform }} + arch: x86 + name: Linux / ${{ matrix.cc }} / ${{ matrix.arch }} runs-on: ubuntu-22.04 - if: (github.event_name == 'schedule' && github.repository == 'mupen64plus/mupen64plus-core') || (github.event_name != 'schedule') steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Get build dependencies and arrange the environment run: | - echo "G_REV=$(git rev-parse --short HEAD)" >> "${GITHUB_ENV}" - if [[ ${{ matrix.bits }} -eq 32 ]]; then sudo dpkg --add-architecture i386; fi - sudo apt-get update - sudo apt-get -y install libfreetype6-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libsdl1.2-dev libsdl2-dev libvulkan-dev nasm zlib1g-dev - if [[ ${{ matrix.bits }} -eq 32 ]]; then sudo apt-get --reinstall -y install gcc-multilib g++-multilib libc6 libc6-dev-i386 libatomic1:i386 libgcc-s1:i386 libstdc++6:i386 libfreetype6-dev:i386 libgl1-mesa-dev:i386 libglu1-mesa-dev:i386 libpng-dev:i386 libsdl1.2-dev:i386 libsdl2-dev:i386 libvulkan-dev:i386 zlib1g-dev:i386; fi - sudo ldconfig + export C_CLANG_SUFFIX="-15" C_GCC_SUFFIX="-12" + export BUILD_DEPS="libfreetype6-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libsdl1.2-dev libsdl2-dev libvulkan-dev zlib1g-dev" + ./.github/workflows/scripts/ci_install_ubuntu_deps.sh ${{ matrix.arch }} ${{ matrix.cc }} - name: Build and related stuff, backup binaries run: | - if [[ ${{ matrix.bits }} -eq 32 ]]; then export PIC="1" CPU_TUNE="-msse2 -mtune=pentium4"; else CPU_TUNE="-mtune=core2"; fi - export OPTFLAGS="-O2 -flto ${CPU_TUNE}" - ORIG="$(pwd)" - CC="gcc" - CXX="g++" - if [[ "${{ matrix.cc }}" != "GCC" ]]; then - CC="clang" - CXX="clang++" - fi - ${CC} --version - SDL="sdl" - MSG="1.2" - mkdir pkg - for DYN in 0 1 0 1; do - unset POSTFIX - if [[ ${DYN} -eq 0 ]]; then export POSTFIX="-old"; else MSG="${MSG} / NEW_DYNAREC"; fi - echo "" - echo ":: ${{ matrix.cc }} ${{ matrix.platform }} / SDL${MSG} ::" - echo "" - make NEW_DYNAREC="${DYN}" -C projects/unix clean - echo "" - make CC="${CC}" CXX="${CXX}" BITS="${{ matrix.bits }}" SDL_CONFIG="${SDL}-config" NEW_DYNAREC="${DYN}" -C projects/unix all -j4 - echo "" - make BITS="${{ matrix.bits }}" NEW_DYNAREC="${DYN}" -C projects/unix install DESTDIR="${ORIG}/pkg/" - echo "" - ls -gG pkg/usr/local/lib/libmupen64plus${POSTFIX}.so* - echo "" - ldd pkg/usr/local/lib/libmupen64plus${POSTFIX}.so.2.0.0 - if [[ ${DYN} -eq 1 ]]; then - SDL="sdl2" - MSG="2" - fi - done - tar cvzf pkg/mupen64plus-core-linux-${{ matrix.platform }}-g${{ env.G_REV }}.tar.gz -C pkg/ "usr" + export C_CLANG_SUFFIX="-15" C_GCC_SUFFIX="-12" + export PATH="$(pwd)/.github/workflows/scripts:${PATH}" + export CONFIG_OVERRIDE="ACCURATE_FPU=1 NEW_DYNAREC=1 SDL_CONFIG="sdl-config"" + ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }} + export CONFIG_OVERRIDE="ACCURATE_FPU=1 NEW_DYNAREC=1 SDL_CONFIG="sdl2-config"" + ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }} + export CONFIG_OVERRIDE="ACCURATE_FPU=0 NEW_DYNAREC=0 SDL_CONFIG="sdl-config" POSTFIX="-old"" + ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }} + export CONFIG_OVERRIDE="ACCURATE_FPU=0 NEW_DYNAREC=0 SDL_CONFIG="sdl2-config" POSTFIX="-old"" + ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }} makepkg - name: Upload artifact if: matrix.cc == 'GCC' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: mupen64plus-core-linux-${{ matrix.platform }}-g${{ env.G_REV }} + name: ${{ env.PKG_NAME }} path: pkg/*.tar.gz MSYS2: @@ -96,24 +60,23 @@ jobs: matrix: include: - cc: GCC - platform: x64 + arch: x64 cross: x86_64 - bits: 64 + env: MINGW64 - cc: GCC - platform: x86 + arch: x86 cross: i686 - bits: 32 - name: Windows / MSYS2 ${{ matrix.cc }} / ${{ matrix.platform }} + env: MINGW32 + name: Windows / MSYS2 ${{ matrix.cc }} / ${{ matrix.arch }} runs-on: windows-2022 - if: (github.event_name == 'schedule' && github.repository == 'mupen64plus/mupen64plus-core') || (github.event_name != 'schedule') defaults: run: shell: msys2 {0} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: msys2/setup-msys2@v2 with: - msystem: MINGW${{ matrix.bits }} + msystem: ${{ matrix.env }} update: true install: >- git @@ -124,47 +87,24 @@ jobs: mingw-w64-${{ matrix.cross }}-freetype mingw-w64-${{ matrix.cross }}-libpng mingw-w64-${{ matrix.cross }}-nasm + mingw-w64-${{ matrix.cross }}-ntldd mingw-w64-${{ matrix.cross }}-SDL2 - mingw-w64-${{ matrix.cross }}-zlib mingw-w64-${{ matrix.cross }}-vulkan-headers + mingw-w64-${{ matrix.cross }}-zlib - name: Build and related stuff, backup binaries run: | - echo "G_REV=$(git rev-parse --short HEAD)" >> "${GITHUB_ENV}" - if [[ ${{ matrix.bits }} -eq 32 ]]; then CPU_TUNE="-msse2 -mtune=pentium4"; else CPU_TUNE="-mtune=core2"; fi - export OPTFLAGS="-O2 -flto ${CPU_TUNE}" - ORIG="$(pwd)" - CC="gcc" - CXX="g++" - ${CC} --version - mkdir pkg - export POSTFIX="-old" - for DYN in 0 1; do - echo "" - echo ":: ${{ matrix.cc }} ${{ matrix.platform }} / SDL2${MSG} ::" - echo "" - make NEW_DYNAREC="${DYN}" -C projects/unix clean - echo "" - make CC="${CC}" CXX="${CXX}" BITS="${{ matrix.bits }}" NEW_DYNAREC="${DYN}" -C projects/unix all -j4 - echo "" - make BITS="${{ matrix.bits }}" NEW_DYNAREC="${DYN}" -C projects/unix install PLUGINDIR="" SHAREDIR="" BINDIR="" MANDIR="" LIBDIR="" APPSDIR="" ICONSDIR="icons" INCDIR="api" LDCONFIG="true" DESTDIR="${ORIG}/pkg/" - echo "" - ls -gG pkg/mupen64plus${POSTFIX}.dll - echo "" - ldd pkg/mupen64plus${POSTFIX}.dll - unset POSTFIX - MSG=" / NEW_DYNAREC" - done + export PATH="$(pwd)/.github/workflows/scripts:${PATH}" + export CONFIG_OVERRIDE="ACCURATE_FPU=1 NEW_DYNAREC=1" + ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }} + export CONFIG_OVERRIDE="ACCURATE_FPU=0 NEW_DYNAREC=0 POSTFIX="-old"" + ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }} - name: Backup dependencies, etc... run: | - if [[ ${{ matrix.bits }} -eq 32 ]]; then LIBGCC="libgcc_s_dw2-1"; else LIBGCC="libgcc_s_seh-1"; fi - for LIB in libbrotlicommon libbrotlidec libbz2-1 libfreetype-6 ${LIBGCC} libglib-2.0-0 libgraphite2 libharfbuzz-0 libiconv-2 libintl-8 libpcre2-8-0 libpng16-16 libstdc++-6 libwinpthread-1 SDL2 zlib1; do - echo ":: Copying ${LIB}.dll" - cp "/mingw${{ matrix.bits }}/bin/${LIB}.dll" pkg/ - done + ./.github/workflows/scripts/ci_backup_mingw_deps.sh ${{ matrix.env }} - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: mupen64plus-core-msys2-${{ matrix.platform }}-g${{ env.G_REV }} + name: ${{ env.PKG_NAME }} path: pkg/* MSVC: @@ -173,52 +113,32 @@ jobs: matrix: include: - toolset: v143 - platform: x64 + arch: x64 vs: 2022 - toolset: v141_xp - platform: x86 + arch: x86 vs: 2019 - name: Windows / MSVC with ${{ matrix.toolset }} / ${{ matrix.platform }} + name: Windows / MSVC with ${{ matrix.toolset }} / ${{ matrix.arch }} runs-on: windows-${{ matrix.vs }} - if: (github.event_name == 'schedule' && github.repository == 'mupen64plus/mupen64plus-core') || (github.event_name != 'schedule') defaults: run: shell: cmd steps: - - uses: actions/checkout@v3 - - uses: microsoft/setup-msbuild@v1 + - uses: actions/checkout@v4 + - uses: microsoft/setup-msbuild@v2 - name: Build and related stuff, backup binaries run: | - for /f "tokens=1" %%R in ('git rev-parse --short HEAD') do echo G_REV=%%R>> "%GITHUB_ENV%" - set "ARCH=${{ matrix.platform }}" - if [%ARCH%] == [x86] set "ARCH=Win32" - echo. - msbuild --version - echo. - git clone --depth 1 https://github.com/mupen64plus/mupen64plus-win32-deps.git ..\mupen64plus-win32-deps - md pkg - for %%B in (Release New_Dynarec_Release) do ( - echo. - msbuild projects\msvc\mupen64plus-core.vcxproj /p:Configuration=%%B;Platform=%ARCH%;PlatformToolset=${{ matrix.toolset }} /t:Rebuild - echo. - copy "projects\msvc\%ARCH%\%%B\mupen64plus.dll" pkg\ - if not exist "pkg\mupen64plus-old.dll" ( - ren "pkg\mupen64plus.dll" mupen64plus-old.dll - dir pkg\mupen64plus-old.dll - ) else dir pkg\mupen64plus.dll - ) + set PATH=%CD%\.github\workflows\scripts;%PATH% + set TOOLSET=${{ matrix.toolset }} + call ci_msvc_build.cmd ${{ matrix.arch }} + ci_msvc_build.cmd ${{ matrix.arch }} newdyn - name: Backup dependencies, etc... run: | - xcopy data pkg - copy "..\mupen64plus-win32-deps\freetype-2.13.0\lib\${{ matrix.platform }}\*.dll" pkg\ - copy "..\mupen64plus-win32-deps\libpng-1.6.39\lib\${{ matrix.platform }}\*.dll" pkg\ - copy "..\mupen64plus-win32-deps\SDL2-2.26.3\lib\${{ matrix.platform }}\*.dll" pkg\ - copy "..\mupen64plus-win32-deps\SDL2_net-2.2.0\lib\${{ matrix.platform }}\*.dll" pkg\ - copy "..\mupen64plus-win32-deps\zlib-1.2.13\lib\${{ matrix.platform }}\*.dll" pkg\ + .\.github\workflows\scripts\ci_backup_msvc_deps.cmd ${{ matrix.arch }} freetype.dll libpng16.dll SDL2.dll SDL2_net.dll zlib.dll - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: mupen64plus-core-msvc-${{ matrix.platform }}-g${{ env.G_REV }} + name: ${{ env.PKG_NAME }} path: pkg/* Nightly-build: @@ -226,9 +146,9 @@ jobs: if: github.ref_name == 'master' needs: [Linux, MSYS2, MSVC] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Download artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: path: binaries - name: Get some tools @@ -237,49 +157,7 @@ jobs: sudo apt-get -y install hashdeep - name: Creating new artifacts and update nightly-build run: | - mkdir pkg - cd binaries - for BIN in *; do - cd "${BIN}" - if [[ "${BIN:17:4}" == "msys" ]]; then - echo ":: Creating ${BIN}.zip" - zip -r "../../pkg/${BIN}.zip" * - elif [[ "${BIN:17:4}" == "msvc" ]]; then - echo ":: Creating ${BIN}.zip" - zip -r "../../pkg/${BIN}.zip" * - else - echo ":: Recovering ${BIN}.tar.gz" - mv *.tar.gz ../../pkg/ - fi - cd .. - done - cd ../pkg - echo "" - for BIN in *; do - ls -gG ${BIN} - tigerdeep -lz ${BIN} >> ../${BIN:0:16}.tiger.txt - sha256sum ${BIN} >> ../${BIN:0:16}.sha256.txt - sha512sum ${BIN} >> ../${BIN:0:16}.sha512.txt - b2sum ${BIN} >> ../${BIN:0:16}.blake2.txt - done - mv ../*.tiger.txt . - mv ../*.sha*.txt . - mv ../*.blake2.txt . - echo "" - echo "TIGER:" - cat *.tiger.txt - echo "" - echo "SHA256:" - cat *.sha256.txt - echo "" - echo "SHA512:" - cat *.sha512.txt - echo "" - echo "BLAKE2:" - cat *.blake2.txt - echo "" - git tag -f nightly-build - git push -f origin nightly-build + ./.github/workflows/scripts/ci_nightly_artifacts.sh - name: Nightly-build uses: ncipollo/release-action@v1 with: diff --git a/Source/3rdParty/mupen64plus-core/.github/workflows/schedule.yml b/Source/3rdParty/mupen64plus-core/.github/workflows/schedule.yml new file mode 100644 index 00000000..6b48bcd7 --- /dev/null +++ b/Source/3rdParty/mupen64plus-core/.github/workflows/schedule.yml @@ -0,0 +1,165 @@ +name: Core - Scheduled + +on: + schedule: + - cron: '55 14 21 * *' + +jobs: + + Linux: + strategy: + fail-fast: false + matrix: + include: + - cc: GCC + arch: x64 + - cc: GCC + arch: x86 + - cc: Clang + arch: x64 + - cc: Clang + arch: x86 + name: Linux / ${{ matrix.cc }} / ${{ matrix.arch }} + runs-on: ubuntu-22.04 + if: github.repository == 'mupen64plus/mupen64plus-core' + steps: + - uses: actions/checkout@v4 + - name: Get build dependencies and arrange the environment + run: | + export C_CLANG_SUFFIX="-15" C_GCC_SUFFIX="-12" + export BUILD_DEPS="libfreetype6-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libsdl1.2-dev libsdl2-dev libvulkan-dev zlib1g-dev" + ./.github/workflows/scripts/ci_install_ubuntu_deps.sh ${{ matrix.arch }} ${{ matrix.cc }} + - name: Build and related stuff, backup binaries + run: | + export C_CLANG_SUFFIX="-15" C_GCC_SUFFIX="-12" + export PATH="$(pwd)/.github/workflows/scripts:${PATH}" + export CONFIG_OVERRIDE="ACCURATE_FPU=1 NEW_DYNAREC=1 SDL_CONFIG="sdl-config"" + ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }} + export CONFIG_OVERRIDE="ACCURATE_FPU=1 NEW_DYNAREC=1 SDL_CONFIG="sdl2-config"" + ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }} + export CONFIG_OVERRIDE="ACCURATE_FPU=0 NEW_DYNAREC=0 SDL_CONFIG="sdl-config" POSTFIX="-old"" + ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }} + export CONFIG_OVERRIDE="ACCURATE_FPU=0 NEW_DYNAREC=0 SDL_CONFIG="sdl2-config" POSTFIX="-old"" + ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }} makepkg + - name: Upload artifact + if: matrix.cc == 'GCC' + uses: actions/upload-artifact@v4 + with: + name: ${{ env.PKG_NAME }} + path: pkg/*.tar.gz + + MSYS2: + strategy: + fail-fast: false + matrix: + include: + - cc: GCC + arch: x64 + cross: x86_64 + env: MINGW64 + - cc: GCC + arch: x86 + cross: i686 + env: MINGW32 + name: Windows / MSYS2 ${{ matrix.cc }} / ${{ matrix.arch }} + runs-on: windows-2022 + if: github.repository == 'mupen64plus/mupen64plus-core' + defaults: + run: + shell: msys2 {0} + steps: + - uses: actions/checkout@v4 + - uses: msys2/setup-msys2@v2 + with: + msystem: ${{ matrix.env }} + update: true + install: >- + git + libtool + make + mingw-w64-${{ matrix.cross }}-gcc + mingw-w64-${{ matrix.cross }}-toolchain + mingw-w64-${{ matrix.cross }}-freetype + mingw-w64-${{ matrix.cross }}-libpng + mingw-w64-${{ matrix.cross }}-nasm + mingw-w64-${{ matrix.cross }}-ntldd + mingw-w64-${{ matrix.cross }}-SDL2 + mingw-w64-${{ matrix.cross }}-vulkan-headers + mingw-w64-${{ matrix.cross }}-zlib + - name: Build and related stuff, backup binaries + run: | + export PATH="$(pwd)/.github/workflows/scripts:${PATH}" + export CONFIG_OVERRIDE="ACCURATE_FPU=1 NEW_DYNAREC=1" + ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }} + export CONFIG_OVERRIDE="ACCURATE_FPU=0 NEW_DYNAREC=0 POSTFIX="-old"" + ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }} + - name: Backup dependencies, etc... + run: | + ./.github/workflows/scripts/ci_backup_mingw_deps.sh ${{ matrix.env }} + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ env.PKG_NAME }} + path: pkg/* + + MSVC: + strategy: + fail-fast: false + matrix: + include: + - toolset: v143 + arch: x64 + vs: 2022 + - toolset: v141_xp + arch: x86 + vs: 2019 + name: Windows / MSVC with ${{ matrix.toolset }} / ${{ matrix.arch }} + runs-on: windows-${{ matrix.vs }} + if: github.repository == 'mupen64plus/mupen64plus-core' + defaults: + run: + shell: cmd + steps: + - uses: actions/checkout@v4 + - uses: microsoft/setup-msbuild@v2 + - name: Build and related stuff, backup binaries + run: | + set PATH=%CD%\.github\workflows\scripts;%PATH% + set TOOLSET=${{ matrix.toolset }} + call ci_msvc_build.cmd ${{ matrix.arch }} + ci_msvc_build.cmd ${{ matrix.arch }} newdyn + - name: Backup dependencies, etc... + run: | + .\.github\workflows\scripts\ci_backup_msvc_deps.cmd ${{ matrix.arch }} freetype.dll libpng16.dll SDL2.dll SDL2_net.dll zlib.dll + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ env.PKG_NAME }} + path: pkg/* + + Nightly-build: + runs-on: ubuntu-latest + if: github.ref_name == 'master' + needs: [Linux, MSYS2, MSVC] + steps: + - uses: actions/checkout@v4 + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + path: binaries + - name: Get some tools + run: | + sudo apt-get update + sudo apt-get -y install hashdeep + - name: Creating new artifacts and update nightly-build + run: | + ./.github/workflows/scripts/ci_nightly_artifacts.sh + - name: Nightly-build + uses: ncipollo/release-action@v1 + with: + prerelease: true + allowUpdates: true + removeArtifacts: true + replacesArtifacts: false + tag: nightly-build + artifacts: pkg/* diff --git a/Source/3rdParty/mupen64plus-core/.github/workflows/scripts/ci_backup_mingw_deps.sh b/Source/3rdParty/mupen64plus-core/.github/workflows/scripts/ci_backup_mingw_deps.sh new file mode 100755 index 00000000..6520d980 --- /dev/null +++ b/Source/3rdParty/mupen64plus-core/.github/workflows/scripts/ci_backup_mingw_deps.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +set -e +u + +if [[ ${#} -ne 1 ]]; then exit 9; fi + +export ENV_MSYS="$(echo "${1}" | tr [A-Z] [a-z])" +export DEPS="$(LC_ALL=C grep "${ENV_MSYS}" pkg/ldd.log | tr -s '\t' ' ' | sort | cut -d ' ' -f4 | tr '\\' '/' | tr -d ':')" + +rm -f pkg/ldd.log + +if [[ "${DEPS}" == "" ]]; then + echo ":: None..." + exit 0 +fi + +for LIB in ${DEPS}; do + echo ":: Copying ${LIB##*/}" + cp "/${LIB}" pkg/ +done + +exit 0 diff --git a/Source/3rdParty/mupen64plus-core/.github/workflows/scripts/ci_backup_msvc_deps.cmd b/Source/3rdParty/mupen64plus-core/.github/workflows/scripts/ci_backup_msvc_deps.cmd new file mode 100644 index 00000000..ab5effdc --- /dev/null +++ b/Source/3rdParty/mupen64plus-core/.github/workflows/scripts/ci_backup_msvc_deps.cmd @@ -0,0 +1,36 @@ +@echo off +setlocal enableextensions enabledelayedexpansion +cls +if not exist "projects\msvc\" exit /b 9 + +set ARCH= +set DEPS= +if "%*" == "" exit /b 8 +for %%P in (%*) do ( + if /i "%%P" == "x86" (set ARCH=x86) else ( + if /i "%%P" == "x64" (set ARCH=x64) else ( + set "DEPS=!DEPS! %%P") ) +) + +if not defined ARCH exit /b 7 + +if exist "data\" xcopy /e data pkg +if errorlevel 1 exit /b 6 +if exist "pkg\mupen64plus.desktop" del /f /q pkg\mupen64plus.desktop + +if not defined DEPS ( + echo :: None... + exit /b 0 +) + +set PKG=%CD%\pkg +cd ..\mupen64plus-win32-deps +if errorlevel 1 exit /b 5 +for %%D in (%DEPS%) do ( + for /f "tokens=*" %%T in ('dir /b /s %%D ^| findstr "%ARCH%"') do ( + if exist "%%T" xcopy "%%T" "%PKG%\" + if errorlevel 1 exit /b 4 + ) +) + +exit /b 0 diff --git a/Source/3rdParty/mupen64plus-core/.github/workflows/scripts/ci_build.sh b/Source/3rdParty/mupen64plus-core/.github/workflows/scripts/ci_build.sh new file mode 100755 index 00000000..ec808de3 --- /dev/null +++ b/Source/3rdParty/mupen64plus-core/.github/workflows/scripts/ci_build.sh @@ -0,0 +1,116 @@ +#!/usr/bin/env bash +set -e +u + +if [[ ${#} -lt 2 ]]; then exit 9; fi + +unset ARCH_ARG CC_ARG +export MAKE_PKG=0 MULTILIB=0 +export ENV_ARGS="$(echo "${*}" | tr [A-Z] [a-z])" + +for ARG in ${ENV_ARGS}; do + case "${ARG}" in + clang ) + export CC_ARG="Clang" CC="clang${C_CLANG_SUFFIX}" CXX="clang++${C_CLANG_SUFFIX}" + ;; + gcc ) + export CC_ARG="GCC" CC="gcc${C_GCC_SUFFIX}" CXX="g++${C_GCC_SUFFIX}" + ;; + makepkg ) + export MAKE_PKG=1 + ;; + multilib ) + export MULTILIB=1 + ;; + x64 ) + export ARCH_ARG="x64" CPU_TUNE="-march=nocona" BITS=64 + ;; + x86 ) + export ARCH_ARG="x86" CPU_TUNE="-march=pentium4" BITS=32 + ;; + esac +done + +if [[ -z ${ARCH_ARG} ]]; then exit 8; fi +if [[ -z ${CC_ARG} ]]; then exit 7; fi + +export REPO="${PWD##*/}" +if [[ "${REPO}" == "" ]]; then exit 6; fi + +export BIN_OS="$(uname -s | tr [A-Z] [a-z])" +if [[ ! -z ${MSYSTEM} ]]; then export BIN_OS="msys2"; fi +export ENV_NAME="$(uname -s)" +export LDD="ldd" +export PKG_PATH="usr/local/lib/mupen64plus/" +if [[ "${REPO}" == *"core"* ]]; then + export PKG_PATH="usr/local/lib/" +elif [[ "${REPO}" == *"ui-console"* ]]; then + export PKG_PATH="usr/local/bin/" +fi + +if [[ "${ENV_NAME}" == *"Linux"* ]]; then + if [[ "${ARCH_ARG}" == "x86" ]]; then export PIC=1 PIE=1; fi + if [[ ${MULTILIB} -eq 0 ]]; then + if [[ "${CC_ARG}" == "GCC" ]]; then + if [[ "${ARCH_ARG}" == "x86" ]]; then export CC="i686-linux-gnu-${CC}" CXX="i686-linux-gnu-${CXX}"; fi + fi + fi +fi + +if [[ "${ENV_NAME}" == *"MINGW"* ]]; then + export INSTALL_OVERRIDE="PLUGINDIR="" SHAREDIR="" BINDIR="" MANDIR="" LIBDIR="" APPSDIR="" ICONSDIR="icons" INCDIR="api"" + export LDD="ntldd -R" + unset PKG_PATH +fi + +export G_REV="$(git rev-parse --short HEAD)" +export PKG_NAME="${REPO}-${BIN_OS}-${ARCH_ARG}-g${G_REV}" +if [[ -f "${GITHUB_ENV}" ]]; then + set +e + grep "PKG_NAME=${PKG_NAME}" "${GITHUB_ENV}" > /dev/null + if [[ ${?} -ne 0 ]]; then echo "PKG_NAME=${PKG_NAME}" >> "${GITHUB_ENV}"; fi + set -e +fi + +if [[ -z ${OPTFLAGS} ]]; then export OPTFLAGS="-O3 -flto ${CPU_TUNE}"; fi + +echo "" +echo ":: CC=${CC} CXX=${CXX} BITS=${BITS} ${CONFIG_OVERRIDE} ::" +echo "" +${CC} --version +echo "" + +make_clean () { + make CC="${CC}" CXX="${CXX}" BITS=${BITS} ${CONFIG_OVERRIDE} -C projects/unix clean + echo "" +} + +make_clean +make CC="${CC}" CXX="${CXX}" BITS=${BITS} ${CONFIG_OVERRIDE} -C projects/unix all -j4 +echo "" + +if [[ ! -d pkg ]]; then + mkdir pkg + chmod -R 755 pkg +fi + +pushd projects/unix > /dev/null +export ARTIFACT="$(find *mupen64plus* -type f 2> /dev/null | head -n 1)" +popd > /dev/null + +make CC="${CC}" CXX="${CXX}" BITS=${BITS} ${CONFIG_OVERRIDE} -C projects/unix install ${INSTALL_OVERRIDE} DESTDIR="$(pwd)/pkg/" +echo "" +make_clean + +if [[ -z ${ARTIFACT} ]]; then + exit 5 +else + cd pkg + ls -gG "${PKG_PATH}${ARTIFACT}" + echo "" + ${LDD} "${PKG_PATH}${ARTIFACT}" > ldd.log + cat ldd.log + echo "" + if [[ ${MAKE_PKG} -eq 1 ]]; then tar --owner=0 --group=0 --mode='og-w' -czf "${PKG_NAME}.tar.gz" usr; fi +fi + +exit 0 diff --git a/Source/3rdParty/mupen64plus-core/.github/workflows/scripts/ci_get_libglew_i386.sh b/Source/3rdParty/mupen64plus-core/.github/workflows/scripts/ci_get_libglew_i386.sh new file mode 100755 index 00000000..50bd7364 --- /dev/null +++ b/Source/3rdParty/mupen64plus-core/.github/workflows/scripts/ci_get_libglew_i386.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +set -e +u + +# NOTE: There is no native "libglew-dev:i386" in Ubuntu 22.04, we will use Debian ones... + +export GLEWVER="$(apt list libglew-dev | grep "amd64" | cut -d ' ' -f2)" +export PKGS="$(apt list libglew* | grep "${GLEWVER}" | cut -d '/' -f1)" +export DEBSOURCE="http://http.us.debian.org/debian/pool/main/g/glew/" +export PKGVER_LS="$(curl -sS ${DEBSOURCE} | grep "${GLEWVER}" | grep "amd64" | cut -d '_' -f2 | sort)" +if [[ "${PKGVER_LS}" != "" ]]; then + for VER in ${PKGVER_LS}; do export PKGVER="${VER}"; done + cd /tmp + for PKG in ${PKGS}; do + for ARCH in amd64 i386; do curl -L -O "${DEBSOURCE}${PKG}_${PKGVER}_${ARCH}.deb"; done + done + sudo dpkg -i libglew*${PKGVER}*.deb +else + exit 9 +fi + +sudo ldconfig + +exit 0 diff --git a/Source/3rdParty/mupen64plus-core/.github/workflows/scripts/ci_install_ubuntu_deps.sh b/Source/3rdParty/mupen64plus-core/.github/workflows/scripts/ci_install_ubuntu_deps.sh new file mode 100755 index 00000000..19984467 --- /dev/null +++ b/Source/3rdParty/mupen64plus-core/.github/workflows/scripts/ci_install_ubuntu_deps.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +set -e +u + +if [[ ${#} -lt 2 ]]; then exit 9; fi + +unset ARCH_DEP CC_DEP +export BUILD_DEPS_I386="crossbuild-essential-i386 g++${C_GCC_SUFFIX}-i686-linux-gnu gcc${C_GCC_SUFFIX}-i686-linux-gnu libc6-i386" +export HOTFIX_I386="libatomic1:i386 libgcc-s1:i386 libstdc++6:i386 ${HOTFIX_I386}" +export ENV_ARGS="$(echo "${*}" | tr [A-Z] [a-z])" + +for ARG in ${ENV_ARGS}; do + case "${ARG}" in + clang ) + export CC_DEP="clang${C_CLANG_SUFFIX}" + ;; + gcc ) + export CC_DEP="g++${C_GCC_SUFFIX} gcc${C_GCC_SUFFIX}" + ;; + multilib ) + export BUILD_DEPS_I386="g++${C_GCC_SUFFIX}-multilib gcc${C_GCC_SUFFIX}-multilib libc6-dev-i386" + ;; + x64 ) + export ARCH_DEP="x64" + ;; + x86 ) + export ARCH_DEP="x86" + ;; + esac +done + +if [[ -z ${ARCH_DEP} ]]; then exit 8; fi +if [[ -z ${CC_DEP} ]]; then exit 7; fi + +sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test +if [[ "${ARCH_DEP}" == "x86" ]]; then sudo dpkg --add-architecture i386; fi +sudo apt-get update +sudo apt-get -y install build-essential git nasm pkg-config ${CC_DEP} ${BUILD_DEPS} +if [[ "${ARCH_DEP}" == "x86" ]]; then + if [[ "${BUILD_DEPS}" != "" ]]; then + for DEP in ${BUILD_DEPS}; do + if [[ "${DEP}" != "libglew-dev" ]]; then export BUILD_DEPS_I386="${BUILD_DEPS_I386} ${DEP}:i386"; fi + done + fi + sudo apt-get --reinstall -y install ${BUILD_DEPS_I386} ${HOTFIX_I386} +fi +sudo ldconfig + +exit 0 diff --git a/Source/3rdParty/mupen64plus-core/.github/workflows/scripts/ci_msvc_build.cmd b/Source/3rdParty/mupen64plus-core/.github/workflows/scripts/ci_msvc_build.cmd new file mode 100644 index 00000000..2ab17503 --- /dev/null +++ b/Source/3rdParty/mupen64plus-core/.github/workflows/scripts/ci_msvc_build.cmd @@ -0,0 +1,62 @@ +@echo off +setlocal enableextensions disabledelayedexpansion +cls +if not exist "projects\msvc\" exit /b 9 + +set ARCH= +set CONF=Release +if "%*" == "" exit /b 8 +for %%P in (%*) do ( + if /i "%%P" == "x86" set ARCH_ARG=x86& set ARCH=Win32 + if /i "%%P" == "x64" set ARCH_ARG=x64& set ARCH=x64 + if /i "%%P" == "newdyn" set CONF=New_Dynarec_Release +) + +if not defined ARCH exit /b 7 + +for %%T in (.) do set REPO=%%~nxT +if not defined REPO exit /b 6 + +set ARTIFACT= +set FPROJ= +set EXT=dll +echo %REPO% | findstr "ui-console" >nul 2>&1 +if not errorlevel 1 set EXT=exe +if not defined TOOLSET set TOOLSET=v143 + +for /f "tokens=1" %%R in ('git rev-parse --short HEAD') do set G_REV=%%R +set PKG_NAME=%REPO%-msvc-%ARCH_ARG%-g%G_REV% +if exist "%GITHUB_ENV%" ( + type "%GITHUB_ENV%" | findstr "PKG_NAME=%PKG_NAME%" >nul 2>&1 + if errorlevel 1 echo PKG_NAME=%PKG_NAME%>> "%GITHUB_ENV%" +) + +echo. +msbuild --version +echo. + +if not exist "..\mupen64plus-win32-deps\" git clone --depth 1 https://github.com/mupen64plus/mupen64plus-win32-deps.git ..\mupen64plus-win32-deps + +pushd projects\msvc\ +for /f "tokens=*" %%F in ('dir /b *.vcxproj') do set FPROJ=%%F +popd +if not defined FPROJ exit /b 5 + +echo. +msbuild "projects\msvc\%FPROJ%" /p:Configuration=%CONF%;Platform=%ARCH%;PlatformToolset=%TOOLSET% /t:Rebuild +if errorlevel 1 exit /b 4 +echo. + +if exist "projects\msvc\%ARCH%\Release\mupen64plus.dll" ren "projects\msvc\%ARCH%\Release\mupen64plus.dll" mupen64plus-old.dll + +pushd projects\msvc\%ARCH%\%CONF%\ +for /f "tokens=*" %%S in ('dir /b mupen64plus*%EXT%') do set ARTIFACT=%%S +popd +if not defined ARTIFACT exit /b 3 + +md pkg 2>nul +xcopy "projects\msvc\%ARCH%\%CONF%\%ARTIFACT%" pkg\ +if errorlevel 1 exit /b 2 +dir "pkg\%ARTIFACT%" + +exit /b 0 diff --git a/Source/3rdParty/mupen64plus-core/.github/workflows/scripts/ci_nightly_artifacts.sh b/Source/3rdParty/mupen64plus-core/.github/workflows/scripts/ci_nightly_artifacts.sh new file mode 100755 index 00000000..8b231449 --- /dev/null +++ b/Source/3rdParty/mupen64plus-core/.github/workflows/scripts/ci_nightly_artifacts.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +set -e +u + +export REPO="${PWD##*/}" +if [[ "${REPO}" == "" ]]; then exit 9; fi + +rm -fr pkg +mkdir pkg +cd binaries +for BIN in *; do + cd "${BIN}" + case "${BIN}" in + *msvc* | *msys2* ) + echo ":: Creating ${BIN}.zip" + zip -r "../../pkg/${BIN}.zip" * + ;; + * ) + echo ":: Recovering ${BIN}.tar.gz" + mv *.tar.gz ../../pkg/ + ;; + esac + cd .. +done +cd ../pkg +echo "" + +for ZIP in *; do + ls -gG ${ZIP} + tigerdeep -lz ${ZIP} >> ../${REPO}.tiger.txt + sha256sum ${ZIP} >> ../${REPO}.sha256.txt + sha512sum ${ZIP} >> ../${REPO}.sha512.txt + b2sum ${ZIP} >> ../${REPO}.blake2.txt +done +mv ../${REPO}.*.txt . +echo "" + +for HASH in tiger sha256 sha512 blake2; do + echo "${HASH}:" | tr [a-z] [A-Z] + cat *.${HASH}.txt + echo "" +done + +if [[ -f "${GITHUB_ENV}" ]]; then + git tag -f nightly-build + git push -f origin nightly-build +fi + +exit 0 diff --git a/Source/3rdParty/mupen64plus-core/.gitrepo b/Source/3rdParty/mupen64plus-core/.gitrepo index 3b002210..f1416e2a 100644 --- a/Source/3rdParty/mupen64plus-core/.gitrepo +++ b/Source/3rdParty/mupen64plus-core/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = git@github.com:mupen64plus/mupen64plus-core.git branch = master - commit = d8cb2faa9e15656a49dbbac56ffc2a7ea251c47e - parent = 49c7db75bae8dd3ff8dec7e119fea30b7f124124 + commit = 5340dafcc0f5e8284057ab931dd5c66222d3d49e + parent = f306caa55b20e873623e58c470b72bb94d105777 method = merge cmdver = 0.4.6 diff --git a/Source/3rdParty/mupen64plus-core/projects/unix/Makefile b/Source/3rdParty/mupen64plus-core/projects/unix/Makefile index 334b334b..42001a1b 100755 --- a/Source/3rdParty/mupen64plus-core/projects/unix/Makefile +++ b/Source/3rdParty/mupen64plus-core/projects/unix/Makefile @@ -796,7 +796,7 @@ targets: @echo " VULKAN=0 == Disable vulkan support for the default video extension implementation" @echo " POSTFIX=name == String added to the name of the the build (default: '')" @echo " Install Options:" - @echo " PREFIX=path == install/uninstall prefix (default: /usr/local/)" + @echo " PREFIX=path == install/uninstall prefix (default: /usr/local)" @echo " SHAREDIR=path == path to install shared data files (default: PREFIX/share/mupen64plus)" @echo " LIBDIR=path == path to install core library (default: PREFIX/lib)" @echo " INCDIR=path == path to install core header files (default: PREFIX/include/mupen64plus)" @@ -833,7 +833,7 @@ uninstall: $(RM) "$(DESTDIR)$(SHAREDIR)/mupencheat.txt" clean: - $(RM) -r $(TARGET) $(SONAME) _obj $(OBJDIR) $(SRCDIR)/asm_defines/asm_defines_* + $(RM) -r _obj $(OBJDIR) $(TARGET) $(SONAME) $(SRCDIR)/asm_defines/asm_defines_*.h # build dependency files CFLAGS += -MD -MP diff --git a/Source/3rdParty/mupen64plus-core/src/device/rcp/rsp/rsp_core.c b/Source/3rdParty/mupen64plus-core/src/device/rcp/rsp/rsp_core.c index 270fd652..550d9bb0 100644 --- a/Source/3rdParty/mupen64plus-core/src/device/rcp/rsp/rsp_core.c +++ b/Source/3rdParty/mupen64plus-core/src/device/rcp/rsp/rsp_core.c @@ -56,12 +56,12 @@ static void do_sp_dma(struct rsp_core* sp, const struct sp_dma* dma) { for(j=0; jdp->fb, dramaddr - length, length); + if (dramaddr <= 0x800000) + post_framebuffer_write(&sp->dp->fb, dramaddr - length, length); dramaddr+=skip; } @@ -72,10 +72,11 @@ static void do_sp_dma(struct rsp_core* sp, const struct sp_dma* dma) else { for(j=0; jdp->fb, dramaddr); + if (dramaddr < 0x800000) + pre_framebuffer_read(&sp->dp->fb, dramaddr); for(i=0; i - in library. + either statically or dynamically; added missing #include + in library. 2002-03-11 lpd Corrected argument list for main(), and added int return - type, in test program and T value program. + type, in test program and T value program. 2002-02-21 lpd Added missing #include in test program. 2000-07-03 lpd Patched to eliminate warnings about "constant is - unsigned in ANSI C, signed in traditional"; made test program - self-checking. + unsigned in ANSI C, signed in traditional"; made test program + self-checking. 1999-11-04 lpd Edited comments slightly for automatic TOC extraction. 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5). 1999-05-03 lpd Original version. */ #include "md5.h" - #include +#include -#undef BYTE_ORDER /* 1 = big-endian, -1 = little-endian, 0 = unknown */ +#undef BYTE_ORDER /* 1 = big-endian, -1 = little-endian, 0 = unknown */ #ifdef ARCH_IS_BIG_ENDIAN # define BYTE_ORDER (ARCH_IS_BIG_ENDIAN ? 1 : -1) #else @@ -133,8 +133,8 @@ static void md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/) { md5_word_t - a = pms->abcd[0], b = pms->abcd[1], - c = pms->abcd[2], d = pms->abcd[3]; + a = pms->abcd[0], b = pms->abcd[1], + c = pms->abcd[2], d = pms->abcd[3]; md5_word_t t; #if BYTE_ORDER > 0 /* Define storage only for big-endian CPUs. */ @@ -147,51 +147,51 @@ md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/) { #if BYTE_ORDER == 0 - /* - * Determine dynamically whether this is a big-endian or - * little-endian machine, since we can use a more efficient - * algorithm on the latter. - */ - static const int w = 1; - - if (*((const md5_byte_t *)&w)) /* dynamic little-endian */ -#endif -#if BYTE_ORDER <= 0 /* little-endian */ - { /* - * On little-endian machines, we can process properly aligned - * data without copying it. + * Determine dynamically whether this is a big-endian or + * little-endian machine, since we can use a more efficient + * algorithm on the latter. */ - if (!((data - (const md5_byte_t *)0) & 3)) { - /* data are properly aligned */ - X = (const md5_word_t *)data; - } else { - /* not aligned */ - memcpy(xbuf, data, 64); - X = xbuf; + static const int w = 1; + + if (*((const md5_byte_t *)&w)) /* dynamic little-endian */ +#endif +#if BYTE_ORDER <= 0 /* little-endian */ + { + /* + * On little-endian machines, we can process properly aligned + * data without copying it. + */ + if (!((data - (const md5_byte_t *)0) & 3)) { + /* data are properly aligned */ + X = (const md5_word_t *)data; + } else { + /* not aligned */ + memcpy(xbuf, data, 64); + X = xbuf; + } } - } #endif #if BYTE_ORDER == 0 - else /* dynamic big-endian */ + else /* dynamic big-endian */ #endif -#if BYTE_ORDER >= 0 /* big-endian */ - { - /* - * On big-endian machines, we must arrange the bytes in the - * right order. - */ - const md5_byte_t *xp = data; - int i; +#if BYTE_ORDER >= 0 /* big-endian */ + { + /* + * On big-endian machines, we must arrange the bytes in the + * right order. + */ + const md5_byte_t *xp = data; + int i; # if BYTE_ORDER == 0 - X = xbuf; /* (dynamic only) */ + X = xbuf; /* (dynamic only) */ # else -# define xbuf X /* (static only) */ +# define xbuf X /* (static only) */ # endif - for (i = 0; i < 16; ++i, xp += 4) - xbuf[i] = xp[0] + (xp[1] << 8) + (xp[2] << 16) + (xp[3] << 24); - } + for (i = 0; i < 16; ++i, xp += 4) + xbuf[i] = xp[0] + (xp[1] << 8) + (xp[2] << 16) + (xp[3] << 24); + } #endif } @@ -321,63 +321,74 @@ md5_init(md5_state_t *pms) } void -md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes) +md5_append(md5_state_t *pms, const md5_byte_t *data, unsigned int nbytes) { const md5_byte_t *p = data; - int left = nbytes; - int offset = (pms->count[0] >> 3) & 63; + unsigned int left = nbytes; + unsigned int offset = (pms->count[0] >> 3) & 63; md5_word_t nbits = (md5_word_t)(nbytes << 3); if (nbytes <= 0) - return; + return; + + /* this special case is handled recursively */ + if (nbytes > INT_MAX - offset) { + unsigned int overlap; + + /* handle the append in two steps to prevent overflow */ + overlap = 64 - offset; + + md5_append(pms, data, overlap); + md5_append(pms, data + overlap, nbytes - overlap); + return; + } /* Update the message length. */ pms->count[1] += nbytes >> 29; pms->count[0] += nbits; if (pms->count[0] < nbits) - pms->count[1]++; + pms->count[1]++; /* Process an initial partial block. */ if (offset) { - int copy = (offset + nbytes > 64 ? 64 - offset : nbytes); - - memcpy(pms->buf + offset, p, copy); - if (offset + copy < 64) - return; - p += copy; - left -= copy; - md5_process(pms, pms->buf); + unsigned int copy = (offset + nbytes > 64 ? 64 - offset : nbytes); + + memcpy(pms->buf + offset, p, copy); + if (offset + copy < 64) + return; + p += copy; + left -= copy; + md5_process(pms, pms->buf); } /* Process full blocks. */ for (; left >= 64; p += 64, left -= 64) - md5_process(pms, p); + md5_process(pms, p); /* Process a final partial block. */ if (left) - memcpy(pms->buf, p, left); + memcpy(pms->buf, p, left); } void md5_finish(md5_state_t *pms, md5_byte_t digest[16]) { static const md5_byte_t pad[64] = { - 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; md5_byte_t data[8]; int i; /* Save the length before padding. */ for (i = 0; i < 8; ++i) - data[i] = (md5_byte_t)(pms->count[i >> 2] >> ((i & 3) << 3)); + data[i] = (md5_byte_t)(pms->count[i >> 2] >> ((i & 3) << 3)); /* Pad to 56 bytes mod 64. */ md5_append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1); /* Append the length. */ md5_append(pms, data, 8); for (i = 0; i < 16; ++i) - digest[i] = (md5_byte_t)(pms->abcd[i >> 2] >> ((i & 3) << 3)); + digest[i] = (md5_byte_t)(pms->abcd[i >> 2] >> ((i & 3) << 3)); } - diff --git a/Source/3rdParty/mupen64plus-core/subprojects/md5/md5.h b/Source/3rdParty/mupen64plus-core/subprojects/md5/md5.h index 5ddb0372..0ab0e684 100644 --- a/Source/3rdParty/mupen64plus-core/subprojects/md5/md5.h +++ b/Source/3rdParty/mupen64plus-core/subprojects/md5/md5.h @@ -21,13 +21,13 @@ ghost@aladdin.com */ -/* $Id: md5.h,v 1.4 2002/04/13 19:20:28 lpd Exp $ */ +/* $Id$ */ /* Independent implementation of MD5 (RFC 1321). This code implements the MD5 Algorithm defined in RFC 1321, whose text is available at - http://www.ietf.org/rfc/rfc1321.txt + http://www.ietf.org/rfc/rfc1321.txt The code is derived from the text of the RFC, including the test suite (section A.5) but excluding the rest of Appendix A. It does not include any code or documentation that is identified in the RFC as being @@ -38,12 +38,12 @@ that follows (in reverse chronological order): 2002-04-13 lpd Removed support for non-ANSI compilers; removed - references to Ghostscript; clarified derivation from RFC 1321; - now handles byte order either statically or dynamically. + references to Ghostscript; clarified derivation from RFC 1321; + now handles byte order either statically or dynamically. 1999-11-04 lpd Edited comments slightly for automatic TOC extraction. 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5); - added conditionalization for C++ compilation from Martin - Purschke . + added conditionalization for C++ compilation from Martin + Purschke . 1999-05-03 lpd Original version. */ @@ -65,9 +65,9 @@ typedef unsigned int md5_word_t; /* 32-bit word */ /* Define the state of the MD5 Algorithm. */ typedef struct md5_state_s { - md5_word_t count[2]; /* message length in bits, lsw first */ - md5_word_t abcd[4]; /* digest buffer */ - md5_byte_t buf[64]; /* accumulate block */ + md5_word_t count[2]; /* message length in bits, lsw first */ + md5_word_t abcd[4]; /* digest buffer */ + md5_byte_t buf[64]; /* accumulate block */ } md5_state_t; #ifdef __cplusplus @@ -79,7 +79,7 @@ extern "C" void md5_init(md5_state_t *pms); /* Append a string to the message. */ -void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes); +void md5_append(md5_state_t *pms, const md5_byte_t *data, unsigned int nbytes); /* Finish the message and return the digest. */ void md5_finish(md5_state_t *pms, md5_byte_t digest[16]); @@ -89,4 +89,3 @@ void md5_finish(md5_state_t *pms, md5_byte_t digest[16]); #endif #endif /* md5_INCLUDED */ -