Adventures in Mega Drive Coding Part 1: The Journey Begins

Mega Drive C

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.

Like my stuff?

Be oldschool and sign up for my newsletter to occasionally get more, some of it exclusive! 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. That's not how I do things. And of course you can unsubscribe at any time.

Adventures in Mega Drive Coding Part 2: Tiles

January 19, 2018
Mega Drive C
comments powered by Disqus