Skip to content

Commit

Permalink
new display reset patch
Browse files Browse the repository at this point in the history
  • Loading branch information
skyfloogle committed Dec 5, 2021
1 parent aa0a439 commit 2aeb48d
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 6 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion gm8x_fix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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},
};

Expand Down Expand Up @@ -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];
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions patch_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ typedef enum {
DPLAY,
SCHED,
INPUTLAG,
RESET,
TYPE_COUNT,
} PatchType;

Expand Down
18 changes: 18 additions & 0 deletions patches.c
Original file line number Diff line number Diff line change
Expand Up @@ -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}
};
10 changes: 5 additions & 5 deletions version.rc
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
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
BLOCK "040904E4"
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

Expand Down

0 comments on commit 2aeb48d

Please sign in to comment.