don't click here

Sonic 1, 2, and CD Remake Decompilation

Discussion in 'Engineering & Reverse Engineering' started by jubbalub, Jan 18, 2021.

  1. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    Setting up palette-based graphics and per-pixel scrolling is more complicated with today's graphics cards. Sonic CD ran into the former issue in ports, twice even! The Gems version has clear water and the mobile version uses an overlay instead of changing the palette.
     
  2. Blue Spikeball

    Blue Spikeball

    Member
    2,359
    958
    93
    I've always wondered why Gems didn't just use a transparent mesh as an overlay for the water in Sonic CD. It wouldn't have looked identical to the Sega CD version, but it would have looked closer (and much better) than colorless water.
     
  3. Clownacy

    Clownacy

    Tech Member
    1,061
    607
    93
    I've released v0.6 of my Sonic Mania Wii U port. As well as fixing the Time Attack/Replay menus and hopefully fixing the game's rampant random crashing issue, this version utilises a new homebrew format (.wuhb) which allows it to be ran directly from the Wii U Menu instead of the Homebrew Launcher. Being ran from the Wii U Menu allows the home button to function properly in-game, opening the home menu instead of just exiting the game without warning. Note that '.wuhb' files require the brand new Aroma homebrew environment.
     
  4. Clownacy

    Clownacy

    Tech Member
    1,061
    607
    93
    I've updated my Sonic Mania Wii U port: now it should run mostly at full speed.

    Where did this speed boost come from? Two things:

    This port leverages the SDL2 library, and one of its responsibilities is displaying the game's framebuffer on the screen. The framebuffer is in the RGB565 format, but SDL2 didn't support displaying RGB565 on the Wii U, so it was converting it to a different format instead. It did this every frame, using up a lot of the CPU. However, the Wii U actually does support RGB565, so I extended SDL2 to make use of it, and now the conversion is skipped.

    The second improvement has to do with V-sync: whenever SDL2 updates the display, it waits for the start of a new frame. However, if the game had lagged so much that a new frame had already begun, it would wait for the next frame instead. It would basically cause the game to run at 30FPS instead of 60FPS, even if it was only lagging a little. Now, it uses adaptive V-sync, which means that it doesn't bother waiting if it's already missed the start of the frame. This way, if the game is only slightly lagging, then it will run at, say, 55FPS instead of 30FPS.
     
  5. Clownacy

    Clownacy

    Tech Member
    1,061
    607
    93
    Last edited: Sep 26, 2022
  6. Clownacy

    Clownacy

    Tech Member
    1,061
    607
    93
    v1.0.2 of my Sonic Mania Wii U port is out: it fixes a crash in the PGZ->SSZ transition, fixes the broken fireflies in SSZ, and reverts the engine from RSDKv5U to RSDKv5 to fix an apparent backwards-compatibility issue with Heavy Shinobi. As the fact that the version number is no longer v0.X should indicate, I think this port is pretty much complete now.

    Fun fact: this port isn't just a straight port of the decompilation, as I've made a few internal improvements here and there. For instance, I replaced the disgusting original MD5 hasher with my own one, and in this update I've even overhauled the audio system, swapping the stb_vorbis Ogg Vorbis decoding library with libvorbis and converting the mixer from F32 (floats) to S16 (integers). It saves around 16MB of RAM, which should be useful for ports to platforms with limited RAM.
     
  7. Clownacy

    Clownacy

    Tech Member
    1,061
    607
    93
  8. Sonic Mania has been ported to the Wii. What port will they make next?!

     
  9. Kinda wish it was a Xbox 360 port.
     
  10. Overlord

    Overlord

    Now playable in Smash Bros Ultimate Moderator
    19,239
    972
    93
    Long-term happiness
    One step closer to Dreamcast: it'd be amazing to see Mania running on Sega hardware.
     
    • Like Like x 9
    • Agree Agree x 1
    • List
  11. Nik Pi

    Nik Pi

    Member
    482
    303
    63
    Kazakhstan
    Sonic 2: Archives
    Lol, it becomes like a DOOM: game, which will soon be possible to play even on a calculator :р

    P.S.: Sega genesis port, anyone? XD
     
  12. Jason

    Jason

    *Results not lab tested. Member
  13. Jeffery Mewtamer

    Jeffery Mewtamer

    Blind Bookworm Member
    1,887
    95
    28
    And now I wonder why I've never heard of anyone making a Sonic game for the TI-8x. I remember playing Mario on my TI-83 Plus in the middle of Precalculus class back in Highschool(would have been the 2003-04 school year), but never heard of anything Sonic-like...

    Though, is it possible to run any of these from the Linux console on a 32-bit kernel without an X server?
     
  14. JaxTH

    JaxTH

    Pudding Deity Oldbie
    10,360
    588
    93
    Los Angeles
    Jack shit.
  15. Harmony Friends

    Harmony Friends

    it's the whole gang Oldbie
    [​IMG]
    tiny little mod but boy oh boy the pixelated Christian Whitehead logo on the splash screen in the Sonic CD decomp was buggin me. hope anyone gets some use outta this
     
  16. Clownacy

    Clownacy

    Tech Member
    1,061
    607
    93
    v1.0.4 of my Sonic Mania Wii U port is out. This is just a quick maintenance release that updates the base decompilations. In particular, the pause menu in Mean Bean no longer has an erroneous 'restart' option. Additionally there have been some small accuracy improvements to the code here and there.

    EDIT: And here's v1.0.5.
     
    Last edited: Dec 21, 2022
  17. Tiberious

    Tiberious

    Yeah, I'm furry. Got a problem? Oldbie
    778
    15
    18
    Has anyone else run into a softlock in Mirage Saloon 1 in Encore mode? I kept getting funneled into a spot with a rock that wouldn't break. Eventually had to use Debug to get past it. This is in 1.0.5 on Wii U.
     
  18. Battons

    Battons

    Shining Force Fan Member
    Man this can't come soon enough, I will make my own custom dreamcast case and manual just for this. I cannot tell you how abused my dreamcast will be if this becomes full speed.
     
  19. Clownacy

    Clownacy

    Tech Member
    1,061
    607
    93