-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
port patches from SP repo - use clean game.exe
- Loading branch information
1 parent
df78a3e
commit 253eb34
Showing
9 changed files
with
195 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include <windows.h> | ||
#include "TiberianSun.h" | ||
|
||
typedef bool (__stdcall *SetProcessDPIAware_)(); | ||
|
||
void DisableHighDpiScaling() | ||
{ | ||
HMODULE hModule = LoadLibraryA("User32.dll"); | ||
if (hModule) | ||
{ | ||
SetProcessDPIAware_ setProcessDPIAware = (SetProcessDPIAware_)GetProcAddress(hModule, "SetProcessDPIAware"); | ||
if (setProcessDPIAware) | ||
setProcessDPIAware(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include <windows.h> | ||
#include "TiberianSun.h" | ||
|
||
typedef int (__stdcall *SetAppCompatData_)(int index, int data); | ||
|
||
void DisableMaxWindowedMode() | ||
{ | ||
HMODULE hModule = LoadLibraryA("ddraw.dll"); | ||
if (hModule) | ||
{ | ||
SetAppCompatData_ setAppCompatData = (SetAppCompatData_)GetProcAddress(hModule, "SetAppCompatData"); | ||
if (setAppCompatData) | ||
setAppCompatData(12, 0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
%include "macros/patch.inc" | ||
%include "macros/datatypes.inc" | ||
|
||
gbool IsNoCD, true | ||
|
||
hack 0x004754A0, 0x004754A6 | ||
cmp byte[IsNoCD], 1 | ||
jnz .out | ||
xor eax, eax | ||
cmp edi, 1 | ||
jnz .ret | ||
inc eax | ||
.ret: | ||
retn | ||
|
||
.out: | ||
sub esp, 0x148 | ||
jmp hackend | ||
|
||
hack 0x004756E4 | ||
cmp byte[IsNoCD], 1 | ||
jnz .out | ||
cmp eax, dword[0x711A00] | ||
jnz 0x0047578F | ||
jmp 0x004756F2 | ||
|
||
.out: | ||
cmp eax, -1 | ||
jle 0x004756FE | ||
jmp hackend | ||
|
||
hack 0x0047578F, 0x00475795 | ||
cmp byte[IsNoCD], 1 | ||
jnz .out | ||
cmp eax, edi | ||
jnz 0x004756F2 | ||
mov dword[0x711A00], eax | ||
jmp 0x004757AC | ||
|
||
.out: | ||
mov ecx, dword[esp+0x10] | ||
test ecx, ecx | ||
jmp hackend | ||
|
||
hack 0x004AB8FB | ||
cmp byte[IsNoCD], 1 | ||
jnz .out | ||
cmp eax, 3 | ||
jnz 0x004AB91E | ||
jmp hackend | ||
|
||
.out: | ||
cmp eax, 5 | ||
jnz 0x004AB91E | ||
jmp hackend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
%include "macros/patch.inc" | ||
%include "macros/datatypes.inc" | ||
|
||
gbool IsNoCD, true | ||
|
||
hack 0x004754A0, 0x004754A6 | ||
cmp byte[IsNoCD], 1 | ||
jnz .out | ||
cmp edi, 1 | ||
je .is1 | ||
xor edi, edi | ||
.is1: | ||
mov eax, edi | ||
retn | ||
.out: | ||
sub esp, 0x148 | ||
jmp hackend | ||
|
||
hack 0x004756E4 | ||
cmp byte[IsNoCD], 1 | ||
jnz .out | ||
cmp eax, dword[0x711A00] | ||
jne 0x0047578F | ||
jmp 0x004756F2 | ||
|
||
.out: | ||
cmp eax, -1 | ||
jle 0x004756FE | ||
jmp hackend | ||
|
||
hack 0x0047578F, 0x00475795 | ||
cmp byte[IsNoCD], 1 | ||
jnz .out | ||
mov dword[0x711A00], eax | ||
cmp eax, edi | ||
jne 0x004756F2 | ||
jmp 0x004757AC | ||
.out: | ||
mov ecx, dword[esp+0x10] | ||
test ecx, ecx | ||
jmp hackend | ||
|
||
hack 0x004AB8FB | ||
cmp byte[IsNoCD], 1 | ||
jnz .out | ||
cmp eax, 3 | ||
jne 0x004AB91E | ||
jmp hackend | ||
|
||
.out: | ||
cmp eax, 5 | ||
jne 0x004AB91E | ||
jmp hackend | ||
|
||
hack 0x005DB2D4, 0x005DB2DC | ||
cmp byte[IsNoCD], 1 | ||
jnz .out | ||
cmp al, 1 | ||
mov dword[0x7E3EC0], ecx | ||
jne 0x005DB327 | ||
cmp ebx, -1 | ||
je 0x005DB327 | ||
mov eax, dword[0x7E2438] | ||
cmp dword[eax+0x7F8], 1 | ||
jne 0x005DB327 | ||
mov eax, dword[eax+0x1DA4] | ||
mov ecx, dword[0x7E2234] | ||
mov edx, dword[eax*4+ecx] | ||
mov ecx, 0x006FE164 | ||
push 1 | ||
push 1 | ||
push 1 | ||
add ebx, 0x30 | ||
mov byte[ecx+4], bl | ||
or edx, 0xFFFFFFFF | ||
sub ebx, 0x30 | ||
call 0x00563670 | ||
jmp 0x005DB327 | ||
|
||
.out: | ||
cmp al, 1 | ||
mov dword[0x7E3EC0], ecx | ||
jmp hackend |