GTA2 Classics Stuck at 640×480 (and fix!)
May 22, 2008 on 8:35 pm | In Development, Research |Lately with friends we've been having some multiplayer fun at GTA 2 Classics Edition (the free one that you can download at Rockstar Classics). I'm amazed to see how cool this game still is in multiplayer. BUT, there was a but. As of now it was impossible to make it run at more than 640x480, despite setting higher resolutions on the GTA 2 Manager. While it's not a big issue, it's still annoying nonetheless.
So I've looked and looked and looked and looked on the net to find some kind of answer. While I did find some people who had the same problem as me (and all my friends for that matter), I did not find any answer.
Because I'm not desperate, I've took my tools and started decompiling GTA 2 (;))
Long story short, here is a patch to activate high resolution on GTA 2 Classics Edition (aka 9.6F) only:
gta2patch.exe (7 kb)
Please bear in mind that this patch is VERY ghetto. It doesn't even check if you are patching the right version, so USE AT YOU OWN RISK!
For the details, the source code and the alternate methods (if you don't feel like downloading and launching an executable from an unknown source), hit the jump.
I won't go into big details but it seems at some point the code to detect whether or not your graphic card is capable of handling high resolution screws up decides that it can't and falls back into "safe mode" by setting a flag. For another weird reason, the flag is not set when a registry key is.
Try to set the DWORD key skip_frontend to 1 under HKEY_LOCAL_MACHINE\SOFTWARE\DMA Design Ltd\GTA2\Debug and it should launch the game at high resolution. The problem is, the game fails telling you that it can't open some file. Whatever.
So what did I do, well, I simply patched the fail-safe code, by forcing high-res.
If you want to patch it yourself, take you favorite hex editor and open gta2.exe. Go at offset 0x000CB2C9, and replace 74 1D by EB 1D (forced jmp ftw).
Finally, if you want to compile the patch yourself (some people do I guess!), here is the code! I told you it was ghetto!
-
#include <windows.h>
-
#include <stdio.h>
-
#include <conio.h>
-
-
int main(int argc, char **argv)
-
{
-
char *patchFile = "gta2.exe";
-
char *backupFile = "gta2.original.exe";
-
long patchOffset = 0x000CB2C9;
-
unsigned char patchData[] = "\xEB";
-
-
-
-
getch();
-
-
if (CopyFile((LPCSTR)patchFile, (LPCSTR)backupFile, FALSE) == FALSE)
-
{
-
getch();
-
return (1);
-
}
-
-
FILE *gtaFile = fopen(patchFile, "r+");
-
if (gtaFile == NULL)
-
{
-
getch();
-
return (1);
-
}
-
-
fseek(gtaFile, patchOffset, SEEK_SET);
-
fwrite((const void *)patchData, sizeof(unsigned char), sizeof(patchData) - 1, gtaFile);
-
fclose(gtaFile);
-
-
getch();
-
-
return (0);
-
}
4 Comments »
RSS feed for comments on this post. TrackBack URI
Leave a comment
Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds.
Valid XHTML and CSS. ^Top^
[...] fix for GTA2 only running at 640×480/. [...]
Pingback by GTAMP.com » Blog Archive » GTA2 resolution patch — May 26, 2008 #
Does this patch:
a) switch the resolution to something above 640×480 and stretch everything (ie. different resolution but everything looks the same), or
b) switch the resolution to something above 640×480 and not stretch anything, so we can now see much more of the map than before (ie. the camera is zoomed out)?
Comment by DrSlony — May 29, 2008 #
ps. if it does not let us see more, what do you think about looking for the default camera height and patching that so it zooms out more and we see more? GTA2 was designed obviously for low-res, but nowadays with >23″ screens it would be nice to zoom out and see more and still not have everything irritatingly small, we have screen space for that.
Comment by DrSlony — May 29, 2008 #
Quick and dirty, I like it
Comment by Coca — July 1, 2008 #