SGDK
A free and open development kit for the Sega Mega Drive
|
Github: https://github.com/Stephane-D/SGDK
Patreon: https://www.patreon.com/SGDK
SGDK is a free development kit allowing development of 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 a ROM image. Binaries (GCC 13.2) are provided for Windows OS for convenience, but you need to install it by yourself for other operating systems (more infos about it in HELP AND SUPPORT section). Note that SGDK also requires Java (custom tools require 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 the 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 as learning 'Sega Mega Drive' programming is definitely too difficult and you will end up getting nowhere. It's also important to have, at least, a basic knowledge of 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
SGDK also comes with an online doxygen documentation (generated from .h header files) which provides descriptions for all SGDK structures and functions:
http://stephane-d.github.io/SGDK/
It's important to know that SGDK heavily relies on resources which are compiled through the rescomp tool. You should read the rescomp.txt file to understand which kind of resources you can use and how to declare them. Then you can look at 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 find a lot of tutorials online about SGDK but be careful, some are outdated and/or they contains errors.
I really recommend starting from the wiki which provides the basics to start.
Then if you need more visual and complete tutorials you can give either of these a try:
MD programming tutorials from Ohsat:
https://www.ohsat.com/tutorial/mdmisc/creating-graphics-for-md/
Very complete and visual tutorials from Danibus (spanish only):
https://danibus.wordpress.com/
Youtube tutorial series from Pigsy:
https://www.youtube.com/watch?v=BnGqc5OTTY4&list=PL1xqkpO_SvY2_rSwHTBIBxXMqmek–GAb
Here's a list of useful tools that will help you to create your assets:
SGDK sound drivers may not fit your needs so it's important to know that some alternatives exist:
If you need help or support with SGDK, you can join the SGDK Discord server:
https://discord.gg/xmnBWQS
You can also 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/
There are several solutions to get SGDK working on Linux, here's a list of some of them:
SGDK doesn't provide anymore any integrated Docker solution as the Doragasu docker solution seems better, faster and simpler to use (native linux compiler):
https://gitlab.com/doragasu/docker-sgdk
Almost everyone now use VSCode editor and the nice extension made by zerasul called Genesis-Code makes SGDK integration even smoother:
https://marketplace.visualstudio.com/items?itemName=zerasul.genesis-code Just install and setup it as it's detailled on the extension page ('GDK/SGDK' and 'Gens' emulator paths mainly) and you're ready to use it :)
You can type Genesis in the command palette (Ctrl+Shift+P shortcut) to see all commands supported by the extension.
SGDK also now integrates a VSCode template located in project/template folder so you can just create a copy of this folder (for instance project/test) and open it in VSCode to start your own project.
Yes you're reading correctly, thanks to Matthew Nimmo you can even now use SGDK from AWS !
Here's the link to his blog which explain how to do that:
https://community.aws/content/2hZInsYwWX8cYEAIFKquutVoYQj/how-to-build-retro-games-in-aws-using-sega-genesis-development-kit-sgdk
SGDK is completly free but you can support it on Patreon: https://www.patreon.com/SGDK
Of course I thank all my patreon for their continuous support but I want to dedicace a very special and warmfull thanks for generous donation from:
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
Demons of Asteborg Neofid Studios