Compare commits

..

13 Commits

Author SHA1 Message Date
Hyper be75bc7ebd Added codes for disabling certain player actions 2025-03-22 01:49:38 +00:00
MegAmi 824405b236 Replace Markdown issue template with YAML schema (#1426)
* Replace Markdown issue template with YML schema

* YAML doesn't like that apparently

* Address requested changes
2025-03-19 01:55:02 +00:00
Hyper d0368665dd Update README FAQ (#1319) 2025-03-11 15:26:14 +00:00
João Moura cc1018a8fc Pass release path to upload-artifact step on Windows builds (#1151) 2025-03-10 15:18:37 +03:00
Skyth (Asilkan) 131427e017 Update version to v1.0.2. (#1149) 2025-03-07 18:52:49 +03:00
Hyper 45c0880145 Rename DisableDPadAsAnalogInput to DisableDPadMovement (#1146) 2025-03-07 13:52:42 +03:00
Skyth (Asilkan) 024c35c1fe Force WASAPI on Windows. (#1134) 2025-03-07 13:52:01 +03:00
Hyper a9e280e116 Fix Homing Attack on Jump not affecting Cool Edge Act 3 (Day) (#904) 2025-03-07 04:54:17 +03:00
Hyper c64ef1fe15 Added error message if included DirectX DLLs are missing (#998)
* Added error message if included DirectX DLLs are missing

* locale: added System_Win32_MissingDLLs localisation

Co-Authored-By: LJSTAR <31629427+LJSTARbird@users.noreply.github.com>
Co-Authored-By: Kitzuku <25226941+Kitzuku@users.noreply.github.com>
Co-Authored-By: NextinHKRY <38560522+NextinMono@users.noreply.github.com>
Co-Authored-By: brianuuu <38166666+brianuuu@users.noreply.github.com>
Co-Authored-By: Darío <538504+DarioSamo@users.noreply.github.com>

* Fix ifdefs

---------

Co-authored-by: LJSTAR <31629427+LJSTARbird@users.noreply.github.com>
Co-authored-by: Kitzuku <25226941+Kitzuku@users.noreply.github.com>
Co-authored-by: NextinHKRY <38560522+NextinMono@users.noreply.github.com>
Co-authored-by: brianuuu <38166666+brianuuu@users.noreply.github.com>
Co-authored-by: Darío <538504+DarioSamo@users.noreply.github.com>
2025-03-07 04:47:15 +03:00
Hyper c19a7b1e11 Added check for AVX on boot (#1067)
Co-authored-by: Wiseguy <68165316+mr-wiseguy@users.noreply.github.com>
2025-03-07 04:45:58 +03:00
Hyper 3c050887d8 Fix shoe upgrade hints patch breaking sequence flags (#1130) 2025-03-07 04:43:49 +03:00
Hyper 676c3f0ff4 Prevent game from closing whilst autosaving (#967) 2025-03-07 04:43:37 +03:00
Skyth (Asilkan) 3676c28114 Fix the unsafe base address assumption. (#1098) 2025-03-07 03:31:13 +03:00
19 changed files with 255 additions and 75 deletions
-48
View File
@@ -1,48 +0,0 @@
---
name: Bug Report
about: Report a bug in Unleashed Recompiled
type: Bug
---
### Validation
- [ ] I have checked the [Issues](https://github.com/hedge-dev/UnleashedRecomp/issues) page to see if my problem has already been reported
- [ ] I have confirmed that this bug does not occur in the original game running on original Xbox 360 hardware
#### If you have DLC installed, please specify which ones you have.
- [ ] Apotos & Shamar Adventure Pack
- [ ] Chun-nan Adventure Pack
- [ ] Empire City & Adabat Adventure Pack
- [ ] Holoska Adventure Pack
- [ ] Mazuri Adventure Pack
- [ ] Spagonia Adventure Pack
#### If you have mods enabled, please specify which ones you have.
Provide a list of your enabled mods in Hedge Mod Manager here. You will not receive support for issues *caused* by mods.
#### If you have codes enabled, please specify which ones you have.
Provide a list of your enabled codes in Hedge Mod Manager here.
### Describe the Bug
A clear and concise description of what the bug is.
### Steps to Reproduce
Steps to reproduce the bug:
1. Go to '...'
2. etc.
### Expected Behavior
A clear and concise description of what you expected to happen.
### Footage
Attach a screenshot or video of the bug. If possible, please also provide footage of the expected behaviour on original Xbox 360 hardware.
### Specifications
Fill out the following details:
- CPU: (e.g. Intel Core [...], AMD Ryzen [...], etc.)
- GPU: (e.g. NVIDIA GeForce [...], Radeon HD [...], Intel HD [...], etc.)
- GPU Driver: (e.g NVIDIA driver 545.XX, AMD driver 24.X.X, etc.)
- OS: (e.g. Windows 10, Windows 11, Linux distro)
- Version: (e.g. 1.0.0)
### Additional Context
Provide any other context about the problem here.
+95
View File
@@ -0,0 +1,95 @@
name: Bug Report
description: Report a bug, crash, or other type of error in Unleashed Recompiled
type: Bug
body:
- id: validation
type: checkboxes
attributes:
label: Validation
options:
- label: I have checked the [Issues](https://github.com/hedge-dev/UnleashedRecomp/issues) page to see if my problem has already been reported
required: true
- label: I have confirmed that this bug does not occur in the original game running on original Xbox 360 hardware
required: false
- id: dlc-installed
type: checkboxes
attributes:
label: If you have DLC installed, please specify which ones you have.
options:
- label: Apotos & Shamar Adventure Pack
required: false
- label: Chun-nan Adventure Pack
required: false
- label: Empire City & Adabat Adventure Pack
required: false
- label: Holoska Adventure Pack
required: false
- label: Mazuri Adventure Pack
required: false
- label: Spagonia Adventure Pack
required: false
- id: mods-used
type: textarea
validations:
required: false
attributes:
label: If you have mods enabled, please specify which ones you have.
description: Provide a list of your enabled mods in Hedge Mod Manager here. You will not receive support for issues *caused* by mods.
- id: codes-used
type: textarea
validations:
required: false
attributes:
label: If you have codes enabled, please specify which ones you have.
description: Provide a list of your enabled codes in Hedge Mod Manager here.
- id: describe-bug
type: textarea
validations:
required: true
attributes:
label: Describe the Bug
description: A clear and concise description of what the bug is.
- id: repro-steps
type: textarea
validations:
required: true
attributes:
label: Steps to Reproduce
description: Step-by-step instructions on how to reproduce the bug.
placeholder: |
1. Go to '...'
2. etc.
- id: expected-behavior
type: textarea
validations:
required: true
attributes:
label: Expected Behavior
description: A clear and concise description of what you expected to happen.
- id: footage
type: textarea
validations:
required: true
attributes:
label: Footage
description: Attach a screenshot or video of the bug. If possible, please also provide footage of the expected behaviour on original Xbox 360 hardware.
- id: system-specifications
type: textarea
validations:
required: true
attributes:
label: System Specifications
description: Fill out the following details.
placeholder: |
- CPU: (e.g. Intel Core [...], AMD Ryzen [...], etc.)
- GPU: (e.g. NVIDIA GeForce [...], Radeon HD [...], Intel HD [...], etc.)
- GPU Driver: (e.g NVIDIA driver 545.XX, AMD driver 24.X.X, etc.)
- OS: (e.g. Windows 10, Windows 11, Linux distro)
- Version: (e.g. 1.0.0)
- id: additional-context
type: textarea
validations:
required: false
attributes:
label: Additional Context
description: Provide any other context about the problem here.
+1
View File
@@ -0,0 +1 @@
blank_issues_enabled: true
+1 -3
View File
@@ -145,13 +145,11 @@ jobs:
Move-Item -Path ".\out\build\${{ env.CMAKE_PRESET }}\UnleashedRecomp\dxil.dll" -Destination ".\release\dxil.dll"
Move-Item -Path ".\out\build\${{ env.CMAKE_PRESET }}\UnleashedRecomp\UnleashedRecomp.exe" -Destination ".\release\UnleashedRecomp.exe"
Compress-Archive -Path .\release\* -DestinationPath .\UnleashedRecomp-Windows.zip
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: UnleashedRecomp-Windows-${{ env.CMAKE_PRESET }}
path: .\UnleashedRecomp-Windows.zip
path: .\release
- name: Upload PDB
uses: actions/upload-artifact@v4
+9 -2
View File
@@ -278,9 +278,16 @@ Simply booting at least once in Desktop Mode will enable the Deck to use the fil
## FAQ
### Do you have a Discord server?
### Do you have a website or Discord server?
Unleashed Recompiled is not associated with any Discord servers. Use the [Issues](https://github.com/hedge-dev/UnleashedRecomp/issues) page if you need support.
Unleashed Recompiled does not have an official website, nor is it affiliated with any Discord servers.
**Please link here when directing anyone to the project.**
> [!CAUTION]
> Do not download builds of Unleashed Recompiled from anywhere but our [Releases](https://github.com/hedge-dev/UnleashedRecomp/releases/latest) page.
>
> **We will never distribute builds on other websites, via Discord servers or via third-party update tools.**
### Why does the installer say my files are invalid?
+2 -2
View File
@@ -293,7 +293,7 @@ if (WIN32)
add_executable(UnleashedRecomp ${UNLEASHED_RECOMP_CXX_SOURCES} "${CMAKE_BINARY_DIR}/res.rc")
# Hide console for release configurations.
if (${CMAKE_BUILD_TYPE} MATCHES "Release" OR ${CMAKE_BUILD_TYPE} MATCHES "RelWithDebInfo")
if (${CMAKE_BUILD_TYPE} MATCHES "Release")
target_link_options(UnleashedRecomp PRIVATE "/SUBSYSTEM:WINDOWS" "/ENTRY:mainCRTStartup")
endif()
else()
@@ -352,7 +352,7 @@ if (WIN32)
Synchronization
winmm
)
endif()
endif()
target_link_libraries(UnleashedRecomp PRIVATE
fmt::fmt
+1
View File
@@ -8,6 +8,7 @@ public:
static inline bool s_isInit;
static inline bool s_isMissingDLC;
static inline bool s_isLoading;
static inline bool s_isSaving;
static inline bool s_isWerehog;
static inline bool s_isSaveDataCorrupt;
@@ -38,6 +38,11 @@ static void CreateAudioDevice()
void XAudioInitializeSystem()
{
#ifdef _WIN32
// Force wasapi on Windows.
SDL_setenv("SDL_AUDIODRIVER", "wasapi", true);
#endif
SDL_SetHint(SDL_HINT_AUDIO_CATEGORY, "playback");
SDL_SetHint(SDL_HINT_AUDIO_DEVICE_APP_NAME, "Unleashed Recompiled");
+11
View File
@@ -692,6 +692,17 @@ std::unordered_map<std::string_view, std::unordered_map<ELanguage, std::string>>
{ ELanguage::Italian, "Impossibile creare un backend D3D12 (Windows) o Vulkan.\n\nAssicurati che:\n\n- Il tuo sistema soddisfi i requisiti minimi.\n- I driver della scheda grafica siano aggiornati.\n- Il tuo sistema operativo sia aggiornato." }
}
},
{
"System_Win32_MissingDLLs",
{
{ ELanguage::English, "The module \"%s\" could not be found.\n\nPlease make sure that:\n\n- You extracted this copy of Unleashed Recompiled fully and not just the *.exe file.\n- You are not running Unleashed Recompiled from a *.zip file." },
{ ELanguage::Japanese, "モジュール\"%s\"が見つかりませんでした\n\n次の点を確認してください:\n\n※Unleashed Recompiledの*.exeファイルだけを抽出していなく、 コピーを完全に抽出してること\n※Unleashed Recompiledを*.zipファイルから実行していないこと" },
{ ELanguage::German, "Das Modul \"%s\" konnte nicht gefunden werden.\n\nBitte stelle sicher, dass:\n\n- Diese Kopie von Unleashed Recompiled vollständig entpackt wurde und nicht nur die *.exe-Datei.\n- Unleashed Recompiled nicht direkt aus einer *.zip-Datei ausgeführt wird." },
{ ELanguage::French, "Le module \"%s\" n'a pas pu être trouvé.\n\nVeuillez vous assurer que :\n\n- Vous avez extrait Unleashed Recompiled dans son entièreté et pas seulement le fichier *.exe.\n- Vous n'exécutez pas Unleashed Recompiled à partir d'un fichier *.zip." },
{ ELanguage::Spanish, "No se pudo encontrar el módulo \"%s\".\n\nAsegúrese de que:\n\n- Ha extraido esta copia de Unleashed Recompiled por completo y no solo el archivo *.exe.\n- No está ejecutando Unleashed Recompiled desde un archivo *.zip." },
{ ELanguage::Italian, "Impossibile trovare il modulo \"%s\".\n\nAssicurati che:\n\n- Hai estratto questa copia di Unleashed Recompiled correttamente e non solo il file *.exe.\n- Non stai eseguendo Unleashed Recompiled da un file *.zip." }
}
},
{
"Common_On",
{
+47 -1
View File
@@ -1,4 +1,5 @@
#include <stdafx.h>
#include <cpuid.h>
#include <cpu/guest_thread.h>
#include <gpu/video.h>
#include <kernel/function.h>
@@ -27,6 +28,15 @@
#include <timeapi.h>
#endif
#if defined(_WIN32) && defined(UNLEASHED_RECOMP_D3D12)
static std::array<std::string_view, 3> g_D3D12RequiredModules =
{
"D3D12/D3D12Core.dll",
"dxcompiler.dll",
"dxil.dll"
};
#endif
const size_t XMAIOBegin = 0x7FEA0000;
const size_t XMAIOEnd = XMAIOBegin + 0x0000FFFF;
@@ -147,6 +157,29 @@ uint32_t LdrLoadModule(const std::filesystem::path &path)
return entry;
}
__attribute__((constructor(101), target("no-avx,no-avx2"), noinline))
void init()
{
#ifdef __x86_64__
uint32_t eax, ebx, ecx, edx;
// Execute CPUID for processor info and feature bits.
__get_cpuid(1, &eax, &ebx, &ecx, &edx);
// Check for AVX support.
if ((ecx & (1 << 28)) == 0)
{
printf("[*] CPU does not support the AVX instruction set.\n");
#ifdef _WIN32
MessageBoxA(nullptr, "Your CPU does not meet the minimum system requirements.", "Unleashed Recompiled", MB_ICONERROR);
#endif
std::_Exit(1);
}
#endif
}
int main(int argc, char *argv[])
{
#ifdef _WIN32
@@ -156,7 +189,7 @@ int main(int argc, char *argv[])
os::process::CheckConsole();
if (!os::registry::Init())
LOGN_WARNING("OS doesn't support registry");
LOGN_WARNING("OS does not support registry.");
os::logger::Init();
@@ -180,6 +213,19 @@ int main(int argc, char *argv[])
Config::Load();
#if defined(_WIN32) && defined(UNLEASHED_RECOMP_D3D12)
for (auto& dll : g_D3D12RequiredModules)
{
if (!std::filesystem::exists(g_executableRoot / dll))
{
char text[512];
snprintf(text, sizeof(text), Localise("System_Win32_MissingDLLs").c_str(), dll.data());
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, GameWindow::GetTitle(), text, GameWindow::s_pWindow);
std::_Exit(1);
}
}
#endif
// Check the time since the last time an update was checked. Store the new time if the difference is more than six hours.
constexpr double TimeBetweenUpdateChecksInSeconds = 6 * 60 * 60;
time_t timeNow = std::time(nullptr);
+18 -6
View File
@@ -212,7 +212,7 @@ g_sdlEventListenerForInputPatches;
static bool IsDPadThreshold(const SWA::SPadState* pPadState)
{
if (Config::DisableDPadAsAnalogInput)
if (Config::DisableDPadMovement)
return false;
return pPadState->IsDown(SWA::eKeyState_DpadUp) ||
@@ -240,7 +240,7 @@ static bool IsCursorThreshold(double deadzone = 0, bool isBelowThreshold = false
static void SetDPadAnalogDirectionX(PPCRegister& pPadState, PPCRegister& x, bool invert, float max = 1.0f)
{
if (Config::DisableDPadAsAnalogInput)
if (Config::DisableDPadMovement)
return;
auto pGuestPadState = (SWA::SPadState*)g_memory.Translate(pPadState.u32);
@@ -254,7 +254,7 @@ static void SetDPadAnalogDirectionX(PPCRegister& pPadState, PPCRegister& x, bool
static void SetDPadAnalogDirectionY(PPCRegister& pPadState, PPCRegister& y, bool invert, float max = 1.0f)
{
if (Config::DisableDPadAsAnalogInput)
if (Config::DisableDPadMovement)
return;
auto pGuestPadState = (SWA::SPadState*)g_memory.Translate(pPadState.u32);
@@ -292,7 +292,7 @@ void PostureDPadSupportYMidAsmHook(PPCRegister& pPadState, PPCRegister& y)
void PostureSpaceHurrierDPadSupportXMidAsmHook(PPCRegister& pPadState, PPCVRegister& vector)
{
if (Config::DisableDPadAsAnalogInput)
if (Config::DisableDPadMovement)
return;
auto pGuestPadState = (SWA::SPadState*)g_memory.Translate(pPadState.u32);
@@ -306,7 +306,7 @@ void PostureSpaceHurrierDPadSupportXMidAsmHook(PPCRegister& pPadState, PPCVRegis
void PostureSpaceHurrierDPadSupportYMidAsmHook(PPCRegister& pPadState, PPCVRegister& vector)
{
if (Config::DisableDPadAsAnalogInput)
if (Config::DisableDPadMovement)
return;
auto pGuestPadState = (SWA::SPadState*)g_memory.Translate(pPadState.u32);
@@ -318,6 +318,18 @@ void PostureSpaceHurrierDPadSupportYMidAsmHook(PPCRegister& pPadState, PPCVRegis
vector.f32[3] = -1.0f;
}
void SetXButtonHomingMidAsmHook(PPCRegister& r1)
{
auto pXButtonHoming = (bool*)(g_memory.base + r1.u32 + 0x63);
*pXButtonHoming = !Config::HomingAttackOnJump;
}
bool IsHomingAttackOnJump()
{
return Config::HomingAttackOnJump;
}
// ------------- WORLD MAP ------------- //
bool WorldMapDeadzoneMidAsmHook(PPCRegister& pPadState)
@@ -418,7 +430,7 @@ PPC_FUNC(sub_8256C938)
pWorldMapCursor->m_LeftStickVertical = rPadState.LeftStickVertical;
pWorldMapCursor->m_LeftStickHorizontal = rPadState.LeftStickHorizontal;
if (!Config::DisableDPadAsAnalogInput)
if (!Config::DisableDPadMovement)
{
if (rPadState.IsDown(SWA::eKeyState_DpadUp))
pWorldMapCursor->m_LeftStickVertical = 1.0f;
+39 -7
View File
@@ -95,13 +95,6 @@ void PostUnleashMidAsmHook(PPCRegister& r30)
g_isUnleashCancelled = false;
}
void SetXButtonHomingMidAsmHook(PPCRegister& r1)
{
auto pXButtonHoming = (bool*)(g_memory.base + r1.u32 + 0x63);
*pXButtonHoming = !Config::HomingAttackOnJump;
}
// SWA::Player::CEvilSonicContext
PPC_FUNC_IMPL(__imp__sub_823B49D8);
PPC_FUNC(sub_823B49D8)
@@ -123,3 +116,42 @@ PPC_FUNC(sub_823B4590)
SDL_User_EvilSonic(false);
}
// Change state to squat kick.
PPC_FUNC_IMPL(__imp__sub_8236FE88);
PPC_FUNC(sub_8236FE88)
{
if (Config::DisableSquatKick)
{
ctx.r3.u32 = 0;
return;
}
__imp__sub_8236FE88(ctx, base);
}
// Change state to drift.
PPC_FUNC_IMPL(__imp__sub_82370A50);
PPC_FUNC(sub_82370A50)
{
if (ctx.r4.u32)
{
if (Config::DisableDriftOnSlide)
{
if (auto pInputState = SWA::CInputState::GetInstance())
{
auto& rPadState = pInputState->GetPadState();
if (!rPadState.IsDown(SWA::eKeyState_LeftTrigger) && !rPadState.IsDown(SWA::eKeyState_RightTrigger))
return;
}
}
}
else
{
if (Config::DisableDriftOnBrake)
return;
}
__imp__sub_82370A50(ctx, base);
}
@@ -97,6 +97,8 @@ PPC_FUNC(sub_824E5170)
__imp__sub_824E5170(ctx, base);
App::s_isSaving = pSaveIcon->m_IsVisible;
if (pSaveIcon->m_IsVisible)
{
App::s_isSaveDataCorrupt = false;
+1 -1
View File
@@ -1,4 +1,4 @@
VERSION_MILESTONE=""
VERSION_MAJOR=1
VERSION_MINOR=0
VERSION_REVISION=1
VERSION_REVISION=2
+6
View File
@@ -34,8 +34,14 @@ int Window_OnSDLEvent(void*, SDL_Event* event)
switch (event->type)
{
case SDL_QUIT:
{
if (App::s_isSaving)
break;
App::Exit();
break;
}
case SDL_KEYDOWN:
{
+5 -2
View File
@@ -79,7 +79,12 @@ CONFIG_DEFINE_HIDDEN("Codes", bool, AllowCancellingUnleash, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, DisableAutoSaveWarning, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, DisableBoostFilter, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, DisableDLCIcon, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, DisableDPadMovement, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, DisableDriftOnBrake, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, DisableDriftOnSlide, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, DisableDWMRoundedCorners, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, DisableLowResolutionFontOnCustomUI, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, DisableSquatKick, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, EnableEventCollisionDebugView, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, EnableGIMipLevelDebugView, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, EnableObjectCollisionDebugView, false);
@@ -92,7 +97,5 @@ CONFIG_DEFINE_HIDDEN("Codes", bool, SaveScoreAtCheckpoints, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, SkipIntroLogos, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, UseArrowsForTimeOfDayTransition, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, UseOfficialTitleOnTitleBar, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, DisableLowResolutionFontOnCustomUI, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, DisableDPadAsAnalogInput, false);
CONFIG_DEFINE("Update", time_t, LastChecked, 0);
+2
View File
@@ -8,6 +8,8 @@
#define GAME_INSTALL_DIRECTORY "."
#endif
extern std::filesystem::path g_executableRoot;
inline std::filesystem::path GetGamePath()
{
return GAME_INSTALL_DIRECTORY;
+9 -2
View File
@@ -181,8 +181,8 @@ jump_address_on_true = 0x829E40A0
# Disable Chip hints for shoe upgrades
[[midasm_hook]]
name = "DisableHintsMidAsmHook"
address = 0x82691CB0
jump_address_on_true = 0x82691E24
address = 0x82691DD0
jump_address_on_true = 0x82691DD4
# Disable navigation volumes
[[midasm_hook]]
@@ -197,11 +197,18 @@ address = 0x823A4FF0
registers = ["r4", "r5"]
return_on_false = true
# Set default value for XButtonHoming.
[[midasm_hook]]
name = "SetXButtonHomingMidAsmHook"
address = 0x8237AC90
registers = ["r1"]
# Disable XML reading for XButtonHoming.
[[midasm_hook]]
name = "IsHomingAttackOnJump"
address = 0x8237ACE4
jump_address_on_true = 0x8237ACE8
# Down force HFR fix
[[midasm_hook]]
name = "DownForceDeltaTimeFixMidAsmHook"