I'm trying to compile SNES9x 1.51 using PS2 toolchain (please, see the WIP Makefile I'm using at the end of this post), and I'm getting the following internal compiler error:
Code: Select all
ee-g++ -D_EE -O2 -G0 -Wall -D_EE -O2 -G0 -Wall -DCPU_SHUTDOWN -DSPC700_SHUTDOWN -DNO_INLINE_SET_GET -DNOASM -DNEW_COLOUR_BLENDING -DZLIB -DRIGHTSHIFT_int8_IS_SAR -DRIGHTSHIFT_int16_IS_SAR -DRIGHTSHIFT_int32_IS_SAR -DRIGHTSHIFT_int64_IS_SAR -DRIGHTSHIFT_IS_SAR -DNOSOUND -DSPC700_C -DUNZIP_SUPPORT -DJMA_SUPPORT -DSDD1_DECOMP -DCORRECT_VRAM_READS -I/usr/local/ps2dev/ps2sdk/ee/include -I/usr/local/ps2dev/ps2sdk/common/include -I. -I/usr/local/ps2dev/ps2sdk/sbv/include -I/usr/local/ps2dev/ps2sdk/ports/include -I/usr/local/ps2dev/gsKit/include -I. -I./unzip -c soundux.cpp -o soundux.o
soundux.cpp: In function `void S9xSetSoundFrequency(int, int)':
soundux.cpp:734: insn does not satisfy its constraints:
(insn 155 37 157 (set (reg:DI 2 v0)
(ashiftrt:DI (reg:DI 66 accum)
(const_int 32 [0x20]))) 216 {ashrdi3_internal4} (nil)
(nil))
soundux.cpp:734: Internal compiler error in reload_cse_simplify_operands, at
reload1.c:8338
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
make: *** [soundux.o] Error 1
If I remove soundux.o from the objects list inside Makefile (and make some corrections [comments] inside file /usr/local/ps2dev/ee/include/c++/3.2.2/cstdio) I got to compile all objects, but it fails when linking (undefined reference).
I tried this in cygwin and MinGW. So what do y ou guys think? Forget about trying to bring a new SNES emulator for PS2? C++ for PS2 won't support its compilation process?
Here is the Makefile I'm using (it's pretty hacky, it's a WIP Makefile :P):
Code: Select all
EE_BIN = SNES9X.ELF
#ZSNESFX=1
#ZSNESC4=1
#NETPLAY=1
UNZIP=1
JMA=1
#GLIDE=1
#OPENGL=1
#AIDO=1
#GUI=0
#THREAD_SOUND=1
#ASMKREED=1
SDD1_DECOMP=1
CORRECT_VRAM_READS=1
#DREAMCAST=1
CHEATS=1
2XSAI=0
ifdef ZSNESFX
FXOBJ=$(CPU)/fxemu2b.o $(CPU)/fxemu2.o $(CPU)/fxemu2c.o $(CPU)/fxtable.o $(CPU)/sfxproc.o $(CPU)/ZSNES.O
FXDEFINES=-DZSNES_FX -DEXECUTE_SUPERFX_PER_LINE
FXDEPENDS=zsnes_fx
FXNO_DEPENDS=c_fx
else
FXOBJ=fxinst.o fxemu.o fxdbg.o
FXDEFINES=
FXDEPENDS=c_fx
FXNO_DEPENDS=zsnes_fx
endif
ifdef ZSNESC4
C4OBJ=$(CPU)/C4.O $(CPU)/zsnesc4.o c4.o
C4DEFINES=-DZSNES_C4
C4DEPENDS=zsnes_c4
C4NO_DEPENDS=c_c4
else
C4OBJ=c4.o c4emu.o
C4DEFINES=
C4DEPENDS=c_c4
C4NO_DEPENDS=zsnes_c4
endif
SOUNDOBJ=spc700.o apu.o soundux.o
SOUNDDEFINES=-DSPC700_C
ifdef ASMCPU
CPUOBJ=$(CPU)/cpuops.o $(CPU)/cpuexec.o $(CPU)/sa1ops.o
else
CPUOBJ=cpuops.o cpuexec.o sa1cpu.o
endif
ifdef CHEATS
CHEATOBJ=cheats.o cheats2.o
endif
ifdef 2XSAI
ifdef ASMKREED
KREEDOBJ=$(CPU)/2XSAIMMX.O $(CPU)/bilinear.o 2xsai.o
KREEDDEFINES=-DMMX
else
KREEDOBJ=2xsai.o
endif
endif
ifdef SDD1_DECOMP
SDD1OBJ=sdd1emu.o
ifdef SDD1_VERIFY
SDD1DEFINES=-DSDD1_DECOMP -DSDD1_VERIFY
else
SDD1DEFINES=-DSDD1_DECOMP
endif
endif
ifdef CORRECT_VRAM_READS
CORRVRAMDEFINES=-DCORRECT_VRAM_READS
endif
SPC7110OBJ=spc7110.o
OBC1OBJ=obc1.o
SETAOBJ=seta.o seta010.o seta011.o seta018.o
EE_OBJS=$(CPUOBJ) $(SOUNDOBJ) apudebug.o $(FXOBJ) $(C4OBJ) \
crosshairs.o controls.o cpu.o sa1.o debug.o sdd1.o tile.o srtc.o gfx.o \
memmap.o clip.o dsp1.o ppu.o dma.o snes9x.o data.o globals.o reader.o \
conffile.o bsx.o logger.o \
$(SPC7110OBJ) $(OBC1OBJ) $(SETAOBJ) $(KREEDOBJ) $(SDD1OBJ) \
$(CHEATOBJ) $(PLATFORMOBJ) $(SNAPOBJ) $(SCREENSHOTOBJ) $(MOVIEOBJ)
ifdef UNZIP
OBJECTS += loadzip.o unzip/unzip.o unzip/explode.o unzip/unreduce.o unzip/unshrink.o
UNZIPDEFINES=-DUNZIP_SUPPORT
endif
ifdef JMA
OBJECTS += jma/s9x-jma.o jma/7zlzma.o jma/crc32.o jma/iiostrm.o jma/inbyte.o jma/jma.o jma/lzma.o jma/lzmadec.o jma/winout.o
JMADEFINES = -DJMA_SUPPORT
endif
ifdef THREAD_SOUND
CPUDEFINES += -DUSE_THREADS
EXTRALIBS += -lpthread
endif
ifdef GLIDE
GLIDEOBJS = unix/glide.o
GLIDEDEFINES = -DUSE_GLIDE -I/usr/include/glide
GLIDELIBS = -lglide2x
endif
ifdef OPENGL
OPENGLOBJS = unix/opengl.o
OPENGLDEFINES = -DUSE_OPENGL
OPENGLLIBS = -lGL -lGLU -ldl
endif
ifdef AIDO
AIDOOBJS = unix/aido.o
AIDODEFINES = -DUSE_AIDO
endif
JOYDEFINES =
#ifdef DREAMCAST
#CCC = sh-elf-c++ -fno-rtti
#CC = sh-elf-gcc
#NASM = fail
#GASM = fail
#else
#CCC = $(EE_CXX) #g++ -fno-rtti
#CC = $(EE_CC) #gcc
#NASM = not_found
#GASM = $(EE_CXX) #g++
#endif
##INCLUDES = -I../zlib -INONE
#ifdef DREAMCAST
#INCLUDES = -Idc
#DEFS = -DDC
#else
#INCLUDES = $(EE_INCS) #-INONE
##DEFS = #-DMITSHM
#endif
#INCLUDES += -I. -Iunzip
#ifdef DREAMCAST
#OPTIMISE=-O4 -ffreestanding -ffast-math -fschedule-insns2 -fomit-frame-pointer -fno-inline-functions -fno-defer-pop -fforce-addr -fstrict-aliasing -funroll-loops -fdelete-null-pointer-checks -fno-exceptions
#CPUFLAGS=-ml -m4-single-only
#else
#OPTIMISE = -D_EE -O2 -G0 -Wall $(EE_CFLAGS) #-O2 -fomit-frame-pointer -fno-exceptions -Wall -W -pedantic -Wno-unused-parameter -pipe
#endif
EE_CFLAGS += \
-DCPU_SHUTDOWN \
-DSPC700_SHUTDOWN \
-DNO_INLINE_SET_GET -DNOASM -DNEW_COLOUR_BLENDING -DZLIB -DRIGHTSHIFT_int8_IS_SAR -DRIGHTSHIFT_int16_IS_SAR -DRIGHTSHIFT_int32_IS_SAR -DRIGHTSHIFT_int64_IS_SAR -DRIGHTSHIFT_IS_SAR -DNOSOUND \
$(FXDEFINES) \
$(C4DEFINES) \
$(CPUDEFINES) \
$(SOUNDDEFINES) \
$(NETPLAYDEFINES) \
$(UNZIPDEFINES) \
$(JMADEFINES) \
$(GLIDEDEFINES) \
$(OPENGLDEFINES) \
$(AIDODEFINES) \
$(KREEDDEFINES) \
$(SDD1DEFINES) \
$(CORRVRAMDEFINES)
#EE_CFLAGS += $(DEFS)
#EE_CXXFLAGS += $(EE_CFLAGS)
EE_CXXFLAGS += $(EE_CFLAGS)
EE_INCS = -I$(PS2SDK)/sbv/include -I$(PS2SDK)/ports/include -I$(PS2DEV)/gsKit/include -I. -I./unzip
EE_LDFLAGS = -L$(PS2DEV)/gskit/lib -L$(PS2DEV)/ps2sdk/ports/lib -s
EE_LIBS = -lgskit -ldmakit -ljpg -lpng -lz -lm -lfileXio -lhdd -lmc -lpadx -laudsrv -lpoweroff -lpatches -ldebug -lcdvdfs
#.SUFFIXES: .o .cpp .c .cc .h .m .i .S .asm .obj .O .CPP .C .ASM
#ifdef ASMCPU
#OFFSET=offsets
#else
#OFFSET=
#endif
#
#offsets: offsets.o
# $(CCC) $(INCLUDES) -o $@ offsets.o
# ./offsets >$(CPU)/offsets.h
#snes9x: $(OBJECTS) #$(AIDOOBJS) $(OFFSET)
# $(CCC) $(INCLUDES) -o $@ $(OBJECTS) #$(AIDOOBJS) $(GLIDEOBJS) $(OPENGLOBJS) $(LDLIBS) $(GLIDELIBS) $(OPENGLLIBS)
all: $(EE_BIN)
ee-strip $(EE_BIN)
#jma/s9x-jma.o: jma/s9x-jma.cpp
# $(CCC) $(INCLUDES) -c $(CCFLAGS) -fexceptions $*.cpp -o $@
#jma/7zlzma.o: jma/7zlzma.cpp
# $(CCC) $(INCLUDES) -c $(CCFLAGS) -fexceptions $*.cpp -o $@
#jma/crc32.o: jma/crc32.cpp
# $(CCC) $(INCLUDES) -c $(CCFLAGS) -fexceptions $*.cpp -o $@
#jma/iiostrm.o: jma/iiostrm.cpp
# $(CCC) $(INCLUDES) -c $(CCFLAGS) -fexceptions $*.cpp -o $@
#jma/inbyte.o: jma/inbyte.cpp
# $(CCC) $(INCLUDES) -c $(CCFLAGS) -fexceptions $*.cpp -o $@
#jma/jma.o: jma/jma.cpp
# $(CCC) $(INCLUDES) -c $(CCFLAGS) -fexceptions $*.cpp -o $@
#jma/lzma.o: jma/lzma.cpp
# $(CCC) $(INCLUDES) -c $(CCFLAGS) -fexceptions $*.cpp -o $@
#jma/lzmadec.o: jma/lzmadec.cpp
# $(CCC) $(INCLUDES) -c $(CCFLAGS) -fexceptions $*.cpp -o $@
#jma/winout.o: jma/winout.cpp
# $(CCC) $(INCLUDES) -c $(CCFLAGS) -fexceptions $*.cpp -o $@
#
#.cpp.o:
# $(CCC) $(INCLUDES) -c $(CCFLAGS) $*.cpp -o $@
#
#.c.o:
# $(CC) $(INCLUDES) -c $(CCFLAGS) $*.c -o $@
#
#.cpp.S:
# $(GASM) $(INCLUDES) -S $(CCFLAGS) $*.cpp -o $@
#
#.cpp.i:
# $(GASM) $(INCLUDES) -E $(CCFLAGS) $*.cpp -o $@
#
#.S.o:
# $(GASM) $(INCLUDES) -c $(CCFLAGS) $*.S -o $@
#
#.S.i:
# $(GASM) $(INCLUDES) -c -E $(CCFLAGS) $*.S -o $@
#
#.s.o:
# @echo Compiling $*.s
# sh-elf-as -little $*.s -o $@
#
#.asm.o:
# $(NASM) -f elf -DELF $(FXDEFINES) -i. -ii386 -o $@ $*.asm
#
#.obj.o:
# cp $*.obj $*.o
#
#.CPP.O:
# $(CCC) $(INCLUDES) -c $(CCFLAGS) -x c++ $*.CPP -o $@
#
#.C.O:
# $(CC) $(INCLUDES) -c $(CCFLAGS) $*.C -o $@
#
#.ASM.O:
# $(NASM) -f elf -DELF $(FXDEFINES) -i . -i i386 $*.ASM -o $@
#
clean:
rm -f *.o
include $(PS2SDK)/samples/Makefile.pref
include $(PS2SDK)/samples/Makefile.eeglobal_cpp
Code: Select all
#define LSB_FIRST
//#if defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__x86_64__) || defined(__WIN32__) || defined(__alpha__)
//#define LSB_FIRST
//#define FAST_LSB_WORD_ACCESS
//#else
//#define MSB_FIRST
//#endif
bootsector