From 205a7f52932b77aac849bd5b6db12ca68e94121b Mon Sep 17 00:00:00 2001 From: Alejandro Asenjo Nitti <96613413+sonicdcer@users.noreply.github.com> Date: Sat, 25 Oct 2025 01:07:02 -0300 Subject: [PATCH] CI Workflows (#2) * CI Implementation setup * update rom name * update rom name (aspMain.us.toml) * update recompsyms * Set execute bit for appimage.sh * Set execute bit for ld64 --- .github/linux/DNZHRecompiled.desktop | 9 + .github/linux/appimage.sh | 45 ++ .github/macos/Info.plist.in | 26 ++ .github/macos/apple_bundle.cmake | 87 ++++ .github/macos/entitlements.plist | 14 + .github/macos/fixup_bundle.cmake | 44 ++ .github/macos/ld64 | 73 +++ .github/macos/macports.yaml | 16 + .github/workflows/update-pr-artifacts.yml | 64 +++ .github/workflows/validate-external.yml | 19 + .github/workflows/validate-internal.yml | 12 + .github/workflows/validate.yml | 434 ++++++++++++++++++ DNZHRecompSyms | 2 +- aspMain.us.toml | 2 +- flatpak/README.md | 4 +- .../io.github.dnzhrecomp.dnzhrecomp.desktop | 8 + ...n => io.github.dnzhrecomp.dnzhrecomp.json} | 6 +- ...github.dnzhrecomp.dnzhrecomp.metainfo.xml} | 8 +- ...ariokart64recomp.mariokart64recomp.desktop | 8 - patches.toml | 2 +- patches/debug.h | 7 +- patches/patches.h | 2 - src/main/main.cpp | 2 +- us.toml | 2 +- 24 files changed, 867 insertions(+), 29 deletions(-) create mode 100644 .github/linux/DNZHRecompiled.desktop create mode 100755 .github/linux/appimage.sh create mode 100644 .github/macos/Info.plist.in create mode 100644 .github/macos/apple_bundle.cmake create mode 100644 .github/macos/entitlements.plist create mode 100644 .github/macos/fixup_bundle.cmake create mode 100755 .github/macos/ld64 create mode 100644 .github/macos/macports.yaml create mode 100644 .github/workflows/update-pr-artifacts.yml create mode 100644 .github/workflows/validate-external.yml create mode 100644 .github/workflows/validate-internal.yml create mode 100644 .github/workflows/validate.yml create mode 100644 flatpak/io.github.dnzhrecomp.dnzhrecomp.desktop rename flatpak/{io.github.mariokart64recomp.mariokart64recomp.json => io.github.dnzhrecomp.dnzhrecomp.json} (87%) rename flatpak/{io.github.mariokart64recomp.mariokart64recomp.metainfo.xml => io.github.dnzhrecomp.dnzhrecomp.metainfo.xml} (59%) delete mode 100644 flatpak/io.github.mariokart64recomp.mariokart64recomp.desktop diff --git a/.github/linux/DNZHRecompiled.desktop b/.github/linux/DNZHRecompiled.desktop new file mode 100644 index 0000000..a506574 --- /dev/null +++ b/.github/linux/DNZHRecompiled.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=DNZHRecompiled +Type=Application +Terminal=false +Icon=DNZHRecompiled +Exec=DNZHRecompiled +GenericName=DNZHRecompiled +Categories=Game; + diff --git a/.github/linux/appimage.sh b/.github/linux/appimage.sh new file mode 100755 index 0000000..f64dd8b --- /dev/null +++ b/.github/linux/appimage.sh @@ -0,0 +1,45 @@ +ARCH=$(uname -m) +LINUX_DEPLOY_ARCH=$(uname -m) + +if [ "$ARCH" = "x86_64" ]; then + ARCH="x86_64" + LINUX_DEPLOY_ARCH="x86_64" +elif [ "$ARCH" = "aarch64" ]; then + ARCH="arm_aarch64" + LINUX_DEPLOY_ARCH="aarch64" +else + echo "Unsupported architecture: $ARCH" + exit 1 +fi + +curl -sSfLO "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-$LINUX_DEPLOY_ARCH.AppImage" +curl -sSfLO "https://github.com/linuxdeploy/linuxdeploy-plugin-gtk/raw/master/linuxdeploy-plugin-gtk.sh" + +chmod a+x linuxdeploy* + +mkdir -p AppDir/usr/bin +cp DNZHRecompiled AppDir/usr/bin/ +cp -r assets/ AppDir/usr/bin/ +cp recompcontrollerdb.txt AppDir/usr/bin/ +cp icons/512.png AppDir/DNZHRecompiled.png +cp .github/linux/DNZHRecompiled.desktop AppDir/ + +"./linuxdeploy-$LINUX_DEPLOY_ARCH.AppImage" --appimage-extract +mv squashfs-root/ deploy +./deploy/AppRun --appdir=AppDir/ -d AppDir/DNZHRecompiled.desktop -i AppDir/DNZHRecompiled.png -e AppDir/usr/bin/DNZHRecompiled --plugin gtk +sed -i 's/exec/#exec/g' AppDir/AppRun +echo 'if [ -f "portable.txt" ]; then' >> AppDir/AppRun +echo ' APP_FOLDER_PATH=$PWD' >> AppDir/AppRun +echo ' cd "$this_dir"/usr/bin/' >> AppDir/AppRun +echo ' APP_FOLDER_PATH=$APP_FOLDER_PATH ./DNZHRecompiled' >> AppDir/AppRun +echo 'else' >> AppDir/AppRun +echo ' cd "$this_dir"/usr/bin/' >> AppDir/AppRun +echo ' ./DNZHRecompiled' >> AppDir/AppRun +echo 'fi' >> AppDir/AppRun + +# Remove conflicting libraries +rm -rf AppDir/usr/lib/libgmodule* +rm -rf AppDir/usr/lib/gio/modules/*.so +rm -rf AppDir/usr/lib/libwayland* + +./deploy/usr/bin/linuxdeploy-plugin-appimage --appdir=AppDir diff --git a/.github/macos/Info.plist.in b/.github/macos/Info.plist.in new file mode 100644 index 0000000..3ff9775 --- /dev/null +++ b/.github/macos/Info.plist.in @@ -0,0 +1,26 @@ + + + + + CFBundleName + ${MACOSX_BUNDLE_BUNDLE_NAME} + CFBundleIdentifier + ${MACOSX_BUNDLE_GUI_IDENTIFIER} + CFBundleVersion + ${MACOSX_BUNDLE_BUNDLE_VERSION} + CFBundleShortVersionString + ${MACOSX_BUNDLE_SHORT_VERSION_STRING} + CFBundleExecutable + DNZHRecompiled + CFBundleIconFile + ${MACOSX_BUNDLE_ICON_FILE} + LSApplicationCategoryType + public.app-category.games + CFBundlePackageType + APPL + LSMinimumSystemVersion + 11 + GCSupportsGameMode + + + diff --git a/.github/macos/apple_bundle.cmake b/.github/macos/apple_bundle.cmake new file mode 100644 index 0000000..28a137f --- /dev/null +++ b/.github/macos/apple_bundle.cmake @@ -0,0 +1,87 @@ +# Define the path to the entitlements file +set(ENTITLEMENTS_FILE ${CMAKE_SOURCE_DIR}/.github/macos/entitlements.plist) + +# Set bundle properties +set_target_properties(DNZHRecompiled PROPERTIES + MACOSX_BUNDLE TRUE + MACOSX_BUNDLE_BUNDLE_NAME "DNZHRecompiled" + MACOSX_BUNDLE_GUI_IDENTIFIER "com.github.dnzhrecompiled" + MACOSX_BUNDLE_BUNDLE_VERSION "1.0" + MACOSX_BUNDLE_SHORT_VERSION_STRING "1.0" + MACOSX_BUNDLE_ICON_FILE "AppIcon.icns" + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_BINARY_DIR}/Info.plist + XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "-" + XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${ENTITLEMENTS_FILE} +) + +# Create icon files for macOS bundle +set(ICON_SOURCE ${CMAKE_SOURCE_DIR}/icons/512.png) +set(ICONSET_DIR ${CMAKE_BINARY_DIR}/AppIcon.iconset) +set(ICNS_FILE ${CMAKE_BINARY_DIR}/resources/AppIcon.icns) + +# Create iconset directory and add PNG file +add_custom_command( + OUTPUT ${ICONSET_DIR} + COMMAND ${CMAKE_COMMAND} -E make_directory ${ICONSET_DIR} + COMMAND ${CMAKE_COMMAND} -E copy ${ICON_SOURCE} ${ICONSET_DIR}/icon_512x512.png + COMMAND ${CMAKE_COMMAND} -E copy ${ICON_SOURCE} ${ICONSET_DIR}/icon_512x512@2x.png + COMMAND touch ${ICONSET_DIR} + COMMENT "Creating iconset directory and copying PNG file" +) + +# Convert iconset to icns +add_custom_command( + OUTPUT ${ICNS_FILE} + DEPENDS ${ICONSET_DIR} + COMMAND iconutil -c icns ${ICONSET_DIR} -o ${ICNS_FILE} + COMMENT "Converting iconset to icns" +) + +# Custom target to ensure icns creation +add_custom_target(create_icns ALL DEPENDS ${ICNS_FILE}) + +# Set source file properties for the resulting icns file +set_source_files_properties(${ICNS_FILE} PROPERTIES + MACOSX_PACKAGE_LOCATION "Resources" +) + +# Add the icns file to the executable target +target_sources(DNZHRecompiled PRIVATE ${ICNS_FILE}) + +# Ensure DNZHRecompiled depends on create_icns +add_dependencies(DNZHRecompiled create_icns) + +# Configure Info.plist +configure_file(${CMAKE_SOURCE_DIR}/.github/macos/Info.plist.in ${CMAKE_BINARY_DIR}/Info.plist @ONLY) + +# Install the app bundle +install(TARGETS DNZHRecompiled BUNDLE DESTINATION .) + +# Ensure the entitlements file exists +if(NOT EXISTS ${ENTITLEMENTS_FILE}) + message(FATAL_ERROR "Entitlements file not found at ${ENTITLEMENTS_FILE}") +endif() + +# Post-build steps for macOS bundle +add_custom_command(TARGET DNZHRecompiled POST_BUILD + # Copy and fix frameworks first + COMMAND ${CMAKE_COMMAND} -D CMAKE_BUILD_TYPE=$ -D CMAKE_GENERATOR=${CMAKE_GENERATOR} -P ${CMAKE_SOURCE_DIR}/.github/macos/fixup_bundle.cmake + + # Copy all resources + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/assets ${CMAKE_BINARY_DIR}/temp_assets + COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/temp_assets/scss + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/temp_assets $/Contents/Resources/assets + COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/temp_assets + + # Copy controller database + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/recompcontrollerdb.txt $/Contents/Resources/ + + # Set RPATH + COMMAND install_name_tool -add_rpath "@executable_path/../Frameworks/" $/Contents/MacOS/DNZHRecompiled + + # Sign the bundle + COMMAND codesign --verbose=4 --options=runtime --no-strict --sign - --entitlements ${ENTITLEMENTS_FILE} --deep --force $ + + COMMENT "Performing post-build steps for macOS bundle" + VERBATIM +) diff --git a/.github/macos/entitlements.plist b/.github/macos/entitlements.plist new file mode 100644 index 0000000..16890d6 --- /dev/null +++ b/.github/macos/entitlements.plist @@ -0,0 +1,14 @@ + + + + + com.apple.security.cs.allow-jit + + com.apple.security.cs.allow-unsigned-executable-memory + + com.apple.security.cs.disable-executable-page-protection + + com.apple.security.cs.disable-library-validation + + + diff --git a/.github/macos/fixup_bundle.cmake b/.github/macos/fixup_bundle.cmake new file mode 100644 index 0000000..e94383f --- /dev/null +++ b/.github/macos/fixup_bundle.cmake @@ -0,0 +1,44 @@ +include(BundleUtilities) + +# Check for pkgx installation +find_program(PKGX_EXECUTABLE pkgx) + +# Xcode generator puts the build type in the build directory +set(BUILD_PREFIX "") +if (CMAKE_GENERATOR STREQUAL "Xcode") + set(BUILD_PREFIX "${CMAKE_BUILD_TYPE}/") +endif() + +# Use generator expressions to get the absolute path to the bundle +set(APPS "${BUILD_PREFIX}DNZHRecompiled.app/Contents/MacOS/DNZHRecompiled") + +# Set up framework search paths +set(DIRS "${BUILD_PREFIX}DNZHRecompiled.app/Contents/Frameworks") + +# Detect if we're using pkgx +if(PKGX_EXECUTABLE) + message(STATUS "pkgx detected, adding pkgx directories to framework search path") + list(APPEND DIRS "$ENV{HOME}/.pkgx/") +endif() + +# Convert all paths to absolute paths +file(REAL_PATH ${APPS} APPS) + +set(RESOLVED_DIRS "") +foreach(DIR IN LISTS DIRS) + # Handle home directory expansion + string(REPLACE "~" "$ENV{HOME}" DIR "${DIR}") + # Convert to absolute path, but don't fail if directory doesn't exist + if(EXISTS "${DIR}") + file(REAL_PATH "${DIR}" RESOLVED_DIR) + list(APPEND RESOLVED_DIRS "${RESOLVED_DIR}") + endif() +endforeach() + +# Debug output +message(STATUS "Bundle fixup paths:") +message(STATUS " App: ${APPS}") +message(STATUS " Search dirs: ${RESOLVED_DIRS}") + +# Fix up the bundle +fixup_bundle("${APPS}" "" "${RESOLVED_DIRS}") \ No newline at end of file diff --git a/.github/macos/ld64 b/.github/macos/ld64 new file mode 100755 index 0000000..9d7bf64 --- /dev/null +++ b/.github/macos/ld64 @@ -0,0 +1,73 @@ +#!/usr/bin/python3 +""" +Custom ld64 wrapper for macOS + +This script wraps the standard macOS linker (/usr/bin/ld) to modify executable memory +protection flags in the resulting Mach-O binary. It works in three stages: + +1. First, it passes through all arguments to the regular macOS linker to create the binary +2. Then, it parses command line arguments to identify output file and segment protection flags +3. Finally, it modifies the output binary's Mach-O headers to ensure segments (particularly __TEXT) + have the maximum protection flags (rwx) we specify, even if the default macOS linker would restrict them + +This is necessary because macOS restricts writable+executable memory by default, +but certain applications need this capability for dynamic code generation or JIT compilation. + +Usage: Same as the standard ld64 linker, with the added benefit that -segprot options +will have their max_prot values properly preserved in the output binary. +""" + +import sys +import subprocess +from itertools import takewhile +from macholib import MachO, ptypes + +def parse_rwx(text): + return ('r' in text and 1) | ('w' in text and 2) | ('x' in text and 4) + +def apply_maxprots(path, maxprots): + mach = MachO.MachO(path) + header = mach.headers[0] + offset = ptypes.sizeof(header.mach_header) + + for cload, ccmd, cdata in header.commands: + if not hasattr(ccmd, 'segname'): + break + + if hasattr(ccmd.segname, 'to_str'): + segname = ccmd.segname.to_str().decode('utf-8').strip('\0') + else: + segname = ccmd.segname.decode('utf-8').strip('\0') + + if segname in maxprots and ccmd.maxprot != maxprots[segname]: + fields = list(takewhile(lambda field: field[0] != 'maxprot', cload._fields_ + ccmd._fields_)) + index = offset + sum(ptypes.sizeof(typ) for _, typ in fields) + + with open(path, 'r+b') as fh: + fh.seek(index) + fh.write(bytes([maxprots[segname]])) + + offset += cload.cmdsize + +try: + subprocess.check_call(['/usr/bin/ld'] + sys.argv[1:]) +except subprocess.CalledProcessError as ex: + sys.exit(ex.returncode) + +output_file = 'a.out' +segprots = {'__TEXT': parse_rwx('rwx')} # maxprot = rwx + +i = 1 +while i < len(sys.argv): + if sys.argv[i] == '-o' and i + 1 < len(sys.argv): + output_file = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-segprot' and i + 3 < len(sys.argv): + segment = sys.argv[i + 1] + maxprot = sys.argv[i + 2] + segprots[segment] = parse_rwx(maxprot) + i += 4 + else: + i += 1 + +apply_maxprots(output_file, segprots) diff --git a/.github/macos/macports.yaml b/.github/macos/macports.yaml new file mode 100644 index 0000000..87b3025 --- /dev/null +++ b/.github/macos/macports.yaml @@ -0,0 +1,16 @@ +version: '2.10.6' +prefix: '/opt/local' +variants: + select: + - aqua + - metal + deselect: x11 +ports: + - name: libiconv + select: universal + - name: libsdl2 + select: universal + - name: freetype + select: universal + - name: clang-18 + - name: llvm-18 diff --git a/.github/workflows/update-pr-artifacts.yml b/.github/workflows/update-pr-artifacts.yml new file mode 100644 index 0000000..c8481ea --- /dev/null +++ b/.github/workflows/update-pr-artifacts.yml @@ -0,0 +1,64 @@ +name: update-pr-artifacts +on: + workflow_run: + workflows: [validate-external, validate-internal] + types: + - completed +jobs: + update-pr-artifacts: + runs-on: ubuntu-latest + if: (github.event.workflow_run.event == 'pull_request' || github.event.workflow_run.event == 'pull_request_target') && github.event.workflow_run.conclusion == 'success' + name: Update PR Artifacts + steps: + - name: Get PR Number + id: pr-number + uses: actions/github-script@v6 + with: + result-encoding: string + script: | + const { owner, repo } = context.repo; + + const findPRNumber = async () => { + const pulls = await github.rest.pulls.list({ owner, repo }); + for await (const { data } of github.paginate.iterator(pulls)) { + for (const pull of data) { + if (pull.head.sha === '${{ github.event.workflow_run.head_sha }}' && pull.user.id === ${{ github.event.sender.id }}) { + return pull.number; + } + } + } + + return null; + }; + + const prNumber = await findPRNumber(); + if (!prNumber) { + core.error(`No matching pull request found`); + } else { + return prNumber; + } + - name: Create Artifacts Content + id: artifacts-content + uses: actions/github-script@v6 + with: + result-encoding: string + script: | + const artifacts = await github.rest.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: context.payload.workflow_run.id, + }); + + const nightlyLinks = artifacts.data.artifacts.reduce((acc, item) => { + acc += `- [${item.name}.zip](https://nightly.link/${context.repo.owner}/${context.repo.repo}/actions/artifacts/${item.id}.zip)\n`; + return acc; + }, '### Build Artifacts\n'); + + return nightlyLinks; + - name: Update PR Description + uses: garrettjoecox/pr-section@3.1.0 + with: + section-name: 'artifacts' + repo-token: '${{ secrets.GITHUB_TOKEN }}' + pr-number: ${{ steps.pr-number.outputs.result }} + section-value: '${{ steps.artifacts-content.outputs.result }}' \ No newline at end of file diff --git a/.github/workflows/validate-external.yml b/.github/workflows/validate-external.yml new file mode 100644 index 0000000..347c1f7 --- /dev/null +++ b/.github/workflows/validate-external.yml @@ -0,0 +1,19 @@ +name: validate-external +on: + pull_request_target: + types: [opened, synchronize] +jobs: + authorize: + if: github.repository != github.event.pull_request.head.repo.full_name + environment: + ${{ github.event_name == 'pull_request_target' && + github.event.pull_request.head.repo.full_name != github.repository && + 'external' || 'internal' }} + runs-on: ubuntu-latest + steps: + - run: echo ✓ + build: + needs: authorize + uses: ./.github/workflows/validate.yml + secrets: + DNZH_REPO_WITH_PAT: ${{ secrets.DNZH_REPO_WITH_PAT }} \ No newline at end of file diff --git a/.github/workflows/validate-internal.yml b/.github/workflows/validate-internal.yml new file mode 100644 index 0000000..2c1ddcb --- /dev/null +++ b/.github/workflows/validate-internal.yml @@ -0,0 +1,12 @@ +name: validate-internal +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize] +jobs: + build: + if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name + uses: ./.github/workflows/validate.yml + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..9fa7415 --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,434 @@ +name: validate +on: + workflow_call: + inputs: + SDL2_VERSION: + type: string + required: false + default: '2.30.3' + N64RECOMP_COMMIT: + type: string + required: false + default: 'a13e5cff96686776b0e03baf23923e3c1927b770' + secrets: + DNZH_REPO_WITH_PAT: + required: true +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + build-linux: + runs-on: ubuntu-22.04 + strategy: + matrix: + type: [ Debug, Release ] + os: [ ubuntu-22.04 ] + name: ubuntu-22.04 (x64, ${{ matrix.type }}, Native, AppImage) + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha || github.ref }} + submodules: recursive + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ${{ matrix.os }}-z64re-ccache-${{ matrix.type }}-x64-${{ inputs.N64RECOMP_COMMIT }} + - name: Install Linux Dependencies + run: | + sudo apt-get update + sudo apt-get install -y ninja-build libsdl2-dev libgtk-3-dev lld llvm clang-15 libfuse2 + + # Install SDL2 + echo ::group::install SDL2 + + # Enable ccache + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" + + wget https://github.com/libsdl-org/SDL/releases/download/release-${{ inputs.SDL2_VERSION }}/SDL2-${{ inputs.SDL2_VERSION }}.tar.gz + tar -xzf SDL2-${{ inputs.SDL2_VERSION }}.tar.gz + cd SDL2-${{ inputs.SDL2_VERSION }} + ./configure + make -j 10 + sudo make install + sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/ + echo ::endgroup:: + + - name: Get extra dependencies + uses: actions/checkout@v4 + with: + repository: ${{ secrets.DNZH_REPO_WITH_PAT }} + token: ${{ secrets.DNZH_TOKEN }} + path: dnzhrecomp-secret + - name: Prepare Build + run: cp -r dnzhrecomp-secret/dnzh.us.z64 ./ + + - name: Build N64Recomp & RSPRecomp + run: | + git clone https://github.com/Mr-Wiseguy/N64Recomp.git --recurse-submodules N64RecompSource + cd N64RecompSource + git checkout ${{ inputs.N64RECOMP_COMMIT }} + git submodule update --init --recursive + + # enable ccache + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" + + # Build N64Recomp & RSPRecomp + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=g++-11 -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build + cmake --build cmake-build --config Release --target N64RecompCLI -j $(nproc) + cmake --build cmake-build --config Release --target RSPRecomp -j $(nproc) + + # Copy N64Recomp & RSPRecomp to root directory + cp cmake-build/N64Recomp .. + cp cmake-build/RSPRecomp .. + - name: Run N64Recomp & RSPRecomp + run: | + ./N64Recomp us.toml + ./RSPRecomp aspMain.us.toml + + - name: Build DNZHRecomp + run: |- + # enable ccache + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" + + cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=clang++-15 -DCMAKE_C_COMPILER=clang-15 -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build + cmake --build cmake-build --config ${{ matrix.type }} --target DNZHRecompiled -j $(nproc) + - name: Prepare Archive + run: | + mv cmake-build/DNZHRecompiled DNZHRecompiled + rm -rf assets/scss + tar -czf DNZHRecompiled.tar.gz DNZHRecompiled assets/ recompcontrollerdb.txt + - name: Archive DNZHRecomp + uses: actions/upload-artifact@v4 + with: + name: DNZHRecompiled-${{ runner.os }}-X64-${{ matrix.type }} + path: DNZHRecompiled.tar.gz + - name: Build AppImage + run: |- + ./.github/linux/appimage.sh + - name: DNZHRecomp AppImage + uses: actions/upload-artifact@v4 + with: + name: DNZHRecompiled-AppImage-X64-${{ matrix.type }} + path: DNZHRecompiled-*.AppImage + build-linux-flatpak: + runs-on: ubuntu-latest + env: + FLATPAK_ID: io.github.dnzhrecomp.dnzhrecomp + FREEDESKTOP_VERSION: 23.08 + LLVM_VERSION: 18 + strategy: + matrix: + type: [ Debug, Release ] + os: [ ubuntu-latest ] + name: ${{ matrix.os }} (x64, ${{ matrix.type }}, Flatpak) + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha || github.ref }} + submodules: recursive + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ${{ matrix.os }}-z64re-ccache-${{ matrix.type }}-x64-${{ inputs.N64RECOMP_COMMIT }} + - name: Install Linux Dependencies + run: | + sudo apt-get update + sudo apt-get install -y flatpak-builder ccache lld + + - name: Get extra dependencies + uses: actions/checkout@v4 + with: + repository: ${{ secrets.DNZH_REPO_WITH_PAT }} + token: ${{ secrets.DNZH_TOKEN }} + path: dnzhrecomp-secret + - name: Prepare Build + run: cp -r dnzhrecomp-secret/dnzh.us.z64 ./ + + - name: Prepare Flatpak + run: | + flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + flatpak --user install -y flathub org.freedesktop.Sdk//${{ env.FREEDESKTOP_VERSION }} + flatpak --user install -y flathub org.freedesktop.Sdk.Extension.llvm${{ env.LLVM_VERSION }}//${{ env.FREEDESKTOP_VERSION }} + + - name: Build DNZHRecomp + run: |- + export CCACHE_DIR=/tmp/ccache + git config --global protocol.file.allow always + make -C patches CC=clang LD=ld.lld + flatpak-builder --user --force-clean --install-deps-from=flathub --repo=repo --ccache builddir ./flatpak/${{ env.FLATPAK_ID }}.json + flatpak build-bundle repo ./${{ env.FLATPAK_ID }}.flatpak ${{ env.FLATPAK_ID }} --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: DNZHRecompiled-Flatpak-X64-${{ matrix.type }} + path: ./${{ env.FLATPAK_ID }}.flatpak + build-linux-arm64: + runs-on: ubuntu-22.04-arm + strategy: + matrix: + type: [ Debug, Release ] + os: [ ubuntu-22.04 ] + name: ubuntu-22.04 (arm64, ${{ matrix.type }}, Native, AppImage) + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha || github.ref }} + submodules: recursive + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ${{ matrix.os }}-z64re-ccache-${{ matrix.type }}-arm64-${{ inputs.N64RECOMP_COMMIT }} + - name: Install Linux Dependencies + run: | + sudo apt-get update + sudo apt-get install -y ninja-build libsdl2-dev libgtk-3-dev lld llvm clang-15 libfuse2 + + # Install SDL2 + echo ::group::install SDL2 + + # Enable ccache + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" + + wget https://github.com/libsdl-org/SDL/releases/download/release-${{ inputs.SDL2_VERSION }}/SDL2-${{ inputs.SDL2_VERSION }}.tar.gz + tar -xzf SDL2-${{ inputs.SDL2_VERSION }}.tar.gz + cd SDL2-${{ inputs.SDL2_VERSION }} + ./configure + make -j 10 + sudo make install + sudo cp -av /usr/local/lib/libSDL* /lib/aarch64-linux-gnu/ + echo ::endgroup:: + + - name: Get extra dependencies + uses: actions/checkout@v4 + with: + repository: ${{ secrets.DNZH_REPO_WITH_PAT }} + token: ${{ secrets.DNZH_TOKEN }} + path: dnzhrecomp-secret + - name: Prepare Build + run: cp -r dnzhrecomp-secret/dnzh.us.z64 ./ + + - name: Build N64Recomp & RSPRecomp + run: | + git clone https://github.com/Mr-Wiseguy/N64Recomp.git --recurse-submodules N64RecompSource + cd N64RecompSource + git checkout ${{ inputs.N64RECOMP_COMMIT }} + git submodule update --init --recursive + + # enable ccache + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" + + # Build N64Recomp & RSPRecomp + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=g++-11 -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build + cmake --build cmake-build --config Release --target N64RecompCLI -j $(nproc) + cmake --build cmake-build --config Release --target RSPRecomp -j $(nproc) + + # Copy N64Recomp & RSPRecomp to root directory + cp cmake-build/N64Recomp .. + cp cmake-build/RSPRecomp .. + - name: Run N64Recomp & RSPRecomp + run: | + ./N64Recomp us.toml + ./RSPRecomp aspMain.us.toml + + - name: Build DNZHRecomp + run: |- + # enable ccache + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" + + cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=clang++-15 -DCMAKE_C_COMPILER=clang-15 -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build + cmake --build cmake-build --config ${{ matrix.type }} --target DNZHRecompiled -j $(nproc) + - name: Prepare Archive + run: | + mv cmake-build/DNZHRecompiled DNZHRecompiled + rm -rf assets/scss + tar -czf DNZHRecompiled.tar.gz DNZHRecompiled assets/ recompcontrollerdb.txt + - name: Archive DNZHRecomp + uses: actions/upload-artifact@v4 + with: + name: DNZHRecompiled-${{ runner.os }}-ARM64-${{ matrix.type }} + path: DNZHRecompiled.tar.gz + - name: Build AppImage + run: |- + ./.github/linux/appimage.sh + - name: DNZHRecomp AppImage + uses: actions/upload-artifact@v4 + with: + name: DNZHRecompiled-AppImage-ARM64-${{ matrix.type }} + path: DNZHRecompiled-*.AppImage + build-windows: + runs-on: windows-latest + strategy: + matrix: + type: [ Debug, RelWithDebInfo ] + name: windows (${{ matrix.type }}) + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha || github.ref }} + submodules: recursive + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ${{ runner.os }}-z64re-ccache-${{ matrix.type }} + - name: Install Windows Dependencies + run: | + choco install ninja + Remove-Item -Path "C:\ProgramData\Chocolatey\bin\ccache.exe" -Force -ErrorAction SilentlyContinue + - name: Download portable LLVM + run: | + $ProgressPreference = 'SilentlyContinue' + Invoke-WebRequest -Uri "https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.3/LLVM-19.1.3-Windows-X64.tar.xz" -OutFile "LLVM.tar.xz" + New-Item -ItemType Directory -Path portable-llvm > $null + 7z x LLVM.tar.xz + 7z x LLVM.tar -oportable-llvm + - name: Configure Developer Command Prompt + uses: ilammy/msvc-dev-cmd@v1 + - name: Get extra dependencies + uses: actions/checkout@v4 + with: + repository: ${{ secrets.DNZH_REPO_WITH_PAT }} + token: ${{ secrets.DNZH_TOKEN }} + path: dnzhrecomp-secret + - name: Prepare Build + run: copy .\dnzhrecomp-secret\dnzh.us.z64 .\ + + - name: Build N64Recomp & RSPRecomp + run: | + git clone https://github.com/Mr-Wiseguy/N64Recomp.git --recurse-submodules N64RecompSource + cd N64RecompSource + git checkout ${{ inputs.N64RECOMP_COMMIT }} + git submodule update --init --recursive + + # enable ccache + set $env:PATH="$env:USERPROFILE/.cargo/bin;$env:PATH" + $cpuCores = (Get-CimInstance -ClassName Win32_Processor).NumberOfLogicalProcessors + + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build + cmake --build cmake-build --config Release --target N64RecompCLI -j $cpuCores + cmake --build cmake-build --config Release --target RSPRecomp -j $cpuCores + + # Copy N64Recomp & RSPRecomp to root directory + cp cmake-build/N64Recomp.exe .. + cp cmake-build/RSPRecomp.exe .. + - name: Run N64Recomp & RSPRecomp + run: | + ./N64Recomp.exe us.toml + ./RSPRecomp.exe aspMain.us.toml + - name: Build DNZHRecomp + run: |- + # enable ccache + set $env:PATH="$env:USERPROFILE/.cargo/bin;$env:PATH" + $cpuCores = (Get-CimInstance -ClassName Win32_Processor).NumberOfLogicalProcessors + + # remove LLVM from PATH so it doesn't overshadow the one provided by VS + $env:PATH = ($env:PATH -split ';' | Where-Object { $_ -ne 'C:\Program Files\LLVM\bin' }) -join ';' + + cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER=clang-cl -DCMAKE_MAKE_PROGRAM=ninja -DPATCHES_C_COMPILER="..\portable-llvm\LLVM-19.1.3-Windows-X64\bin\clang" -DPATCHES_LD="..\portable-llvm\LLVM-19.1.3-Windows-X64\bin\ld.lld" -G Ninja -S . -B cmake-build -DCMAKE_CXX_FLAGS="-Xclang -fexceptions -Xclang -fcxx-exceptions" + cmake --build cmake-build --config ${{ matrix.type }} --target DNZHRecompiled -j $cpuCores + env: + SDL2_VERSION: ${{ inputs.SDL2_VERSION }} + - name: Prepare Archive + run: | + Move-Item -Path "cmake-build/DNZHRecompiled.exe" -Destination "DNZHRecompiled.exe" + Move-Item -Path "cmake-build/dxcompiler.dll" -Destination "dxcompiler.dll" + Move-Item -Path "cmake-build/dxil.dll" -Destination "dxil.dll" + Move-Item -Path "cmake-build/SDL2.dll" -Destination "SDL2.dll" + Move-Item -Path "cmake-build/DNZHRecompiled.pdb" -Destination "DNZHRecompiled.pdb" + Remove-Item -Path "assets/scss" -Recurse -Force + - name: Archive DNZHRecomp + uses: actions/upload-artifact@v4 + with: + name: DNZHRecompiled-${{ runner.os }}-${{ matrix.type }} + path: | + DNZHRecompiled.exe + dxcompiler.dll + dxil.dll + SDL2.dll + assets/ + recompcontrollerdb.txt + - name: Archive Debug Files + uses: actions/upload-artifact@v4 + with: + name: DNZHRecompiled-PDB-${{ matrix.type }} + path: | + DNZHRecompiled.pdb + build-macos: + runs-on: macos-14 + strategy: + matrix: + type: [ Debug, Release ] + name: macos (x64, arm64, ${{ matrix.type }}) + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha || github.ref }} + submodules: recursive + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ${{ runner.os }}-z64re-ccache-${{ matrix.type }} + - name: Homebrew Setup + run: | + brew install ninja + brew uninstall --ignore-dependencies libpng freetype + - name: MacPorts Setup + uses: melusina-org/setup-macports@v1 + id: 'macports' + with: + parameters: '.github/macos/macports.yaml' + + - name: Get extra dependencies + uses: actions/checkout@v4 + with: + repository: ${{ secrets.DNZH_REPO_WITH_PAT }} + token: ${{ secrets.DNZH_TOKEN }} + path: dnzhrecomp-secret + - name: Prepare Build + run: cp -r dnzhrecomp-secret/dnzh.us.z64 ./ + + - name: Build N64Recomp & RSPRecomp + run: | + git clone https://github.com/Mr-Wiseguy/N64Recomp.git --recurse-submodules N64RecompSource + cd N64RecompSource + git checkout ${{ inputs.N64RECOMP_COMMIT }} + git submodule update --init --recursive + + # enable ccache + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" + + # Build N64Recomp & RSPRecomp + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build + cmake --build cmake-build --config Release --target N64Recomp -j $(sysctl -n hw.ncpu) + cmake --build cmake-build --config Release --target RSPRecomp -j $(sysctl -n hw.ncpu) + + # Copy N64Recomp & RSPRecomp to root directory + cp cmake-build/N64Recomp .. + cp cmake-build/RSPRecomp .. + - name: Run N64Recomp & RSPRecomp + run: | + ./N64Recomp us.toml + ./RSPRecomp aspMain.us.toml + - name: Build DNZHRecomp + run: |- + # enable ccache + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" + + cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build \ + -DPATCHES_LD=/opt/local/bin/ld.lld-mp-18 -DCMAKE_AR=/opt/local/bin/llvm-ar-mp-18 -DPATCHES_C_COMPILER=/opt/local/bin/clang-mp-18 \ + -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" + cmake --build cmake-build --config ${{ matrix.type }} --target DNZHRecompiled -j $(sysctl -n hw.ncpu) + - name: Prepare Archive + run: | + mv cmake-build/DNZHRecompiled.app DNZHRecompiled.app + zip -r -y DNZHRecompiled.zip DNZHRecompiled.app + - name: Archive DNZHRecomp + uses: actions/upload-artifact@v4 + with: + name: DNZHRecompiled-${{ runner.os }}-${{ matrix.type }} + path: DNZHRecompiled.zip diff --git a/DNZHRecompSyms b/DNZHRecompSyms index 14188d6..294cde0 160000 --- a/DNZHRecompSyms +++ b/DNZHRecompSyms @@ -1 +1 @@ -Subproject commit 14188d60090748806ffec1a0ba14a38e6e157783 +Subproject commit 294cde0307efaa735ed6986a47cd4e83c44f5bbe diff --git a/aspMain.us.toml b/aspMain.us.toml index 3267a62..dd2e296 100644 --- a/aspMain.us.toml +++ b/aspMain.us.toml @@ -1,7 +1,7 @@ text_offset = 0xBD1B0 text_size = 0xE20 text_address = 0x04001080 -rom_file_path = "baserom.us.z64" +rom_file_path = "dnzh.us.z64" output_file_path = "rsp/aspMain.cpp" output_function_name = "aspMain" extra_indirect_branch_targets = [ diff --git a/flatpak/README.md b/flatpak/README.md index be9cd0a..3adddac 100644 --- a/flatpak/README.md +++ b/flatpak/README.md @@ -5,11 +5,11 @@ make -C patches CC=clang LD=ld.lld Build ```sh -flatpak-builder --force-clean --user --install-deps-from=flathub --repo=repo --install builddir io.github.mariokart64recomp.mariokart64recomp.json +flatpak-builder --force-clean --user --install-deps-from=flathub --repo=repo --install builddir io.github.dnzhrecomp.dnzhrecomp.json ``` Bundle ```sh -flatpak build-bundle repo io.github.mariokart64recomp.mariokart64recomp.flatpak io.github.mariokart64recomp.mariokart64recomp --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo +flatpak build-bundle repo io.github.dnzhrecomp.dnzhrecomp.flatpak io.github.dnzhrecomp.dnzhrecomp --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo ``` diff --git a/flatpak/io.github.dnzhrecomp.dnzhrecomp.desktop b/flatpak/io.github.dnzhrecomp.dnzhrecomp.desktop new file mode 100644 index 0000000..27f3413 --- /dev/null +++ b/flatpak/io.github.dnzhrecomp.dnzhrecomp.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=Duke Nukem Zero Hour: Recompiled +Exec=/app/bin/DNZHRecompiled +Type=Application +Icon=io.github.dnzhrecomp.dnzhrecomp +Categories=Game; +Comment=Static recompilation of Duke Nukem Zero Hour for PC. +MimeType=x-scheme-handler/dnzhrecomp diff --git a/flatpak/io.github.mariokart64recomp.mariokart64recomp.json b/flatpak/io.github.dnzhrecomp.dnzhrecomp.json similarity index 87% rename from flatpak/io.github.mariokart64recomp.mariokart64recomp.json rename to flatpak/io.github.dnzhrecomp.dnzhrecomp.json index 5577356..7756db0 100644 --- a/flatpak/io.github.mariokart64recomp.mariokart64recomp.json +++ b/flatpak/io.github.dnzhrecomp.dnzhrecomp.json @@ -1,5 +1,5 @@ { - "id": "io.github.mariokart64recomp.mariokart64recomp", + "id": "io.github.dnzhrecomp.dnzhrecomp", "runtime": "org.freedesktop.Platform", "runtime-version": "23.08", "sdk": "org.freedesktop.Sdk", @@ -35,8 +35,8 @@ "cp recompcontrollerdb.txt /app/bin/recompcontrollerdb.txt", "cp -R assets /app/bin/assets", "install -Dm644 icons/512.png /app/share/icons/hicolor/512x512/apps/${FLATPAK_ID}.png", - "install -Dm644 flatpak/io.github.mariokart64recomp.mariokart64recomp.metainfo.xml /app/share/metainfo/${FLATPAK_ID}.metainfo.xml", - "install -Dm644 flatpak/io.github.mariokart64recomp.mariokart64recomp.desktop /app/share/applications/${FLATPAK_ID}.desktop" + "install -Dm644 flatpak/io.github.dnzhrecomp.dnzhrecomp.metainfo.xml /app/share/metainfo/${FLATPAK_ID}.metainfo.xml", + "install -Dm644 flatpak/io.github.dnzhrecomp.dnzhrecomp.desktop /app/share/applications/${FLATPAK_ID}.desktop" ], "sources": [ { diff --git a/flatpak/io.github.mariokart64recomp.mariokart64recomp.metainfo.xml b/flatpak/io.github.dnzhrecomp.dnzhrecomp.metainfo.xml similarity index 59% rename from flatpak/io.github.mariokart64recomp.mariokart64recomp.metainfo.xml rename to flatpak/io.github.dnzhrecomp.dnzhrecomp.metainfo.xml index 2bf87ab..4aca555 100644 --- a/flatpak/io.github.mariokart64recomp.mariokart64recomp.metainfo.xml +++ b/flatpak/io.github.dnzhrecomp.dnzhrecomp.metainfo.xml @@ -1,9 +1,9 @@ - io.github.mariokart64recomp.mariokart64recomp + io.github.dnzhrecomp.dnzhrecomp Duke Nukem Zero Hour: Recompiled - Static recompilation of MarioKart 64 for PC. + Static recompilation of Duke Nukem Zero Hour for PC. CC0-1.0 GPL-3.0+ @@ -17,7 +17,7 @@

- Duke Nukem Zero Hour: Recompiled is a project that uses N64: Recompiled to statically recompile MarioKart 64 into a native port with many new features and enhancements. This project uses RT64 as the rendering engine to provide some of these enhancements. + Duke Nukem Zero Hour: Recompiled is a project that uses N64: Recompiled to statically recompile Duke Nukem Zero Hour into a native port with many new features and enhancements. This project uses RT64 as the rendering engine to provide some of these enhancements. The original game is required to run this project. @@ -25,5 +25,5 @@

- io.github.mariokart64recomp.mariokart64recomp.desktop + io.github.dnzhrecomp.dnzhrecomp.desktop
diff --git a/flatpak/io.github.mariokart64recomp.mariokart64recomp.desktop b/flatpak/io.github.mariokart64recomp.mariokart64recomp.desktop deleted file mode 100644 index 39d35bc..0000000 --- a/flatpak/io.github.mariokart64recomp.mariokart64recomp.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Name=Duke Nukem Zero Hour: Recompiled -Exec=/app/bin/DNZHRecompiled -Type=Application -Icon=io.github.mariokart64recomp.mariokart64recomp -Categories=Game; -Comment=Static recompilation of Mario Kart 64 for PC. -MimeType=x-scheme-handler/mariokart64recomp diff --git a/patches.toml b/patches.toml index e4dafc0..11aef63 100644 --- a/patches.toml +++ b/patches.toml @@ -1,4 +1,4 @@ -# Config file for recompiling patches for the MarioKart 64 NTSC Recompilation. +# Config file for recompiling patches for the Duke Nukem Zero Hour US NTSC Recompilation. [input] # Paths are relative to the location of this config file. diff --git a/patches/debug.h b/patches/debug.h index 6bfa90e..c7418dc 100644 --- a/patches/debug.h +++ b/patches/debug.h @@ -1,7 +1,4 @@ -#ifndef MK64RECOMP_DEBUG -#define MK64RECOMP_DEBUG - -#define DEBUG_ENDING 0 -#define DEBUG_CEREMONY 0 +#ifndef DNZHRECOMP_DEBUG +#define DNZHRECOMP_DEBUG #endif \ No newline at end of file diff --git a/patches/patches.h b/patches/patches.h index d1738bf..b88aa2e 100644 --- a/patches/patches.h +++ b/patches/patches.h @@ -43,10 +43,8 @@ // #include "defines.h" // #include "macros.h" // #include "course.h" -// #include "mk64.h" // #include "objects.h" // #include "render_objects.h" -// #include "mk64_tagging.h" // #include "actor_types.h" // #include "misc_funcs.h" // #include "menu_items.h" diff --git a/src/main/main.cpp b/src/main/main.cpp index 84290a3..a4e2f14 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -352,7 +352,7 @@ gpr get_entrypoint_address(); std::vector supported_games = { { .rom_hash = 0xafc33da7101fec88, // retail - .internal_name = "MARIOKART64", + .internal_name = "DUKE NUKEM ZERO HOUR", .game_id = u8"dnzh.us", .mod_game_id = "dnzh", .save_type = recomp::SaveType::None, diff --git a/us.toml b/us.toml index 7ccb193..1030536 100644 --- a/us.toml +++ b/us.toml @@ -6,7 +6,7 @@ entrypoint = 0x80000400 output_func_path = "RecompiledFuncs" # elf_path = "dukenukemzerohour.elf" symbols_file_path = "DNZHRecompSyms/dump.toml" -rom_file_path = "baserom.us.z64" +rom_file_path = "dnzh.us.z64" [patches] stubs = [