configuration changes and README

This commit is contained in:
kub 2019-08-21 18:27:26 +02:00
parent 906a1d1820
commit 0f7a30ede3
11 changed files with 196 additions and 56 deletions

112
README.md Normal file
View file

@ -0,0 +1,112 @@
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) and ARM64 (aarch64) to the recompiler, as
well as spent much effort to optimize the code generated by the DRC.
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 optimzations all over the
place, mainly for 32X and CD, 32X graphics handling, and probably some more,
see the commit history.
### compiling
I mainly worked with standalone PicoDrive versions as created by configure/make.
A list of platforms for which this is possible can be obtained with
> configure --help
If you want to build an executable for a unixoid platform not listed in the
platform list, just use
> configure --platform=generic
If DRC is available for the platform, it should be enabled automatically.
For other platforms using a cross-compiling toolchain I used this,
assuming $TC points to the appropriate cross compile toolchain directory:
platform|toolchain|configure command
--------|---------|-----------------
gp2x,wiz,caanoo|open2x|CROSS_COMPILE=arm-open2x-linux- CFLAGS="-I$TC/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/include -fno-stack-protector -fno-common -finline-limit=42" 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 -fno-stack-protector -fno-common -finline-limit=42 -fipa-pta" 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 -fno-stack-protector -fno-common -finline-limit=42 -fipa-pta" 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 -fno-stack-protector -fno-common -finline-limit=42 -fipa-pta" LDFLAGS="-B$TC/usr/lib -B$TC/lib -Wl,-rpath-link=$TC/usr/lib -Wl,-rpath-link=$TC/lib" ./configure --platform=opendingux
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 -fno-stack-protector -fno-common -finline-limit=42 -fipa-pta" LDFLAGS="--sysroot $TC/usr/mipsel-gcw0-linux-uclibc/sysroot" ./configure --platform=gcw0
For gp2x, wiz, and caanoo you may need to compile libpng first, and additionally
this patch may need to be applied to the cpu/cyclone submodule:
> diff --git a/OpArith.cpp b/OpArith.cpp
> index 96c7e0d..09517b8 100644
> --- a/OpArith.cpp
> +++ b/OpArith.cpp
> @@ -425,7 +425,7 @@ int OpAbcd(int op)
> ot(" add r1,r1,r0\n");
> ot(" add r1,r1,r6\n");
> ot(" mov r12,r1\n");
> - ot(" addhi r12,#6 ;@ Decimal adjust units\n");
> + ot(" addhi r12,r12,#6 ;@ Decimal adjust units\n");
> ot(" tst r1,#0x80\n");
> ot(" orreq r10,r10,#0x10000000 ;@ Undefined V behavior\n");
> ot(" cmp r12,#0x9f\n");
> @@ -452,7 +452,7 @@ int OpAbcd(int op)
> ot(" cmp r1,r12\n");
> ot(" orrlt r10,r10,#0x20000000 ;@ C\n");
> ot(" cmp r1,#0xff\n");
> - ot(" addhi r1,#0xa0\n");
> + ot(" addhi r1,r1,#0xa0\n");
> ot(" sub r12,r1,r12\n");
> ot(" movs r0,r12,lsl #24\n");
> ot(" bicmi r10,r10,#0x10000000 ;@ Undefined V behavior part II\n");
> diff --git a/OpLogic.cpp b/OpLogic.cpp
> index 012e35a..d40d814 100644
> --- a/OpLogic.cpp
> +++ b/OpLogic.cpp
> @@ -74,12 +74,12 @@ const char *TestCond(int m68k_cc, int invert)
> break;
> case 0x0e: // gt
> ot(" eor r0,r10,r10,lsl #3 ;@ gt: !Z && N == V\n");
> - ot(" orrs r0,r10,lsl #1\n");
> + ot(" orrs r0,r0,r10,lsl #1\n");
> cond="pl", icond="mi";
> break;
> case 0x0f: // le
> ot(" eor r0,r10,r10,lsl #3 ;@ le: Z || N != V\n");
> - ot(" orrs r0,r10,lsl #1\n");
> + ot(" orrs r0,r0,r10,lsl #1\n");
> cond="mi", icond="pl";
> break;
> default:
After configure, compile with
> make opk # for opendingux and gcw0
>
> make # for anything else
### helix MP3 decoder
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.
The helix source files aren't supplied because of licensing issues. However, if
you have obtained the sources, put them into the platform/common/helix
directory, set CROSS to your cross compiler prefix (e.g. arm-linux-gnueabi-)
and LIBGCC to your cross compiler's libgcc.a
(e.g. /usr/lib/gcc-cross/arm-linux-gnueabi/4.7/libgcc.a), and compile with
> make -C platform/common/helix CROSS=$CROSS LIBGCC=$LIBGCC
Copy the resulting ${CROSS}helix_mp3.so as libhelix.so to the directory where
the PicoDrive binary is.
### 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
[PicoDrive_191.zip](http://notaz.gp2x.de/releases/PicoDrive/PicoDrive_191.zip)
on you SD card and replace the PicoDrive binary.
Send bug reports, fixes etc to <derkub@gmail.com>
Kai-Uwe Bloem