Sonic 1 SMS Solidity Data

Discussion in 'Engineering & Reverse Engineering' started by chacanger, Nov 12, 2017.

  1. chacanger



    I've recently been looking into hacking Sonic 1 for the SMS, in that time I have noticed that there seems to be a lack of information regarding the solidity data such as "how slopes work", "foreground and background layers" and so forth.

    Kroc Kamen managed to locate the data and the pointers and I've managed to delve a bit deeper into this.

    Within the hacking guide on Sonic Retro, it says that the level headers have something called the Solidity Pointer or SP. The SP value is an index which determines whic solidity pointer to use, these are located from addresses $03A65 - $03A74 I have listed these as follows:

    Code (Text):
    1. SP Index    Address     Description
    2. ----------------------------------------------------------
    3. 0       $3A75 - $3B2C       Green Hill / End Sequence
    4. 1       $3B2D - $3BBC       Bridge
    5. 2       $3BBD - $3C5C       Jungle
    6. 3       $3C5D - $3D0C       Labyrinth
    7. 4       $3D0D - $3DC7       Scrap Brain
    8. 5       $3DC8 - $3EA7       Sky Base Exterior
    9. 6       $3EA8 - $3F27       Special Stage
    10. 7       $3F28 - $3F8F       Sky Base Interior
    A few things I noticed were...
    1. The pointers suggest that there should only be 187 blocks opposed to 192, seeing as the data for the other blocks would cross over into the Sky Base Exterior tileset.
    2. Sky Base Exterior seems to extend to 224 blocks even though there are only 216.

    So with the pointer data, we can see that in most cases (except for SBZ and Sky Base Exterior), there is a byte for each block that determines what solidity to use. I have therfore listed all of the types that are used in the game, note that there are many unused byte values, which are actually different solidity types that were unsued.

    Code (Text):
    1. ID  Description
    2. ----------------------------------------------------------
    3. 00  None
    4. 01  Slope Steep Bottom Down
    5. 02  Slope Steep Top Down
    6. 03  Slope Steep Top Up
    7. 04  Slope Steep Bottom Up
    8. 05  Slope Shallow Top Down
    9. 06  Slope Shallow Middle Down
    10. 07  Slope Shallow Bottom Down
    11. 08  Slope Shallow Bottom Up
    12. 09  Slope Shallow Middle Up
    13. 0A  Slope Shallow Top Up
    14. 0B  Floor Divot Bottom
    15. 0C  Slope Smooth Bottom Down
    16. 0D  Slope Smooth Bottom Up
    17. 0E  Slope Smooth Top Down
    18. 0F  Slope Smooth Top Up
    19. 10  Floor Pass Through
    20. 11  Ski Jump To Right
    21. 12  Floor To Shallow Slope Down
    22. 13  Shallow Slope Up To Floor
    23. 14  Shallow Slope Down To Floor
    24. 15  Floor To Shallow Slope Up
    25. 16  Solid
    26. 17  Floor Divot Top
    27. 18  Shallow Slope Up To Ceiling
    28. 19  Ceiling To Shallow Slope Down
    29. 1A  Ceiling Slope Steep Top Up
    30. 1B  Ceiling Slope Steep Bottom Up
    31. 1C  Ceiling Slope Steep Bottom Down
    32. 1D  Ceiling Slope Steep Top Down
    33. 1E  Ceiling
    34. 1F  Ceiling Slope Shallow Top Down
    35. 20  Ceiling Slope Shallow Middle Down
    36. 21  Ceiling Slope Shallow Bottom Down
    37. 22  Ceiling Slope Shallow Bottom Up
    38. 23  Ceiling Slope Shallow Middle Up
    39. 24  Ceiling Slope Shallow Top Up
    40. 25  Shallow Slope Down To Ceiling
    41. 26  Ceiling To Shallow Slope Up
    42. 27  Floor Solid
    43. 28-7F   **Undocumented**
    44. 80  Area Behind Background
    45. 81-8F   **Undocumented**
    46. 90  Floor Behind Background
    47. 91-95   **Undocumented**
    48. 96  Solid Foreground
    49. 97-9D   **Undocumented**
    50. 9E  Ceiling With Semi Transparent Layer
    51. 9F-A6   **Undocumented**
    52. A7  Floor With Semi Transparent Layer
    53. A8  Raised Floor Platform
    54. A9-FF   **Undocumented**
    Apologies for the naming convention for some of these, it can get a bit difficult to name each one individually seeing as they are very similar.

    I have provided an illustration of Green Hill where you can see the values matching the actual blocks.


    From this you can see that the solidity data determines the type of ground to stand on or behind. But it doesn't determine which tiles have spikes, water slides, springs, bumpers etc. This is still a mystery and I'm unsure where it could be.

    Anyhow I'm not sure if anyone will appreciate this seeing as there aren't many people hacking Sonic 1 SMS.
  2. lordxernom


    Hail Darkness Member
    Tails Adventure LX, Tails Adventure X-L, Sonic Limbo
    I'm interested with Sonic 1 SMS hacking and I love info you've put here! 8-bit Sonic games needs more love. Maybe there's chances for S1 SMS Level/Object Editor in future? (I'm not sure it already exist or not)
  3. nineko


    I am the Holy Cat Tech Member
    The aforementioned Kroc has been working on one, but it's been a while since he last talked about it, he only briefly mentioned it once (plus a second time a couple of weeks later in a certain private subforum), but that was 4 years ago, so I don't know about its current status. Perhaps you guys could help revive the project.
  4. Ravenfreak


    Is actually a guy. Tech Member
    O'Fallon Mo
    Hacking Sonic Drift, Writer at Sonic Cage Dome
    I couldn't get his editor to work on my computer. :\ Also his wife had a child a few years back, and he's working on his own forum software so he doesn't have too much time to work on his Sonic 1 SMS projects it seems. Anyways great work as always chacanger!
  5. chacanger


    Well, I've hit a brick wall , I've been searching for ages trying to find the indexes for special blocks (which are blocks that are used for springs, spikes and conveyor belts). The floor layouts and slope solidity where really easy to find.

    One thing I tried was to find the code that causes Sonic to interact with these special blocks.

    There is a section documented in Krocs disassembly which refers to these 29 addresses within the ROM, after doing some further research they seem to refer to the special blocks code, or how Sonic interacts with them.

    Code (Text):
    1. .dw _54bc, _54c6, _54ce, _550f, _552d, _5556, _5578, _5590
    2. .dw _55a8, _55b6, _55e2, _55eb, _565c, _567c, _56a6, _56b6
    3. .dw _56c6, _56d6, _5761, _5771, _5781, _5791, _57cd, _57f6
    4. .dw _5808, _584b, _5883, _58d0
    I've managed to figure out what some of these refer to and listed them below, ones with "?" are ones I'm not 100% sure of.

    Code (Text):
    1. Address Type
    2. --------------------------------------------------------
    3. 54BC    ?
    4. 54C6    ?Ring?
    5. 54CE    Ski Jump Right
    6. 550F    Left Spring
    7. 552D    Upwards Spring (Right Hand Side)
    8. 5556    Right Spring
    9. 5578    ?
    10. 5590    ?
    11. 55A8    Water / Also applies to water line object.
    12. 55B6    Upwards Spring (Centre)
    13. 5500    Falling Through Part
    14. 55EB    Teleporter
    15. 565C    ?Water?
    16. 567C    ? Includes 568F - ?
    17. 56A6    ?
    18. 56B6    ?
    19. 56C6    ?
    20. 56D6    Round Bumper
    21. 5761    Weak Special Upwards Spring
    22. 5771    Medium Special Upwards Spring
    23. 5781    Strong Special Upwards Spring
    24. 5791    Tall Bumper
    25. 57CD    ?
    26. 57F6    ?
    27. 5808    ?
    28. 584B    ?
    29. 5883    ?
    30. 5893    ?Collapsing Bridge?
    31. 58D0    ?
    I thought, maybe I could figure out if these 29 were the indexes and that I could some how match them with the solidity or block data to determine which blocks were set to springs, spikes etc., unfortunately I couldn't find anything.

    If I knew how this worked I'd probably submit my hack to the SHC2018, but at the moment it''s looking doubtful.