Sonic 1 Blastless

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

  1. vladikcomper


    Tech Member
    Sonic Warped
    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?


    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
  2. Vaiz


    I'm still here for some reason! Member
    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


    Evoland, maybe?
  4. Vaiz


    I'm still here for some reason! Member
    Yes! Thank you. That's the one.
  5. Overlord


    Now playable in Smash Bros Ultimate Moderator
    Berkshire, England
    Learning Cymraeg
    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


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


    The sheep goes quack! 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

    This is fantastic. Thank you.
  9. Lostgame


    turntablist, dinosaur goddess Oldbie
    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


    Tech Member
    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


    Model2wannaB Tech Member
    Formerly 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


    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


    Tech Member
    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


    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


    Not here. Moderator
    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. Alex Field

    Alex Field

    シュート! カオス・エメラルド・ザが消えようとしている! Member
    Downunda, Mobius
    Sonic the Hedgehog 2+, Sonic the Hedgehog 3+
    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.