This is for linux. The SH2 toolchain is gcc from KPIT, and the 68000 toolchain is gcc from the uclinux project. You can get a Windows toolchain for the SH2 from KPIT, but you'd need a Windows 68000 assembler like asmx to get this devkit working in Windows. I leave that to the reader as an exercise. :D
Just copy the gendev directory from the archive to wherever you keep your toolchains (usually /usr/local). You'll need a couple exports:
Code: Select all
export GENDEV=/usr/local/gendev
export PATH=$GENDEV/sh2/bin:$GENDEV/m68k/bin:$GENDEV/bin:$PATH
The makefile assembles the two m68k files into binary, then compiles all the rest, linking the result into a binary suitable to running with your 32X emulator. The entry for your code is main(), just like normal. If you wish to use the second SH2 in your program, comment out the _slave function in sh2_crt0.s, then add a slave() entry in your code.
One of the funny things about the KPIT toolchain for the SH2 is you can't compile the code as SH2. It seems when they built the toolchain, they enabled hardware floating point for all SH2 variants, not just the A and E variants. As such, you have to compile as SH1. The toolchain included here includes the SH1 libraries. You can still do SH2 specific code via inline assembly or separate assembly files.
The debug code should look familiar - it's based on the PSP homebrew SDK debug code. It's VERY handy for seeing whats going on in the 32X. It could also be used for simple interfaces like people often do on the PSP. One issue is the SH libraries don't seem to do varargs properly, so don't use Debug32xScreenPrintf() - sprintf to a string and use Debug32xScreenPuts() instead.
DevKit32X-20090203.7z