{"id":13407203,"url":"https://github.com/Stephane-D/SGDK","last_synced_at":"2025-03-14T11:31:13.084Z","repository":{"id":28827240,"uuid":"32350744","full_name":"Stephane-D/SGDK","owner":"Stephane-D","description":"SGDK - A free and open development kit for the Sega Mega Drive","archived":false,"fork":false,"pushed_at":"2025-03-10T10:33:21.000Z","size":197850,"stargazers_count":1839,"open_issues_count":27,"forks_count":196,"subscribers_count":146,"default_branch":"master","last_synced_at":"2025-03-10T19:57:00.534Z","etag":null,"topics":["68000","assembly","c","game-development","gcc","java","m68k","m68k-assembly","m68k-elf-gcc","mega-drive","megadrive","motorola-68000","programming","retrodev","sdk","sega","sega-genesis","sega-megadrive","sgdk","sgdk-library"],"latest_commit_sha":null,"homepage":"https://www.patreon.com/SGDK","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Stephane-D.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.txt","contributing":null,"funding":".github/FUNDING.yml","license":"COPYING.RUNTIME","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"Stephane-D","patreon":"SGDK","custom":"https://paypal.me/StephaneDa"}},"created_at":"2015-03-16T20:22:13.000Z","updated_at":"2025-03-10T10:33:25.000Z","dependencies_parsed_at":"2023-02-14T19:45:42.555Z","dependency_job_id":"398c97ed-3bea-4c8d-9e29-52069e34e37e","html_url":"https://github.com/Stephane-D/SGDK","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stephane-D%2FSGDK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stephane-D%2FSGDK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stephane-D%2FSGDK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stephane-D%2FSGDK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Stephane-D","download_url":"https://codeload.github.com/Stephane-D/SGDK/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243521281,"owners_count":20304186,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["68000","assembly","c","game-development","gcc","java","m68k","m68k-assembly","m68k-elf-gcc","mega-drive","megadrive","motorola-68000","programming","retrodev","sdk","sega","sega-genesis","sega-megadrive","sgdk","sgdk-library"],"created_at":"2024-07-30T20:00:29.896Z","updated_at":"2025-03-14T11:31:13.073Z","avatar_url":"https://github.com/Stephane-D.png","language":"C","readme":"# SGDK 2.00 (January 2024)\r\n#### Copyright 2024 Stephane Dallongeville\r\nPatreon: https://www.patreon.com/SGDK\u003cbr\u003e\r\nGithub: https://github.com/Stephane-D/SGDK\r\n\r\n**SGDK** is a free development kit allowing development of software in **C language** for the **Sega Mega Drive**.\r\nIt contains the development library itself (with the code sources) and some custom tools used to compile resources.\r\nSGDK 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.\r\nNote that SGDK also requires Java (custom tools require it), so you need to have Java installed on your system.\r\n\r\nSGDK library and custom tools are distributed under the MIT license (see [license.txt](license.txt) file).\r\nGCC 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](COPYING.RUNTIME) file)\r\n \r\n## GETTING STARTED\r\n\r\nFirst, 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). \r\n\r\n### MEGA DRIVE TECHNICAL INFO REFERENCES\r\n\r\n* And-0 - Awesome Mega Drive Development references:\u003cbr\u003e\r\nhttps://github.com/And-0/awesome-megadrive\r\n* Raster Scroll - Sega Mega Drive Graphics guide:\u003cbr\u003e\r\nhttps://rasterscroll.com/mdgraphics/\r\n* Mega Cat Studios - Sega Mega Drive graphics guide:\u003cbr\u003e\r\nhttps://megacatstudios.com/blogs/retro-development/sega-genesis-mega-drive-vdp-graphics-guide-v1-2a-03-14-17\r\n* Sik's Blog dedicated to MD assembly programming but explain a lot of stuff (and in a nice way) about the Sega Mega Drive hardware:\u003cbr\u003e\r\nhttps://plutiedev.com\r\n* A nice article from Rodrigo Copetti explaining the Mega Drive architecture:\u003cbr\u003e\r\nhttps://www.copetti.org/projects/consoles/mega-drive-genesis\r\n* Genesis Software Manual which contains absolutely everything you need to know about the Sega Mega Drive:\u003cbr\u003e\r\nhttps://segaretro.org/images/a/a2/Genesis_Software_Manual.pdf\r\n\r\n### INSTALLATION AND DOCUMENTATION \r\n\r\nThen when you feel ready you can go further and finally install SGDK :)\r\n\r\nYou can find installation instructions and tutorials about how use SGDK on the wiki:\u003cbr\u003e\r\nhttps://github.com/Stephane-D/SGDK/wiki\r\n\r\nSGDK comes with doxygen documentation (generated from .h header files) which provides descriptions about SGDK structures and functions. You can find it in the _'doc'_ folder (open your local _doc/html/files.html_ in your browser).\r\n\r\nIt's important to know that SGDK heavily relies on _resources_ which are compiled through the _rescomp_ tool. You should read the [rescomp.txt](https://raw.githubusercontent.com/Stephane-D/SGDK/master/bin/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](https://github.com/Stephane-D/SGDK/tree/master/sample/game/sonic) which is a good showcase of SGDK usage in general (functions and resources).\r\n\r\n### OTHERS TUTORIALS\r\n\r\nYou can find a lot of tutorials online about SGDK but be careful, some are outdated or sometimes just wrong.\u003cbr\u003e\r\nI really recommend starting from the [wiki](https://github.com/Stephane-D/SGDK/wiki) which provides the basics to start, but if you need more _visual_ and more complete tutorials you can give either of these a try:\u003cbr\u003e\r\nMD programming tutorials from Ohsat:\u003cbr\u003e\r\nhttps://www.ohsat.com/tutorial/mdmisc/creating-graphics-for-md/\u003cbr\u003e\r\nVery complete and visual tutorials from Danibus (spanish only):\u003cbr\u003e\r\nhttps://danibus.wordpress.com/\u003cbr\u003e\r\n\r\n### USEFUL TOOLS\r\n\r\nHere's a list of useful tools to help you creating your assets:\r\n\r\n#### Pixel art / Sprite\r\n\r\n* [Asesprite](https://www.aseprite.org/)\r\n* [Graphics gale](https://graphicsgale.com/)\r\n* [Pro Motion](https://www.cosmigo.com/)\r\n* [Grafx2](http://grafx2.chez.com/)\r\n* [Palette quantizer](https://rilden.github.io/tiledpalettequant/): powerful tool to convert your image with palette palette constraints\r\n\r\n#### Map / Level\r\n\r\n* [16Tile](https://allone-works.itch.io/16tile): SGDK specific tile map editor\r\n* [Tiled](https://www.mapeditor.org/): Tile map editor, supported by SGDK resource compiler tool\r\n* [LDTK](https://deepnight.net/tools/ldtk-2d-level-editor/): New but powerful tile map editor (support Tiled formats as well)\r\n* [Ogmo](https://ogmo-editor-3.github.io/): Another nice and simple tile map editor\r\n* [Palette merger](https://github.com/bolon667/paletteMergerForSGDK): A tool allowing to easily change tile palette index and priority\r\n\r\n#### Music / sound\r\n\r\n* [Deflemask](https://www.deflemask.com/): music tracker supporting several system as the Sega Mega Drive\r\n* [Furnace](https://github.com/tildearrow/furnace): new music tracker supporting many systems\r\n* [Wavosaur](https://www.wavosaur.com/): wave sound editor (windows only)\r\n* [Audacity](https://www.audacityteam.org/): wave sound editor (all OS)\r\n\r\n#### Alternates sound drivers\r\n\r\nSGDK sound drivers may not fit your needs so it's important to know that some alternatives exist:\r\n* [MDSDRV](https://github.com/superctr/MDSDRV): powerful sound driver support FM \u0026 PSG SFX, pitchable PCM playback...\r\n* [Echo](https://github.com/sikthehedgehog/Echo): another sound driver supporting FM \u0026 PSG SFX and working 100% on Z80 CPU.\r\n* [MiniMusic](https://github.com/sikthehedgehog/minimusic): a tiny Z80 sound driver for Mega Drive that runs entirely off Z80 RAM\r\nand doesn't access the cartridge slot.\r\n \r\n \r\n## HELP AND SUPPORT\r\n\r\nIf you need help or support with SGDK, you can join the SGDK Discord server:\u003cbr\u003e\r\nhttps://discord.gg/xmnBWQS\r\n\r\nYou can also go to the Spritesmind forum which is dedicated to Sega Mega Drive development and has a specific section for SGDK:\u003cbr\u003e\r\nhttp://gendev.spritesmind.net/forum/\r\n \r\n### MACOSX / LINUX\r\n\r\nUnix/Linux users should give this very simple script a try, allowing you to use SGDK from Wine easily:\u003cbr\u003e\r\nhttps://github.com/Franticware/SGDK_wine\r\n\r\nThere is also a new solution proposed by Daniel Valdivieso to use SGDK with VSCode under any OS using Wine:\u003cbr\u003e\r\nhttps://github.com/v4ld3r5/sgdk_vscode_template\r\n\r\nAnother great alternative is to use the complete _MarsDev_ environment developed by Andy Grind:\r\nhttps://github.com/andwn/marsdev\r\nIt supports all OSes, provides SGDK compatibility as well as 32X support, so be sure to check it out.\r\n\r\nMacOSX users also have access to SGDK with Gendev for MacOS from the Sonic3D project:\u003cbr\u003e\r\nhttps://github.com/SONIC3D/gendev-macos\r\n\r\n### DOCKER\r\n\r\n*A modern way to install it on any environement is to use Docker.*\r\n\r\nTo download the `sgdk` base image:\r\n\r\n     docker pull ghcr.io/stephane-d/sgdk\r\n     docker tag ghcr.io/stephane-d/sgdk sgdk\r\n\r\nOr build it:\r\n\r\n     docker build -t ghcr.io/stephane-d/sgdk-m68k-gcc:latest -f deps/gcc.Dockerfile deps/\r\n     docker build -t sgdk .\r\n\r\nAnd then to compile the local env, such as `samples` for example:\r\n\r\n    cd sample/game/sonic\r\n    docker run --rm -v \"$PWD\":/src sgdk\r\n\r\nNotes:\r\n\r\n- `$PWD` will not work on Windows, `%CD%` has to be used instead.\r\n- To avoid writing `./out` files as root, execute the docker command as current user:\r\n  `docker run --rm -v \"$PWD\":/src -u $(id -u):$(id -g) sgdk`\r\n- You can also try the alternate Doragasu docker solution which uses a native linux compiler (much faster):\r\n  https://gitlab.com/doragasu/docker-sgdk\r\n \r\n### AWS\r\n\r\nYes you're reading correctly, thanks to Matthew Nimmo you can even now use SGDK from AWS ^^\r\nHere's the link to his blog which explain how to do that:\r\nhttps://community.aws/content/2hZInsYwWX8cYEAIFKquutVoYQj/how-to-build-retro-games-in-aws-using-sega-genesis-development-kit-sgdk\r\n\r\n### VISUAL STUDIO\r\n\r\nYou can find a Visual Studio template in the 'vstudio' folder to facilate SGDK integration with VS.\r\nOr, to take it even further, you can also install the VS extension made by zerasul:\u003cbr\u003e\r\nhttps://marketplace.visualstudio.com/items?itemName=zerasul.genesis-code\r\n \r\n## SUPPORT SGDK\r\n\r\nSGDK is completly free but you can support it on Patreon: https://www.patreon.com/SGDK\r\n\r\n## THANKS\r\n\r\n- Doragasu for the multi-tasking engine (based on Sik implementation), MegaWifi, flash save support and others nice additions.\r\n- Sik for the multi-tasking base implementation and for all its unvaluable Plutidev Sega Mega Drive technical information source. \r\n- Chilly Willy for making almost all the JOY / controller support in SGDK (and the joy test sample ^^).\r\n- Vladikcomper for the powerful error handler capable of displaying human readable backtrace informations :)\r\n- Astrofra for the starfield donut sample and the revamped readme ;)\r\n- Gligli for building and providing GCC 6.3 for Windows.\r\n- Gunpog for making the 'cute' SGDK logo.\r\n- Adrian Spoz for making the 'profesionnal' SGDK logo.\r\n- Vojtěch Salajka for the script allowing to use SGDK easily from Wine (Linux/Unix but may work on OSX too).\r\n- Daniel Valdivieso for another Wine based solution to use SGDK on multi-OS (including a VSCode template).\r\n- Andy Grind for the MarsDev project allowing to use SGDK on any OS and also supporting 32X dev.\r\n- Kubilus for the GenDev Linux port of SGDK.\r\n- Sonic3D for the GenDev OSX port of SGDK.\r\n- Vladimir Kryvian for Visual Studio support and template.\r\n- Steve Schnepp for Docker support.\r\n- Andreas Dietrich for the nice Wobbler \u0026 scaling effect samples.\r\n- clbr for various contributions.\r\n- jgyllinsky for providing / improving build batches.\r\n- nolddor for fixes / contributions.\r\n- starling13 for fixes.\r\n- davidgf for its contributions (improved assembly LTO optimization).\r\n- ShiningBzh / Jeremy and Kentosama for their precious help in testing.\r\n- Vetea and Studio Vetea Discord people in general for their support and kindness.\r\n- all those I forgot and generally all people who contributed in any form to SGDK !\r\n\r\n## SPECIAL THANKS\r\n\r\nOf 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:\r\n\r\n- Bitmap Bureau (Xeno Crisis team)\r\n- Neofid Studios (Demons of Asteborg team)\r\n- Dmitry (D I)\r\n- Rajen Savjani\r\n\r\n## POWERED BY THE SGDK!\r\n\r\nThese projects are known to be based on the SGDK _(non-exhaustive list)_:\r\n\r\n![alt text](doc/img/game_tanzer.gif)\r\n \r\nTanzer by [Mega Cat Studios](https://megacatstudios.com/products/tanzer-sega-genesis)\r\n\r\n![alt text](doc/img/demo_masiaka.gif)\r\n \r\nMASIAKA by [Resistance](https://www.pouet.net/prod.php?which=71543)\r\n\r\n![alt text](doc/img/game_xenocrisis.gif)\r\n \r\nXeno Crisis by the [Bitmap Bureau](https://www.bitmapbureau.com/)\r\n\r\n![alt text](doc/img/game_doa.gif)\r\n \r\nDemons of Asteborg [Neofid Studios](https://neofid-studios.com/)\r\n\r\n### Random list of SGDK-powered games and demos\r\n\r\n* [2048](https://github.com/atamurad/sega-2048) by atamurad\r\n* [Abbaye des Morts (l')](https://playonretro.itch.io/labbaye-des-morts-megadrivegenesis-por-002) unofficial MD port by Moon-Watcher\r\n* [Art of LeonBli (the)](https://www.pouet.net/prod.php?which=72272) by Resistance\r\n* [Barbarian](https://www.youtube.com/watch?v=e8IIfNLXzAU) unofficial MD port by Z-Team\r\n* [Demons of Asteborg](https://demonsofasteborg.com/) by Neofid Studio\r\n* [Devwill Too MD](https://amaweks.itch.io/devwill-too-md) by Amaweks\r\n* [Fatal Smarties](https://globalgamejam.org/2016/games/fatal-smarties) made for the GGJ 2016\r\n* [Fullscreen NICCC 2000](https://www.pouet.net/prod.php?which=81136) by Resistance\r\n* [IK+ Deluxe](https://www.youtube.com/watch?v=mcm0TRsOwuw) unofficial MD port by Z-Team\r\n* [Irena](https://white-ninja.itch.io/irena-genesis-metal-fury) by White Ninja Studio\r\n* [Omega Blast](https://nendo16.jimdofree.com/omega-blast/) by Nendo\r\n* [Perlin \u0026 Pinpin](https://lizardrive.itch.io/perlin-pinpin-episode1) by Lizardrive\r\n* [Right 2 Repair](https://supermegabyte.itch.io/right-2-repair) by Super Megabyte made for the GGJ 2020\r\n* [Return to Genesis](https://www.youtube.com/watch?v=jjy0Iz_64dY) unofficial MD port by Z-Team\r\n* [Road to Valhalla](https://www.pouet.net/prod.php?which=72961) by Bounty/Banana \u0026 Resistance\r\n* [Spiral (the)](https://www.pouet.net/prod.php?which=82607) by Resistance\r\n* [TCK](https://www.cursed-knight.fr/cursed-knight-fr.php) by GGS Studio Creation\r\n* [Tetris MD](https://github.com/NeroJin/TetrisMD) unofficial MD port by Nero Jin\r\n* [ThunderCats MD](https://github.com/mxfolken/thundercats_megadrive) by Rolando Fernández Benavidez.\r\n* [Travel](https://www.pouet.net/prod.php?which=65975) by Resistance\r\n* [Wacky Willy Weiner Sausage Surfer](https://globalgamejam.org/2017/games/wacky-willy-weiner-sausage-surfer) made for the GGJ 2017\r\n","funding_links":["https://github.com/sponsors/Stephane-D","https://patreon.com/SGDK","https://paypal.me/StephaneDa","https://www.patreon.com/SGDK"],"categories":["Uncategorized","Sega Genesis","Programming"],"sub_categories":["Uncategorized","\u003ca name = \"retro-sega-genesis-devkit\"\u003e\u003c/a\u003eDevkit","Frameworks and Compilers"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStephane-D%2FSGDK","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FStephane-D%2FSGDK","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStephane-D%2FSGDK/lists"}