diff --git a/README.md b/README.md index 1a41314..4678a31 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,14 @@ the OS the program can understand addresses bigger than 2GB. Shoutouts to [these guys](https://iwannacommunity.com/forum/index.php@topic=2308.msg16505.html) for finding that. +## The display reset patch +In all GameMaker 8.1.141 games, when the game loses its Direct3D handle (for +example, through the computer being locked), without any surfaces having been +created, the game will lock up. This patch makes it behave the same as if you +had created and deleted a surface: it will try to get a new handle, then if +that fails, wait for five seconds and try again, and if that fails it will +close. This issue only affects specifically 8.1.141. + ## The DirectPlay patch GameMaker games use DirectPlay for networking, but loading the DirectPlay DLL on newer versions of Windows brings up a prompt because DirectPlay is diff --git a/gm8x_fix.c b/gm8x_fix.c index 50dfc7a..15c5c3f 100644 --- a/gm8x_fix.c +++ b/gm8x_fix.c @@ -53,6 +53,9 @@ Patch patches[] = { {.bytes = dplaypatch_81_141, .name = "GM8.1.141 DirectPlay patch", .type = DPLAY}, {.bytes = schedpatch_81_141, .name = "GM8.1.141 scheduler patch", .type = SCHED}, {.bytes = inputlagpatch_81_141, .name = "GM8.1.141 input lag patch", .type = INPUTLAG}, + + {.bytes = resetpatch_81_141, .name = "GM8.1.141 display reset patch", .type = RESET}, + {.bytes = NULL}, }; @@ -288,6 +291,8 @@ int main(int argc, const char *argv[]) { disable_patches[SCHED] = true; } else if (strcmp(argv[i], "-ni") == 0) { disable_patches[INPUTLAG] = true; + } else if (strcmp(argv[i], "-nr") == 0) { + disable_patches[RESET] = true; } else if (fn == NULL) { // yeah i don't feel like figuring out something better fn = argv[i]; @@ -299,7 +304,7 @@ int main(int argc, const char *argv[]) { valid_args = false; } // funny title - puts("Welcome to gm8x_fix v0.5.4!"); + puts("Welcome to gm8x_fix v0.5.5!"); puts("Source code is at https://github.com/skyfloogle/gm8x_fix under MIT license."); puts("---------------------------------------------------------------------------"); // did the user decide to be a funnyman and disable everything diff --git a/patch_types.h b/patch_types.h index ec434e8..48b90ba 100644 --- a/patch_types.h +++ b/patch_types.h @@ -16,6 +16,7 @@ typedef enum { DPLAY, SCHED, INPUTLAG, + RESET, TYPE_COUNT, } PatchType; diff --git a/patches.c b/patches.c index 1ff62a3..4e41a16 100644 --- a/patches.c +++ b/patches.c @@ -3680,3 +3680,21 @@ PatchByte inputlagpatch_81_141[] = { { 0x206ecc, 0x0, 0xdc }, {-1,0,0} }; + +PatchByte resetpatch_81_141[] = { + { 0x21ee8d, 0xeb, 0xe8 }, + { 0x21ee8e, 0x5, 0x2a }, + { 0x21ee8f, 0xe8, 0xbb }, + { 0x21ee90, 0x28, 0xf4 }, + { 0x21ee91, 0xbb, 0xff }, + { 0x21ee92, 0xf4, 0xa1 }, + { 0x21ee93, 0xff, 0xa0 }, + { 0x21ee94, 0xa1, 0x69 }, + { 0x21ee95, 0x94, 0x68 }, + { 0x21ee96, 0x8a, 0x0 }, + { 0x21ee97, 0x68, 0x85 }, + { 0x21ee98, 0x0, 0xc0 }, + { 0x21ee99, 0x8b, 0x74 }, + { 0x21ee9a, 0x0, 0x4 }, + {-1,0,0} +}; diff --git a/version.rc b/version.rc index ebb6b8d..b92f94c 100644 --- a/version.rc +++ b/version.rc @@ -1,6 +1,6 @@ 1 VERSIONINFO -FILEVERSION 0,5,4,0 -PRODUCTVERSION 0,5,4,0 +FILEVERSION 0,5,5,0 +PRODUCTVERSION 0,5,5,0 BEGIN BLOCK "StringFileInfo" BEGIN @@ -8,12 +8,12 @@ BEGIN BEGIN VALUE "CompanyName", "Floogle @ https://github.com/skyfloogle" VALUE "FileDescription", "gm8x_fix" - VALUE "FileVersion", "0.5.4" + VALUE "FileVersion", "0.5.5" VALUE "InternalName", "gm8x_fix" VALUE "LegalCopyright", "" VALUE "OriginalFilename", "gm8x_fix.exe" - VALUE "ProductName", "gm8x_fix v0.5.4" - VALUE "ProductVersion", "0.5.4" + VALUE "ProductName", "gm8x_fix v0.5.5" + VALUE "ProductVersion", "0.5.5" END END