2.6a: bug fixes
This commit is contained in:
@@ -1,156 +1,156 @@
|
||||
#########################################
|
||||
# /!\ WARNING: DO NOT EDIT WITH NOTEPAD!#
|
||||
#########################################
|
||||
|
||||
[Global]
|
||||
# Load plugins including below options
|
||||
Enable=1
|
||||
|
||||
[GPU]
|
||||
# Force GPU model -- -1=auto, 0=Kepler, 1=Maxwell, 2=Turing, 3=Ampere
|
||||
Model=-1
|
||||
|
||||
[Launcher]
|
||||
# Forces the launcher to be skipped, you can use the --launch parameter instead of this.
|
||||
Skip=0
|
||||
# Disables unsupported GPU warning dialogs.
|
||||
No_GPU_Dialog=0
|
||||
# Sets the dark colour scheme in the launcher.
|
||||
Dark_Launcher=0
|
||||
# Enables acrylic blur in the launcher on Windows 10 20H2 or later.
|
||||
Acrylic_Blur=0
|
||||
#Ignores some OpenGL-related errors. Don't use both patches at the same time unless you're know what you're doing
|
||||
OpenGL_Patch_A=0
|
||||
#Ignores some OpenGL-related errors. Don't use both patches at the same time unless you're know what you're doing
|
||||
OpenGL_Patch_B=0
|
||||
# Command line arguments
|
||||
Command_Line=
|
||||
# Launches divahook.bat/start.bat intead of diva.exe.
|
||||
Use_divahook_bat=0
|
||||
|
||||
[Patches]
|
||||
#Disable movies (enable this if the game hangs when loading certain PVs)
|
||||
No_Movies=0
|
||||
#Enable custom MP4 adv movies (experimental)
|
||||
MP4_Movies=1
|
||||
#Enable or disable mouse cursor
|
||||
Cursor=1
|
||||
#Use 2 channels instead of 4 (when not using DivaSound)
|
||||
Stereo=1
|
||||
#Skip one or more menus -- 0=disabled, 1=guest, 2=guest+normal
|
||||
Quick_Start=1
|
||||
#Disable the scrolling sound effect
|
||||
No_Scrolling_SFX=0
|
||||
#Enhanced Stage Manager (sets a custom number of stages; "stage_manager" should be disabled in "components.ini")
|
||||
#Number of stages (0 = disabled)
|
||||
Enhanced_Stage_Manager=0
|
||||
#Use encore stages or not
|
||||
Enhanced_Stage_Manager_Encore=1
|
||||
#Change the mouth animations -- 0=default, 1=force PDA, 2=force FT
|
||||
Force_Mouth=0
|
||||
#Change the expressions -- 0=default, 1=force PDA, 2=force FT
|
||||
Force_Expressions=0
|
||||
#Change the look animations -- 0=default, 1=force PDA, 2=force FT
|
||||
Force_Look=0
|
||||
#Disable hand scaling
|
||||
No_Hand_Scaling=0
|
||||
#Default hand size -- 0-10000=default, 12200=PDA
|
||||
Default_Hand_Size=0
|
||||
#Sing missed notes
|
||||
Sing_Missed=0
|
||||
#Hide the volume and SE control buttons
|
||||
Hide_Volume=0
|
||||
#Remove the photo controls during PV playback
|
||||
No_PV_UI=0
|
||||
#Hide the watermark that's usually shown in PV viewing mode
|
||||
Hide_PV_Watermark=0
|
||||
#Set the card reader and network status icons -- 0=default, 1=hidden, 2=error, 3=OK, 4=partial OK
|
||||
Status_Icons=0
|
||||
#Disable showing lyrics
|
||||
No_Lyrics=0
|
||||
#Disable the error banner
|
||||
No_Error=1
|
||||
#Hide "CREDIT(S)"/"FREE PLAY"
|
||||
Hide_Freeplay=0
|
||||
#Show "FREE PLAY" instead of "CREDIT(S)" and don't require credits
|
||||
Freeplay=1
|
||||
#Show "PD Loader" instead of "FREE PLAY"
|
||||
PDLoaderText=1
|
||||
#Freeze the timer
|
||||
No_Timer=1
|
||||
#Disable the timer sprite
|
||||
No_Timer_Sprite=1
|
||||
#Unlock PSEUDO modules (incomplete, will default to Miku)
|
||||
Unlock_Pseudo=0
|
||||
#Enable the card menu (incomplete, it doesn't bypass the card prompt)
|
||||
Card=0
|
||||
#Allow using a real arcade slider attached to COM11 (or PS4 official FT controller)
|
||||
Hardware_Slider=0
|
||||
#Enable custom patches
|
||||
Custom_Patches=1
|
||||
#Prevent data deletion
|
||||
Prevent_Data_Deletion=0
|
||||
|
||||
[Graphics]
|
||||
# Lag Compensation
|
||||
Lag_Compensation = 0
|
||||
# Set to -1 to unlock the frame rate.
|
||||
FPS.Limit=60
|
||||
# Reduces FPS Limiter CPU usage
|
||||
# (may have less consistent performance)
|
||||
FPS.Limit.LightMode=1
|
||||
# Enable debug warnings for lightweight limiter
|
||||
FPS.Limit.Verbose=0
|
||||
# Temporal Anti-Aliasing
|
||||
TAA=1
|
||||
# Morphological Anti-Aliasing
|
||||
MLAA=1
|
||||
# MAG Filter -- 0=default (bilinear), 1=nearest-neighbour, 2=sharpen, 3=cone (smooth)
|
||||
MAG=0
|
||||
# Depth of Field
|
||||
DOF=1
|
||||
# Reflections
|
||||
Reflections=1
|
||||
# Gamma -- 0 or 100=default, 125=console-like
|
||||
Gamma=100
|
||||
# Shadows
|
||||
Shadows=1
|
||||
# Transparent Meshes
|
||||
Punchthrough=1
|
||||
# Glare
|
||||
Glare=1
|
||||
# Shader
|
||||
Shader=1
|
||||
# Toon shader (press F9 to toggle) -- 0=default, 1=force on, 2=force off
|
||||
NPR1=0
|
||||
# Disable all 3D passes. WARNING: The extended data will be deleted unless Prevent Data Deletion is enabled.
|
||||
2D=0
|
||||
# FrameRateManager motion rate (fps)
|
||||
FRM.Motion.Rate=400
|
||||
|
||||
[Resolution]
|
||||
# 0 = Windowed, 1 = Fast, 2 = Exclusive, 3 = Safe
|
||||
# For same as screen res: -1x-1
|
||||
Display=1
|
||||
Width=-1
|
||||
Height=-1
|
||||
# Fullscreen only options
|
||||
BitDepth=32
|
||||
RefreshRate=60
|
||||
|
||||
# Set a custom internal render resolution
|
||||
# Same as window: -1x-1
|
||||
# HD : 1280x720
|
||||
# FHD : 1920x1080
|
||||
# WQHD : 2560x1440
|
||||
# 4K UHD: 3840x2160
|
||||
# 5K UHD: 5120x2880
|
||||
# 8K UHD: 7680x4320
|
||||
r.Enable=0
|
||||
r.Width=1920
|
||||
r.Height=1080
|
||||
|
||||
[plugins]
|
||||
DivaWig.dva=0
|
||||
DSCRemote.dva=0
|
||||
custom_freeplay_text_example.p=0
|
||||
#########################################
|
||||
# /!\ WARNING: DO NOT EDIT WITH NOTEPAD!#
|
||||
#########################################
|
||||
|
||||
[Global]
|
||||
# Load plugins including below options
|
||||
Enable=1
|
||||
|
||||
[GPU]
|
||||
# Force GPU model -- -1=auto, 0=Kepler, 1=Maxwell/Pascal, 2=Turing, 3=Ampere
|
||||
Model=-1
|
||||
|
||||
[Launcher]
|
||||
# Forces the launcher to be skipped, you can use the --launch parameter instead of this.
|
||||
Skip=0
|
||||
# Disables unsupported GPU warning dialogs.
|
||||
No_GPU_Dialog=0
|
||||
# Sets the dark colour scheme in the launcher.
|
||||
Dark_Launcher=0
|
||||
# Enables acrylic blur in the launcher on Windows 10 20H2 or later.
|
||||
Acrylic_Blur=0
|
||||
#Ignores some OpenGL-related errors. Don't use both patches at the same time unless you're know what you're doing
|
||||
OpenGL_Patch_A=0
|
||||
#Ignores some OpenGL-related errors. Don't use both patches at the same time unless you're know what you're doing
|
||||
OpenGL_Patch_B=0
|
||||
# Command line arguments
|
||||
Command_Line=
|
||||
# Launches divahook.bat/start.bat intead of diva.exe.
|
||||
Use_divahook_bat=0
|
||||
|
||||
[Patches]
|
||||
#Disable movies (enable this if the game hangs when loading certain PVs)
|
||||
No_Movies=0
|
||||
#Enable custom MP4 adv movies (experimental)
|
||||
MP4_Movies=1
|
||||
#Enable or disable mouse cursor
|
||||
Cursor=1
|
||||
#Use 2 channels instead of 4 (when not using DivaSound)
|
||||
Stereo=1
|
||||
#Skip one or more menus -- 0=disabled, 1=guest, 2=guest+normal
|
||||
Quick_Start=1
|
||||
#Disable the scrolling sound effect
|
||||
No_Scrolling_SFX=0
|
||||
#Enhanced Stage Manager (sets a custom number of stages; "stage_manager" should be disabled in "components.ini")
|
||||
#Number of stages (0 = disabled)
|
||||
Enhanced_Stage_Manager=0
|
||||
#Use encore stages or not
|
||||
Enhanced_Stage_Manager_Encore=1
|
||||
#Change the mouth animations -- 0=default, 1=force PDA, 2=force FT
|
||||
Force_Mouth=0
|
||||
#Change the expressions -- 0=default, 1=force PDA, 2=force FT
|
||||
Force_Expressions=0
|
||||
#Change the look animations -- 0=default, 1=force PDA, 2=force FT
|
||||
Force_Look=0
|
||||
#Disable hand scaling
|
||||
No_Hand_Scaling=0
|
||||
#Default hand size -- 0-10000=default, 12200=PDA
|
||||
Default_Hand_Size_uint=0
|
||||
#Sing missed notes
|
||||
Sing_Missed=0
|
||||
#Hide the volume and SE control buttons
|
||||
Hide_Volume=0
|
||||
#Remove the photo controls during PV playback
|
||||
No_PV_UI=0
|
||||
#Hide the watermark that's usually shown in PV viewing mode
|
||||
Hide_PV_Watermark=0
|
||||
#Set the card reader and network status icons -- 0=default, 1=hidden, 2=error, 3=OK, 4=partial OK
|
||||
Status_Icons=0
|
||||
#Disable showing lyrics
|
||||
No_Lyrics=0
|
||||
#Disable the error banner
|
||||
No_Error=1
|
||||
#Hide "CREDIT(S)"/"FREE PLAY"
|
||||
Hide_Freeplay=0
|
||||
#Show "FREE PLAY" instead of "CREDIT(S)" and don't require credits
|
||||
Freeplay=1
|
||||
#Show "PD Loader" instead of "FREE PLAY"
|
||||
PDLoaderText=1
|
||||
#Freeze the timer
|
||||
No_Timer=1
|
||||
#Disable the timer sprite
|
||||
No_Timer_Sprite=1
|
||||
#Unlock PSEUDO modules (incomplete, will default to Miku)
|
||||
Unlock_Pseudo=0
|
||||
#Enable the card menu (incomplete, it doesn't bypass the card prompt)
|
||||
Card=0
|
||||
#Allow using a real arcade slider attached to COM11 (or PS4 official FT controller)
|
||||
Hardware_Slider=0
|
||||
#Enable custom patches
|
||||
Custom_Patches=1
|
||||
#Prevent data deletion
|
||||
Prevent_Data_Deletion=0
|
||||
|
||||
[Graphics]
|
||||
# Lag Compensation
|
||||
Lag_Compensation = 0
|
||||
# Set to -1 to unlock the frame rate.
|
||||
FPS.Limit=60
|
||||
# Reduces FPS Limiter CPU usage
|
||||
# (may have less consistent performance)
|
||||
FPS.Limit.LightMode=1
|
||||
# Enable debug warnings for lightweight limiter
|
||||
FPS.Limit.Verbose=0
|
||||
# Temporal Anti-Aliasing
|
||||
TAA=1
|
||||
# Morphological Anti-Aliasing
|
||||
MLAA=1
|
||||
# MAG Filter -- 0=default (bilinear), 1=nearest-neighbour, 2=sharpen, 3=cone (smooth)
|
||||
MAG=0
|
||||
# Depth of Field
|
||||
DOF=1
|
||||
# Reflections
|
||||
Reflections=1
|
||||
# Gamma -- 0 or 100=default, 125=console-like
|
||||
Gamma=100
|
||||
# Shadows
|
||||
Shadows=1
|
||||
# Transparent Meshes
|
||||
Punchthrough=1
|
||||
# Glare
|
||||
Glare=1
|
||||
# Shader
|
||||
Shader=1
|
||||
# Toon shader (press F9 to toggle) -- 0=default, 1=force on, 2=force off
|
||||
NPR1=0
|
||||
# Disable all 3D passes. WARNING: The extended data will be deleted unless Prevent Data Deletion is enabled.
|
||||
2D=0
|
||||
# FrameRateManager motion rate (fps)
|
||||
FRM.Motion.Rate=400
|
||||
|
||||
[Resolution]
|
||||
# 0 = Windowed, 1 = Fast, 2 = Exclusive, 3 = Safe
|
||||
# For same as screen res: -1x-1
|
||||
Display=1
|
||||
Width=-1
|
||||
Height=-1
|
||||
# Fullscreen only options
|
||||
BitDepth=32
|
||||
RefreshRate=60
|
||||
|
||||
# Set a custom internal render resolution
|
||||
# Same as window: -1x-1
|
||||
# HD : 1280x720
|
||||
# FHD : 1920x1080
|
||||
# WQHD : 2560x1440
|
||||
# 4K UHD: 3840x2160
|
||||
# 5K UHD: 5120x2880
|
||||
# 8K UHD: 7680x4320
|
||||
r.Enable=0
|
||||
r.Width=1920
|
||||
r.Height=1080
|
||||
|
||||
[plugins]
|
||||
DivaWig.dva=0
|
||||
DSCRemote.dva=0
|
||||
custom_freeplay_text_example.p=0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+1220
-1219
File diff suppressed because it is too large
Load Diff
+1748
-1748
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,131 +1,131 @@
|
||||
#pragma once
|
||||
#include "windows.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
std::string TrimString(const std::string& str, const std::string& whitespace)
|
||||
{
|
||||
const size_t strBegin = str.find_first_not_of(whitespace);
|
||||
|
||||
if (strBegin == std::string::npos)
|
||||
return "";
|
||||
|
||||
const size_t strEnd = str.find_last_not_of(whitespace);
|
||||
const size_t strRange = strEnd - strBegin + 1;
|
||||
|
||||
return str.substr(strBegin, strRange);
|
||||
}
|
||||
|
||||
std::vector<std::string> SplitString(const std::string& str, const std::string& delim)
|
||||
{
|
||||
std::vector<std::string> tokens;
|
||||
size_t prev = 0, pos = 0;
|
||||
do
|
||||
{
|
||||
pos = str.find(delim, prev);
|
||||
if (pos == std::string::npos)
|
||||
pos = str.length();
|
||||
|
||||
std::string token = str.substr(prev, pos - prev);
|
||||
|
||||
if (!token.empty())
|
||||
tokens.push_back(token);
|
||||
|
||||
prev = pos + delim.length();
|
||||
} while (pos < str.length() && prev < str.length());
|
||||
|
||||
return tokens;
|
||||
}
|
||||
|
||||
void InjectCode(void* address, const std::vector<uint8_t> data)
|
||||
{
|
||||
const size_t byteCount = data.size() * sizeof(uint8_t);
|
||||
|
||||
DWORD oldProtect;
|
||||
VirtualProtect(address, byteCount, PAGE_EXECUTE_READWRITE, &oldProtect);
|
||||
memcpy(address, data.data(), byteCount);
|
||||
VirtualProtect(address, byteCount, oldProtect, nullptr);
|
||||
}
|
||||
|
||||
// patchMovieExt will modify an extension to mp4 only if the file exists on disk as an mp4
|
||||
void patchMovieExt(std::string moviefile, void* address)
|
||||
{
|
||||
bool isinmdata = 0;
|
||||
try {
|
||||
for (std::filesystem::path p : std::filesystem::directory_iterator("../mdata"))
|
||||
{
|
||||
if (std::filesystem::path(p).filename().string().at(0) != 'M' || std::filesystem::path(p).filename().string().length() > 4) continue;
|
||||
if (std::filesystem::exists(p.string() + "/rom/movie/" + moviefile + ".mp4"))
|
||||
{
|
||||
isinmdata = 1;
|
||||
//std::cout << "[Patches] Movie " << moviefile << ".mp4 found in M" << ss.str() << std::endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (const std::filesystem::filesystem_error& e) {
|
||||
std::cout << "[Patches] File system error " << e.what() << " " << e.path1() << " " << e.path2() << " " << e.code() << std::endl;
|
||||
}
|
||||
|
||||
if (isinmdata || std::filesystem::exists("../rom/movie/" + moviefile + ".mp4"))
|
||||
{
|
||||
InjectCode(address, { 0x6D, 0x70, 0x34 });
|
||||
std::cout << "[Patches] Movie " << moviefile << " patched to mp4\n";
|
||||
return;
|
||||
}
|
||||
//std::cout << "[Patches] Movie " << moviefile << " NOT patched to mp4\n";
|
||||
return;
|
||||
}
|
||||
|
||||
const LPCWSTR CONFIG_FILE = L".\\config.ini";
|
||||
|
||||
auto nCursor = GetPrivateProfileIntW(L"patches", L"cursor", TRUE, CONFIG_FILE);
|
||||
auto nHideFreeplay = GetPrivateProfileIntW(L"patches", L"hide_freeplay", FALSE, CONFIG_FILE);
|
||||
auto nFreeplay = GetPrivateProfileIntW(L"patches", L"freeplay", TRUE, CONFIG_FILE);
|
||||
auto nPDLoaderText = GetPrivateProfileIntW(L"patches", L"pdloadertext", TRUE, CONFIG_FILE);
|
||||
auto nStatusIcons = GetPrivateProfileIntW(L"patches", L"status_icons", 0, CONFIG_FILE);
|
||||
auto nHidePVWatermark = GetPrivateProfileIntW(L"patches", L"hide_pv_watermark", FALSE, CONFIG_FILE);
|
||||
auto nNoPVUi = GetPrivateProfileIntW(L"patches", L"no_pv_ui", FALSE, CONFIG_FILE);
|
||||
auto nHideVolCtrl = GetPrivateProfileIntW(L"patches", L"hide_volume", FALSE, CONFIG_FILE);
|
||||
auto nNoLyrics = GetPrivateProfileIntW(L"patches", L"no_lyrics", FALSE, CONFIG_FILE);
|
||||
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 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 nGamma = GetPrivateProfileIntW(L"graphics", L"gamma", 100, CONFIG_FILE);
|
||||
auto nStereo = GetPrivateProfileIntW(L"patches", L"stereo", TRUE, CONFIG_FILE);
|
||||
auto nCustomPatches = GetPrivateProfileIntW(L"patches", L"custom_patches", TRUE, 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);
|
||||
auto nDefaultHandSize = GetPrivateProfileIntW(L"patches", L"default_hand_size", 0, CONFIG_FILE);
|
||||
auto nSingMissed = GetPrivateProfileIntW(L"patches", L"sing_missed", FALSE, CONFIG_FILE);
|
||||
auto nForceMouth = GetPrivateProfileIntW(L"patches", L"force_mouth", 0, CONFIG_FILE);
|
||||
auto nForceExpressions = GetPrivateProfileIntW(L"patches", L"force_expressions", 0, CONFIG_FILE);
|
||||
auto nForceLook = GetPrivateProfileIntW(L"patches", L"force_look", 0, CONFIG_FILE);
|
||||
auto nNpr1 = GetPrivateProfileIntW(L"graphics", L"npr1", 0, CONFIG_FILE);
|
||||
auto nReflections = GetPrivateProfileIntW(L"graphics", L"reflections", TRUE, CONFIG_FILE);
|
||||
auto nShadows = GetPrivateProfileIntW(L"graphics", L"shadows", TRUE, CONFIG_FILE);
|
||||
auto nPunchthrough = GetPrivateProfileIntW(L"graphics", L"punchthrough", TRUE, CONFIG_FILE);
|
||||
auto nGlare = GetPrivateProfileIntW(L"graphics", L"glare", TRUE, CONFIG_FILE);
|
||||
auto nShader = GetPrivateProfileIntW(L"graphics", L"shader", TRUE, CONFIG_FILE);
|
||||
auto n2D = GetPrivateProfileIntW(L"graphics", L"2D", FALSE, CONFIG_FILE);
|
||||
auto nNoDelete = GetPrivateProfileIntW(L"patches", L"prevent_data_deletion", FALSE, CONFIG_FILE);
|
||||
auto nReflectResWidth = GetPrivateProfileIntW(L"graphics", L"reflect_res_width", 512, CONFIG_FILE);
|
||||
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);
|
||||
#pragma once
|
||||
#include "windows.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
std::string TrimString(const std::string& str, const std::string& whitespace)
|
||||
{
|
||||
const size_t strBegin = str.find_first_not_of(whitespace);
|
||||
|
||||
if (strBegin == std::string::npos)
|
||||
return "";
|
||||
|
||||
const size_t strEnd = str.find_last_not_of(whitespace);
|
||||
const size_t strRange = strEnd - strBegin + 1;
|
||||
|
||||
return str.substr(strBegin, strRange);
|
||||
}
|
||||
|
||||
std::vector<std::string> SplitString(const std::string& str, const std::string& delim)
|
||||
{
|
||||
std::vector<std::string> tokens;
|
||||
size_t prev = 0, pos = 0;
|
||||
do
|
||||
{
|
||||
pos = str.find(delim, prev);
|
||||
if (pos == std::string::npos)
|
||||
pos = str.length();
|
||||
|
||||
std::string token = str.substr(prev, pos - prev);
|
||||
|
||||
if (!token.empty())
|
||||
tokens.push_back(token);
|
||||
|
||||
prev = pos + delim.length();
|
||||
} while (pos < str.length() && prev < str.length());
|
||||
|
||||
return tokens;
|
||||
}
|
||||
|
||||
void InjectCode(void* address, const std::vector<uint8_t> data)
|
||||
{
|
||||
const size_t byteCount = data.size() * sizeof(uint8_t);
|
||||
|
||||
DWORD oldProtect;
|
||||
VirtualProtect(address, byteCount, PAGE_EXECUTE_READWRITE, &oldProtect);
|
||||
memcpy(address, data.data(), byteCount);
|
||||
VirtualProtect(address, byteCount, oldProtect, nullptr);
|
||||
}
|
||||
|
||||
// patchMovieExt will modify an extension to mp4 only if the file exists on disk as an mp4
|
||||
void patchMovieExt(std::string moviefile, void* address)
|
||||
{
|
||||
bool isinmdata = 0;
|
||||
try {
|
||||
for (std::filesystem::path p : std::filesystem::directory_iterator("../mdata"))
|
||||
{
|
||||
if (std::filesystem::path(p).filename().string().at(0) != 'M' || std::filesystem::path(p).filename().string().length() > 4) continue;
|
||||
if (std::filesystem::exists(p.string() + "/rom/movie/" + moviefile + ".mp4"))
|
||||
{
|
||||
isinmdata = 1;
|
||||
//std::cout << "[Patches] Movie " << moviefile << ".mp4 found in M" << ss.str() << std::endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (const std::filesystem::filesystem_error& e) {
|
||||
std::cout << "[Patches] File system error " << e.what() << " " << e.path1() << " " << e.path2() << " " << e.code() << std::endl;
|
||||
}
|
||||
|
||||
if (isinmdata || std::filesystem::exists("../rom/movie/" + moviefile + ".mp4"))
|
||||
{
|
||||
InjectCode(address, { 0x6D, 0x70, 0x34 });
|
||||
std::cout << "[Patches] Movie " << moviefile << " patched to mp4\n";
|
||||
return;
|
||||
}
|
||||
//std::cout << "[Patches] Movie " << moviefile << " NOT patched to mp4\n";
|
||||
return;
|
||||
}
|
||||
|
||||
const LPCWSTR CONFIG_FILE = L".\\config.ini";
|
||||
|
||||
auto nCursor = GetPrivateProfileIntW(L"patches", L"cursor", TRUE, CONFIG_FILE);
|
||||
auto nHideFreeplay = GetPrivateProfileIntW(L"patches", L"hide_freeplay", FALSE, CONFIG_FILE);
|
||||
auto nFreeplay = GetPrivateProfileIntW(L"patches", L"freeplay", TRUE, CONFIG_FILE);
|
||||
auto nPDLoaderText = GetPrivateProfileIntW(L"patches", L"pdloadertext", TRUE, CONFIG_FILE);
|
||||
auto nStatusIcons = GetPrivateProfileIntW(L"patches", L"status_icons", 0, CONFIG_FILE);
|
||||
auto nHidePVWatermark = GetPrivateProfileIntW(L"patches", L"hide_pv_watermark", FALSE, CONFIG_FILE);
|
||||
auto nNoPVUi = GetPrivateProfileIntW(L"patches", L"no_pv_ui", FALSE, CONFIG_FILE);
|
||||
auto nHideVolCtrl = GetPrivateProfileIntW(L"patches", L"hide_volume", FALSE, CONFIG_FILE);
|
||||
auto nNoLyrics = GetPrivateProfileIntW(L"patches", L"no_lyrics", FALSE, CONFIG_FILE);
|
||||
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 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 nGamma = GetPrivateProfileIntW(L"graphics", L"gamma", 100, CONFIG_FILE);
|
||||
auto nStereo = GetPrivateProfileIntW(L"patches", L"stereo", TRUE, CONFIG_FILE);
|
||||
auto nCustomPatches = GetPrivateProfileIntW(L"patches", L"custom_patches", TRUE, 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);
|
||||
auto nDefaultHandSize = GetPrivateProfileIntW(L"patches", L"default_hand_size_uint", 0, CONFIG_FILE);
|
||||
auto nSingMissed = GetPrivateProfileIntW(L"patches", L"sing_missed", FALSE, CONFIG_FILE);
|
||||
auto nForceMouth = GetPrivateProfileIntW(L"patches", L"force_mouth", 0, CONFIG_FILE);
|
||||
auto nForceExpressions = GetPrivateProfileIntW(L"patches", L"force_expressions", 0, CONFIG_FILE);
|
||||
auto nForceLook = GetPrivateProfileIntW(L"patches", L"force_look", 0, CONFIG_FILE);
|
||||
auto nNpr1 = GetPrivateProfileIntW(L"graphics", L"npr1", 0, CONFIG_FILE);
|
||||
auto nReflections = GetPrivateProfileIntW(L"graphics", L"reflections", TRUE, CONFIG_FILE);
|
||||
auto nShadows = GetPrivateProfileIntW(L"graphics", L"shadows", TRUE, CONFIG_FILE);
|
||||
auto nPunchthrough = GetPrivateProfileIntW(L"graphics", L"punchthrough", TRUE, CONFIG_FILE);
|
||||
auto nGlare = GetPrivateProfileIntW(L"graphics", L"glare", TRUE, CONFIG_FILE);
|
||||
auto nShader = GetPrivateProfileIntW(L"graphics", L"shader", TRUE, CONFIG_FILE);
|
||||
auto n2D = GetPrivateProfileIntW(L"graphics", L"2D", FALSE, CONFIG_FILE);
|
||||
auto nNoDelete = GetPrivateProfileIntW(L"patches", L"prevent_data_deletion", FALSE, CONFIG_FILE);
|
||||
auto nReflectResWidth = GetPrivateProfileIntW(L"graphics", L"reflect_res_width", 512, CONFIG_FILE);
|
||||
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 nUseDivahookBat = GetPrivateProfileIntW(L"launcher", L"use_divahook_bat", FALSE, CONFIG_FILE);
|
||||
Reference in New Issue
Block a user