diff --git a/CMakeLists.txt b/CMakeLists.txt index 7498b81..480412e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,5 @@ project ("StuntKit_modules") # Include sub-projects. add_subdirectory ("skScreen") -add_subdirectory ("skSpeedrun") add_subdirectory ("skDebug") -add_subdirectory ("skWin10") +add_subdirectory ("skFreeze") diff --git a/readme.md b/readme.md index 5bc0f55..294bbf5 100644 --- a/readme.md +++ b/readme.md @@ -16,15 +16,16 @@ Modules: * Removes quality limitations in DirectX mode, when using Radeon graphics card * `skDebug` * Attempts to get last DirectX error and dave it in `log.txt` file -* `skWin10` - * Removes 0.5s freeze every 7m9.5s +* `skFreeze` + * Removes 0.5s freezes every 3-20 minutes (depending on the computer) + * Under Windows 10, the game freezes every 7m9.5s # Installation and usage 1. Download [`skScreen.dll`](https://github.com/Halamix2/StuntKit_modules/releases/tag/v0.0.2a) and put it in the same folder as `StuntGP.exe` -2. Download [`StuntKit.zip`](https://github.com/Halamix2/StuntKit/releases/tag/0.0.1) and unpack files in the same folder as `StuntGP.exe` -3. If you want to play the game in resolution greater than 2048px (e.g. 2560x1440), download [LegacyD3DResolutionHack](https://github.com/UCyborg/LegacyD3DResolutionHack/releases/tag/v1.0.0), and unpack it in the same folder as `StuntGP.exe` -4. Edit `game.cfg` (if it doesn't exist, run `config.exe`) with a text editor, edit lines `DISPLAYRESWIDTH` and `DISPLAYRESHEIGHT` with requested resolution. -5. Run `StuntKit_D3D.exe` or `StuntKit_Glide.exe`, depending on wanted graphics API. These programs will load all `sk*.dll` modules and start the game. +2. Download any of the modules (e.g. [`StuntKit.dll`](https://github.com/Halamix2/StuntKit/releases/)) and put files in the same folder as `StuntGP.exe` +3. If you want to play the game in resolution greater than 2048px (e.g. 2560x1440), download [`StuntKit.dll`](https://github.com/Halamix2/StuntKit/releases/) and [LegacyD3DResolutionHack](https://github.com/UCyborg/LegacyD3DResolutionHack/releases/tag/v1.0.0), unpack it and put the files in the same folder as `StuntGP.exe` +4. Edit `game.cfg` (if it doesn't exist, run `config.exe`) with a text editor, update lines `DISPLAYRESWIDTH` and `DISPLAYRESHEIGHT` with desired resolution. +5. Run `StuntKit_D3D.exe` or `StuntKit_Glide.exe`, depending on used graphics API. If you don't know which one you should use, I suggest `stuntKit_D3D.exe`. These programs will load all `sk*.dll` modules and start the game. ![skScreen screenshot](https://i.imgur.com/xLSMScZ.png) \ No newline at end of file diff --git a/skDebug/init.cpp b/skDebug/init.cpp index eb28cfd..f17024a 100644 --- a/skDebug/init.cpp +++ b/skDebug/init.cpp @@ -16,13 +16,14 @@ BOOL Initialize() return FALSE; } + OutputDebugString("skDebug loaded"); return TRUE; } BOOL Finalize() { // this module doesn't need any cleanup yet // it would if it wa hooking up to any API - OutputDebugString("skDebug:quitting"); + OutputDebugString("skDebug: quitting"); //char[256], so 255 chars plus \0 char *errorAddress = 0x0; if (gameVersion.getRelease() == Release::International && gameVersion.getAPI() == API::DirectX) { @@ -60,13 +61,13 @@ BOOL Finalize() { logFile.close(); } else { - OutputDebugString("skDebug: can't write to log.txt!"); + OutputDebugString("skDebug: can't write to log.txt!"); } // MessageBox(NULL, "No DirectX error message found!", "skDebug seems clean", MB_OK | MB_ICONERROR); } } else { - OutputDebugString("skDebug: broken c++"); + OutputDebugString("skDebug: broken code on my side, this shouldn't ever happen"); // MessageBox(NULL, "Broken C++, you can't ship that! Address not set", "skDebug was written badly", MB_OK | MB_ICONERROR); } return TRUE; diff --git a/skScreen/binaryFix.cpp b/skScreen/binaryFix.cpp index ae46dac..df2cb47 100644 --- a/skScreen/binaryFix.cpp +++ b/skScreen/binaryFix.cpp @@ -34,11 +34,11 @@ void BinaryFix::set3DRatio() OutputDebugString(ss.str().c_str()); if (!address) { - throw std::runtime_error("set3DRatio: unknown game version"); + throw std::runtime_error("skScreen: unknown game version"); } float ratio = static_cast(gameConfig.getWidth())/ static_cast(gameConfig.getHeight()); replaceMemory(address, ratio); - + OutputDebugString("skScreen: 3D screen ratio was set"); } void BinaryFix::setUIRatio() @@ -66,7 +66,7 @@ void BinaryFix::setUIRatio() } if (!addressX) { - throw std::runtime_error("set3DRatio: unknown game version"); + throw std::runtime_error("skScreen: unknown game version"); } addressY = addressX - 4; @@ -83,6 +83,7 @@ void BinaryFix::setUIRatio() float ratio = ratioWanted /ratio43 * 0.0020833334f; // 0.0020833334 is magic replaceMemory(addressY, ratio); } + OutputDebugString("skScreen: UI screen ratio was set"); } void BinaryFix::removeResolutionLimit() @@ -110,7 +111,7 @@ void BinaryFix::removeResolutionLimit() } if (!addressX) { - throw std::runtime_error("set3DRatio: unknown game version"); + throw std::runtime_error("skScreen: unknown game version"); } addressY = addressX+17; @@ -119,6 +120,7 @@ void BinaryFix::removeResolutionLimit() uint32_t resolution = 15360; //16k is 15360x864 we should be good for a few years :P replaceMemory(addressX, resolution); replaceMemory(addressY, resolution); + OutputDebugString("skScreen: removed resolution limit"); } void BinaryFix::fixRadeon() @@ -137,10 +139,12 @@ void BinaryFix::fixRadeon() } if (!address) { - throw std::runtime_error("set3DRatio: unknown game version"); + throw std::runtime_error("skScreen: unknown game version"); } char radeonFix[] = {'b', 'a', 'd', 'e', 'o', 'n', '\0'}; replaceMemory(address, radeonFix, sizeof(radeonFix)); -} \ No newline at end of file + + OutputDebugString("skScreen: Applied Radeon fix"); +} diff --git a/skScreen/common.cpp b/skScreen/common.cpp index 86baf74..94ceab5 100644 --- a/skScreen/common.cpp +++ b/skScreen/common.cpp @@ -23,4 +23,4 @@ void replaceMemory(DWORD address, uint32_t number) char data[4]; memcpy(data, &number, 4); replaceMemory(address, data, 4); -} \ No newline at end of file +} diff --git a/skScreen/common.hpp b/skScreen/common.hpp index 5105783..8f29f23 100644 --- a/skScreen/common.hpp +++ b/skScreen/common.hpp @@ -7,4 +7,4 @@ void replaceMemory(DWORD address, const char data[], uint32_t length); void replaceMemory(DWORD address, float number); -void replaceMemory(DWORD address, uint32_t number); \ No newline at end of file +void replaceMemory(DWORD address, uint32_t number); diff --git a/skScreen/gameConfig.cpp b/skScreen/gameConfig.cpp index 1046f21..77ab0f7 100644 --- a/skScreen/gameConfig.cpp +++ b/skScreen/gameConfig.cpp @@ -17,14 +17,6 @@ GameConfig::GameConfig() std::string equalSign; std::string value; - - - ss >> key >> equalSign >> value; - - std::stringstream ss2; - ss2 << key << equalSign << value; - OutputDebugString(ss.str().c_str()); - configContainer.insert({ key, value }); } diff --git a/skScreen/init.cpp b/skScreen/init.cpp index 22c9ecb..bf1f70c 100644 --- a/skScreen/init.cpp +++ b/skScreen/init.cpp @@ -3,17 +3,6 @@ BOOL Initialize() { - // getGameVersion(); - // readGameResolution(); - // readModuleConfiguration(); - - // set3Dratio(); - // setUIRatio(); - - // removeResolutionLimit(); - // fixRadeon(); - - // runInWindow(); GameVersion gameVersion; GameConfig gameConfig; BinaryFix binaryFix(gameVersion, gameConfig);