don't click here

Level Mappings in Sonic 2 for SMS

Discussion in 'Engineering & Reverse Engineering' started by Ambil, Sep 5, 2005.

Thread Status:
Not open for further replies.
  1. Ambil

    Ambil

    I want that heinous hedgehog hammered! Member
    893
    0
    0
    Spain
    Before start explaining anything, I would really like to thank Hivebrain for his Sonic 2 SMS Hacking Guide in Sonicology -- most all work I've done is based on this guide.

    As I explained in a previous topic, I could directly rip tiles from Underground Zone in S2SMS using Emukon 1.05, a SMS/GG emulator with amazing technical features.

    [​IMG]

    I changed the colors so they can fit to the MegaDrive pallets and yesterday I spent the afternoon creating the 32x32 blocks, as explained in Hivebrain's guide. The result shows like this:

    [​IMG]

    These are the 160 blocks used for UGZ. All stuff in PCX format, along with its ACT pallet file, can be downloaded in this ZIP package.

    The 32x32 blocks are the ones that are directly placed into the level layout. The problem is, how do that? According to Hivebrain's guide, the layout for UGZ act 1 starts at 0x3ADBB, and it starts with the following compressed data:
    Code (Text):
    1. 00 C8 FD 05 D4
    This format is easily decompressed: when you see a FD (compression), ignore it and write the third byte those times that are shown in the second one.
    Code (Text):
    1. 00 C8 D4 D4 D4 D4 D4
    I suppose that in the ROM the layout ends at offset 0x3B720, just because a shitload of $FF's starts there.

    To verify this data I made a MEKA savestate and searched for this hex string. There it is, from offset 0x6D to 0x102E in the savestate.

    This solved, I still have some questions that I can't answer myself with the sources I know. The first is, how are the 32x32 blocks numbered? I doubt they start off from $00, because I see numbers up to $FF and there are only 160 ($A0) of them.

    The other question is about the level size. I checked the level header for UGZ act 1 in the ROM, at offset 0x56FB, the 22 bytes are the following:
    Code (Text):
    1. 0F 80 9D 0E BC AD A8 00 58 FF 98 04 08 00 08 00 00 14 10 02 45 4B                          
    According to the guide, the level is $14 wide and $02 high. But $14 and $02 what? those levels sure don't fit to the tiles. Again I would like your help to solve my doubts.

    RIght now I am about to visit SMS Power! and have a watch to the existing documentation and the next features of the MEKA emulator.

    Thank you for your interest,

    ~Ambil
     
  2. Heran Bago

    Heran Bago

    Ah! It's Puyo battle then. Tech Member
    This seems awesome. I wish I could help, but I'm not really interested in the 8-bit games. The only 8-bit games I've ever poked are Mario Bros., Rainbow Islands, and Bubble Bobble.
     
  3. Neo Majin

    Neo Majin

    Member
    261
    0
    0
    New England / Virginia
    Very little thanks to poor computer access
    On your second question, looking at the header in the ROM for UGZ1 I get this:

    e5 5e 16 00 eb 29 ed 4b 64 d1 09 5e 23 56 3a 74 d1 dd cb 00 56 28 02

    CB wide and 56 height, which seems closer to the real height...
     
  4. Ambil

    Ambil

    I want that heinous hedgehog hammered! Member
    893
    0
    0
    Spain
    Nice try, but you looked at a wrong offset (0x5876, which isn't figured in the guide or the pointers).

    I read Charles MacDonald's VRAM documentation and the width/height values have something to do with the screen size. I think I will post for help at SMS Power forum tomorrow.
     
  5. Neo Majin

    Neo Majin

    Member
    261
    0
    0
    New England / Virginia
    Very little thanks to poor computer access
    I could have sworn that I had gone to the right offset.... and yet looking at the ROM proves I screwed up... Oops...
     
Thread Status:
Not open for further replies.