Skip to content

Commit

Permalink
rdr: full intro skip
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirteenAG committed Oct 31, 2024
1 parent aaf9bd0 commit da0adba
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/docs/rdr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
![rdr](https://thirteenag.github.io/screens/rdr/main2.jpg)

![](https://habrastorage.org/webt/ow/yy/mg/owyymgpibfqzfbwyf_iqoiqrede.png) Added an option to skip intro and legal screens

Installation:
Download and extract the archive to the game directory, where the exe is located.

[Website](https://thirteenag.github.io/wfp#rdr) | [Source](https://github.com/ThirteenAG/WidescreenFixesPack/blob/master/source/RedDeadRedemption.FusionMod/dllmain.cpp)
8 changes: 8 additions & 0 deletions .github/workflows/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,14 @@ jobs:
tag: sonicheroes
artifacts: data/Archives/SonicHeroes.WidescreenFix.zip

- name: Red Dead Redemption Fusion Mod
uses: ./.github/workflows/release_tag
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_list: ${{ format('{0},{1}', github.event.inputs.tag_list, inputs.tag_list) }}
tag: rdr
artifacts: data/Archives/RedDeadRedemption.FusionMod.zip

- name: Resident Evil 0 Fusion Fix
uses: ./.github/workflows/release_tag
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ on:
- psiops
- psychonauts
- punisher
- rdr
- re0
- re1
- re2re3gc
Expand Down Expand Up @@ -150,6 +151,7 @@ env:
psiops: "/t:Win32\\PsiOpsTheMindgateConspiracy_WidescreenFix"
psychonauts: "/t:Win32\\Psychonauts_WidescreenFix"
punisher: "/t:Win32\\ThePunisher_WidescreenFix"
rdr: "/t:Win64\\RedDeadRedemption_FusionMod"
re0: "/t:Win32\\ResidentEvil\\ResidentEvil0_FusionFix"
re1: "/t:Win32\\ResidentEvil\\ResidentEvil_FusionFix"
re2re3gc: "/t:Dolphin\\ResidentEvil2_RE3_Dolphin_FusionMod"
Expand Down
1 change: 1 addition & 0 deletions data/RedDeadRedemption.FusionMod/dinput8.x64ual
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
loadfromscriptsonly
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[MAIN]
SkipIntro = 1
6 changes: 6 additions & 0 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,12 @@ project "SpyroReignitedTrilogy.WidescreenFix"
platforms { "Win64" }
architecture "x64"
setpaths("Z:/WFP/Games/Spyro Reignited Trilogy/", "Falcon/Binaries/Win64/Spyro-Win64-Shipping.exe", "Falcon/Binaries/Win64/scripts/")

project "RedDeadRedemption.FusionMod"
add_kananlib()
platforms { "Win64" }
architecture "x64"
setpaths("Z:/WFP/Games/Red Dead Redemption/", "RDR.exe", "plugins/")
group ""

group "Win32"
Expand Down
55 changes: 55 additions & 0 deletions source/RedDeadRedemption.FusionMod/dllmain.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#include "stdafx.h"
#include <utility/Scan.hpp>

namespace rdrFlashIntroHandler
{
struct FlashIntroHandler
{
char unk[17];
char bLegalsCompleted;
};

SafetyHookInline FlashIntroHandlerHook{};
void __fastcall Update(FlashIntroHandler* smp_Instance)
{
smp_Instance->bLegalsCompleted = 1;
}
}

void Init()
{
CIniReader iniReader("");
bool bSkipIntro = iniReader.ReadInteger("MAIN", "SkipIntro", 1) != 0;

if (bSkipIntro)
{
auto LegalsCompletedRef = utility::find_function_from_string_ref(GetModuleHandleW(NULL), "LegalsCompleted");
if (LegalsCompletedRef)
{
auto func_start = utility::find_function_start_with_call(LegalsCompletedRef.value());
if (func_start)
rdrFlashIntroHandler::FlashIntroHandlerHook = safetyhook::create_inline(func_start.value(), rdrFlashIntroHandler::Update);
}
}
}

CEXP void InitializeASI()
{
std::call_once(CallbackHandler::flag, []()
{
CallbackHandler::RegisterCallbackAtGetSystemTimeAsFileTime(Init);
});
}

BOOL APIENTRY DllMain(HMODULE hModule, DWORD reason, LPVOID lpReserved)
{
if (reason == DLL_PROCESS_ATTACH)
{
if (!IsUALPresent()) { InitializeASI(); }
}
else if (reason == DLL_PROCESS_DETACH)
{

}
return TRUE;
}

0 comments on commit da0adba

Please sign in to comment.