don't click here

Sonic 1 Blastless DX

Discussion in 'Engineering & Reverse Engineering' started by vladikcomper, Apr 1, 2021.

  1. vladikcomper

    vladikcomper

    Tech Member
    205
    134
    43
    Sonic Warped
    UPDATE 2021-10-11: Sonic 1 Blastless DX, an enhanced and extended edition of the original hack has been released. The download link in this post has been updated. Please see this post for more details: https://forums.sonicretro.org/index.php?threads/sonic-1-blastless.40149/#post-992617

    * * *

    As you all know, Sega Mega-Drive® is famously powered by Blast Processing™ technology. This isn't just a marketing term, but a really sophisticated, advanced technology behind SEGA's most successful titles, most notably, the Sonic series.

    So, as usual, I was working on my Sonic the Hedgehog™ hack, doing my usual Blast Processing™ wizardry to bring you state of the art High Definition Sound and Graphics™ experience. However, I got a little carried away and shoved in so much Blast Processing™ power into the hack that the ROM nearly exploded.
    It is now forever cursed and has forever lost any Blast Processing™ power. Or has it?

    [​IMG]

    But my senses feel that Blast Processing™ power is still there, well-hidden deep inside it. Can you regain it?
    Be careful, though, and avoid any form of damage in the game. With so much processing power already lost, who knows what may come out of it? If you aren't careful enough, you may enter into an Anti-Blast Processing™ parallel universe, where the power of your beloved Sega Mega-Drive® may be reduced beyond, I dunno, GameBoy®?

    Play it at your own risk! Your Sega Mega-Drive® won't feel the same anymore!


    Special Thanks:
    • AURORA☆FIELDS - For testing, and valuable debugging help;
    • Jet - For testing and various ideas;
    • RayDC - For making the presentation image;
    • LazloPsylus - For grammar corrections and enhancements to this post, because I'm too tired to come up with good text right now; and for coming up with a better name for this project which I ended up using =P
     
    Last edited: Oct 11, 2021
  2. Vaiz

    Vaiz

    I'm still here for some reason! Member
    1,281
    22
    18
    Internet.
    Holy crap, I only watched the youtube video, but this seems really cool and creative. It reminds me of uh... Crap, what's that mobile game RPG where as you level up the graphics get better. I don't remember, but this reminds me of it.
     
  3. kcowolf

    kcowolf

    Oldbie
    23
    4
    3
    Evoland, maybe?
     
  4. Vaiz

    Vaiz

    I'm still here for some reason! Member
    1,281
    22
    18
    Internet.
    Yes! Thank you. That's the one.
     
  5. Overlord

    Overlord

    Now playable in Smash Bros Ultimate Moderator
    19,239
    971
    93
    Long-term happiness
    I love this. I watched the Youtube video and was impressed just by the initial act restoration from Master System upwards - I didn't see the lower levels coming!
     
  6. Brainulator

    Brainulator

    Regular garden-variety member Member
    Sonic's in-game palette, though. It looks like a much better blue.
     
  7. DeltaWooloo

    DeltaWooloo

    Be a boss-man and come to my big and tall man shop Member
    I want to say that this hack is one of the few that got released on April Fools that managed to be far from a joke and more focused to be on a gimmick or even an RPG game where you rank up to level up. Unlike where everyone (including myself) makes a horrible shitpost hack only to fool a lot of people. I do like that there are five variants to the hack if you turn on Blast Processing or downgrade your Mega Drive. From my findings, the oldest variant a Gameboy variant with its greenish colour reminiscent of the original Gameboy screen with no sound besides some sound effects. Upgrading progresses us to an Atari 5200/SG-1000 variant where we start to see some life into the hack with the colours coming together and the music playing, albeit without the background and the music feeling bland. The default variant is the Master System, where we have more colours, and the music is coming together, and then with Blast Processing, we are back to normal. Overall, I'm quite impressed with the amount of work put in for release for a certain day, and I wish to see more people bringing amusing gimmicks to their hack like this.
     
  8. The Joebro64

    The Joebro64

    SAY HELLO TO MY CHOCOLATE BLEND Member
    2,970
    2,600
    93
    This is fantastic. Thank you.
     
  9. Lostgame

    Lostgame

    producer/turnablist. homebrew dev. cosplayer. Oldbie
    4,134
    58
    28
    Toronto, ON
    The O.I.C.
    I just wanted to chime in and say this is particularly impressive.

    I've been here almost 20 years, and it's rare to see such truly original and well-implemented ideas. :)

    Keep that magic alive! <3
     
  10. vladikcomper

    vladikcomper

    Tech Member
    205
    134
    43
    Sonic Warped
    Thanks to everyone for their reactions and feedback! I feel more than happy with how this hack was received, with some people even wanting to replay the whole game emphasizing on how different graphic modes change their perception on it. I'm really-really glad to see it as it means all the extra effort to get every level, every zone and every game mode (Special Stages included, unless you didn't know =P) under every "graphics mode" did pay off.

    This hack is actually a lot bigger than it may seem, as this concept (the way it functions in the final product) was insanely hard to pull off to say the least. The development started in 2017, and while it wasn't even remotely active all the way through until 2020, unbelievable amounts of time and effort were put into it, as the hack's premise required me to completely overhaul just about every subsystem in the engine that handled graphics display in one way or another (this includes level rendering, level and objects art loading, transferring tiles and palettes just to name a few; this hack even uses a completely custom sprites format!)

    So again, huge thanks to everyone, as it's your reactions and feedback that really inspires me to move forward with my projects and crazy ideas, now that I'm back after quite a hiatus (my last big release was Sonic Winter Adventures in 2013!)

    Anyways, I also came to bring a small update...


    A small update for anyone who is going to run it on Real Hardware

    So recently, Sonic 1 Blastless was featured in @redhotsonic's But does it work on Real Hardware? video (which was an honor, so huge thanks to redhotsonic for covering my hack in such a spectacular way!)

    It was, however, mentioned in the video that while the hack seems to work on the hardware pretty well for the most, some tests on some configurations showed that it sometimes may freeze completely when switching graphics modes in the water levels (LZ1-LZ3, SBZ3). I investigated the issue and it appears there was indeed a low-level bug when switching the "graphic mode" which introduced a data race that affected some machines (I assume it really comes down to tiny differences in memory performance of the flashcart and the system itself).

    This bug has now been fixed, so it should always work stable on any Genesis/Mega-Drive revision. Other than that, no noticeable changes were made, apart from a few tiny fixes listed below. If you're an emulator user, almost nothing really changes for you, so feel free to ignore it if you already played it.

    • Fixed a 1-frame corruption of purple flowers during "All Emeralds" ending;
    • Fixed another extremely unlikely theoretical crash; I think you'll never in your life trigger it, even I could never trigger it (hence it only exists in theory), but it was fixed anyways, which is good;
    • Don't reduce blast processing when Sonic's hurt wearing a shield (the original version subtracted a little of Blast Processing as a punishment, it was frustrating at times as the game would immediately downgrade the graphics if you had nearly zero Blast Processing to begin with);

    The download link is exactly the same (I just replaced the file on the server with the newer revision, hence the original post wasn't edited).


    P.S.: Redhotsonic's video also mentions a certain pleasant surprise Sonic 1 Blastless has for the PAL users! So you may want to check that section of a video or try booting the ROM in PAL mode (EU region) for yourself.
    I'm actually surprised no one has noticed it before, this also took me a quite lot of time and debugging to pull off! =P
    P.S.S.: Still surprised no one talks about the ROM size, haha.
     
    Last edited: Apr 18, 2021
    • Like Like x 6
    • Informative Informative x 1
    • List
  11. biggestsonicfan

    biggestsonicfan

    Model2wannaB Tech Member
    1,613
    418
    63
    ALWAYS Sonic the Fighters
    I have to ask: Does it actually free resources on the hardware, or is it all a "gimmick"? Does each lower mode run as if it were running on heavily throttled hardware or as if the limitations of the hardware were much lower than they really are?

    A stupid question I know, but I just have to ask...
     
  12. Brainulator

    Brainulator

    Regular garden-variety member Member
    Well, it would seem this ROM is smaller than that of the vanilla Sonic 1, though that might just be a lack of padding...
     
  13. vladikcomper

    vladikcomper

    Tech Member
    205
    134
    43
    Sonic Warped
    Well, if you were only to remove padding, you could save around 2.5 Kilobytes in the vanilla ROM. Memory was really expensive back then, so every Kilobyte counted. There's no way Sonic Team would've wasted any more of that precious ROM space~
    There, of course, were a few unused sprites they forgot the remove. If you were to remove just about every unused graphics and data, you could save 10-20 Kilobytes, which is a lot better, but still far from how much space this hack's actually saved.

    And we're just talking about the original Sonic 1 with no extra content, right?
    Well, in case of Sonic 1 Blastless, we have: all the original Sonic 1 assets + 3 completely new graphics modes for virtually every bit of the game + 8-bit/4-bit/2-bit music and sounds + extended PAL resolution support + Spin Dash, extended HUD etc. = ROM that is ~60 Kilobytes (12%) smaller than the vanilla Sonic 1?! Quite funny math, isn't it? =P

    If you take a look most of Sonic 1 ROM hacks, they're about 550 Kb - 1 MB on the average (the latter is often due to ROM size padding to the nearest power of 2), even if most of them are GHZ-only demos. Because once you port Spin Dash (adds quite a bit of uncompressed art), add some music, your ROM size would quickly go over 512 Kb.

    I wanted to change that and finally create a full-fledged hack that is actually less than 512 Kb!
    So in case of Sonic 1 Blastless I decided to challenge myself with saving as much ROM space as possible without cutting down the original game (all of this besides all the technical challenges implied by the hack's concept itself). And I went so far with it, that I eventually optimized many of game's data formats to the extreme, which is how the impressive size of mere 452.6 Kilobytes was achieved, despite all the extra stuff added.
    Most of the size savings in Blastless come from:
    • Utilizing better compression format for graphics (Kosinski+);
    • Using custom sprites format and storage (reduced sprite mappings size by almost 15%);
    • Using unusual level layout format (compressed, resembles Sonic 2's, but arranged differently for more effective compression);
    • Optimizing compression for misc. data (Special Stage layouts, level chunks etc.)
    Speaking of the original game's content, there's only one place I cheated to be completely honest, that being the SEGA PCM sample. I figured I could compress it, as it was only meant to be played in 8-bit mode.
    I wrote a 1-bit DPCM encoder/decoder for this (a really similar in implementation to the hardware delta-modulation channel in NES' APU). This gave 8x compression with the sample still being recognizable (26.4 KB original vs 3.5 KB compressed), so this little cheat saved me ~22.9 KB I used for the extra content.

    Sonic 1 Blastless implements all of its "graphics modes" by actually emulating lower-end hardware. Most of that "emulation" is actually driven by software.
    All the original graphics are parsed by software downscalers (implemented on the CPU side) to emulate lower resolutions. Similar concepts are applied to processing palettes and sounds.
    One of the biggest challenges was to make this processing work in real-time and to be able to switch "emulation" modes on the fly without reloading the game. Which is why it took several years to make.

    A few instances where it actually relies on the hardware tricks to enhance the "emulation" are the following:
    • It switches to 256-pixel horizontal resolution (supported by Genesis' VDP) to give a more "stretched" and authentic look in 8-bit modes;
    • Background display is disabled by a VDP trick, by manipulating VDP registers so both foreground (Plane A) and background (Plane B) point to the same nametable (a video-memory area which contains the tile map to display); so foreground becomes the background as well. The trick leads to drawing foreground twice at the same position, which gives an illusion of only using one plane, like in 8-bit games. You cannot technically remove the background layer on the Genesis (without using undocumented registers at least). This saves me a lot of processing, because I have to keep background drawn (but hidden) to switch to 16-bit mode on the fly; otherwise, I'd have to redraw the entire background every time.
    • NES-like sprite flickering is emulated by abusing the sprite limit: each sprite is drawn twice. In case of 256-pixel mode this effectively lowers the amount of sprites VDP is able to draw from 16 sprites on the line to 8 (which is exactly matches NES sprite limit); unique sprites on screen are also limited from 64 to 32 by the doubling (as half of the sprites is "wasted" this way);
     
    • Like Like x 6
    • Informative Informative x 6
    • List
  14. AndKnuckles

    AndKnuckles

    Member
    1
    0
    1
    I love this. I love this so damn much.. and that extended PAL resolution? Absolute bliss, for once PAL has an edge over NTSC
     
    Last edited: Apr 24, 2021
  15. Aerosol

    Aerosol

    Not here. Moderator
    11,163
    573
    93
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    Several years? Worth it.

    Thanks for abusing the Mega Drive for all this time!
     
  16. I'm guessing to utilize the 240p of PAL systems, you would have to create checks that, if the game is running on the PAL Mega Drive, would extend the size of the vertical interrupts to fit 240 scanlines.
     
  17. vladikcomper

    vladikcomper

    Tech Member
    205
    134
    43
    Sonic Warped
    Sonic 1 Blastless DX

    Today, I proudly present to you Sonic 1 Blastless DX, an enhanced and extended edition of Sonic 1 Blastless which is featured in Sonic Hacking Contest 2021!

    Since the original release, quite a few of people were asking to be able to leave the game in certain "Blastless" mode (most notably, Game Boy) or just to play certain modes separately. Your requests were heard, and I've made something even better just for you! For all of you returning players, the DX edition (which stands for Deluxe, not Director's Cut) includes the following exclusive hidden goodies (but shhhh, it's a secret~):
    • All-new DOS mode! - Imagine playing Sonic 1 on a good old i386 DOS-PC!
    • A brand new Configuration mode! - That changes the way you play the game! This is absolutely the most powerful built-in tool you may ever get in a Sonic hack!
    Can you figure out access to them?



    On top of that DX version brings in the following improvements to the original "Blastless" gameplay:
    • Even faster graphics mode switches! As if there weren't already fast enough, but the DX version is able to restore Blast Processing in the blink of an eye!
    • Subtle changes/improvements in some graphic modes;
    • Get a new life every 50,0000 score points;
    • Many bugfixes and QoL improvements (that SYZ3 block no longer blocks the way!);
    • Play it in PAL region! I know, 50 Hz is slower, but seriously, go play it at least once. Have you turned it on? You may need to doublecheck...

    Download DX version
    Go to hack's SHC page

    Hint: There's no in-game messages that reveal access to those hidden goodies, so you have to it figure out using a bit of brute force. Accessing them is easier than you may think though. It's just one step away from entering the Level Select mode! Once you activated that secret mode, you can also press certain buttons when paused the game to go back to Title Screen or Configuration mode respectively.

    Please note that current version is slightly (literally, 2 bytes) different from the one uploaded to SHC'21. That's because I had to fix a silly typo in the secret menu I made while in a hurry. I couldn't update SHC anymore build due to expired deadlines.

    Before you ask...
    [​IMG]

    I can't believe I did it, it was correct all the way even in the code!
    [​IMG]

    ... still here, huh?
    You've found a treasure:

    Cheats to access Configuration mode:


    On the title screen, press Up, Down, Left, Right, B + Start (in all regions, except JP).
    While in the level, press Start, B to return to Configuration mode. Press Start, A to return to the Title screen.
     
    Last edited: Oct 11, 2021
  18. Wait, is the game speed optimized for PAL?
     
  19. vladikcomper

    vladikcomper

    Tech Member
    205
    134
    43
    Sonic Warped
    Quality Update & Widescreen Support coming soon!



    Over the past few months, I've been working on further improving and optimizing Sonic 1 Blastless' engine and fixing even more of the original game's bugs. As a result, I've almost finished one big feature I always wanted to pull off: full widescreen support for all the "Blastless" modes.

    In case you didn't know, there's Gensplus-GX-Wide emulator you can use with RetroArch, which basically allows game to overdraw tiles to fit widescreen, however drawing these extra tiles should be properly handled by the game itself. I'd really love to see widescreen hacks gaining traction in the future, which is why I'm putting so much effort into this update. Converting Mega-Drive games to widescreen isn't a trivial task, given emulator's quirks and the fact you have to deal with increased drawing distance and way more sprites on the screen.

    Unfortunately, this widescreen emulator has some bugs and hardware incompatibility issues, which currently delay the release. One minor emulator bug I was able to track down and fix myself (by contributing to the emulator's source code), however, one major issue still remains and it's a deal-breaker unfortunately. A secret game mode configuration mode cannot be rendered properly because it uses Window plane and it has plenty of drawing issues under Gensplus-GX-Wide. Unless I finish workaround or come up with another patch to the emulator, Sonic 1 Blastless DX cannot be released as is, I'm afraid.

    Once major issue is resolved, I'll release both Widescreen (16:9) and Normal (4:3) builds of Sonic 1 Blastless DX, as there are way too many bugfixes and quality improvements to yield another "normal" build (most of which you can potentially spot on the video).
     
  20. LockOnRommy11

    LockOnRommy11

    Member
    2,708
    225
    43
    I’ve been playing the latest release of the game this evening on my MegaDrive Model 1 (PAL) and I think it’s possibly the most technically impressive game I’ve seen on the console. Switching graphic modes is basically instant, and it’s truly amazing how these modes are achieved. Also as UK console owner the PAL optimisation is really appreciated. Looking forward to the next release!