One of the problems I encountered running Map Detectives: Urban Mystery on Windows 10 was that the game changed the screen resolution to 640×480 and did not restore it upon exiting.
My laptop's natural resolution is 3240×2160 with 200% scaling, so having all my windows and icons rearranged to fit such a small screen size was very annoying.
There are no display options within the game and the
sherston.ini file located next to the game executable had no effect when edited.
All is not lost, however — with a few small edits to the game's executable files these problems can be solved.
Just before I posted this I happened to take another look at the Teacher Options in the game, and there's a 'Whole screen' checkbox right there, which sort of makes this post redundant. Oh well — at least it might help you avoid the initial resolution change… original post follows:
To prevent the screen resolution being changed, patch
xtras/budapi.x32 as follows:
| File offset | RVA | Original byte | Patched byte | |-------------|----------|---------------|--------------| | 0e8b8 | 1000e8b8 | 55 | c3 | | 1514b | 1001514b | 55 | c3 |
This changes the two functions that call
ChangeDisplaySettingsExA to return immediately.
These functions are ultimately called by the exported xtra methods
That stops the resolution change but the game still runs fullscreen which makes referring to it while using other applications awkward. Let's change things so it doesn't go fullscreen!
Fixing this is a bit more involved since the code that creates the game window is located in a DLL that's extracted at runtime. The game attempts to load the DLL and, if it can't do so, proceeds to extract it to a temporary directory and load it from there. All we need to do is grab a copy of that DLL, patch it, and make sure the game can load our patched copy. Easy!
Kill the game after it has switched to fullscreen mode and locate
iml32.dll in a subdirectory of your temporary directory (on my system
this was in
Copy it to the game's directory.
Now patch the following bytes:
| File offset | RVA | Original byte | Patched byte | |-------------|----------|---------------|--------------| | 2755f | 6902755f | 6a | eb | | 27560 | 69027560 | 03 | 07 |
This changes the following code sequence:
; ... ... loc_6902755f: push 03h ; 6A 03 push eax ; 50 call ds:ShowWindow ; FF 15 4C 34 07 69 loc_69027568: lea ecx, [esp+154h+lpWindowName] ; 8D 4C 24 08 ; ... ...
…to skip over the call to
; ... ... loc_6902755f: jmp loc_69027568 ; EB 07 push eax ; 50 call ds:ShowWindow ; FF 15 4C 34 07 69 loc_69027568: lea ecx, [esp+154h+lpWindowName] ; 8D 4C 24 08 ; ... ...