Adventures in Mega Drive Coding Part 1: The Journey Begins

Mega Drive C

WARNING: These are outdated and obsolete! Instad check out the new >tutorial section<. There you'll learn everything you could here but better!

Note: These are not tutorials, I'm just chronicling my progress as I figure stuff out. Some of the things I do might make an experienced Mega Drive coder cry out in anguish. Feel free to use these posts to guide yourself along, but be aware I might be leading you off a cliff!

Well, let’s do this! As I mentioned in my New Year’s resolutions I intend to have created a game running on the Mega Drive by the end of the year, even if it is a crummy one. And since that’s a prospect that has excited me ever since I was a kid, I decided to just get the ball rolling sooner rather than later. And to spice things up a little I will blog about every step of my journey right here! So if you’ve ever been interested in programming for the Mega Drive or a retro console in general, make sure to stop by regularly to see how it is done…and most likely how it should not be done as well. It’s not like I really know what I’m doing after all.

To ease into things I will be working with SGDK, a free dev kit that allows you to write Mega Drive code in C rather than Assembly. While I would love to work in Assembly I feel like it would be too much of a hurdle to overcome at this point in time, especially since I can’t focus all my energy on it. And it literally only took me a few seconds to code, compile and run my first Mega Drive program using SGDK, so…yeah, I’m sticking with that for the beginning to get a general feel for the hardware and how programming for it works.


What a game, it’s so taxing it’s not even running at 60fps. The goal is to read the text before you get bored. I call it a read ‘em up.

Kidding aside though, it felt strangely exhilarating to get something running on the Mega Drive. My 6-year old self would probably high five me before calling the police. And thanks to SGDK it really wasn’t that hard to do. The line that worked the magic was this one:

VDP_drawText("Hello MD World!", 10, 13);

The VDP is the Video Display Processor and using VDP_drawText tells it to put a string of text on the screen. The coordinates are given in tiles by the way, not pixels, but more on that in the next post.

While I can’t say how much time this project will actually take, I will have some type of game running by the end of the year and I’ve decided to document each step of my journey there. Why not join me, if you have nothing better to do?

If there are any questions or things you are curious about, don’t hesitate to let me know! I want this series to be interesting and useful to you, so the more feedback you can give me the better.

Check out the rest of this series!

  • Adventures in Mega Drive Coding Part 1: The Journey Begins
  • Adventures in Mega Drive Coding Part 2: Tiles
  • Adventures in Mega Drive Coding Part 3: Importing Graphics
  • Adventures in Mega Drive Coding Part 4: More Tiles
  • Adventures in Mega Drive Coding Part 5: Palettes and Splitting Tiles
  • Adventures in Mega Drive Coding Part 6: Enter Sprites
  • Adventures in Mega Drive Coding Part 7: Handling Input
  • Take It to the Next Level!

    Want to boost your Mega Drive coding skills? Get exclusive bonus steps and project files for each tutorial by supporting me on Patreon!

    Become a Patron!
    Just Want to Buy Me a Coffee?

    Get Words in Your Inbox!

    Be oldschool and sign up for my newsletter to occasionally get updates and ramblings! Just enter your email address, prove you're not part of Skynet and you're good to go!

    I will not send you spam or sell/give your email address to someone else.  You can of course unsubscribe at any time. By clicking the subscribe button above, you confirm that you have read and agreed to our privacy policy.

    New SGDK Tutorial: Megarunner!

    November 4, 2019
    Mega Drive Ramblings

    Tutorials and Patreon!

    September 2, 2019
    Mega Drive Ramblings

    Adventures in Mega Drive Coding Part 7: Handling Input

    December 19, 2018
    Mega Drive C

    By using the Disqus service you confirm that you have read and agreed to the privacy policy.

    comments powered by Disqus