mirror of
https://github.com/hedge-dev/UnleashedRecomp
synced 2026-06-10 04:54:37 -04:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9e2d1a920c | |||
| cd7bd167a2 | |||
| 5e8695a157 |
@@ -160,6 +160,9 @@ jobs:
|
|||||||
build-flatpak:
|
build-flatpak:
|
||||||
name: Build Flatpak
|
name: Build Flatpak
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
preset: ["Flatpak-Debug", "Flatpak-Release"]
|
||||||
env:
|
env:
|
||||||
FLATPAK_ID: io.github.hedge_dev.unleashedrecomp
|
FLATPAK_ID: io.github.hedge_dev.unleashedrecomp
|
||||||
|
|
||||||
@@ -185,7 +188,7 @@ jobs:
|
|||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: /tmp/ccache
|
path: /tmp/ccache
|
||||||
key: ccache-${{ runner.os }}
|
key: ccache-${{ runner.os }}-${{ matrix.preset }}
|
||||||
|
|
||||||
- name: Prepare Project
|
- name: Prepare Project
|
||||||
run: cp ./private/* ./UnleashedRecompLib/private
|
run: cp ./private/* ./UnleashedRecompLib/private
|
||||||
@@ -198,13 +201,13 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "commit_message=$(git log -1 --pretty=%s)" >> $GITHUB_ENV
|
echo "commit_message=$(git log -1 --pretty=%s)" >> $GITHUB_ENV
|
||||||
export CCACHE_DIR=/tmp/ccache
|
export CCACHE_DIR=/tmp/ccache
|
||||||
flatpak-builder --user --force-clean --install-deps-from=flathub --repo=repo --ccache builddir ./flatpak/${{ env.FLATPAK_ID }}.json
|
flatpak-builder --user --force-clean --install-deps-from=flathub --repo=repo --ccache builddir ./flatpak/${{ env.FLATPAK_ID }}-${{ matrix.preset }}.json
|
||||||
flatpak build-bundle repo ./${{ env.FLATPAK_ID }}.flatpak ${{ env.FLATPAK_ID }} --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo
|
flatpak build-bundle repo ./${{ env.FLATPAK_ID }}.flatpak ${{ env.FLATPAK_ID }} --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo
|
||||||
|
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: UnleashedRecomp-Flatpak
|
name: UnleashedRecomp-${{ matrix.preset }}
|
||||||
path: ./${{ env.FLATPAK_ID }}.flatpak
|
path: ./${{ env.FLATPAK_ID }}.flatpak
|
||||||
build-macos:
|
build-macos:
|
||||||
name: Build macOS
|
name: Build macOS
|
||||||
|
|||||||
@@ -89,6 +89,9 @@ PPC_FUNC(sub_822C1130)
|
|||||||
if (Config::EnableObjectCollisionDebugView)
|
if (Config::EnableObjectCollisionDebugView)
|
||||||
*SWA::SGlobals::ms_IsObjectCollisionRender = true;
|
*SWA::SGlobals::ms_IsObjectCollisionRender = true;
|
||||||
|
|
||||||
|
if (Config::EnableStageCollisionDebugView)
|
||||||
|
*SWA::SGlobals::ms_IsCollisionRender = true;
|
||||||
|
|
||||||
__imp__sub_822C1130(ctx, base);
|
__imp__sub_822C1130(ctx, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -195,3 +195,11 @@ bool SparkleLocusMidAsmHook()
|
|||||||
// This has the side effect of the locus particle eventually snapping to the rest position during pause, but it's better than vertices exploding.
|
// This has the side effect of the locus particle eventually snapping to the rest position during pause, but it's better than vertices exploding.
|
||||||
return App::s_deltaTime < (1.0 / 60.0);
|
return App::s_deltaTime < (1.0 / 60.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CEvilSonicContext_CStateWall_LeaveRotationMidAsmHook(PPCRegister& f1)
|
||||||
|
{
|
||||||
|
// The code in the Werehog's "wall" state for leaving walls adds a constant
|
||||||
|
// value of 0.05 to his transform every frame. This makes the value respect
|
||||||
|
// delta time whilst maintaining the original behaviour at 30 FPS.
|
||||||
|
f1.f64 = f1.f64 * (std::min(App::s_deltaTime, 1.0 / 15.0) / (1.0 / 30.0));
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
#include "misc_patches.h"
|
|
||||||
#include <api/SWA.h>
|
#include <api/SWA.h>
|
||||||
#include <ui/game_window.h>
|
#include <ui/game_window.h>
|
||||||
#include <user/achievement_manager.h>
|
#include <user/achievement_manager.h>
|
||||||
@@ -194,54 +193,3 @@ PPC_FUNC(sub_824EE620)
|
|||||||
|
|
||||||
ctx.r3.u32 = PersistentStorageManager::ShouldDisplayDLCMessage(true);
|
ctx.r3.u32 = PersistentStorageManager::ShouldDisplayDLCMessage(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StageCollisionDebugViewMidAsmHook(PPCRegister& r27)
|
|
||||||
{
|
|
||||||
if (Config::EnableStageCollisionDebugView)
|
|
||||||
{
|
|
||||||
r27.u32 = true;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The game is set up so that after parsing the Stage.set.xml it checks if TerrainInfoFile is found or not.
|
|
||||||
// Based on the result of that it will either draw terrain or debug collision (if enabled).
|
|
||||||
//
|
|
||||||
// The XMLs in the game are populated like this generally speaking:
|
|
||||||
// <Terrain>
|
|
||||||
// <TerrainInfoFile>terrain</TerrainInfoFile>
|
|
||||||
// <GIAtlas>1</GIAtlas>
|
|
||||||
// </Terrain>
|
|
||||||
// <Terrain>
|
|
||||||
// <RigidBodyContainer>collision</RigidBodyContainer>
|
|
||||||
// <IsCollisionRender>false</IsCollisionRender>
|
|
||||||
// </Terrain>
|
|
||||||
//
|
|
||||||
// In some cases however, the information in these two Terrain blocks is combined into one block,
|
|
||||||
// which makes the logic checking TerrainInfoFile's contents only fire once, and with success only, as such
|
|
||||||
// the logic for drawing collision will never execute.
|
|
||||||
//
|
|
||||||
// To combat this we check if both types returned with some value from the XML file, which indicates that its
|
|
||||||
// a single Terrain block, and if so we store that information so we can later on re-use to manually fire the
|
|
||||||
// logic controlling the drawing of the debug collision view.
|
|
||||||
void StageCollisionDebugViewStoreXmlTypeMidAsmHook(PPCRegister& r1)
|
|
||||||
{
|
|
||||||
uint8_t* base = g_memory.base;
|
|
||||||
|
|
||||||
const char* rigidBodyContainer = (const char*)(base + PPC_LOAD_U32(r1.u32 + 108));
|
|
||||||
const char* terrainInfoFile = (const char*)(base + PPC_LOAD_U32(r1.u32 + 132));
|
|
||||||
if (*rigidBodyContainer != '\0' && *terrainInfoFile != '\0')
|
|
||||||
{
|
|
||||||
g_singleTerrainBlockXml = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool StageCollisionDebugViewSingleTerrainBlockXmlMidAsmHook()
|
|
||||||
{
|
|
||||||
bool runCollisionViewDrawLogic = g_singleTerrainBlockXml;
|
|
||||||
g_singleTerrainBlockXml = false;
|
|
||||||
|
|
||||||
return runCollisionViewDrawLogic;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
static bool g_singleTerrainBlockXml = false;
|
|
||||||
@@ -1142,18 +1142,14 @@ name = "EndingTextPositionMidAsmHook"
|
|||||||
address = 0x82580168
|
address = 0x82580168
|
||||||
registers = ["r31", "f13"]
|
registers = ["r31", "f13"]
|
||||||
|
|
||||||
|
# Wall Leave - Left
|
||||||
[[midasm_hook]]
|
[[midasm_hook]]
|
||||||
name = "StageCollisionDebugViewMidAsmHook"
|
name = "CEvilSonicContext_CStateWall_LeaveRotationMidAsmHook"
|
||||||
address = 0x825648F8
|
address = 0x824067BC
|
||||||
registers = ["r27"]
|
registers = ["f1"]
|
||||||
jump_address_on_true = 0x825648FC
|
|
||||||
|
|
||||||
|
# Wall Leave - Right
|
||||||
[[midasm_hook]]
|
[[midasm_hook]]
|
||||||
name = "StageCollisionDebugViewStoreXmlTypeMidAsmHook"
|
name = "CEvilSonicContext_CStateWall_LeaveRotationMidAsmHook"
|
||||||
address = 0x8256422C
|
address = 0x82406774
|
||||||
registers = ["r1"]
|
registers = ["f1"]
|
||||||
|
|
||||||
[[midasm_hook]]
|
|
||||||
name = "StageCollisionDebugViewSingleTerrainBlockXmlMidAsmHook"
|
|
||||||
address = 0x82564B00
|
|
||||||
jump_address_on_true = 0x82564764
|
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
{
|
||||||
|
"id": "io.github.hedge_dev.unleashedrecomp",
|
||||||
|
"runtime": "org.freedesktop.Platform",
|
||||||
|
"runtime-version": "24.08",
|
||||||
|
"sdk": "org.freedesktop.Sdk",
|
||||||
|
"sdk-extensions" : [ "org.freedesktop.Sdk.Extension.llvm18" ],
|
||||||
|
"finish-args": [
|
||||||
|
"--share=network",
|
||||||
|
"--socket=wayland",
|
||||||
|
"--socket=fallback-x11",
|
||||||
|
"--socket=pulseaudio",
|
||||||
|
"--device=all",
|
||||||
|
"--filesystem=host",
|
||||||
|
"--filesystem=/media",
|
||||||
|
"--filesystem=/run/media",
|
||||||
|
"--filesystem=/mnt"
|
||||||
|
],
|
||||||
|
"modules": [
|
||||||
|
{
|
||||||
|
"name": "UnleashedRecomp",
|
||||||
|
"buildsystem": "simple",
|
||||||
|
"build-commands": [
|
||||||
|
"cmake --preset linux-debug -DUNLEASHED_RECOMP_FLATPAK=ON -DSDL2MIXER_VORBIS=VORBISFILE -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache",
|
||||||
|
"cmake --build out/build/linux-debug --target UnleashedRecomp",
|
||||||
|
"mkdir -p /app/bin",
|
||||||
|
"cp out/build/linux-debug/UnleashedRecomp/UnleashedRecomp /app/bin/UnleashedRecomp",
|
||||||
|
"install -Dm644 UnleashedRecompResources/images/game_icon.png /app/share/icons/hicolor/128x128/apps/${FLATPAK_ID}.png",
|
||||||
|
"install -Dm644 flatpak/io.github.hedge_dev.unleashedrecomp.metainfo.xml /app/share/metainfo/${FLATPAK_ID}.metainfo.xml",
|
||||||
|
"install -Dm644 flatpak/io.github.hedge_dev.unleashedrecomp.desktop /app/share/applications/${FLATPAK_ID}.desktop"
|
||||||
|
],
|
||||||
|
"sources": [
|
||||||
|
{
|
||||||
|
"type": "dir",
|
||||||
|
"path": "../"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"build-options": {
|
||||||
|
"no-debuginfo": true,
|
||||||
|
"strip": false,
|
||||||
|
"append-path": "/usr/lib/sdk/llvm18/bin",
|
||||||
|
"prepend-ld-library-path": "/usr/lib/sdk/llvm18/lib",
|
||||||
|
"build-args": [
|
||||||
|
"--share=network"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user