diff --git a/UnleashedRecomp/game.cpp b/UnleashedRecomp/game.cpp index 84b6d51..a969e38 100644 --- a/UnleashedRecomp/game.cpp +++ b/UnleashedRecomp/game.cpp @@ -256,3 +256,39 @@ PPC_FUNC(sub_82547DF0) } #pragma endregion + +#pragma region DLC Hooks + +// CApplicationDocument::LoadArchiveDatabases +PPC_FUNC_IMPL(__imp__sub_824EFD28); +PPC_FUNC(sub_824EFD28) +{ + auto r3 = ctx.r3; + + // CSigninXenon::InitializeDLC + ctx.r3.u64 = PPC_LOAD_U32(r3.u32 + 4) + 200; + ctx.r4.u64 = 0; + sub_822C57D8(ctx, base); + + ctx.r3 = r3; + __imp__sub_824EFD28(ctx, base); +} + +// CFileReaderXenon_DLC::InitializeParallel +PPC_FUNC(sub_822C3778) +{ + if (!PPC_LOAD_U8(0x83361F10)) // ms_DLCInitialized + { + // CFileReaderXenon_DLC::InitializeSerial + sub_822C2CF0(ctx, base); + } +} + +// HasAnyDLC +// NOTE: This is not used outside title screen outro, so it's safe to hook. +PPC_FUNC(sub_82BD06C8) +{ + ctx.r3.u64 = 0; +} + +#pragma endregion