VOGONS


Building/Compiling DOSBOX Question

Topic actions

First post, by meowser

User metadata
Rank Newbie
Rank
Newbie

Hi!

I was wondering if anyone knows which C++ compiler was used to build the official DOSBOX release.

I did a build with Visual Studio 2008 Pro (VC++ 9.0) a MinGW (GCC) Build and ran off some benchmarks between them as well as the release. The official release is faster for the most part than either of the above. In pretty much all respects, I ran off memory benchmarks, Graphics, Dhrystone, Whetstone etc. Granted I did not get heavy into setting any forms of optimization characteristics other than telling VC++ to optimize for fast code .vs. size.

I have not tried a build under previous versions of Visual C++ or 2010 nor have I tried a build using Intel C++.

I will get around to that sometime and do some benchmarks perhaps I could post.

So does anyone know what compiler was used for the release candidate?

Reply 1 of 23, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

gcc, an pretty old version.
I am sure I posted the flags and maybe even the version a few times on this forum.
So some searching might reveal them.

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

Reply 2 of 23, by meowser

User metadata
Rank Newbie
Rank
Newbie

Hi!

I think I am going to do a full GCC/Dev environment install on a linux machine or maybe just XAMPP it .vs. continuing messin' with MinGW. I also see that Watcom now has their C++ compiler out there for free. Been many years since I used Watcom but it used to produce better code than just about anything else at the time by a significant margin.

I fuddled a bit with VC++ 9's stuff last night and managed to produce a build that's a bit faster than the official release candidate, I just really dislike (dont understand why MS hasnt done something about it!) the runtime deployment issues of VC.

I have not looked at DOSBOX's actual code as of yet. Given its platform independence which clearly was a goal I assume there is nothing in it dealing with multiple core CPU's?

It would really be interesting to isolate cycle munching such as the video related I/O to use a core. Years (I mean years) back I coded a graphics kernel (brother and I) called BLEAM which creamed Fastgraf and numerous others in abilities/speed... Eventually became part of the Atari ST "ST Lightning" etc etc. Once we ported the assembler primitives to the 68K CPU's.

I worked for Atari, Sierra, EMI and others back when game codin' was fun. In fact our line segment code was given to Mike Abrash and ended up in Quake. Never saw a dime from it 😀

Course' back in the DOS Days much slews of code sat based atop the interrupt structure, not shielded from it as things are today with layers of crap atop more layers of crap.

While I dont have time to toy with such things right now if ya'll have some architectural diagrams etc. of DOSBOX (to save me from having to go, "Oh... thats how they did it!" (reverse engineering) I might enjoy playing about to partition "DB" for multi-core's. Without having a clue about DB's current architecture I have no idea how easy or difficult it might be. In reality if one looks at the Quad Core CPU's things could get very interesting!

Look forward to hearing from you.

Reply 3 of 23, by TeaRex

User metadata
Rank Member
Rank
Member

Personally I got executables of DOSBox that were faster than the standard downloadable version when using VC++ Express 2010 and tweaking all the optimization options. The 2010 compiler produces noticeably faster executables than the 2008. The difference is more pronounced when using the interpretive cores than when using the dynamic core of DOSBox, though.

Also you can link the C++ runtime statically, should save you the technical hassles of deployment, though I have no idea whether there are any legal problems with that.

tearex

Reply 4 of 23, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie

I don't think there are any problems with distributing MSVCRT100 statically linked, however, there's an interesting note about that here:
http://msdn.microsoft.com/en-us/library/ms235316.aspx

Reply 5 of 23, by meowser

User metadata
Rank Newbie
Rank
Newbie

I was reading various threads on here and there were a few posts sometime ago stating that dosbox's stability was not as good w/ VC as w/ GCC.

Apparently there are only a handful of people on here that have bothered to toy with DB and VC in any form of serious fashion.

Can anyone make statement towards this?

I dont have to do what I am working on in VS as far as Dosbox's part of it is concerned anyways. The .NET stuff I do but thats essentially independent of DosBox.

Should I just trash bothering to play with VC 9.0 and just go direct to VS 2010? And again, any testament towards stability .vs. a GCC build?

Thanks!

Reply 6 of 23, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

in the past we had problems with VC.
I don't know of problems with new versions.

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

Reply 7 of 23, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie

Unless I'm trying to help someone here with a game I have (not using the official release for that would kind of beat the point, wouldn't it), I use my DosBox built with VC2010 to play any game and haven't had any problems so far, as TeaRex pointed out, I find it faster too. The only problems I've had are present in the official release too: when the PC Speaker beeps the buffer doesn't go silent immediately and Dungeon Keeper won't work; other than that, it's fine.
The 2010 compiler is better than 9.0 all in all, as TeaRex stated, and the end result, at least in my experience, is faster than GCC: I wrote several programs using wxWidgets (in the name of portability) and the Mersenne-Twister algorithm (a nice, fast, pseudo-random generator) and, while they were fast when compiled with GCC (mingw, specifically) they were noticeably faster when compiled with VC2010. DosBox too...

