don't click here

Everything That I Know About Sonic the Hedgehog's Source Code

Discussion in 'General Sonic Discussion' started by Clownacy, Mar 30, 2022.

  1. Kilo

    Kilo

    Starting new projects every week Tech Member
    1,209
    1,159
    93
    Canada
    Changes with the weather
    Seems like a case of interchangeable terms, with both chunks and levels being referred to as maps... Which definitely makes things annoying.
     
  2. Devon

    Devon

    La mer va embrassé moi et délivré moi lakay. Tech Member
    1,485
    1,810
    93
    your mom
    I don't think it's unheard of, honestly, because there's "waterflag", the flag for when the water palette takes up the entire screen, and then "water_flag", the water events routine ID.
     
  3. Kilo

    Kilo

    Starting new projects every week Tech Member
    1,209
    1,159
    93
    Canada
    Changes with the weather
    It's been a hot minute (2 months) but I did a massive update to our wiki page on the source code. Just variables. Still need to add disassembly equivalents, and a couple variables pertaining to scrolling may be wrong? I did what I could though.
     
    • Like Like x 1
    • Informative Informative x 1
    • List
  4. Devon

    Devon

    La mer va embrassé moi et délivré moi lakay. Tech Member
    1,485
    1,810
    93
    your mom
    scrh_flag and scrv_flag enable autoscrolling for their respective axis. I previously stated that they disabled scrolling, but I had misread the code and made an edit to reflect the actual functionality. I also think "lpcolorwk" should just be "colorwk", because "lp" is a prefix used in Win32 applications to indicate a pointer (it stands for "long pointer", which is only really called that to distinguish 32-bit pointers from 16-bit pointers from the old Win16 API).
     
  5. Kilo

    Kilo

    Starting new projects every week Tech Member
    1,209
    1,159
    93
    Canada
    Changes with the weather
    Went ahead and corrected both of those. Wasn't too sure on the lp thing, I also thought colorwk would make more sense, but better to go off of what is there than what isn't.
     
  6. Devon

    Devon

    La mer va embrassé moi et délivré moi lakay. Tech Member
    1,485
    1,810
    93
    your mom
    You also got colorwk and colorwk2 backwards.
     
  7. Kilo

    Kilo

    Starting new projects every week Tech Member
    1,209
    1,159
    93
    Canada
    Changes with the weather
    Also fixed. Do you have a wiki account? I feel like you could be chipping in too here. Not forcing you of course but I'd recommend it.
     
  8. Devon

    Devon

    La mer va embrassé moi et délivré moi lakay. Tech Member
    1,485
    1,810
    93
    your mom
    I do, but I'm currently not in a position to edit the wiki right now.
     
    • Informative Informative x 1
    • List
  9. Kilo

    Kilo

    Starting new projects every week Tech Member
    1,209
    1,159
    93
    Canada
    Changes with the weather
    In today's wiki page update
    - Put a list of what disassemblies I'm referencing for the equivalents boxes.
    - Added images to actors where I could. I'm currently just using images that were already uploaded to the wiki. But I'll have to upload more later.
    - Added some disassembly equivalents needed from my last update.
    - Added a section to Sonic 1 for special stage blocks.
    - Started on Sonic CD's actors table, but it's just the flower so far, lol.
    Tomorrow's goal is going to be to add more to the global functions list.
     
  10. Devon

    Devon

    La mer va embrassé moi et délivré moi lakay. Tech Member
    1,485
    1,810
    93
    your mom
    I'd like to point out that the big ring flash object's graphics in Sonic 1 are called "ebigringcg". It is possible that it was called "ebigring" in Sonic 1, and got renamed to "bigring2" in Sonic CD, like how checkpoints were renamed from "save" to "marker" and signposts were renamed from "gole" to "goal". Not sure how I would fit that into the wiki page, so make of it what you will.
     
  11. Kilo

    Kilo

    Starting new projects every week Tech Member
    1,209
    1,159
    93
    Canada
    Changes with the weather
    I was thinking about this in regards to Sonic and Tails' player objects, since those were renamed to sonic and miles in S3K if I recall. Maybe just a play00/sonic or gole/goal will do the trick with a note in the description box about the renaming would do.
     
  12. Devon

    Devon

    La mer va embrassé moi et délivré moi lakay. Tech Member
    1,485
    1,810
    93
    your mom
    I have a hunch on what this could be. In Sonic 2 Nick Arcade, a good chunk of the special stage graphics were removed, including the sprite data for the walls, because they were grouped with the graphics data in Sonic 1. However, the sprite table for the special stage still includes the entries for the walls, except they all point to where "goalpat" and co. are instead. So, I think "metpat" refers to the walls, with the data removed, and its label moved in with the rest of the block sprites.
     
    Last edited: Jan 8, 2025
  13. Kilo

    Kilo

    Starting new projects every week Tech Member
    1,209
    1,159
    93
    Canada
    Changes with the weather
    If that's the case, I'd really like to figure out what exactly "met" means. Not easy since you only extract about 2 hiragana/katakana characters from that. But here are some options, of course take these with a fist sized grain of salt because I'm taking these terms off of Google Translate.
    めて/mete = First time. Could possibly mean first frame of the walls? Although that wouldn't make sense because it refers to the whole block, including angle frames. Maybe first block ID?
    めちゃ/metya = Confusion/mess. Could refer to the mazey architecture of the special stages. Or the dev's frustration at figuring out how the rotation is meant to work. Depending on how primitive their graphics editor is I'd certainly be confused by this
    upload_2025-1-8_16-36-35.png
    メ テ/me te = Meter. Don't exactly know what exactly this would refer to, but it's a very generic term.
    If there's someone who actually understands Japanese and could make a connection between blocks/squares/walls that could provide a possible actual answer, that would be much appreciated.
     
  14. Devon

    Devon

    La mer va embrassé moi et délivré moi lakay. Tech Member
    1,485
    1,810
    93
    your mom
    • Like Like x 3
    • Informative Informative x 1
    • List
  15. Brainulator

    Brainulator

    Regular garden-variety member Member
  16. Kilo

    Kilo

    Starting new projects every week Tech Member
    1,209
    1,159
    93
    Canada
    Changes with the weather
    ... Yeah? Why wouldn't the code compiled in S2NA be the same as the code that was uncompiled.
     
  17. Devon

    Devon

    La mer va embrassé moi et délivré moi lakay. Tech Member
    1,485
    1,810
    93
    your mom
    In regards to these scraps, they come from an earlier build (technically 2 earlier builds, if you count the second variant of "bossba" that, while has the same code, has differing pointers for outside functions and data), and does have some differences. It just happens that the raw source code that can be found actually matches the earlier version of "edit" found in these scraps, rather than the actual properly used version in the ROM. I do think that's worth a mention.
     
    Last edited: Jan 9, 2025 at 1:58 AM
    • Agree Agree x 1
    • Useful Useful x 1
    • List
  18. evilhamwizard

    evilhamwizard

    Researcher
    1,397
    474
    63
    • Informative Informative x 6
    • List
  19. Devon

    Devon

    La mer va embrassé moi et délivré moi lakay. Tech Member
    1,485
    1,810
    93
    your mom
    Man, that's definitely quite later into development, considering it's using the finalized Sonic 1 Sega logo instead of the stock one.
     
    • Informative Informative x 1
    • List
  20. Kilo

    Kilo

    Starting new projects every week Tech Member
    1,209
    1,159
    93
    Canada
    Changes with the weather
    Interesting how the game seems stuck on the Sega screen. I wonder what he could've been testing, the chant? The palette cycle effect? Very cool to see. Though unfortunate that the video is too low res and too far away to see what the actual code he's working on is.
     
    Last edited: Jan 9, 2025 at 1:15 PM