GTA1 - crash when changing video mode

Having problems with a specific game or application? Post your problems here!

GTA1 - crash when changing video mode

Postby junglemontana » 2019-7-19 @ 08:24

I found a freeze/crash problem with the original Grand Theft Auto.

When playing, video mode set to 640x480x32, press F11 and choose video mode 800x600x32. Dosbox freezes and audio starts looping. Choosing certain other video modes may also result in a freeze, or sometimes distorted aspect ratio.

If normal core is used, with 64-bit or 32-bit Dosbox, a bunch of messages like "Illegal read from 1018afab, CS:IP 2e0:1018afaa" appears in the console. See attachment. Dosbox can be terminated with Ctrl+C.

If dynamic core is used with 64-bit Dosbox, a core dump is generated when Dosbox is terminated by Ctrl+C. Sometimes Dosbox crashes by itself and core is dumped. I examined one core dump using coredumpctl, please see the attachment.

If dynamic core and 32-bit Dosbox are used, no core dump is generated and no messages seem to appear.


System is Arch Linux, 64-bit. Dosbox is SVN rev. 4252. I used openglnb as video output. Please let me know if there's any other information I should provide.
Attachments
dosbox_gta1_crash_64_dynamic.txt
coredumpctl results when dynamic core was used
(6.82 KiB) Downloaded 9 times
dosbox_gta1_crash_64_normal.txt
Console output when normal core is used
(50.78 KiB) Downloaded 8 times
junglemontana
Newbie
 
Posts: 37
Joined: 2019-2-16 @ 17:37

Re: GTA1 - crash when changing video mode

Postby Qbix » 2019-7-23 @ 10:10

The line mentioned in the crash is probably a corrupt event after switching the videomode. Not really sure what is happening.
Does it always crash at the same line ?
Water flows down the stream
How to ask questions the smart way!
User avatar
Qbix
DOSBox Author
 
Posts: 10893
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: GTA1 - crash when changing video mode

Postby junglemontana » 2019-7-23 @ 10:41

Qbix wrote:The line mentioned in the crash is probably a corrupt event after switching the videomode. Not really sure what is happening.
Does it always crash at the same line ?


Do you mean this:

Code: Select all
Illegal read from 1018afab, CS:IP 2e0:1018afaa


I think it's always the same... I repeated this 3 times, once with 32-bit Dosbox, twice with 64-bit Dosbox, with normal core, and the console output was always the same.


I tried this again with 64-bit Dosbox and dynamic core and this time it crashed by itself. I saw this in the console:

Code: Select all
terminate called after throwing an instance of 'char*'
Aborted (core dumped)


coredumpctl/GDB output is in attachment.
Attachments
dosbox_gta1_crash_64_dynamic_2.txt
coredumpctl output, 64-bit Dosbox, r4252, dynamic core
(6.51 KiB) Downloaded 5 times
junglemontana
Newbie
 
Posts: 37
Joined: 2019-2-16 @ 17:37

Re: GTA1 - crash when changing video mode

Postby jmarsh » 2019-7-23 @ 10:58

junglemontana wrote:I tried this again with 64-bit Dosbox and dynamic core and this time it crashed by itself. I saw this in the console:

Code: Select all
terminate called after throwing an instance of 'char*'
Aborted (core dumped)



