How stephane-d/sgdk works
Project type and purpose
• SGDK is a software development kit (SDK) in C (with some assembly) for writing Sega Mega Drive/Genesis games.
• It comprises three main “layers”:
– The SGDK core library (headers in inc/, sources in src/)
– A suite of resource‐compilation and auxiliary tools (Java- and C/C++-based tools under tools/ and their Windows binaries in bin/)
– Sample projects and a VSCode project template to demonstrate usage.
File structure
• inc/ + src/ → the C/assembly code that implements the SGDK API (graphics, sound, VDP, input, multitasking, memory, etc.).
• tools/ → source code for the custom tools (e.g. rescomp, apj, lz4w, convsym, sjasm, xgmtool, etc.).
• bin/ → prebuilt tool binaries/jars for Windows (Java .jar, .exe).
• lib/ → static libraries (libmd.a, libgcc.a) used at link time.
• project/template/ → a minimal starter project; user copies this to begin a new game.
• sample/ → dozens of example projects illustrating “basics”, “advanced” features, demos, audio tools, multitasking, etc.
• Build scripts & config (makefile.gen, common.mk, CMakeLists.txt, batch files) glue together compilation.
README for additional insights
• SGDK uses the m68k-elf GCC toolchain (targeting the 68000 CPU in the Mega Drive) plus Java for resource tools.
• Resources (images, maps, sprites, sounds) are processed by rescomp and other tools to generate C data arrays.
• The final ROM is produced by linking SGDK library code + user code + generated resource code + libgcc.a.