Minimalist build configuration; move toon to keyconfig
This commit is contained in:
@@ -5,6 +5,10 @@
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Minimalist|x64">
|
||||
<Configuration>Minimalist</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
@@ -34,6 +38,14 @@
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<CLRSupport>false</CLRSupport>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Minimalist|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<CLRSupport>false</CLRSupport>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
@@ -45,6 +57,9 @@
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Minimalist|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
@@ -54,6 +69,10 @@
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>dnsapi</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Minimalist|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>dnsapi</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
@@ -107,6 +126,37 @@
|
||||
</EnableDpiAwareness>
|
||||
</Manifest>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Minimalist|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>MINIMALIST;_CRT_SECURE_NO_WARNINGS;NDEBUG;PDLOADER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>..\..\dependencies\freeglut\include;..\..\dependencies\PluginConfigApi;..\..\dependencies\detours\include;..\..\dependencies\MemoryModule;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<AdditionalOptions>-d2FH4- /utf-8 %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableUAC>false</EnableUAC>
|
||||
<ModuleDefinitionFile>x64.def</ModuleDefinitionFile>
|
||||
<AdditionalOptions>-d2:-FH4- %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalLibraryDirectories>..\..\dependencies\freeglut\lib;..\..\dependencies\detours\lib</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<Manifest>
|
||||
<EnableDpiAwareness>
|
||||
</EnableDpiAwareness>
|
||||
</Manifest>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="exception.hpp" />
|
||||
<ClInclude Include="framework.h" />
|
||||
|
||||
@@ -268,6 +268,7 @@ class PatchApplier710 : public PatchApplier {
|
||||
// Freeze PV selection timer
|
||||
InjectCode((void*)0x00000001405BDFBF, { 0x90, 0x90, 0x90, 0x90 });
|
||||
}
|
||||
#ifndef MINIMALIST
|
||||
// Disable timer sprite
|
||||
if (nNoTimerSprite)
|
||||
{
|
||||
@@ -275,49 +276,6 @@ class PatchApplier710 : public PatchApplier {
|
||||
InjectCode((void*)0x0000000140A3D3F0, { 0x00 }); // time_in
|
||||
InjectCode((void*)0x0000000140A3D3F8, { 0x00 }); // time_out
|
||||
}
|
||||
// Enhanced Stage Manager
|
||||
if (nEStageManager > 0)
|
||||
{
|
||||
// Replace the function that provides the number of stages and compact some of it
|
||||
InjectCode((void*)0x000000014038AEF0, { 0x48, 0x8B, 0x88, 0x40, 0x01, 0x00, 0x00, 0x48, 0x89, 0x4C, 0x24, 0x20, 0x48, 0x8B, 0xD0, 0x48, 0x8B, 0x88, 0x48, 0x01, 0x00, 0x00, 0x48, 0x89, 0x4C, 0x24, 0x28, 0x8B, 0x88, 0x50, 0x01, 0x00, 0x00, 0x89, 0x4C, 0x24, 0x30, 0x8B, 0x88, 0x54, 0x01, 0x00, 0x00, 0x8B, 0x80, 0x58, 0x01, 0x00, 0x00, 0x89, 0x44, 0x24, 0x38, 0x8B, 0x82, 0x5C, 0x01, 0x00, 0x00, 0x89, 0x4C, 0x24, 0x34, 0x89, 0x44, 0x24, 0x3C, 0x48, 0x8B, 0x82, 0x60, 0x01, 0x00, 0x00, 0x48, 0x89, 0x44, 0x24, 0x40, 0x48, 0x8B, 0x82, 0x68, 0x01, 0x00, 0x00, 0x48, 0x89, 0x44, 0x24, 0x48, 0x48, 0x8B, 0x82, 0x70, 0x01, 0x00, 0x00, 0x48, 0x89, 0x44, 0x24, 0x50, 0x8B, 0x82, 0x78, 0x01, 0x00, 0x00, 0x89, 0x44, 0x24, 0x58, 0x84, 0xC0, 0x74, 0x2A, 0x48, 0x8B, 0x44, 0x24, 0x38, 0x48, 0xC1, 0xE8, 0x20, 0x85, 0xC0, 0x75, 0x1D, 0xE8, 0xD9, 0xD9, 0xE5, 0xFF, 0x48, 0x85, 0xC0, 0x74, 0x13, 0x48, 0x8D, 0x48, 0x10, 0xE8, 0xFB, 0xD3, 0xE5, 0xFF, 0xB9, 0x03, 0x00, 0x00, 0x00, 0x85, 0xC0, 0x0F, 0x45, 0xD9, 0x8B, 0x1D, 0x1B, 0x0C, 0x00, 0x00, 0x83, 0x3D, 0x1C, 0x0C, 0x00, 0x00, 0x00, 0x74, 0x06, 0x8B, 0x1D, 0x10, 0x0C, 0x00, 0x00, 0x8B, 0xC3, 0x48, 0x83, 0xC4, 0x60, 0x5B, 0xC3, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC });
|
||||
|
||||
// Jump to another section by addding some code to replace the values (Jump 1)
|
||||
InjectCode((void*)0x000000014038AFF4, { 0xE9, 0x87, 0x0B, 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC });
|
||||
|
||||
// Jump to another section by addding some code to replace the values (Replace 1/2) while some reserving space for values
|
||||
InjectCode((void*)0x000000014038BB40, { 0xFF, 0x05, 0x76, 0x00, 0x00, 0x00, 0x8B, 0x0D, 0x70, 0x00, 0x00, 0x00, 0xBA, 0x02, 0x00, 0x00, 0x00, 0x83, 0x3D, 0x60, 0x00, 0x00, 0x00, 0x00, 0x74, 0x02, 0xFF, 0xC2, 0x39, 0xD1, 0x0F, 0x4D, 0xCA, 0x89, 0x48, 0x08, 0xB9, 0x0E, 0x00, 0x00, 0x00, 0xE8, 0x92, 0x98, 0xE0, 0xFF, 0xB0, 0x01, 0x48, 0x83, 0xC4, 0x28, 0xC3, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x44, 0x89, 0x61, 0x08, 0x44, 0x88, 0x61, 0x0C, 0x4C, 0x89, 0x61, 0x10, 0x44, 0x89, 0x25, 0x29, 0x00, 0x00, 0x00, 0xE9, 0x68, 0xF4, 0xFF, 0xFF, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 });
|
||||
|
||||
// Use the value from our own address instead of the original one
|
||||
InjectCode((void*)0x00000001403F65AF, { 0x48, 0x8D, 0x05, 0x4A, 0x18, 0xDA, 0x00, 0x8B, 0x1D, 0x00, 0x56 });
|
||||
|
||||
// Jump to another section by addding some code to replace the values (Jump 2)
|
||||
InjectCode((void*)0x00000001403F6638, { 0xE9, 0x03, 0x55, 0xF9, 0xFF, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC });
|
||||
|
||||
DWORD StageCountProtect;
|
||||
VirtualProtect((int32_t*)0x14038BBB0, 0x10, PAGE_EXECUTE_READWRITE, &StageCountProtect);
|
||||
|
||||
int* ESM = (int*)0x000000014038BBB0;
|
||||
|
||||
if (nEStageManagerEncore)
|
||||
ESM[1] = nEStageManager;
|
||||
else
|
||||
ESM[0] = nEStageManager;
|
||||
|
||||
ESM[2] = nEStageManagerEncore;
|
||||
|
||||
printf("[Patches] Enhanced Stage Manager enabled\n");
|
||||
}
|
||||
// OpenGL Patches
|
||||
/*if (nOGLPatchA)
|
||||
{
|
||||
// (call cs:glGetError) -> (xor eax, eax); (nop); (nop); (nop); (nop);
|
||||
InjectCode((void*)0x000000014069D21D, { 0x31, 0xC0, 0x90, 0x90, 0x90, 0x90 });
|
||||
}
|
||||
if (nOGLPatchB)
|
||||
{
|
||||
// (js loc_14069BC32) -> (nop)...
|
||||
InjectCode((void*)0x000000014069BAF4, { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 });
|
||||
}*/
|
||||
// Unlock PSEUDO modules (which will all default to Miku, unless we also patch them to match the first performer)
|
||||
if (nUnlockPseudo)
|
||||
{
|
||||
@@ -332,12 +290,6 @@ class PatchApplier710 : public PatchApplier {
|
||||
{
|
||||
InjectCode((void*)0x0000000140565E6B, { 0x90, 0x90 });
|
||||
}
|
||||
// The original slider update needs to run for hardware sliders to work -- only patch it when using emulation
|
||||
if (!nHardwareSlider)
|
||||
{
|
||||
// Don't update the touch slider state so we can write our own
|
||||
InjectCode((void*)0x000000014061579B, { 0x90, 0x90, 0x90, 0x8B, 0x42, 0xE0, 0x90, 0x90, 0x90 });
|
||||
}
|
||||
// Quick start
|
||||
{
|
||||
if (nQuickStart == 1) // skip the card/guest screen
|
||||
@@ -681,17 +633,6 @@ class PatchApplier710 : public PatchApplier {
|
||||
InjectCode((void*)(0x14050294f), { 0xc3 }); // RET
|
||||
}
|
||||
|
||||
// lag compensation
|
||||
if (nLagCompensation>0 && nLagCompensation<=500)
|
||||
{
|
||||
InjectCode((void*)(0x14011e44e), { 0xf3, 0x0f, 0x10, 0x05, 0x8a, 0xcf, 0x9c, 0x00 }); // hijack xmm0
|
||||
InjectCode((void*)(0x14011e46b), { 0xf3, 0x0f, 0x11, 0x44, 0x24, 0x20 }); // get value from xmm0 instead of xmm1
|
||||
float startPos = (float)nLagCompensation / 1000.0f;
|
||||
InjectCode((void*)(0x140aeB3e0), { *((uint8_t*)(&startPos)), *((uint8_t*)(&startPos)+1), *((uint8_t*)(&startPos) + 2), *((uint8_t*)(&startPos) + 3) });
|
||||
|
||||
printf("[Patches] Lag Compensation: %f\n", startPos);
|
||||
}
|
||||
|
||||
// no message bar
|
||||
if (nNoMessageBar)
|
||||
{
|
||||
@@ -723,6 +664,107 @@ class PatchApplier710 : public PatchApplier {
|
||||
InjectCode((void*)(0x1404728C0), { 0xC3 });
|
||||
InjectCode((void*)(0x1404789C3), { 0x0D });
|
||||
}
|
||||
// gamma
|
||||
if (nGamma != 100)
|
||||
{
|
||||
float gamma_float = (float)nGamma / 100.0f;
|
||||
InjectCode((void*)(0x1404a863b), { *((uint8_t*)(&gamma_float)), *((uint8_t*)(&gamma_float) + 1), *((uint8_t*)(&gamma_float) + 2), *((uint8_t*)(&gamma_float) + 3) });
|
||||
|
||||
printf("[Patches] Gamma: %f\n", gamma_float);
|
||||
}
|
||||
|
||||
// modpack redirection
|
||||
/*{
|
||||
wchar_t* mpstr = NULL;
|
||||
mpstr = (wchar_t*)malloc(256);
|
||||
memset(mpstr, 0, 256);
|
||||
GetPrivateProfileStringW(L"Mods", L"Modpack", L"", mpstr, 256, CONFIG_FILE_NAME);
|
||||
std::string modpack_name(std::filesystem::path(mpstr).string());
|
||||
free(mpstr);
|
||||
std::cout << "[Patches] Modpack name: " << modpack_name << std::endl;
|
||||
|
||||
if (modpack_name != "")
|
||||
{
|
||||
// ram
|
||||
std::string modpack_path = "modpacks\\" + modpack_name;
|
||||
std::cout << "[Patches] New ram path: " << modpack_path << std::endl;
|
||||
char* mpstr_path = (char*)malloc(modpack_path.size());
|
||||
memcpy(mpstr_path, modpack_path.c_str(), modpack_path.size());
|
||||
InjectLong((void*)0x0000000014096C120, (long)mpstr_path);
|
||||
|
||||
// mdata
|
||||
std::string modpack_mdata = "modpacks\\" + modpack_name + "\\mdata";
|
||||
std::cout << "[Patches] New mdata path: " << modpack_mdata << std::endl;
|
||||
char* mpstr_mdata = (char*)malloc(modpack_mdata.size());
|
||||
memcpy(mpstr_mdata, modpack_mdata.c_str(), modpack_mdata.size());
|
||||
InjectCode((void*)0x000000014066CEA0, { 0x48, 0xC7, 0xC2 });
|
||||
InjectInt((void*)0x000000014066CEA3, (int)mpstr_mdata);
|
||||
InjectCode((void*)0x000000014066CE9C, { (unsigned char)modpack_mdata.size() });
|
||||
InjectCode((void*)0x000000014066CEAE, { (unsigned char)modpack_mdata.size() });
|
||||
}
|
||||
}*/
|
||||
#endif
|
||||
// Enhanced Stage Manager
|
||||
if (nEStageManager > 0)
|
||||
{
|
||||
// Replace the function that provides the number of stages and compact some of it
|
||||
InjectCode((void*)0x000000014038AEF0, { 0x48, 0x8B, 0x88, 0x40, 0x01, 0x00, 0x00, 0x48, 0x89, 0x4C, 0x24, 0x20, 0x48, 0x8B, 0xD0, 0x48, 0x8B, 0x88, 0x48, 0x01, 0x00, 0x00, 0x48, 0x89, 0x4C, 0x24, 0x28, 0x8B, 0x88, 0x50, 0x01, 0x00, 0x00, 0x89, 0x4C, 0x24, 0x30, 0x8B, 0x88, 0x54, 0x01, 0x00, 0x00, 0x8B, 0x80, 0x58, 0x01, 0x00, 0x00, 0x89, 0x44, 0x24, 0x38, 0x8B, 0x82, 0x5C, 0x01, 0x00, 0x00, 0x89, 0x4C, 0x24, 0x34, 0x89, 0x44, 0x24, 0x3C, 0x48, 0x8B, 0x82, 0x60, 0x01, 0x00, 0x00, 0x48, 0x89, 0x44, 0x24, 0x40, 0x48, 0x8B, 0x82, 0x68, 0x01, 0x00, 0x00, 0x48, 0x89, 0x44, 0x24, 0x48, 0x48, 0x8B, 0x82, 0x70, 0x01, 0x00, 0x00, 0x48, 0x89, 0x44, 0x24, 0x50, 0x8B, 0x82, 0x78, 0x01, 0x00, 0x00, 0x89, 0x44, 0x24, 0x58, 0x84, 0xC0, 0x74, 0x2A, 0x48, 0x8B, 0x44, 0x24, 0x38, 0x48, 0xC1, 0xE8, 0x20, 0x85, 0xC0, 0x75, 0x1D, 0xE8, 0xD9, 0xD9, 0xE5, 0xFF, 0x48, 0x85, 0xC0, 0x74, 0x13, 0x48, 0x8D, 0x48, 0x10, 0xE8, 0xFB, 0xD3, 0xE5, 0xFF, 0xB9, 0x03, 0x00, 0x00, 0x00, 0x85, 0xC0, 0x0F, 0x45, 0xD9, 0x8B, 0x1D, 0x1B, 0x0C, 0x00, 0x00, 0x83, 0x3D, 0x1C, 0x0C, 0x00, 0x00, 0x00, 0x74, 0x06, 0x8B, 0x1D, 0x10, 0x0C, 0x00, 0x00, 0x8B, 0xC3, 0x48, 0x83, 0xC4, 0x60, 0x5B, 0xC3, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC });
|
||||
|
||||
// Jump to another section by addding some code to replace the values (Jump 1)
|
||||
InjectCode((void*)0x000000014038AFF4, { 0xE9, 0x87, 0x0B, 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC });
|
||||
|
||||
// Jump to another section by addding some code to replace the values (Replace 1/2) while some reserving space for values
|
||||
InjectCode((void*)0x000000014038BB40, { 0xFF, 0x05, 0x76, 0x00, 0x00, 0x00, 0x8B, 0x0D, 0x70, 0x00, 0x00, 0x00, 0xBA, 0x02, 0x00, 0x00, 0x00, 0x83, 0x3D, 0x60, 0x00, 0x00, 0x00, 0x00, 0x74, 0x02, 0xFF, 0xC2, 0x39, 0xD1, 0x0F, 0x4D, 0xCA, 0x89, 0x48, 0x08, 0xB9, 0x0E, 0x00, 0x00, 0x00, 0xE8, 0x92, 0x98, 0xE0, 0xFF, 0xB0, 0x01, 0x48, 0x83, 0xC4, 0x28, 0xC3, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x44, 0x89, 0x61, 0x08, 0x44, 0x88, 0x61, 0x0C, 0x4C, 0x89, 0x61, 0x10, 0x44, 0x89, 0x25, 0x29, 0x00, 0x00, 0x00, 0xE9, 0x68, 0xF4, 0xFF, 0xFF, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 });
|
||||
|
||||
// Use the value from our own address instead of the original one
|
||||
InjectCode((void*)0x00000001403F65AF, { 0x48, 0x8D, 0x05, 0x4A, 0x18, 0xDA, 0x00, 0x8B, 0x1D, 0x00, 0x56 });
|
||||
|
||||
// Jump to another section by addding some code to replace the values (Jump 2)
|
||||
InjectCode((void*)0x00000001403F6638, { 0xE9, 0x03, 0x55, 0xF9, 0xFF, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC });
|
||||
|
||||
DWORD StageCountProtect;
|
||||
VirtualProtect((int32_t*)0x14038BBB0, 0x10, PAGE_EXECUTE_READWRITE, &StageCountProtect);
|
||||
|
||||
int* ESM = (int*)0x000000014038BBB0;
|
||||
|
||||
if (nEStageManagerEncore)
|
||||
ESM[1] = nEStageManager;
|
||||
else
|
||||
ESM[0] = nEStageManager;
|
||||
|
||||
ESM[2] = nEStageManagerEncore;
|
||||
|
||||
printf("[Patches] Enhanced Stage Manager enabled\n");
|
||||
}
|
||||
// OpenGL Patches
|
||||
/*if (nOGLPatchA)
|
||||
{
|
||||
// (call cs:glGetError) -> (xor eax, eax); (nop); (nop); (nop); (nop);
|
||||
InjectCode((void*)0x000000014069D21D, { 0x31, 0xC0, 0x90, 0x90, 0x90, 0x90 });
|
||||
}
|
||||
if (nOGLPatchB)
|
||||
{
|
||||
// (js loc_14069BC32) -> (nop)...
|
||||
InjectCode((void*)0x000000014069BAF4, { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 });
|
||||
}*/
|
||||
// The original slider update needs to run for hardware sliders to work -- only patch it when using emulation
|
||||
if (!nHardwareSlider)
|
||||
{
|
||||
// Don't update the touch slider state so we can write our own
|
||||
InjectCode((void*)0x000000014061579B, { 0x90, 0x90, 0x90, 0x8B, 0x42, 0xE0, 0x90, 0x90, 0x90 });
|
||||
}
|
||||
|
||||
|
||||
// lag compensation
|
||||
if (nLagCompensation>0 && nLagCompensation<=500)
|
||||
{
|
||||
InjectCode((void*)(0x14011e44e), { 0xf3, 0x0f, 0x10, 0x05, 0x8a, 0xcf, 0x9c, 0x00 }); // hijack xmm0
|
||||
InjectCode((void*)(0x14011e46b), { 0xf3, 0x0f, 0x11, 0x44, 0x24, 0x20 }); // get value from xmm0 instead of xmm1
|
||||
float startPos = (float)nLagCompensation / 1000.0f;
|
||||
InjectCode((void*)(0x140aeB3e0), { *((uint8_t*)(&startPos)), *((uint8_t*)(&startPos)+1), *((uint8_t*)(&startPos) + 2), *((uint8_t*)(&startPos) + 3) });
|
||||
|
||||
printf("[Patches] Lag Compensation: %f\n", startPos);
|
||||
}
|
||||
|
||||
// debug scaling by somewhatlurker
|
||||
if (nDwguiScaling)
|
||||
@@ -764,45 +806,5 @@ class PatchApplier710 : public PatchApplier {
|
||||
InjectCode((void*)(0x140300a82), { 0x90, 0x90, 0x90 }); // NOPs
|
||||
InjectCode((void*)(0x140300a88), { 0x90, 0x90, 0x90 }); // NOPs
|
||||
}
|
||||
|
||||
// gamma
|
||||
if (nGamma != 100)
|
||||
{
|
||||
float gamma_float = (float)nGamma / 100.0f;
|
||||
InjectCode((void*)(0x1404a863b), { *((uint8_t*)(&gamma_float)), *((uint8_t*)(&gamma_float) + 1), *((uint8_t*)(&gamma_float) + 2), *((uint8_t*)(&gamma_float) + 3) });
|
||||
|
||||
printf("[Patches] Gamma: %f\n", gamma_float);
|
||||
}
|
||||
|
||||
// modpack redirection
|
||||
/*{
|
||||
wchar_t* mpstr = NULL;
|
||||
mpstr = (wchar_t*)malloc(256);
|
||||
memset(mpstr, 0, 256);
|
||||
GetPrivateProfileStringW(L"Mods", L"Modpack", L"", mpstr, 256, CONFIG_FILE_NAME);
|
||||
std::string modpack_name(std::filesystem::path(mpstr).string());
|
||||
free(mpstr);
|
||||
std::cout << "[Patches] Modpack name: " << modpack_name << std::endl;
|
||||
|
||||
if (modpack_name != "")
|
||||
{
|
||||
// ram
|
||||
std::string modpack_path = "modpacks\\" + modpack_name;
|
||||
std::cout << "[Patches] New ram path: " << modpack_path << std::endl;
|
||||
char* mpstr_path = (char*)malloc(modpack_path.size());
|
||||
memcpy(mpstr_path, modpack_path.c_str(), modpack_path.size());
|
||||
InjectLong((void*)0x0000000014096C120, (long)mpstr_path);
|
||||
|
||||
// mdata
|
||||
std::string modpack_mdata = "modpacks\\" + modpack_name + "\\mdata";
|
||||
std::cout << "[Patches] New mdata path: " << modpack_mdata << std::endl;
|
||||
char* mpstr_mdata = (char*)malloc(modpack_mdata.size());
|
||||
memcpy(mpstr_mdata, modpack_mdata.c_str(), modpack_mdata.size());
|
||||
InjectCode((void*)0x000000014066CEA0, { 0x48, 0xC7, 0xC2 });
|
||||
InjectInt((void*)0x000000014066CEA3, (int)mpstr_mdata);
|
||||
InjectCode((void*)0x000000014066CE9C, { (unsigned char)modpack_mdata.size() });
|
||||
InjectCode((void*)0x000000014066CEAE, { (unsigned char)modpack_mdata.size() });
|
||||
}
|
||||
}*/
|
||||
}
|
||||
};
|
||||
@@ -82,21 +82,24 @@ auto nNoLyrics = GetPrivateProfileIntW(L"patches", L"no_lyrics", FALSE, CONFIG_F
|
||||
auto nNoMovies = GetPrivateProfileIntW(L"patches", L"no_movies", FALSE, CONFIG_FILE);
|
||||
auto nNoError = GetPrivateProfileIntW(L"patches", L"no_error", FALSE, CONFIG_FILE);
|
||||
auto nNoTimer = GetPrivateProfileIntW(L"patches", L"no_timer", TRUE, CONFIG_FILE);
|
||||
auto nNoTimerSprite = GetPrivateProfileIntW(L"patches", L"no_timer_sprite", TRUE, CONFIG_FILE);
|
||||
auto nEStageManager = GetPrivateProfileIntW(L"patches", L"enhanced_stage_manager", 0, CONFIG_FILE);
|
||||
auto nEStageManagerEncore = GetPrivateProfileIntW(L"patches", L"enhanced_stage_manager_encore", TRUE, CONFIG_FILE);
|
||||
auto nUnlockPseudo = GetPrivateProfileIntW(L"patches", L"unlock_pseudo", FALSE, CONFIG_FILE);
|
||||
auto nCard = GetPrivateProfileIntW(L"patches", L"card", TRUE, CONFIG_FILE);
|
||||
auto nHardwareSlider = GetPrivateProfileIntW(L"patches", L"hardware_slider", FALSE, CONFIG_FILE);
|
||||
//auto nOGLPatchA = GetPrivateProfileIntW(L"patches", L"opengl_patch_a", FALSE, CONFIG_FILE);
|
||||
//auto nOGLPatchB = GetPrivateProfileIntW(L"patches", L"opengl_patch_b", FALSE, CONFIG_FILE);
|
||||
auto nTAA = GetPrivateProfileIntW(L"graphics", L"taa", TRUE, CONFIG_FILE);
|
||||
auto nMLAA = GetPrivateProfileIntW(L"graphics", L"mlaa", TRUE, CONFIG_FILE);
|
||||
auto nDoF = GetPrivateProfileIntW(L"graphics", L"dof", TRUE, CONFIG_FILE);
|
||||
auto nMAG = GetPrivateProfileIntW(L"graphics", L"mag", 0, CONFIG_FILE);
|
||||
auto nStereo = GetPrivateProfileIntW(L"patches", L"stereo", TRUE, CONFIG_FILE);
|
||||
auto nBuiltinPatches = GetPrivateProfileIntW(L"global", L"builtin_patches", TRUE, CONFIG_FILE);
|
||||
auto nCustomPatches = GetPrivateProfileIntW(L"global", L"custom_patches", TRUE, CONFIG_FILE);
|
||||
auto nLagCompensation = GetPrivateProfileIntW(L"graphics", L"lag_compensation", 0, CONFIG_FILE);
|
||||
auto nDwguiScaling = GetPrivateProfileIntW(L"patches", L"dwgui_scaling", FALSE, CONFIG_FILE);
|
||||
#ifndef MINIMALIST
|
||||
auto nNoTimerSprite = GetPrivateProfileIntW(L"patches", L"no_timer_sprite", TRUE, CONFIG_FILE);
|
||||
auto nUnlockPseudo = GetPrivateProfileIntW(L"patches", L"unlock_pseudo", FALSE, CONFIG_FILE);
|
||||
auto nCard = GetPrivateProfileIntW(L"patches", L"card", TRUE, CONFIG_FILE);
|
||||
auto nDoF = GetPrivateProfileIntW(L"graphics", L"dof", TRUE, CONFIG_FILE);
|
||||
auto nMAG = GetPrivateProfileIntW(L"graphics", L"mag", 0, CONFIG_FILE);
|
||||
auto nQuickStart = GetPrivateProfileIntW(L"patches", L"quick_start", 1, CONFIG_FILE);
|
||||
auto nNoScrollingSfx = GetPrivateProfileIntW(L"patches", L"no_scrolling_sfx", FALSE, CONFIG_FILE);
|
||||
auto nNoHandScaling = GetPrivateProfileIntW(L"patches", L"no_hand_scaling", FALSE, CONFIG_FILE);
|
||||
@@ -118,8 +121,7 @@ auto nReflectResWidth = GetPrivateProfileIntW(L"graphics", L"reflect_res_width",
|
||||
auto nReflectResHeight = GetPrivateProfileIntW(L"graphics", L"reflect_res_height", 256, CONFIG_FILE);
|
||||
auto nRefractResWidth = GetPrivateProfileIntW(L"graphics", L"refract_res_width", 512, CONFIG_FILE);
|
||||
auto nRefractResHeight = GetPrivateProfileIntW(L"graphics", L"refract_res_height", 256, CONFIG_FILE);
|
||||
auto nLagCompensation = GetPrivateProfileIntW(L"graphics", L"lag_compensation", 0, CONFIG_FILE);
|
||||
auto nNoMessageBar = GetPrivateProfileIntW(L"patches", L"no_message_bar", FALSE, CONFIG_FILE);
|
||||
auto nNoStageText = GetPrivateProfileIntW(L"patches", L"no_stage_text", FALSE, CONFIG_FILE);
|
||||
auto nNoOpd = GetPrivateProfileIntW(L"patches", L"no_opd", FALSE, CONFIG_FILE);
|
||||
auto nDwguiScaling = GetPrivateProfileIntW(L"patches", L"dwgui_scaling", FALSE, CONFIG_FILE);
|
||||
#endif
|
||||
|
||||
@@ -780,10 +780,12 @@ void Init()
|
||||
writeTemplate(config_template, CONFIG_FILE);
|
||||
WritePrivateProfileStringW(L"global", L"pc", this_pcname, CONFIG_FILE);
|
||||
WritePrivateProfileStringW(L"plugins", L"Launcher.dva", L"1", CONFIG_FILE);
|
||||
WritePrivateProfileStringW(L"plugins", L"DivaSound.dva", L"1", CONFIG_FILE);
|
||||
WritePrivateProfileStringW(L"plugins", L"TLAC.dva", L"1", CONFIG_FILE);
|
||||
#ifndef MINIMALIST
|
||||
WritePrivateProfileStringW(L"plugins", L"DivaSound.dva", L"1", CONFIG_FILE);
|
||||
WritePrivateProfileStringW(L"plugins", L"Novidia.dva", L"1", CONFIG_FILE);
|
||||
WritePrivateProfileStringW(L"plugins", L"ShaderPatch.dva", L"1", CONFIG_FILE);
|
||||
#endif
|
||||
}
|
||||
const auto COMPONENTS = L"plugins\\components.ini";
|
||||
if (!PathFileExistsW(COMPONENTS)) writeTemplate(components_template, COMPONENTS);
|
||||
|
||||
@@ -28,14 +28,18 @@ char config_template[] =
|
||||
"Skip=0\n"
|
||||
"# Disables unsupported GPU warning dialogs.\n"
|
||||
"No_GPU_Dialog=0\n"
|
||||
#ifndef MINIMALIST
|
||||
"# Sets the dark colour scheme in the launcher.\n"
|
||||
"Dark_Launcher=0\n"
|
||||
#endif
|
||||
"# Command line arguments\n"
|
||||
"Command_Line=\n"
|
||||
#ifndef MINIMALIST
|
||||
"# Launches divahook.bat intead of diva.exe.\n"
|
||||
"Use_divahook_bat=0\n"
|
||||
"# Language -- 0=auto, 1=en, 2=zh-Hans, 3=pt-BR, 4=it-IT\n"
|
||||
"Launcher_Language=0\n"
|
||||
#endif
|
||||
"\n"
|
||||
"[Patches]\n"
|
||||
"# Disable movies (enable this if the game hangs when loading certain PVs)\n"
|
||||
@@ -44,15 +48,18 @@ char config_template[] =
|
||||
"Cursor=1\n"
|
||||
"# Use 2 channels instead of 4 (when not using DivaSound)\n"
|
||||
"Stereo=1\n"
|
||||
#ifndef MINIMALIST
|
||||
"# Skip one or more menus -- 0=disabled, 1=guest, 2=guest+normal\n"
|
||||
"Quick_Start=1\n"
|
||||
"# Disable the scrolling sound effect\n"
|
||||
"No_Scrolling_SFX=0\n"
|
||||
#endif
|
||||
"# Enhanced Stage Manager (sets a custom number of stages; \"stage_manager\" should be disabled in \"components.ini\")\n"
|
||||
"# Number of stages (0 = disabled)\n"
|
||||
"Enhanced_Stage_Manager=0\n"
|
||||
"# Use encore stages or not\n"
|
||||
"Enhanced_Stage_Manager_Encore=1\n"
|
||||
#ifndef MINIMALIST
|
||||
"# Change the mouth animations -- 0=default, 1=force PDA, 2=force FT\n"
|
||||
"Force_Mouth=0\n"
|
||||
"# Change the expressions -- 0=default, 1=force PDA, 2=force FT\n"
|
||||
@@ -63,10 +70,13 @@ char config_template[] =
|
||||
"No_Hand_Scaling=0\n"
|
||||
"# Default hand size -- -1=default, 12200=PDA\n"
|
||||
"Default_Hand_Size=-1\n"
|
||||
#endif
|
||||
"# Show \"FREE PLAY\" instead of \"CREDIT(S)\" and don't require credits\n"
|
||||
"Freeplay=1\n"
|
||||
#ifndef MINIMALIST
|
||||
"# Sing missed notes\n"
|
||||
"Sing_Missed=0\n"
|
||||
#endif
|
||||
"# Hide the volume and SE control buttons\n"
|
||||
"Hide_Volume=0\n"
|
||||
"# Remove the photo controls during PV playback\n"
|
||||
@@ -85,6 +95,7 @@ char config_template[] =
|
||||
"PDLoaderText=1\n"
|
||||
"# Freeze the timer\n"
|
||||
"No_Timer=1\n"
|
||||
#ifndef MINIMALIST
|
||||
"# Disable the timer sprite\n"
|
||||
"No_Timer_Sprite=1\n"
|
||||
"# Disable Message Bar\n"
|
||||
@@ -97,12 +108,15 @@ char config_template[] =
|
||||
"Card=0\n"
|
||||
"# Disable Extended Data (may break physics in some edits) AKA Skyth's no-opd patch\n"
|
||||
"No_Opd=0\n"
|
||||
#endif
|
||||
"# Scale Debug Windows above HD internal resolution AKA somewhatlurker's dwgui patch\n"
|
||||
"Dwgui_Scaling=0\n"
|
||||
"# Allow using a real arcade slider attached to COM11 (or PS4 official FT controller)\n"
|
||||
"Hardware_Slider=0\n"
|
||||
#ifndef MINIMALIST
|
||||
"# Prevent data deletion\n"
|
||||
"Prevent_Data_Deletion=0\n"
|
||||
#endif
|
||||
"\n"
|
||||
"[Graphics]\n"
|
||||
"# Lag Compensation\n"
|
||||
@@ -118,6 +132,7 @@ char config_template[] =
|
||||
"TAA=1\n"
|
||||
"# Morphological Anti-Aliasing\n"
|
||||
"MLAA=1\n"
|
||||
#ifndef MINIMALIST
|
||||
"# MAG Filter -- 0=default (bilinear), 1=nearest-neighbour, 2=sharpen, 3=cone (smooth)\n"
|
||||
"MAG=0\n"
|
||||
"# Depth of Field\n"
|
||||
@@ -142,6 +157,7 @@ char config_template[] =
|
||||
"NPR1=0\n"
|
||||
"# Disable all 3D passes. WARNING: The extended data will be deleted unless Prevent Data Deletion is enabled. Don't enable on Intel GPUs, enable no_opd instead.\n"
|
||||
"2D=0\n"
|
||||
#endif
|
||||
"# FrameRateManager motion rate (fps)\n"
|
||||
"FRM.Motion.Rate=400\n"
|
||||
"\n"
|
||||
@@ -358,6 +374,8 @@ char keyconfig_template[] =
|
||||
"MENU_R = Right, Down, Ds4_R1, XINPUT_RS, Ds4_DPad_Right, Ds4_DPad_Down, XINPUT_RIGHT, XINPUT_DOWN, E, O, Ds4_L_Stick_Right, XINPUT_LRIGHT, Ds4_L_Stick_Down, XINPUT_LDOWN, Ds4_R_Stick_Right, XINPUT_RRIGHT, Ds4_R_Stick_Down, XINPUT_RDOWN\n"
|
||||
"MENU_CIRCLE = Spacebar\n"
|
||||
"\n"
|
||||
"TOON = F9\n"
|
||||
"\n"
|
||||
"COIN = F10\n"
|
||||
"\n"
|
||||
"WIREFRAME = F12\n"
|
||||
|
||||
Reference in New Issue
Block a user