cp $< .od_data/PicoDrive
$(STRIP) .od_data/PicoDrive
-ifneq (,$(filter %__OPENDINGUX__, $(CFLAGS)))
-# "legacy" opendingux without opk support
+ifneq (,$(filter %__DINGUX__, $(CFLAGS)))
+# "legacy" dingux without opk support
$(TARGET)-dge.zip: .od_data
rm -f .od_data/default.*.desktop
cd .od_data && zip -9 -r ../$@ *
all: $(TARGET)-dge.zip
+CFLAGS += -DSDL_SURFACE_SW # some legacy dinguces had bugs in HWSURFACE
else
$(TARGET).opk: .od_data
rm -f .od_data/PicoDrive.dge
all: $(TARGET).opk
endif
-ifneq (,$(filter %__GCW0__ %__RG350__, $(CFLAGS)))
-CFLAGS += -DMIPS_USE_SYNCI # mips32r2 clear_cache uses SYNCI instead of syscall
+ifneq (,$(filter %mips32r2, $(CFLAGS)))
+CFLAGS += -DMIPS_USE_SYNCI # mips32r2 clear_cache uses SYNCI instead of a syscall
endif
OBJS += platform/opendingux/inputmap.o
This is my foray into dynamic recompilation using PicoDrive, a
Megadrive / Genesis / Sega CD / Mega CD / 32X / SMS emulator.
-I added support for MIPS (mips32r1), ARM64 (aarch64) and RISC-V (RV64IM) to the
-SH2 recompiler, as well as spent much effort to optimize the DRC-generated code.
-I also optimized SH2 memory access inside the emulator, and did some work on
-M68K/SH2 CPU synchronization to fix some problems and speed up the emulator.
+I added support for MIPS (mips32r2), ARM64 (armv8), RISC-V (RV64IM) and
+PowerPC (G4/2.03) support to the SH2 recompiler, as well as spent much effort to
+optimize the DRC-generated code. I also optimized SH2 memory access inside the
+emulator, and did some work on M68K/SH2 CPU synchronization to fix some problems
+and speed up the emulator.
It got a bit out of hand. I ended up doing fixes and optimizations all over the
-place, mainly for 32X and CD, 32X graphics handling, and probably some more,
-see the commit history. As a result, 32X emulation speed has improved a lot.
+place, mainly for 32X and CD, graphics handling, sound, and probably some more,
+see the commit history. As a result, 32X emulation speed has improved a lot, a
+lot of bugs were fixed, and some new features (e.g. chd file support) have been
+added.
### compiling
--------|---------|-----------------
gp2x,wiz,caanoo|open2x|CROSS_COMPILE=arm-open2x-linux- CFLAGS="-I$TC/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/include" LDFLAGS="--sysroot $TC/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux -L$TC/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/lib" ./configure --platform=gp2x
gp2x,wiz,caanoo|open2x with ubuntu arm gcc 4.7|CROSS_COMPILE=arm-linux-gnueabi- CFLAGS="-I$TC/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/include" LDFLAGS="-B$TC/gcc-4.1.1-glibc-2.3.6/lib/gcc/arm-open2x-linux/4.1.1 -B$TC/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/lib -L$TC/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/lib" ./configure --platform=gp2x
-opendingux|opendingux|CROSS_COMPILE=mipsel-linux- CFLAGS="-I$TC/usr/include -I$TC/usr/include/SDL" LDFLAGS="--sysroot $TC -L$TC/lib" ./configure --platform=opendingux
-opendingux|opendingux with ubuntu mips gcc 5.4|CROSS_COMPILE=mipsel-linux-gnu- CFLAGS="-I$TC/usr/include -I$TC/usr/include/SDL" LDFLAGS="-B$TC/usr/lib -B$TC/lib -Wl,-rpath-link=$TC/usr/lib -Wl,-rpath-link=$TC/lib" ./configure --platform=opendingux
+dingux|dingux|CROSS_COMPILE=mipsel-linux- CFLAGS="-I$TC/usr/include -I$TC/usr/include/SDL" LDFLAGS="--sysroot $TC -L$TC/lib" ./configure --platform=dingux
+dingux|dingux with ubuntu mips gcc 5.4|CROSS_COMPILE=mipsel-linux-gnu- CFLAGS="-I$TC/usr/include -I$TC/usr/include/SDL" LDFLAGS="-B$TC/usr/lib -B$TC/lib -Wl,-rpath-link=$TC/usr/lib -Wl,-rpath-link=$TC/lib" ./configure --platform=dingux
+retrofw|retrofw|CROSS_COMPILE=mipsel-linux- CFLAGS="-I $TC/include -I $TC/include/SDL -Wno-unused-result" LDFLAGS="--sysroot $TC/mipsel-buildroot-linux-uclibc/sysroot" ./configure --platform=retrofw
gcw0|gcw0|CROSS_COMPILE=mipsel-gcw0-linux-uclibc- CFLAGS="-I$TC/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/include -I$TC/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/include/SDL" LDFLAGS="--sysroot $TC/usr/mipsel-gcw0-linux-uclibc/sysroot" ./configure --platform=gcw0
rg350|rg350|CROSS_COMPILE=mipsel-linux- CFLAGS="-I$TC/usr/include -I$TC/usr/include/SDL" LDFLAGS="--sysroot $TC -L$TC/lib" ./configure --platform=rg350
> make
-### helix MP3 decoder
+### helix MP3 decoder for ARM
For 32 bit ARM platforms, there is the possibility to compile the helix MP3
decoder into a shared library to be able to use MP3 audio files with CD games.
### installing
You need to install the resulting binary onto your device manually.
-For opendingux and gcw0, copy the opk to your SD card.
-For gp2x, wiz and caanoo, the easiest way is to unpack
+For opendingux, gcw0, and rg350, copy the opk to your SD card.
+For gp2x, wiz, and caanoo, the easiest way is to unpack
[PicoDrive_191.zip](http://notaz.gp2x.de/releases/PicoDrive/PicoDrive_191.zip)
on your SD card and replace the PicoDrive binary.
+For legacy dingux, unpack the dge zip and copy the files to your SD card.
Send bug reports, fixes etc to <derkub@gmail.com>
-Kai-Uwe Bloem
# "" means "autodetect".
# TODO this is annoyingly messy. should have platform and device
-platform_list="generic pandora gp2x wiz caanoo opendingux retrofw gcw0 rg350 rpi1 rpi2 psp"
+platform_list="generic pandora gp2x wiz caanoo dingux retrofw gcw0 rg350 opendingux rpi1 rpi2 psp"
platform="generic"
sound_driver_list="oss alsa sdl"
sound_drivers=""
;;
generic)
;;
- opendingux | retrofw | gcw0 | rg350)
+ dingux)
+ # dingoo a320, ritmix rzx-50, the like. all have ingenic MIPS cpus <= JZ4755
+ sound_drivers="sdl"
+ # uses a predecessor of opendingux
+ CFLAGS="$CFLAGS -D__DINGUX__ -march=mips32 -msoft-float"
+ platform="opendingux"
+ ;;
+ retrofw)
+ # devices using retrofw. AFAIK all have ingenic MIPS cpus JZ4760 with fpu
+ sound_drivers="sdl"
+ # uses it's own modified version of opendingux
+ CFLAGS="$CFLAGS -D__RETROFW__ -march=mips32"
+ platform="opendingux"
+ ;;
+ opendingux | gcw0 | rg350)
+ # more modern devices using opendingux, generally using cpus >= JZ4770
sound_drivers="sdl"
# all are more or less based on opendingux. save device type as C define.
- CFLAGS="$CFLAGS -D__`echo $platform | tr '[a-z]' '[A-Z]'`__"
+ CFLAGS="$CFLAGS -D__`echo $platform | tr '[a-z]' '[A-Z]'`__ -march=mips32r2"
platform="opendingux"
;;
pandora)
sound_drivers="oss alsa"
optimize_cortexa8="yes"
have_arm_neon="yes"
+ have_libavcodec="yes"
;;
gp2x | wiz | caanoo)
sound_drivers="oss"
;;
--sound-drivers=*) sound_drivers="$optarg"
;;
+ --with-libavcodec=*) have_libavcodec="$optarg"
+ ;;
*) echo "ERROR: unknown option $opt"; show_help="yes"
;;
esac
echo " available: $platform_list"
echo " --sound-drivers=LIST sound output drivers [guessed]"
echo " available: $sound_driver_list"
+ echo " --with-libavcodec=yes|no use libavcodec for mp3 decoding"
echo "influential environment variables:"
echo " CROSS_COMPILE CC CXX AS STRIP CFLAGS ASFLAGS LDFLAGS LDLIBS"
exit 1
MAIN_LDLIBS="-lpng $MAIN_LDLIBS"
check_libpng || fail "please install libpng (libpng-dev)"
-if check_libavcodec; then
- have_libavcodec="yes"
- # add -ldl if needed
- case "$MAIN_LDLIBS" in
- *"-ldl"*) ;;
- *) MAIN_LDLIBS="-ldl $MAIN_LDLIBS" ;;
- esac
-fi
+case "$have_libavcodec" in
+y|Y|yes)
+ if check_libavcodec; then
+ have_libavcodec="yes"
+ # add -ldl if needed
+ case "$MAIN_LDLIBS" in
+ *"-ldl"*) ;;
+ *) MAIN_LDLIBS="-ldl $MAIN_LDLIBS" ;;
+ esac
+ else
+ have_libavcodec="no"
+ fi ;;
+*) have_libavcodec="no" ;;
+esac
#if check_libchdr; then
# have_libchdr="yes"