SGDK - A free and open development kit for the Sega Mega Drive
Patreon: https://www.patreon.com/SGDK
Github: https://github.com/Stephane-D/SGDK
SGDK is a free development kit allowing to develop software in C language for the Sega Mega Drive. It contains the development library itself (with the code sources) and some custom tools used to compile resources. SGDK uses the GCC compiler (m68k-elf target) and the libgcc to generate ROM image. Binaries (GCC 6.3) are provided for Windows OS for convenience but you need to install it by yourself for others operating systems. Note that SGDK also requires Java (custom tools need it) so you need to have Java installed on your system.
SGDK library and custom tools are distributed under the MIT license (see license.txt file). GCC compiler and libgcc are under GNU license (GPL3) and any software build from it (as the SGDK library) is under the GCC runtime library exception license (see COPYING.RUNTIME file)
First, you need to know that SGDK uses C language (assembly is also possible but not necessary) so it's highly recommended to be familiar with C programming before trying to develop with SGDK. Learning C language at same time than learning 'Sega Mega Drive' programming is definitely too difficult and you will end nowhere. It's also important to have, at least, a basic knowledge about the Sega Mega Drive hardware (specifically the video system).
Then when you feel ready you can go further and finally install SGDK :)
You can find installation instructions and tutorials about how use SGDK on the wiki:
https://github.com/Stephane-D/SGDK/wiki
Also SGDK comes with a doxygen documentation (generated from .h header files) which provides complete information about SGDK structures and functions description. You can find it in the 'doc' folder (open your local doc/html/files.html in your browser).
Another important point to know is that SGDK heavily relies on resources which are compiled through rescomp tool. You can read the rescomp.txt file to know which kind of resource you can use and how to declare them then you can check the 'sample' folder from SGDK and in particular the sonic sample which is a good showcase of SGDK usage in general (functions and resources).
You can also follow up-to-date and more complete online tutorials as this one (thanks to Ohsat for making them):
https://www.ohsat.com/tutorial/
You also have the great ones from Danibus (spanish only):
https://danibus.wordpress.com/
If you need help or support with SGDK, you can go to the Spritesmind forum which is dedicated to Sega Mega Drive development and has a specific section for SGDK:
http://gendev.spritesmind.net/forum/
You can also join the SGDK Discord server to get support:
https://discord.gg/xmnBWQS
Unix/Linux users should give a try to this very simple script allowing to use SGDK from Wine easily:
https://github.com/Franticware/SGDK_wine
There is also the new and nice solution proposed by Daniel Valdivieso to use SGDK with VSCode under any OS using Wine:
https://github.com/v4ld3r5/sgdkvscodetemplate
Another great alternative is to use the complete MarsDev environment developed by Andy Grind: https://github.com/andwn/marsdev It suppots all OSes, provides SGDK compatibility as well than 32X support so be sure to check it.
MacOSX users also have access to SGDK with Gendev for MacOS from Sonic3D project:
https://github.com/SONIC3D/gendev-macos
A modern way to install it on any environement is to use Docker.
To build the
sgdkbase image:
docker build -t sgdk .
And then to compile the local env, such as
samplesfor example:
cd sample/sonic docker run --rm -v $PWD:/src sgdk
Note:
$PWDwill not work on Windows, there
%CD%has to be used instead.
You can find a Visual Studio template into the 'vstudio' folder to facilate SGDK integration with VS.
To go even further you can also install the VS extension made by zerasul:
https://marketplace.visualstudio.com/items?itemName=zerasul.genesis-code
SGDK is completly free but you can support it on Patreon: https://www.patreon.com/SGDK
Thanks =) I wish you a great and happy coding time !
These projects are known to be based on the SGDK (non-exhaustive list):
Tanzer by Mega Cat Studios
MASIAKA by Resistance
Xeno Crisis by the Bitmap Bureau