Timer patches

This commit is contained in:
nastys
2019-10-13 02:10:42 +02:00
parent ace2ea03f3
commit 42bee2ffaf
8 changed files with 26 additions and 75 deletions
+4
View File
@@ -37,6 +37,10 @@ MP4_Movies=1
Hide_Volume=0
#Disable the error banner
No_Error=1
#Freeze the timer
No_Timer_Sprite=1
#Disable the timer sprite
No_Timer_Sprite=1
#Allow using a real arcade slider attached to COM11
Hardware_Slider=0
#Enhanced Stage Manager (sets a custom number of stages; "stage_manager" should be disabled in "components.ini")
@@ -58,7 +58,7 @@ LPCWSTR PLAYERDATA_SECTION = L"playerdata";
LPCWSTR KEYCONFIG_SECTION = L"keyconfig";
int nSkipLauncher = GetPrivateProfileIntW(LAUNCHER_SECTION, L"skip", FALSE, CONFIG_FILE);
int nNoGPUDialog = GetPrivateProfileIntW(LAUNCHER_SECTION, L"no_gpu_diaog", FALSE, CONFIG_FILE);
int nNoGPUDialog = GetPrivateProfileIntW(LAUNCHER_SECTION, L"no_gpu_dialog", FALSE, CONFIG_FILE);
std::vector<DEVMODEW> getScreenModes() {
@@ -165,6 +165,8 @@ ConfigOptionBase* optionsArray[] = {
new BooleanOption(L"hide_pv_watermark", PATCHES_SECTION, CONFIG_FILE, L"Hide PV Watermark", L"Hide the watermark that's usually shown in PV viewing mode.", false, false),
new BooleanOption(L"no_lyrics", PATCHES_SECTION, CONFIG_FILE, L"Disable Lyrics", L"Disable showing lyrics.", false, false),
new BooleanOption(L"no_error", PATCHES_SECTION, CONFIG_FILE, L"Disable Error Banner", L"Disable the error banner on the attract screen.", true, false),
new BooleanOption(L"no_timer", PATCHES_SECTION, CONFIG_FILE, L"Freeze Timer", L"Disable the timer.", true, false),
new BooleanOption(L"no_timer_sprite", PATCHES_SECTION, CONFIG_FILE, L"Disable Timer Sprite", L"Disable the timer sprite.", true, false),
new DropdownOption(L"status_icons", PATCHES_SECTION, CONFIG_FILE, L"Status Icons:", L"Set the state of card reader and network status icons.", 3, std::vector<LPCWSTR>({ L"Default", L"Hidden", L"Error", L"OK", L"Partial OK" })),
new OptionMetaSpacer(8),
@@ -187,7 +189,7 @@ ConfigOptionBase* optionsArray[] = {
new NumericOption(L"xinput_preferred", KEYCONFIG_SECTION, KEYCONFIG_FILE, L"XInput Controller Num:", L"Sets the preferred XInput controller.\nIf unavailable, the next connected controller is used.", 0, 0, 3),
new OptionMetaSpacer(8),
new BooleanOption(L"no_gpu_diaog", LAUNCHER_SECTION, CONFIG_FILE, L"Disable GPU Warning", L"Disables the warning dialog for unsupported GPUs.", L"", false),
new BooleanOption(L"no_gpu_dialog", LAUNCHER_SECTION, CONFIG_FILE, L"Disable GPU Warning", L"Disables the warning dialog for unsupported GPUs.", L"", false),
new StringOption(L"command_line", LAUNCHER_SECTION, CONFIG_FILE, L"Command Line:", L"Allows setting command line parameters for the game when using the launcher.\nDisabling the launcher will bypass this.", L"", false),
};
@@ -221,8 +223,6 @@ ConfigOptionBase* componentsArray[] = {
new BooleanOption(L"touch_slider_emulator", COMPONENTS_SECTION, COMPONENTS_FILE, L"Slider Emulator", L"Emulates slider through keyboard and/or mouse.", false, true),
new BooleanOption(L"touch_panel_emulator", COMPONENTS_SECTION, COMPONENTS_FILE, L"Touch Panel Emulator", L"Emulates touch panel through mouse.", false, true),
new BooleanOption(L"sys_timer", COMPONENTS_SECTION, COMPONENTS_FILE, L"Timer Freeze", L"Freezes the PV select timer at 39 seconds.", false, true),
new BooleanOption(L"player_data_manager", COMPONENTS_SECTION, COMPONENTS_FILE, L"Player Data Manager", L"Loads user-defined values into the PlayerData struct.\nRequired for modules and game mode modifiers.", false, true),
new BooleanOption(L"frame_rate_manager", COMPONENTS_SECTION, COMPONENTS_FILE, L"Frame Rate Manager", L"Adjusts animations to the correct speed at different frame rates.\nOnly needed when FPS isn't locket at 60.", false, true),
+18 -2
View File
@@ -100,8 +100,6 @@ void ApplyPatches() {
// Force Hide IDs
{ (void*)0x00000001409A5918, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
{ (void*)0x00000001409A5928, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
// Freeze mode selection timer
{ (void*)0x0000000140566B9E, { 0x90, 0x90, 0x90 } },
// fix TouchReaction
// get some more space by optimizing this code for size
{ (void*)0x00000001406A1FE2,{ 0x7E } }, // MOVQ XMM0,qword ptr [0x168 + RSP] (change to MOVQ)
@@ -138,6 +136,8 @@ void ApplyPatches() {
auto nNoMovies = GetPrivateProfileIntW(L"patches", L"no_movies", FALSE, CONFIG_FILE);
auto nMP4Movies = GetPrivateProfileIntW(L"patches", L"mp4_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 nHardwareSlider = GetPrivateProfileIntW(L"patches", L"hardware_slider", FALSE, CONFIG_FILE);
@@ -276,6 +276,22 @@ void ApplyPatches() {
InjectCode((void*)0x00000001403B9E9B, { 0x90, 0x90 });
printf("[Patches] Errors Banner disabled\n");
}
// Disable timer
if (nNoTimer)
{
// Freeze mode selection timer
InjectCode((void*)0x0000000140566B9E, { 0x90, 0x90, 0x90 });
// Freeze PV selection timer
InjectCode((void*)0x00000001405BDFBF, { 0x90, 0x90, 0x90, 0x90 });
}
// Disable timer sprite
if (nNoTimerSprite)
{
InjectCode((void*)0x00000001409C075D, { 0x72 }); // time_loop -> time_roop
InjectCode((void*)0x0000000140A3D3F5, { 0x6E }); // time_in -> time_nn
InjectCode((void*)0x0000000140A3D3FF, { 0x70 }); // time_out -> time_oup
}
// Enhanced Stage Manager
if (nEStageManager > 0)
{
@@ -4,7 +4,6 @@
#include "Input/InputEmulator.h"
#include "Input/TouchSliderEmulator.h"
#include "Input/TouchPanelEmulator.h"
#include "SysTimer.h"
#include "PlayerDataManager.h"
#include "FrameRateManager.h"
#include "FastLoader.h"
@@ -37,7 +36,6 @@ namespace TLAC::Components
new InputEmulator(),
new TouchSliderEmulator(),
new TouchPanelEmulator(),
new SysTimer(),
new PlayerDataManager(),
new FrameRateManager(),
new FastLoader(),
@@ -1,34 +0,0 @@
#include "SysTimer.h"
#include "../Constants.h"
namespace TLAC::Components
{
SysTimer::SysTimer()
{
}
SysTimer::~SysTimer()
{
}
const char* SysTimer::GetDisplayName()
{
return "sys_timer";
}
void SysTimer::Initialize(ComponentsManager*)
{
selPvTime = GetSysTimePtr((void*)SEL_PV_TIME_ADDRESS);
}
void SysTimer::Update()
{
// account for the decrement that occures during this frame
*selPvTime = SEL_PV_FREEZE_TIME * SYS_TIME_FACTOR + 1;
}
int* SysTimer::GetSysTimePtr(void *address)
{
return (int*)address;
}
}
@@ -1,25 +0,0 @@
#pragma once
#include "EmulatorComponent.h"
namespace TLAC::Components
{
class SysTimer : public EmulatorComponent
{
const int SYS_TIME_FACTOR = 60;
const int SEL_PV_FREEZE_TIME = 39;
public:
SysTimer();
~SysTimer();
virtual const char* GetDisplayName() override;
virtual void Initialize(ComponentsManager*) override;
virtual void Update() override;
private:
int* selPvTime;
int* GetSysTimePtr(void *address);
};
}
@@ -197,7 +197,6 @@
<ClInclude Include="Components\ScaleComponent.h" />
<ClInclude Include="Components\ScoreSaver.h" />
<ClInclude Include="Components\StageManager.h" />
<ClInclude Include="Components\SysTimer.h" />
<ClInclude Include="Constants.h" />
<ClInclude Include="FileSystem\ConfigFile.h" />
<ClInclude Include="FileSystem\TextFile.h" />
@@ -250,7 +249,6 @@
<ClCompile Include="Components\ScaleComponent.cpp" />
<ClCompile Include="Components\ScoreSaver.cpp" />
<ClCompile Include="Components\StageManager.cpp" />
<ClCompile Include="Components\SysTimer.cpp" />
<ClCompile Include="dllmain.cpp" />
<ClCompile Include="FileSystem\ConfigFile.cpp" />
<ClCompile Include="FileSystem\TextFile.cpp" />
@@ -54,9 +54,6 @@
<ClInclude Include="Components\StageManager.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Components\SysTimer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Components\Input\InputBufferType.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -230,9 +227,6 @@
<ClCompile Include="Components\StageManager.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Components\SysTimer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Components\Input\InputEmulator.cpp">
<Filter>Source Files</Filter>
</ClCompile>