Fixed topmost in borderless

This commit is contained in:
uberhalit 2019-03-31 01:48:24 +01:00
parent c8696f0a45
commit f0ad1e49fa
5 changed files with 18 additions and 16 deletions

View file

@ -48,7 +48,7 @@ The game enforces VSYNC and forces 60 Hz in fullscreen even on 144 Hz monitors s
11. [![Preferred refresh rate Highest available and Vertical sync Off](https://camo.githubusercontent.com/209678e46eb63c150abf394894ef24a75bb664d0/68747470733a2f2f692e696d6775722e636f6d2f56634d754f33362e706e67)](#) 11. [![Preferred refresh rate Highest available and Vertical sync Off](https://camo.githubusercontent.com/209678e46eb63c150abf394894ef24a75bb664d0/68747470733a2f2f692e696d6775722e636f6d2f56634d754f33362e706e67)](#)
12. Hit apply and close Nvidia Control Panel 12. Hit apply and close Nvidia Control Panel
13. Start `Sekiro FPS Unlocker and more` and set FPS lock to your desired framerate 13. Start `Sekiro FPS Unlocker and more` and set FPS lock to your desired framerate
14. Start the game and use fullscreen or borderless window mode 14. Start the game and use fullscreen (144 Hz or 60 Hz Monitors) or borderless window mode (144 Hz Monitors)
15. These steps will force disable vsync so it won't limit your fps to monitor refresh rate and also force the monitor to ignore the games request to run at 60 Hz if in fullscreen 15. These steps will force disable vsync so it won't limit your fps to monitor refresh rate and also force the monitor to ignore the games request to run at 60 Hz if in fullscreen
#### If you do not have 'Preferred refresh rate' or 'Vertical sync' follow these steps (Nvidia): #### If you do not have 'Preferred refresh rate' or 'Vertical sync' follow these steps (Nvidia):
1. **Delete the Sekiro Profile in Nvidia Control panel as otherwise it will block all settings from Profile Inspector** 1. **Delete the Sekiro Profile in Nvidia Control panel as otherwise it will block all settings from Profile Inspector**
@ -56,7 +56,7 @@ The game enforces VSYNC and forces 60 Hz in fullscreen even on 144 Hz monitors s
3. Download and extract the [Nvidia Inspector](https://www.techpowerup.com/download/nvidia-inspector/) 3. Download and extract the [Nvidia Inspector](https://www.techpowerup.com/download/nvidia-inspector/)
4. Start the Nvidia Profile Inspector 4. Start the Nvidia Profile Inspector
5. **Check if there already is a profile for Sekiro and if so DELETE IT using the red 'X' button** 5. **Check if there already is a profile for Sekiro and if so DELETE IT using the red 'X' button**
6. Press the yellow start icon in the menu bar to create a new Profile (1) 6. Press the yellow star icon in the menu bar to create a new Profile (1)
7. [![Vertical sync Off and Preferred refresh rate Highest available](https://camo.githubusercontent.com/531be3614b0742e9065f8c2a19df7e31afcdc7ed/68747470733a2f2f692e696d6775722e636f6d2f6f75664a7239632e706e67)](#) 7. [![Vertical sync Off and Preferred refresh rate Highest available](https://camo.githubusercontent.com/531be3614b0742e9065f8c2a19df7e31afcdc7ed/68747470733a2f2f692e696d6775722e636f6d2f6f75664a7239632e706e67)](#)
8. Name it `Sekiro` and select it in dropdown 8. Name it `Sekiro` and select it in dropdown
9. Press the blue window icon with the plus symbol to add an application to this profile (2) 9. Press the blue window icon with the plus symbol to add an application to this profile (2)
@ -128,7 +128,7 @@ The game enforces VSYNC and forces 60 Hz in fullscreen even on 144 Hz monitors s
### Unlocked framerate ### Unlocked framerate
[![Sekiro FPS Unlocker and more](https://camo.githubusercontent.com/2c22eea5a618066716cdd1d45274720814592172/68747470733a2f2f692e696d6775722e636f6d2f534e636b6445732e706e67)](#) [![Sekiro FPS Unlocker and more](https://camo.githubusercontent.com/2c22eea5a618066716cdd1d45274720814592172/68747470733a2f2f692e696d6775722e636f6d2f534e636b6445732e706e67)](#)
### Increased FOV borderless window and 90% game speed: ### Increased FOV, borderless window and 90% game speed
[![FOV increase on the fly and borderless window](https://camo.githubusercontent.com/fbca15acc147937ccc1b98a9fc0850c06cff4476/68747470733a2f2f692e696d6775722e636f6d2f536e6f394e39302e706e67)](#) [![FOV increase on the fly and borderless window](https://camo.githubusercontent.com/fbca15acc147937ccc1b98a9fc0850c06cff4476/68747470733a2f2f692e696d6775722e636f6d2f536e6f394e39302e706e67)](#)
## Prerequisites ## Prerequisites
@ -166,11 +166,14 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
## Version History ## Version History
* v1.1.1 (2019-03-31)
* Fixed topmost for borderless
* v1.1.0 (2019-03-30) * v1.1.0 (2019-03-30)
* Added game speed modifier (thanks to Zullie the Witch#7202 for offset) * Added game speed modifier (thanks to Zullie the Witch#7202 for offset)
* Added player speed modifier (thanks to Zullie the Witch#7202 for offset) * Added player speed modifier (thanks to Zullie the Witch#7202 for offset)
* Custom resolution now support displays down to 1280x720
* Settings are saved and loaded from config file now * Settings are saved and loaded from config file now
* FOV will now stick even after save game load * FOV will now stick even between loads
* Fixed a potential issue with unlimited frame rate unlock * Fixed a potential issue with unlimited frame rate unlock
* Fixed a potential issue when user tried to enable borderless while in minimized fullscreen * Fixed a potential issue when user tried to enable borderless while in minimized fullscreen
* Improved initial load time til game is patchable * Improved initial load time til game is patchable

View file

@ -77,7 +77,6 @@ namespace SekiroFpsUnlockAndMore
{ new byte[1] {0xF0}, 150f } { new byte[1] {0xF0}, 150f }
}; };
internal static byte[] PATCH_FRAMELOCK_SPEED_FIX_DISABLE = new byte[1] { 0x90 }; // 30f internal static byte[] PATCH_FRAMELOCK_SPEED_FIX_DISABLE = new byte[1] { 0x90 }; // 30f
/// <summary> /// <summary>
/// Finds closest valid speed fix value for a frame rate limit. /// Finds closest valid speed fix value for a frame rate limit.
/// </summary> /// </summary>
@ -142,7 +141,9 @@ namespace SekiroFpsUnlockAndMore
internal const string PATTERN_FOVSETTING_MASK = "xxxxxxxx??xx"; internal const string PATTERN_FOVSETTING_MASK = "xxxxxxxx??xx";
internal const int PATTERN_FOVSETTING_OFFSET = 8; internal const int PATTERN_FOVSETTING_OFFSET = 8;
/** /**
00000001430F7C60
Key: Patch to pFovTableEntry last 2 bytes
Value: Value resolve in float table from pFovTableEntry->fFov
*/ */
internal static Dictionary<byte[], string> PATCH_FOVSETTING_MATRIX = new Dictionary<byte[], string> internal static Dictionary<byte[], string> PATCH_FOVSETTING_MATRIX = new Dictionary<byte[], string>
{ {

View file

@ -761,7 +761,7 @@ namespace SekiroFpsUnlockAndMore
private static void SetWindowBorderless(IntPtr hWnd, int width, int height, int posX, int posY, bool demoMode = false) private static void SetWindowBorderless(IntPtr hWnd, int width, int height, int posX, int posY, bool demoMode = false)
{ {
SetWindowLongPtr(hWnd, GWL_STYLE, WS_VISIBLE | WS_POPUP); SetWindowLongPtr(hWnd, GWL_STYLE, WS_VISIBLE | WS_POPUP);
SetWindowPos(hWnd, !demoMode ? HWND_TOPMOST : HWND_NOTOPMOST, posX, posY, width, height, !demoMode ? SWP_FRAMECHANGED | SWP_SHOWWINDOW : SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOACTIVATE); SetWindowPos(hWnd, !demoMode ? HWND_TOP : HWND_NOTOPMOST, posX, posY, width, height, !demoMode ? SWP_FRAMECHANGED | SWP_SHOWWINDOW : SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOACTIVATE);
} }
/// <summary> /// <summary>
@ -1016,7 +1016,6 @@ namespace SekiroFpsUnlockAndMore
private const uint WS_POPUP = 0x80000000; private const uint WS_POPUP = 0x80000000;
private const uint WS_EX_TOPMOST = 0x00000008; private const uint WS_EX_TOPMOST = 0x00000008;
private const int HWND_TOP = 0; private const int HWND_TOP = 0;
private const int HWND_TOPMOST = -1;
private const int HWND_NOTOPMOST = -2; private const int HWND_NOTOPMOST = -2;
private const uint SWP_NOSIZE = 0x0001; private const uint SWP_NOSIZE = 0x0001;
private const uint SWP_NOACTIVATE = 0x0010; private const uint SWP_NOACTIVATE = 0x0010;

View file

@ -28,7 +28,7 @@ namespace SekiroFpsUnlockAndMore
if (lpNumberOfBytesRead.ToInt64() != nSize) if (lpNumberOfBytesRead.ToInt64() != nSize)
throw new Exception("ReadProcessMemory error!"); throw new Exception("ReadProcessMemory error!");
if (bData == null || bData.Length == 0) if (bData == null || bData.Length == 0)
throw new Exception("Could not read memory in FindPattern."); throw new Exception("Could not read memory in PatternScan.");
} }
~PatternScan() ~PatternScan()
@ -38,13 +38,12 @@ namespace SekiroFpsUnlockAndMore
} }
/// <summary> /// <summary>
/// Finds a pattern or signature inside another process's memory. /// Finds a pattern or signature inside initialized process.
/// </summary> /// </summary>
/// <param name="szPattern">A character-delimited string representing the pattern to be found.</param> /// <param name="szPattern">A character-delimited string representing the pattern to be found.</param>
/// <param name="szMask">A string of 'x' (match), '!' (not-match), or '?' (wildcard).</param> /// <param name="szMask">A string of 'x' (match), '!' (not-match), or '?' (wildcard).</param>
/// <param name="cDelimiter">Determines how the string will be split. If null, defaults to ' '.</param> /// <param name="cDelimiter">Determines how the string will be split. If null, defaults to ' '.</param>
/// <returns>The address of the beginning of the pattern if found, 0 if not found</returns> /// <returns>The address of the beginning of the pattern if found, 0 if not found.</returns>
internal Int64 FindPatternInternal(string szPattern, string szMask, char cDelimiter = ' ') internal Int64 FindPatternInternal(string szPattern, string szMask, char cDelimiter = ' ')
{ {
string[] saPattern = szPattern.Split(cDelimiter); string[] saPattern = szPattern.Split(cDelimiter);
@ -89,7 +88,7 @@ namespace SekiroFpsUnlockAndMore
/// <param name="szPattern">A character-delimited string representing the pattern to be found.</param> /// <param name="szPattern">A character-delimited string representing the pattern to be found.</param>
/// <param name="szMask">A string of 'x' (match), '!' (not-match), or '?' (wildcard).</param> /// <param name="szMask">A string of 'x' (match), '!' (not-match), or '?' (wildcard).</param>
/// <param name="cDelimiter">Determines how the string will be split. If null, defaults to ' '.</param> /// <param name="cDelimiter">Determines how the string will be split. If null, defaults to ' '.</param>
/// <returns>The address of the beginning of the pattern if found, 0 if not found</returns> /// <returns>The address of the beginning of the pattern if found, 0 if not found.</returns>
internal static Int64 FindPattern(IntPtr hProcess, ProcessModule pModule, string szPattern, string szMask, char cDelimiter = ' ') internal static Int64 FindPattern(IntPtr hProcess, ProcessModule pModule, string szPattern, string szMask, char cDelimiter = ' ')
{ {
string[] saPattern = szPattern.Split(cDelimiter); string[] saPattern = szPattern.Split(cDelimiter);

View file

@ -21,5 +21,5 @@ using System.Runtime.InteropServices;
ResourceDictionaryLocation.SourceAssembly ResourceDictionaryLocation.SourceAssembly
)] )]
[assembly: AssemblyVersion("1.1.0.0")] [assembly: AssemblyVersion("1.1.0.1")]
[assembly: AssemblyFileVersion("1.1.0.0")] [assembly: AssemblyFileVersion("1.1.0.1")]