News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

MDS' Micro-compendium

Started by MultiDarkSamuses, December 10, 2020, 02:42:03 PM

Previous topic - Next topic

MultiDarkSamuses

For a while I've been talking about doing some work with Metroid 2, and this week I finally started. Quite a few people have, over the past 4+ years, spent a decent chunk of time documenting the game, disassembling routines, and overall helping newcomers figure out the game. I have decided to join in, starting on designing a tool specifically to rip sprites out of the game. I know there are already tools for ripping sprites and tiles out of GameBoy games, however I haven't found any specifically regarding Metroid 2 and I feel this work will shape the way for injecting new sprites into the game.

So far I've managed to write a script that can rip out sprite tiles from the game. My next goal is using the spritesets in the game to generate full sprites and go from there. From what I can tell, the documentation on how this is done specifically is lacking. What I know is the formatting for spritesets, tile data, and a general idea of assembling sprites. However, what I don't know is how the game puts those tiles into VRAM, since knowing the order of tiles is necessary to actually use the spritesets.

I will keep this post updated with my own work on Metroid 2, right now primarily focusing on ripping sprites.

Anna

 :yay:if you practice patience you can do it be patient and I support you the power is in you go on developing this game :) practice patient that all :)

RT-55J

Enemies sprite tiles are loaded by the screen transition scripts. The tiles are loaded to 0x8B00 in VRAM (corresponding to sprite tiles 192-255 IIRC). Technically speaking, the tiles can come from any location in the ROM, but according to my (very dusty) notes the only the following offsets are used:

    0x19920 : 'gfxSPRpg1',
    0x19D20 : 'gfxSPRpg2',
    0x1A120 : 'gfxSPRpg3',
    0x1A520 : 'gfxSPRpg4',
    0x1A920 : 'gfxSPRpg5',
    0x1AD20 : 'gfxSPRpg6',
    0x1B120 : 'gfxSPRarchanus',
    0x1B520 : 'gfxSPRsurface',   
    0x219BC : 'gfxSPRalpha',
    0x21DBC : 'gfxSPRgamma',
    0x221BC : 'gfxSPRzeta',
    0x225BC : 'gfxSPRomega',
    0x239BC : 'gfxSPRqueen'


(Note that the landing site and metroid queen tilesets take advantage of the fact that sprites and BG share the upper half of their tiles.)

IIRC item sprites are handled differently.

MultiDarkSamuses

Quote from: RT-55J on December 11, 2020, 09:58:10 PM
Enemies sprite tiles are loaded by the screen transition scripts. The tiles are loaded to 0x8B00 in VRAM (corresponding to sprite tiles 192-255 IIRC). Technically speaking, the tiles can come from any location in the ROM, but according to my (very dusty) notes the only the following offsets are used:

    0x19920 : 'gfxSPRpg1',
    0x19D20 : 'gfxSPRpg2',
    0x1A120 : 'gfxSPRpg3',
    0x1A520 : 'gfxSPRpg4',
    0x1A920 : 'gfxSPRpg5',
    0x1AD20 : 'gfxSPRpg6',
    0x1B120 : 'gfxSPRarchanus',
    0x1B520 : 'gfxSPRsurface',   
    0x219BC : 'gfxSPRalpha',
    0x21DBC : 'gfxSPRgamma',
    0x221BC : 'gfxSPRzeta',
    0x225BC : 'gfxSPRomega',
    0x239BC : 'gfxSPRqueen'


(Note that the landing site and metroid queen tilesets take advantage of the fact that sprites and BG share the upper half of their tiles.)

IIRC item sprites are handled differently.

Good to know. Right now, for testing purposes, I'm just trying to work on Samus facing forward. I think I've almost got it down, but a bug in my BitMap manager messed up about 2 hours of work so all my testing and code has to be redone so I can compare results (hopefully I fixed my BitMap manager...). I'll keep this in mind once I get to working with more complex sprites like enemies, or Samus' different poses. Not 100% certain how I'm gonna handle that, honestly.