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,648
    214
    43
    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
    1,789
    576
    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
    930
    241
    43
    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
    930
    241
    43
    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
    930
    241
    43
    Last edited: Sep 26, 2022
  6. Clownacy

    Clownacy

    Tech Member
    930
    241
    43
    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
    930
    241
    43
  8. Sonic Mania has been ported to the Wii. What port will they make next?!

     
  9. Crimson Neo

    Crimson Neo

    Loopin' around. Member
    Kinda wish it was a Xbox 360 port.
     
  10. Overlord

    Overlord

    Now playable in Smash Bros Ultimate Moderator
    18,825
    709
    93
    Long-term happiness
    One step closer to Dreamcast: it'd be amazing to see Mania running on Sega hardware.
     
  11. Nik Pi

    Nik Pi

    Member
    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,733
    22
    18
    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
    9,881
    380
    63
    Los Angeles
    Jack shit.
  15. [​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