DOSbox 0.65 for INTeL Macs
I have seen that there was only a PPC version of the DOSbox emulator available for Macs running OSX. Since I now own a Core2Duo Mac (mum is going to get the old G5 iMac) it was the time to change this.
There is some ASM code in the file src/cpu/core_dyn_x86/risc_x86.h that doesn't compile out of the box:
core_dyn_x86/risc_x86.h: In function 'Bits CPU_Core_Dyn_X86_Run()': core_dyn_x86/risc_x86.h:125: error: PIC register '%ebx' clobbered in 'asm' make[4]: *** [core_dyn_x86.o] Error 1
My idiot-approach of fixing stuff like that is removing the words from the code that were quoted in the compilers error message.
This simple solution obviously works here too. So comment out line 125 and write a new one below:
// :"%edx","%ebx","%edi","%esi","cc","memory" :"%edx","%edi","%esi","cc","memory"
After make succeded I built a static binary from inside the src/ folder like this:
g++ -g -O2 -o dosbox dosbox.o cpu/libcpu.a debug/libdebug.a dos/libdos.a \ fpu/libfpu.a hardware/libhardware.a gui/libgui.a ints/libints.a \ misc/libmisc.a shell/libshell.a hardware/serialport/libserial.a \ /opt/local/lib/libSDL_mixer.a \ /opt/local/lib/libSDL_sound.a \ /opt/local/lib/libSDL_net.a \ /opt/local/lib/libmikmod.a \ /opt/local/lib/libmp3lame.a \ /opt/local/lib/libsmpeg.a \ /opt/local/lib/libvorbisenc.a \ /opt/local/lib/libvorbisfile.a \ /opt/local/lib/libvorbis.a \ /opt/local/lib/libogg.a \ /opt/local/lib/libpng.a \ /opt/local/lib/libz.a \ /opt/local/lib/libSDL.a \ /opt/local/lib/libSDLmain.a \ -framework OpenGL \ -framework QuickTime \ -framework AudioUnit \ -framework IOKit \ -framework Cocoa \ -framework Carbon \ -lm
I then took the files from the DOSBox0.65-MacOSX-PPC.dmg distribution, replaced the PPC DosBox binary inside the DosBox.app package with the INTeL one and repacked all into a new .dmg container using Disk Utility.
Update:
Here you can see two screenshots of the mid-90ies DOS classics Terminal Velocity and one of Dark Forces (you can still download the playable demos from a few abandonware websites). My dosbox.conf is still pretty much default and the performance is a little bit disappointing on the 2.16GHz Core2Duo. I set all options inside the game to the max and get like 2-8fps in TV. Dark Forces is running pretty much OK though. It feels just as good as back in the old days on my 486DX40 VESA.
Update:
I was interested in making an universal binary. The docs suggest using both switches -arch ppc -arch i386 at compiletime to achieve this. Since I was using DarwinPorts for the library dependancies this would mean fiddling and recompiling the whole DarwinPorts tree. So I decided to look out for another solution. And there is even one.
There is a tool called lipo that bakes a ppc binary and a i386 together into one universal binary. It is as easy as cream pie.
I got me the DOSBox0.65-MacOSX-PPC.dmg distribution, pulled out the binary from inside DOSBox.app/Contents/MacOS/ and renamed it to dosbox.ppc. The i386 binary that I build was renamed to dosbox.i386. Then I ran the lipo tool:
$ lipo -create -arch ppc dosbox.ppc -arch i386 dosbox.intel -output DosBox
And that's it.
Update:
Too bad that it took me till now to find this webpage.
And this guys port even looks better than mine! It comes with pre defined preferences for the different platforms and has a nice icon aswell.
Update:
I included Paul Aubins patch into my source tree and rebuild the whole thing. I have the slight impression that my build runs a little bit faster. Thats why I took the focus back on my build. I updated the download-link with the new build. I also added a new icon.
Update:
Good news everyone! Even though there have been a few attempts to fix the source code none of them was working 100% - up till now! Some guy added a fix to CVS which not only makes the source compile fine on OSX but also fixes the issues with the dynamic core. I am now able now play Terminal Velocity with all settings to the max on my iMac at high framerates.
Be sure to check out the CVS from 'Oct 12 15:00:00 2006 UTC' - otherwise grab the universal binary distribution here: DOSBox0.65-MacOSX-Universal.dmg.zip
(I used these settings for the INTeL build: -march=nocona -mtune=pentium-m -msse3)
Update:
Here you will find the latest (as of 2006/11/09) CVS build of DosBox. It already includes SDL so you do not have to install any other stuff. Download and run it.. ah yes.. you need an INTeL Mac because this is just the binary - no universal no nothing. Its also an optimized build using the nocona compiler switches. Its very fast - I never saw Dark Forces running so fast in my mid-90ies DOS life.
Click here: DosBoxCVS09.11.2006static.zip
Update:
Thanks to Ryan for giving me a hint that OpenGL wasn't working in the old build. I wasn't aware of this as I already included the –enable-opengl switch but didn't see that the configure script was unable to link libGL (which is correct) and thus did not enable OpenGL at all.
This is a “bug” in the sources because under Mac OSX it should try to link the OpenGL framework instead. Fixed that manualy and did a new static build from todays CVS. A first test was very promising. The fancy scaler modes work way faster now - prolly because they are done in hardware using OpenGL.
Have fun with this one (INTeL only!): DOSBox0.65-INTeL_OpenGL.dmg.zip
Update:
And here is a little extra for the brave ones out there: a dosbox build using a Core2Duo optimized static build of an OpenGL-HQ pimped libSDL! Again this is an INTeL-only build with everything linked in. This one is even missing X11 dependancies (so you don't need to have it installed - I don't know whether this was an issue with the old binary because all my machines have X11 installed). The OpenGL-HQ mode is a little bit broken though.
I am still working on it to make it run stable.




