Skip to content

Commit

Permalink
Fix for recent patch
Browse files Browse the repository at this point in the history
  • Loading branch information
andon authored and andon committed Jan 31, 2017
1 parent 59946df commit a2368c4
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@
/x64/Release
tbf.VC.db
/tbf.VC.VC.opendb
*.opendb
*.db
/.vs/tbf/v15/Browse.VC.db
*.ipch
*.ipch
*.ipch
2 changes: 1 addition & 1 deletion include/DLL_VERSION.H
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#define TBF_MAJOR 0
#define TBF_MINOR 5
#define TBF_BUILD 1
#define TBF_BUILD 2
#define TBF_REV 0


Expand Down
1 change: 1 addition & 0 deletions include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ struct tbf_config_t
int target = 60;
float tolerance = 0.05f;
bool reshade_fix = false;
int64_t limit_addr = 0xBCC3FCULL;
} framerate;

struct {
Expand Down
13 changes: 13 additions & 0 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ struct {
struct {
tbf::ParameterBool* replace_limiter;
tbf::ParameterFloat* tolerance;
tbf::ParameterInt64* limit_addr;
} framerate;

struct {
Expand Down Expand Up @@ -334,6 +335,16 @@ TBF_LoadConfig (std::wstring name)
L"Framerate.Fix",
L"LimiterTolerance" );

framerate.limit_addr =
static_cast <tbf::ParameterInt64 *>
(g_ParameterFactory.create_parameter <int64_t> (
L"User-Selected Framerate Limit Address")
);
framerate.limit_addr->register_to_ini (
dll_ini,
L"TBFIX.System",
L"LimitAddress" );


input.gamepad.texture_set =
static_cast <tbf::ParameterStringW *>
Expand Down Expand Up @@ -418,6 +429,7 @@ TBF_LoadConfig (std::wstring name)

framerate.replace_limiter->load (config.framerate.replace_limiter);
framerate.tolerance->load (config.framerate.tolerance);
framerate.limit_addr->load (config.framerate.limit_addr);

textures.remaster->load (config.textures.remaster);
textures.uncompressed->load (config.textures.uncompressed);
Expand Down Expand Up @@ -445,6 +457,7 @@ TBF_SaveConfig (std::wstring name, bool close_config)

framerate.replace_limiter->store (config.framerate.replace_limiter);
framerate.tolerance->store (config.framerate.tolerance);
framerate.limit_addr->store (config.framerate.limit_addr);

render.dump_shaders->store (config.render.dump_shaders);

Expand Down
2 changes: 1 addition & 1 deletion src/framerate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
// @TODO: Develop a heuristic to scan for this memory address;
// hardcoding it is going to break stuff :)
//
uintptr_t TICK_ADDR_BASE = 0xB15074;//0xB1B074;
#define TICK_ADDR_BASE (uintptr_t)config.framerate.limit_addr

int32_t tbf::FrameRateFix::tick_scale = INT32_MAX; // 0 FPS

Expand Down
Binary file modified tbf.VC.db
Binary file not shown.
6 changes: 3 additions & 3 deletions tbf.vcxproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
Expand All @@ -21,13 +21,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand Down
Binary file modified version.ini
Binary file not shown.

0 comments on commit a2368c4

Please sign in to comment.