VOGONS


First post, by Tobis87

User metadata
Rank Newbie
Rank
Newbie

Hi,

I have successful compiled Dosbox in VS2010 as an 64-Bit Application. However it always crashes on start.
Debugging it showed that it always crashes on the following line in src/gui/sdlmain.cpp:

	sdl.surface=SDL_SetVideoMode(640,400,0,0);

Does anyone know what could cause this?
I'm using Windows 7 SP1 x64 right now.

I followed this guide, http://www.dosbox.com/wiki/Building_DOSBox_wi … _C_2008_Express

For the 64-Bit Build I changed the lines in config.h to:

/* The type of cpu this host has */
//#define C_TARGETCPU X86
#define C_TARGETCPU X86_64

/* Define to 1 to use x86 dynamic cpu core */
#define C_DYNAMIC_X86 0

/* Define to 1 to use recompiling cpu core. Can not be used together with the dynamic-x86 core */
#define C_DYNREC 1

/* Enable memory function inlining in */
#define C_CORE_INLINE 1

/* Enable the FPU module, still only for beta testing */
#define C_FPU 1

/* Define to 1 to use a x86 assembly fpu core */
#define C_FPU_X86 0

I have attached the build log of SDL and Dosbox. If necessary I can also upload the binaries tomorrow.

Edit: Success!! I have a working build. 😁
The sdl_64bit_dx patch was needed in combination with SDL 1.2.13.
The compiled SDL 1.2.13 also includes the sdl-win32 and bugfix patch.
The compiled DOSBox 0.74 also includes the dosidle patch.

Attachments

  • Filename
    sdl_64bit_dx.diff
    File size
    1.2 KiB
    Downloads
    646 downloads
    File license
    Fair use/fair dealing exception
  • Filename
    dosbox-0.74-x64.zip
    File size
    1.14 MiB
    Downloads
    1147 downloads
    File license
    Fair use/fair dealing exception
  • Filename
    SDL.log
    File size
    9.66 KiB
    Downloads
    575 downloads
    File license
    Fair use/fair dealing exception
  • Filename
    dosbox.log
    File size
    31.81 KiB
    Downloads
    601 downloads
    File license
    Fair use/fair dealing exception
Last edited by Tobis87 on 2011-09-26, 00:46. Edited 2 times in total.

Reply 2 of 14, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

@Tobis, what wd means with recompiler is that dosbox 64bit will not be as fast as Dosbox 32bit. On OSX 64bit Dosbox is about a tenth of the 32bit Dosbox' speed. So in Dosbox case, a 64bit version is not something that would be nice to have... 😉

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 4 of 14, by Tobis87

User metadata
Rank Newbie
Rank
Newbie

Recompiler won't work, but that's not where it crashes. Check if the sdl examples work.

The sdl examples all seem to work, they don't crash.

I compiled SDL again with debuging symbols and it crashes in /SDL-1.2.14/src/video/windx5/SDL_dx5events.c:

#ifdef WM_ACTIVATEAPP
case WM_ACTIVATEAPP: {
int i, active;

active = (wParam && (GetForegroundWindow() == hwnd));
if ( active ) {
for ( i=0; SDL_DIdev[i]; ++i ) {
-> IDirectInputDevice2_Acquire(
SDL_DIdev[i]);
}
} else {
for ( i=0; SDL_DIdev[i]; ++i ) {
IDirectInputDevice2_Unacquire(
SDL_DIdev[i]);
}
mouse_lost = 1;
}
}
break;
#endif /* WM_ACTIVATEAPP */

Maybe not much of use, but fun to try. However if it crashes it brings the system to a grinding halt.

Reply 6 of 14, by Tobis87

User metadata
Rank Newbie
Rank
Newbie

Sounds like bad graphics card drivers then.

The problem is way more complex than this.

Compiled with SDL-1.2.13:

Windows XP and 7 x64 -

DOSBox version 0.74 […]
Show full quote

DOSBox version 0.74

Copyright 2002-2010 DOSBox Team, published under GNU GPL.

---

Exit to error: Can't init SDL DirectInputDevice::SetDataFormat: Invalid parameters

Compiled with SDL-1.2.14:

Windows XP x64 - It does seem to work.
Windows 7 x64 - It crashes, even if it is started in a virtual machine.

Attached a screenshot of the debugging window and the binaries which seem to work in Windows XP x64

Edit: Removed binaries, since they freeze Windows 7

TpGnB.png

Last edited by Tobis87 on 2011-09-26, 00:21. Edited 1 time in total.

Reply 9 of 14, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

And how is the speed compared to lock stock dosbox 0.74? Good utility to test is the pcp benchmark (that I attached to some post in the forum, you might need to search for that here 😉)
And does dynamic core work? (enter 'core dynamic' on dosbox prompt)

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 10 of 14, by Tobis87

User metadata
Rank Newbie
Rank
Newbie

I ran the benchmark three times and made the average.
However the dynamic core did not work.

Ran in a Windows XP x64 VM:
Win64 normal core 7.3fps
Win32 normal core 9.6fps
Win32 dynamic core 40fps

On my native Ubuntu 10.10 amd64:
ELF-64 normal core 8.7fps
ELF-64 dynamic core 39.1fps

There doesn't seem to be much difference between the Win32 and the ELF-64 dynamic core in terms of speed.
It would really be interesting to see how Win64 would compare to Win32 with a dynamic core.

Reply 11 of 14, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Run a 32bit build on your Ubuntu to make a better comparison (though I don't know wether this works on Linux, I'm just used to OSX).

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 13 of 14, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

the figures look good and quite normal. I used to get about the same for normal core (7-10fps) and about 55fps for dynamic. Strangely with my new imac I now get about 110fps on dynamic core. Either the new CPU is really that more perfomant or Apple did some graphics tuning... (this is with 32bit, I'll see about 64bit now. I remember this being horrible on OS X (0.1fps on normal and 5 or so on dynamic - too lazy to look up the thread 😀)

Edit:Yeah, terrible... 0.3fps normal and 3.2fps on dynamic core 😀
Edit2: with some optimization (-msse -msse2 -force_cpusubtype_ALL) it gets up to 7fps in normal and 33fps in dynamic. Got to keep in mind that there can be some speed gain.

Reply 14 of 14, by Tobis87

User metadata
Rank Newbie
Rank
Newbie
Dominus wrote:

with some optimization (-msse -msse2 -force_cpusubtype_ALL) it gets up to 7fps in normal and 33fps in dynamic. Got to keep in mind that there can be some speed gain.

SSE optimization is very poorly done by the VS compilers, because they can't vectorise.
Anyway I optimized the build with IPO (Interprocedural optimization) also called Whole Program Optimization in VS.
I now get 9.1fps average, which is an speed increase of 25%. 😀

Btw, this is what I get if I want to run the dynamic core:

Eine Ausnahme (erste Chance) bei 0x000007fefd9acacd (KernelBase.dll) in dosbox.exe: Microsoft C++-Ausnahme: char * __ptr64 an Speicherposition 0x0028aa08..

Attachments

  • Filename
    dosbox-0.74-x64-ipo.zip
    File size
    1.19 MiB
    Downloads
    637 downloads
    File license
    Fair use/fair dealing exception