This is what happens when a function called from dynamic code throws an exception (unwinding doesn't work properly). Normally this means something has gone wrong and DOSBox was trying to show an error message before quitting (via E_Exit) - the "char*" that it mentions is the error message, but you miss out on seeing what it was unless you're lucky enough to have gdb attached at the time the exception is thrown.
jmarsh
Member
 
Posts: 241
Joined: 2014-1-04 @ 09:17

Re: GTA1 - crash when changing video mode

Postby Qbix » 2019-7-23 @ 11:16

Ah wait, I was looking at the wrong line number. It does show up in throw(0); thought it was the HandleMousemotion line
Water flows down the stream
How to ask questions the smart way!
User avatar
Qbix
DOSBox Author
 
Posts: 10893
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: GTA1 - crash when changing video mode

Postby jmarsh » 2019-7-23 @ 13:13

The "Illegal read from 1018afab, CS:IP 2e0:1018afaa" messages mean execution jumped to an invalid address/unmapped page so DOSBox would be fetching/translating 0xFF instead of valid opcodes.
jmarsh
Member
 
Posts: 241
Joined: 2014-1-04 @ 09:17

Re: GTA1 - crash when changing video mode

Postby ripsaw8080 » 2019-7-23 @ 18:01

If this is with GTA24.EXE (hi-color) then use GTA8.EXE (256 color) instead; the former is prone to crashing, and not the gameplay kind, which appears to be caused by flaws in the game code.
User avatar
ripsaw8080
DOSBox Author
 
Posts: 4395
Joined: 2006-4-25 @ 23:24

Re: GTA1 - crash when changing video mode

Postby junglemontana » 2019-7-23 @ 19:43

ripsaw8080 wrote:If this is with GTA24.EXE (hi-color) then use GTA8.EXE (256 color) instead; the former is prone to crashing, and not the gameplay kind, which appears to be caused by flaws in the game code.


Yes, this is the high-color version.

I'm pretty sure I have occasionally managed to switch to 800x600x32 but I don't remember when exactly. It may have worked with 0.74-2 but I'm not completely sure. Or it may have just worked randomly.

I think the game may successfully use the new video mode if it doesn't crash when it's switched and the game is closed normally. But again, I'm not completely sure. I haven't yet found where the game saves the video mode information when it's closed.
junglemontana
Newbie
 
Posts: 37
Joined: 2019-2-16 @ 17:37

Re: GTA1 - crash when changing video mode

Postby junglemontana » 2019-8-02 @ 13:52

The low-color version works quite well but it doesn't seem to have an option to change the game resolution. It also has a very low in-game resolution.

It suffers from this problem as well, just like the high-color version: viewtopic.php?f=33&t=68120


edit: I tried the GTA London 1969 expansion, and it doesn't seem to crash when switching the resolution. However, some resolutions still cause a distorted aspect ratio. Could this be related to the scaler setting?
junglemontana
Newbie
 
Posts: 37
Joined: 2019-2-16 @ 17:37

Re: GTA1 - crash when changing video mode

Postby FulValBot » 2019-8-03 @ 09:59

With 800x600 GTA1 freeze here too...

I don't know if is a problem of DOSBox 0.74 and all latest versions...


For that scaling problem i suggest to use a multiple of game resolution (for example: if your game use 640x480 try to use 1280x960 in DOSBox settings; for 320x200 games try with 1600x1000 if your have a 1080p display)

set also opengl (NOT openglnb), scaler=normal3x for 320x200 games and scaler=normal2x for 640x480 games


(for this you need also to use GPU scaling and use center scaling or no scaling; DON'T use display scaling)
FulValBot
Newbie
 
Posts: 75
Joined: 2008-3-01 @ 18:43

Re: GTA1 - crash when changing video mode

Postby junglemontana » 2019-8-17 @ 18:47

I tried the high color version (GTA24) in windowed mode, output set to surface, scaler set to none, windowresolution set to original and the aspect ratio problem still occurred so it's not apparently related to any scaling. It's either a bug in Dosbox or in the game. Probably in the game.

The game video mode is 640x480x32 when it's started, setting it to 640x400x16 results in a badly distorted aspect ratio. Also, after setting it to 640x400x16 (distorted), then back to 640x480x32 (normal), then 640x480x16 results in similar distortion. However, I managed to set 640x480x16 without distortion when I set it right after starting the game.

Setting video mode to 640x400x32 caused Dosbox to freeze with looping audio although no distortion occurred. No messages or core dump were generated this time.
junglemontana
Newbie
 
Posts: 37
Joined: 2019-2-16 @ 17:37


Return to DOSBox Games/Apps

Who is online

Users browsing this forum: No registered users and 2 guests