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:


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 = {
    "(C)FLEMTEAM 2013",
    "SAMPLE PROGRAM                                  ",
    "SAMPLE PROGRAM                                  ",
    "GM 00000000-00",
    "JD              ",
    "  ",
    "            ",
    "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:


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 have any questions, comments or criticism, post them in the comments below or reach out to me on Twitter @ohsat_games! Special thanks to Stephane Dallongeville for creating SGDK and everyone in the SGDK Discord for their help and keeping the dream alive!

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?

Check out the rest of this tutorial series!

  • Creating Graphics for the Mega Drive
  • 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

    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

    Make a Space Shooter for the Mega Drive!

    It’s time for another SGDK tutorial series! After doing a single player Pong game and an endless runner, it’s time to reach for the stars… and make a space shooter! Apart from things like scrolling and animating sprites, this new series will show you how to deal with multiple entities and their collisions, how to randomly generate backgrounds and more! This project builds upon the previous tutorials, so if you’re new to SGDK programming and have not done those yet, I highly recommend starting with Megapong.
    Read More

    Patreon Revamps

    Hey there, what’s up? Things are continuing to evolve, as I’ve now updated my Patreon to give patrons more perks! Apart from early access to new tutorials and posts, the biggest one is probably the ability to peek behind the scenes…and there will be a lot to peek at in the coming months! This year I’m writing and submitting my MA thesis, meaning that I will have to do more stuff to make ends meet.
    Read More