News
Documents
Source Code
Downloads
Message Board


Sega Megadrive Assembly Programming Basics

Copyright, Lewis Bassett, December 2005


Chapter 5 - Sega Megadrive ROM Format

Editors note: This chapter also turned out to be quite long, so I have split it into 4 different sections covering: the ROM header; the interrupt routines; TMSS security code; and padding the ROM.

Now that we have covered the basic hardware, the environment and the basics of assembly language, we can now begin the practical stuff. In this chapter, I'm going to explain how to make a ROM that the Megadrive will run. Before we move on, make sure you've completly read all the chapters so far, and understand them fully.

A Megadrive ROM is simply a binary file of assembled instructions, consisting of a header, some program code and some data (eg, graphics, music, level layouts, etc). However, due to some of the various security and copyright features in the Megadrive, writing a program is not quite as easy as simply assembing some instructions. All Megadrive programs have a particular format that we must adhere to. In the good old days, Sega would have provided developers with lots of template files, code libraries and utilites to format their programs for them. Unfortunatly, we have to do all this ourselves, but it isn't very difficult.

In section 1, I'll show you how to write a Megadrive ROM header.



Chapter 4 - Section 6 Contents Chapter 5 - Section 1


Designed & maintained by Lewis AS Bassett
SEGA, Megadrive, Genesis, Sonic the Hedgehog, etc are all owned by Sega Enterprises Ltd