Take your skills to the next level with these bite-sized tutorials!

Editing the Rom Header

Posted May 11, 2020

Has this happened to you? You spend days crafting and coding an amazing Pong game for the Mega Drive. You create artistic, beautiful graphics, use highly advanced coding techniques and magical algorithms, and have composed a soundtrack that sounds like Streets of Rage as arranged and conducted by John Williams. Then you compile the game, fire it up in your emulator and see this:

images/sampleheader.png

That just ruins the whole thing, doesn’t it?

But luckily it’s very easy to change the title of your game if you know where to look. And where you need to look is inside your project folder. There you will find a folder named src and inside that, a folder named boot. See that file named rom_head.c? That is where the information is stored that will go in the header of your rom.

The header basically stores meta information about your game, such as the title, release date, copyright information and more. If you simply open rom_head.c in a text editor, you will see all of this information in plain text. All the information is stored in a single struct:

const struct
{
    char console[16];               /* Console Name (16) */
    char copyright[16];             /* Copyright Information (16) */
    char title_local[48];           /* Domestic Name (48) */
    char title_int[48];             /* Overseas Name (48) */
    char serial[14];                /* Serial Number (2, 12) */
    u16 checksum;                   /* Checksum (2) */
    char IOSupport[16];             /* I/O Support (16) */
    u32 rom_start;                  /* ROM Start Address (4) */
    u32 rom_end;                    /* ROM End Address (4) */
    u32 ram_start;                  /* Start of Backup RAM (4) */
    u32 ram_end;                    /* End of Backup RAM (4) */
    char sram_sig[2];               /* "RA" for save ram (2) */
    u16 sram_type;                  /* 0xF820 for save ram on odd bytes (2) */
    u32 sram_start;                 /* SRAM start address - normally 0x200001 (4) */
    u32 sram_end;                   /* SRAM end address - start + 2*sram_size (4) */
    char modem_support[12];         /* Modem Support (24) */
    char notes[40];                 /* Memo (40) */
    char region[16];                /* Country Support (16) */
} rom_header = {
    "SEGA MEGA DRIVE ",
    "(C)FLEMTEAM 2013",
    "SAMPLE PROGRAM                                  ",
    "SAMPLE PROGRAM                                  ",
    "GM 00000000-00",
    0x0000,
    "JD              ",
    0x00000000,
    0x00100000,
    0x00FF0000,
    0x00FFFFFF,
    "  ",
    0x0000,
    0x00200000,
    0x002001FF,
    "            ",
    "DEMONSTRATION PROGRAM                   ",
    "JUE             "
};

And if you change any of the values, they will be incorporated into the rom the next time you compile your project! So if you wanted to change the title of your game that is displayed in the emulator, you would change the third (and fourth) lines of the rom header struct. Be aware however that you cannot exceed the amount of characters reserved for an item. For example, your title_local can only consist of 48 characters, while your copyright note can only be 16 characters long.

So if I change the two instances of SAMPLE PROGRAM to MEGAPONG I will end up with this:

images/realheader.png

Much better! Now the game is fit to be sold on itch.io. (See what I did there?)

And if you want some more information on what each field contains and what values are permissible, check out this great breakdown by Plutiedev.

If you've got problems or questions, join the official SGDK Discord! It's full of people a lot smarter and skilled than me. Of course you're also welcome to just hang out and have fun!

Take It to the Next Level!

Want more tutorials like this one? Want sneak peeks, early access and more? Then consider supporting me on Patreon!

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

Check out the rest of this tutorial series!

  • Creating Graphics for the Mega Drive
  • How to Quickly Generate C Prototype Functions in VSCode
  • Color Swapping
  • 4 Programs For Creating Mega Drive Graphics
  • Editing the Rom Header
  • Simple Game States
  • Creating a Simple Menu
  • Changing The Text Color in SGDK
  • Playing Music in SGDK
  • Converting VGZ to VGM
  • Processing Resets
  • Drawing Tiles From Code
  • Get Words in Your Inbox!

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



    Powered by CleverReach. 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.

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

    comments powered by Disqus

    Related Posts

    HaxeFlixel Tutorials!

    If you’ve popped over to the tutorial section recently you might have noticed that I’ve added my very first HaxeFlixel tutorial! It shows how to implement a simple, pixel-perfect 2D water shader which I used for Go! Go! PogoGirl. But a few of you might be wondering what a HaxeFlixel is. Well, it’s a 2D game framework that is as powerful as it is underrated! It runs on the (also underrated) Haxe language, is extremely well documented, open source, and has built-in functions for almost anything you’d need.
    Read More

    Streets of Was

    As I’m sure many of you will remember, the original Streets of Rage for the Mega Drive had multiple endings. The real canonical ending has you beat the crap out of Mr. X, thereby ending his reign of terror forever (yeah, right). However, if you confronted Mr. X with a buddy in tow, a new possible path unlocked. A quick refresher is in order. When you confront Mr. X he will ask you to join his organization.
    Read More

    Streets of Rage 2 Design Docs

    A few years ago, Yuzo Koshiro posted a pile of old game design documents for Bare Knuckle 2 aka Streets of Rage 2 on the Ancient blog to commemorate the release of Streets of Rage 2 3D on the Nintendo 3DS. These documents gave a deep insight into the game’s inner workings, technical aspects, designs and even some cut content. They were an awesome resource for one of the most awesome games ever created.

    Read More