VOGONS

Common searches


DOSBox 0.70 crashes on me

Topic actions

Reply 21 of 49, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

But what? I also launched dxdiag, and verified that hardware accelleration was on (card is NVIDIA GeForce Go 7800 with somewhat recent drivers: 78.59). Also tried with hw-accelleration off. No change.

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 23 of 49, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

Ran all the SDL-test programs with SDL_VIDEOMODE=directx. No failures in the test-programs, but dosbox crashes.

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 24 of 49, by MiniMax

User metadata
Rank Moderator
Rank
Moderator
gulikoza wrote:

SDL needs some modifications to support ddraw

Re: CVS compile question(s)

I recompled 1.2.11 with

--- SDL_dx5video.c.ORIG Tue Jun 27 05:48:31 2006
+++ SDL_dx5video.c Fri Mar 9 21:15:04 2007
@@ -1489,7 +1489,7 @@
}
}
dd_surface3 = NULL;
-#if 0 /* FIXME: enable this when SDL consistently reports lost surfaces */
+#if 1 /* FIXME: enable this when SDL consistently reports lost surfaces */
if ( (flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
video->flags |= SDL_HWSURFACE;
} else {

but it made no difference.

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 25 of 49, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

But what?

Erm i didn't say it's caused by the hardware acceleration setting. I don't
know why it does that (i would have guessed that the change gulikoza
posted would help, but well) and didn't really bother yet. Qbix's compile
works fine.

Reply 26 of 49, by MiniMax

User metadata
Rank Moderator
Rank
Moderator
MiniMax wrote:

Ran all the SDL-test programs with SDL_VIDEOMODE=directx. No failures in the test-programs, but dosbox crashes.

UPS!!! That was totally wrong. Noticed that it is not SDL_VIDEOMODE, it is SDL_VIDEODRIVER!

Re-did the test with SDL_VIDEODRIVER=directx, and SDL_VIDEODRIVER=ddraw, and now the test-programs that creates windows fails. They don't even show the SDL-window - they just silently dies.

Edit: A stderr.txt file is left saying "Couldn't initialize SDL: No available video device".

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 27 of 49, by gulikoza

User metadata
Rank Oldbie
Rank
Oldbie

SDL_VIDEODRIVER=ddraw does not exist, that's why sdl crashes. directx and windib are the only available options. Why don't you compile in debug mode and check where it crashes? 😀

http://www.si-gamer.net/gulikoza

Reply 28 of 49, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

I will - I am on a steep learning curve here. I have identified 2 points in sdlmain.cpp where SDL_InitSubSystem is being called. I am recompiling now. Will try with ./configure --enable-debug next.

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 29 of 49, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

here are my changes

patch -p1 < sdl11rel.diff

Attachments

  • Filename
    sdl11rel.diff
    File size
    1.61 KiB
    Downloads
    263 downloads
    File comment
    changes
    File license
    Fair use/fair dealing exception

Water flows down the stream
How to ask questions the smart way!

Reply 30 of 49, by MiniMax

User metadata
Rank Moderator
Rank
Moderator
gulikoza wrote:

SDL_VIDEODRIVER=ddraw does not exist, that's why sdl crashes. directx and windib are the only available options. Why don't you compile in debug mode and check where it crashes? 😀

It dies (as expected) in sdlmain.cpp:main(), around line 1379:

#if defined (WIN32) 
#if SDL_VERSION_ATLEAST(1, 2, 10)
sdl.using_windib=true;
#else
sdl.using_windib=false;
#endif
char sdl_drv_name[128];
if (getenv("SDL_VIDEODRIVER")==NULL) {
if (SDL_VideoDriverName(sdl_drv_name,128)!=NULL) {
if (strcmp(sdl_drv_name,"directx")!=0) {
SDL_QuitSubSystem(SDL_INIT_VIDEO);
putenv("SDL_VIDEODRIVER=directx");
/* JBA2 */ if( SDL_InitSubSystem(SDL_INIT_VIDEO) < 0 )
E_Exit("JBA2: Could not initialize SDL: %s",SDL_GetError());
}
sdl.using_windib=false;
}
} else {
char* sdl_videodrv = getenv("SDL_VIDEODRIVER");
if (strcmp(sdl_videodrv,"directx")==0) sdl.using_windib = false;
else if (strcmp(sdl_videodrv,"windib")==0) sdl.using_windib = true;
}
if (SDL_VideoDriverName(sdl_drv_name,128)!=NULL) {
if (strcmp(sdl_drv_name,"windib")==0) LOG_MSG("SDL_Init: Starting up with SDL windib video driver.\n Try to update
your video card and directx drivers!");
}
#endif

with the message:

Exit to error: JBA2: Could not initialize SDL: No available video device

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 31 of 49, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

Added a little debugging output to SDL_video.c:SDL_VideoInit():

for ( i=0; bootstrap[i]; ++i ) {
fprintf( stderr, "JBA3: Checking for driver '%s' against bs[%i]('%s')\n", driver_name, i, bootstrap[i]->name );

if ( SDL_strncmp(bootstrap[i]->name, driver_name,
SDL_strlen(bootstrap[i]->name)) == 0 ) {
if ( bootstrap[i]->available() ) {
video = bootstrap[i]->create(index);
break;
}
}
}
} else {
for ( i=0; bootstrap[i]; ++i ) {
if ( bootstrap[i]->available() ) {
fprintf( stderr, "JBA4: No driver name. First available driver bs[%i]('%s')\n", i, bootstrap[i]->name );

video = bootstrap[i]->create(index);
if ( video != NULL ) {
break;
}
}
}
}

If I explicitly select SDL_VIDEODRIVER=windib, SDL_video.c:SDL_VideoInit succesfully finds the driver in the bootstrap-list:

JBA3: Checking for driver 'windib' against bs[0]('windib')
SDL_Init: Starting up with SDL windib video driver.
Try to update your video card and directx drivers!
CONFIG: Using default settings. Create a configfile to change them
MIDI:Opened device:win32

Selecting directx fails, because the bootstrap[] does not contain a driver with that name:

JBA3: Checking for driver 'directx' against bs[0]('windib')
JBA3: Checking for driver 'directx' against bs[1]('dummy')
Exit to error: Can't init SDL No available video device

Without an SDL_VIDEODRIVER specified, I see something strange:

JBA4: No driver name. First available driver bs[0]('windib')
JBA3: Checking for driver 'directx' against bs[0]('windib')
JBA3: Checking for driver 'directx' against bs[1]('dummy')
Exit to error: JBA2: Could not initialize SDL No available video device

I assume that it is some logic in DOSBox that first calls SDL_VideoInit without a named driver, then checks the returned name (windib), and decides to force directx - which fails.

So the question is: Why is there no directx in my bootstrap[] list?

/me digs deeper into SDL...

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 33 of 49, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

Aha! Thanks gulikoza: Looks like configure don't find ddraw.h:

$ grep ddraw config.log 
configure:20: checking ddraw.h usability
conftest.c:124:19: ddraw.h: No such file or directory
| #include <ddraw.h>
configure:65: checking ddraw.h presence
conftest.c:90:19: ddraw.h: No such file or directory
| #include <ddraw.h>
configure:136: checking for ddraw.h
ac_cv_header_ddraw_h=no

Edit: Looks like this article contains the basics for getting the MS DirectX stuff into my MinGW setup. Guess I need to download, extract, and re-confgure SDL with the headers and libs in pkace.

Found the latest SDK here:
http://msdn.microsoft.com/library/default.asp … tentid=28000410

It will take quite some time for that to download, so this will be the end of tonights debugging session. It has been interesting 😀

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 34 of 49, by MiniMax

User metadata
Rank Moderator
Rank
Moderator
Qbix wrote:

here are my changes

patch -p1 < sdl11rel.diff

I look at those diffs, and here is my interpretation:

SDL_video.c: Switch the order of the WINDIB and DDRAW drivers in the bootstrap-list, so DDRAW comes before WINDIB. But why? What do this accomplish? DDRAW is faster/better/more compatible across Windows platforms?

SDL_dx5events.c: A change to let DOSBox handle all keyinput? It is an ugly way to do it by removing a break, and let the code fall-through to the return(0) . I would have kept with the structure of the original code and added a separate return(0) for WM_SYSKEYUP/DOWN (and - for style - I would have inserted break's after each return(0)'s.

SDL_dx5video.c: I can read the comments as well as anyone else. Is this a particular problem with DOSBox on some platforms, or is it just to prevent problems, should they happen?

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 35 of 49, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I can read the comments as well as anyone else.

Nice, thanks for telling.

DDRAW is faster/better/more compatible across Windows platforms?

The windib driver has some bugs (fullscreen, keyboard) on many pcs.

A change to let DOSBox handle all keyinput?

No, reverting a change.

It is an ugly way to do it by removing a break

No it's not. If you don't like it don't do it.

Reply 36 of 49, by MiniMax

User metadata
Rank Moderator
Rank
Moderator
wd wrote:

A change to let DOSBox handle all keyinput?

No, reverting a change.

So with an unmodified SDL, the SDL-application would get control of the PrtScr/SysRq key on the keyboard? And with DOSBox, that is not desired? If so, why not keep SDL unchanged, accept the event in DOSBox, and pass it back to the window manager?

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 38 of 49, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

Okay - I think I understand the WM_SYSKEY issue now. The standard SDL-1.2.11 correctly passes these SYSKEY-events (e.g. ALT-key, F10, ..) to the Windows window-manager(?) so ordinary SDL/Windows applications will behave like they they always do and focus on the window-menu (with File, Edit, Help, ...) or close the window when ALT-F4 is pressed.

But DOSBox do not want this to happen. It wants full control of ALT, Right-CTRL and similar system-keys. By doing a return(0) SDL is told that there is no special handler for this event, and the application (DOSBos) gets to handle the ALT-key.

This means, that to build and run DOSBox, I need

  1. a modified version of SDL (which explains the path-names listed in Qbix's diffs (SDL-1.2.11rel and SDL-1.2.11 - one for the official release, and one for an DOSBox-adapted version)
  2. to make sure that I don't accidential install the modified SDL.dll in my ordinary build envinronment, e.g. /mingw/bin.

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 39 of 49, by MiniMax

User metadata
Rank Moderator
Rank
Moderator
MiniMax wrote:

SDL_dx5video.c: I can read the comments as well as anyone else. Is this a particular problem with DOSBox on some platforms, or is it just to prevent problems, should they happen?

It was this diff:

-#if 0 /* FIXME: enable this when SDL consistently reports lost surfaces */
+#if 1 /* FIXME: enable this when SDL consistently reports lost surfaces */
if ( (flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
video->flags |= SDL_HWSURFACE;
} else {

Why is this recommended when building SDL for DOSBox?

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32