very interesting problem with dosbox - compile it with gcc and it appears to work fine, compile it with MIPSpro and basically dosbox is unusable. The "mount" command just either doesn't work or it crashes dosbox. neko thread about it
https://web.archive.org/web/201302100909...hp?t=10361
I thought it might be some sort of optimization bug with MIPSpro, but compiling with -O0 makes no difference.
I've been toying around with the MOUNT class in src/dos/dos_programs.cpp and the DOS_Shell::Execute function in src/shell/shell_misc.cpp
but I was not able to find anything that stuck out to me (plus I suck at this) .
Anyone have any ideas how to troubleshoot the MIPSpro build?
Here is how I compiled dosbox 0.74-2 and got the source to be both gcc and MIPSpro happy:
Code:
- needed beta/neko_gmp11-5.0.2-p1.tardist and libFLAC from freeware
- edit src/gui/sdlmain.cpp to remove the SDL_INIT_CDROM from stopping dosbox from starting (this is
probably the only real source edit that needs to be made to get the source to compile using gcc only):
change:
if ( SDL_Init( SDL_INIT_AUDIO|SDL_INIT_VIDEO | /*SDL_INIT_TIMER |*/ SDL_INIT_CDROM
to:
if ( SDL_Init( SDL_INIT_AUDIO|SDL_INIT_VIDEO //| /*SDL_INIT_TIMER |*/ SDL_INIT_CDROM
- after the #includes in src/dos/cdrom_image.cpp, add the below to resolve "dirname" symbol:
#if defined(__sgi)
extern long int lround(double x);
#pragma optional lround
#endif
- line 43 in src/cpu/cpu.cpp change:
"#define CPU_LOG(...)" to "#define CPU_LOG"
- line 33 in include/ipx.h change:
"#define LOG_IPX(...)" to "#define LOG_IPX"
- define and undefine __c99 in src/hardware/mame/emu.h:
#inlude "dosbox.h"
#if defined(_MSC_VER) && (_MSC_VER <= 1500)
#include <SDL.h>
#else
#if defined(__sgi) //added for MIPSpro
#define __c99 //added for MIPSpro
#endif //added for MIPSpro
#include <stdint.h>
#if defined(__sgi) //added for MIPSpro
#undef __c99 //added for MIPSpro
#endif //added for MIPSpro
#endif
#include <math.h>
#include <float.h>
#include <stdlib.h>
#include <memory.h>
############## gcc ##############
export CC=gcc
export CXX=g++
export CFLAGS="-std=gnu99 -g0 -O2 -mips4"
export CXXFLAGS="-g0 -O2 -mips4"
export CPPFLAGS="-I/usr/local/include -I/usr/nekoware/include"
export LDFLAGS=" -L/usr/local/lib -L/usr/local/lib32 -L/usr/nekoware/lib"
export LD_LIBRARYN32_PATH=/usr/local/lib:/usr/local/lib32:/usr/nekoware/lib
./configure -prefix=/usr/local
- add -lgen after libdos.a in src/Makefile to fix "dirname" unresolved symbol:
dosbox_LDADD = cpu/libcpu.a debug/libdebug.a dos/libdos.a -lgen fpu/libfpu.a hardware/libhardware.a gui/libgui.a \
ints/libints.a misc/libmisc.a shell/libshell.a hardware/mame/libmame.a \
hardware/serialport/libserial.a libs/gui_tk/libgui_tk.a
gmake
############## MIPSpro ##############
export CC=cc
export CXX=CC
export CFLAGS="-c99 -g0 -O2 -mips4"
export CXXFLAGS="-g0 -woff all -O2 -mips4"
export CPPFLAGS="-I/usr/local/include -I/usr/nekoware/include"
export LDFLAGS=" -L/usr/local/lib -L/usr/local/lib32 -L/usr/nekoware/lib -L/usr/freeware/lib32"
export LD_LIBRARYN32_PATH=/usr/local/lib:/usr/local/lib32:/usr/nekoware/lib:/usr/freeware/lib32
./configure -prefix=/usr/local
- edit src/Makefile to fix various unresolved symbol:
dosbox_LDADD = cpu/libcpu.a debug/libdebug.a dos/libdos.a -L/usr/lib32 -lgen -lm -lmx fpu/libfpu.a -lm hardware/libhardware.a -lm gui/libgui.a \
ints/libints.a misc/libmisc.a shell/libshell.a hardware/mame/libmame.a \
hardware/serialport/libserial.a libs/gui_tk/libgui_tk.a
-dosbox links the libraries it uses statically, so it uses "ar cru". It appears there is no way to change this from the
./configure script or setting env variables like ./configure AR="CC" ARFLAGS="-ar -o"
-the hard written AR=ar and ARFLAGS=cru is fine for gcc, but it kills MIPSpro, so those flags need to be edited by hand
to read AR=CC and ARFLAGS="-ar -o"
gmake
btw one important point is the default keymapping is broken for IRIX, edit the autogenerated ~.dosbox/dosbox-0.74-2.conf file:
Code:
- need to change "usescancodes=true" to false in dosbox-0.74-2.conf to fix keyboard mapping