Reply 8 of 23, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author
bloodbat wrote:

The only problems I've had are present in the official release too: ... Dungeon Keeper won't work

Dungeon Keeper most definitely works in the official release.

Reply 9 of 23, by TeaRex

User metadata
Rank Member
Rank
Member

I can only support what bloodbat has said: There was a time when I wouldn't have touched a Microsoft product even with a pair of pincers, but their newer compilers are quite good as regards performace of the compiled code, they beat even GCC 4.5 which is already quite a bit better than older GCC versions for most things I've tried it with. Though they have other things I don't like so much, such as lack of a >64bit long double type.

I didn't have any stability problems with the resulting DOSBox executable either, but then again the number of DOS games that I play more or less regularly isn't all that high - mostly the later Ultimas and early 3D shooters, with the odd 1980s adventure game thrown in once in a while.

tearex

Reply 10 of 23, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie
ripsaw8080 wrote:
bloodbat wrote:

The only problems I've had are present in the official release too: ... Dungeon Keeper won't work

Dungeon Keeper most definitely works in the official release.

Not the Gold version...

Reply 11 of 23, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

DK Gold works fine for me. A problem that often occurs with the Gold version is not finding a volume label of "KDDISK1" from the disc, but I don't recall seeing a post from you about your specific problem, so can't advise better than that.

Reply 12 of 23, by meowser

User metadata
Rank Newbie
Rank
Newbie

Hiya's....

I guess I'll give it a go w/ VS 2010 then rather than continuing on w/ 2008.

I'll download Watcom sometime this week and see what I can make happen with it, as I noted... Watcom C++ is now free and used to be a really good compiler, not sure if it still is.

Thanks for the info.

I dont exactly know where it would be or if I even still have it... But back when we'd authored up Bleam which as I noted was a graphics kernel (and more) which we'd licensed portions of to varied entities the low level prim's for the PC we did not code. Instead we'd bought this library which was just low-level assembler basic primitives for literally every video card that existed for the PC. Our higher level primitives were coded in asm, such as line segments, on and on.

I can do some searching about to see if its still in a box someplace if it'd be of use to the project. As I recall it was like 3 or 4 diskette's and we'd had some update diskettes as new cards released... This was all pre 3DFX etc. But as I said, had all the low level code in asm, draw a pixel, read a pixel, BITBLT, setting res modes, color's blah blah for each card and a wee bit of common interface code to it. If I remember correctly it supported about 100-150 different boards.

Reply 13 of 23, by leileilol

User metadata
Rank l33t++
Rank
l33t++
meowser wrote:

In fact our line segment code was given to Mike Abrash and ended up in Quake. Never saw a dime from it 😀

Elaborate (i.e. which file/function?)? I have a tough time believing this.

Reply 14 of 23, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie
ripsaw8080 wrote:

DK Gold works fine for me. A problem that often occurs with the Gold version is not finding a volume label of "KDDISK1" from the disc, but I don't recall seeing a post from you about your specific problem, so can't advise better than that.

It's in the dosbox games forum...thing is I get a "Can't switch video mode" error.

Reply 16 of 23, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Here's how I install and run DK Gold: default settings in DOSBox 0.74, mount a drive C:, mount the disc image as drive D:, install with SETUP.EXE to C:\KEEPER using the English language choice, choose SB16 and auto configuration, exit install, run the game, it works with no problems.

Bloodbat's screenshot of the install program shows missing text in its menu, a sign that something is not right... perhaps certain files are not found. The "Unable To Change Screen Resolution" error message is contained in DATA\TEXT.DAT, but don't know the conditions under which it might be displayed.

DK uses VESA mode 0x101 for its menu, and mode 0x100 for its main game screen when toggled to hi-res with Alt-R, which should not be a problem for DOSBox with machine=svga_s3. SDD/UNIVBE is not included with the game, and does not appear to be needed.

Reply 18 of 23, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Maybe there are different versions of the game, or maybe you're using an image that has something odd about it. Are you mounting a CUE/BIN image with IMGMOUNT in DOSBox? A couple of things to try: 1) mount the image in Daemon Tools, MOUNT Daemon Tool's virtual drive in DOSBox, and install from that. 2) If you don't have Daemon Tools or don't want to install it, you can copy the entire directory structure of the CD into a folder on your HD and then mount the folder in DOSBox like "MOUNT D C:\DKGOLD -t cdrom -label KDDISK1" and install from that. It will be interesting to see if either of those work when IMGMOUNT does not.

Reply 19 of 23, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie

Yeah, I'm mounting the .cue/bin pair...I'll try your other suggestions.

Fancy that! It does work, install and all if mounted within alcohol 120 and then using the virtual drive as the mount for DosBox.

Thanks 😀