Skip to content

TheBlad768/Sonic-1-in-Sonic-3-S.C.E.-

Repository files navigation

SONIC-1-IN-SONIC-3-S.C.E.-

Title

GitHub Release GitHub repo size GitHub top language GitHub Repo stars GitHub watchers GitHub forks GitHub commit activity GitHub Downloads (all assets, all releases)

Download

Disclaimer

This is a port of Sonic The Hedgehog (1991) to Sonic Clean Engine (S.C.E.) Extended version, our heavily modified and improved Sonic 3 & Knuckles engine, which we have been using for a long time for our MD projects (such as Hellfire Saga and Sonic 3 & Knuckles: Epilogue).

Please read the license before using this project.

Screenshots

Show screenshots

Features

  • Cleaned up and optimized disassembly of Sonic 3 & Knuckles:

    • There are no hardcoded things as there were in the original Sonic 3 & Knuckles. Complete freedom in your work;
  • Changed level layout format. Now there are two bytes for chunk IDs:

    • This will allow you to create more chunks for levels because there will be no one-byte limit here. This will allow you to port levels even from Sonic CD;
  • All current level settings in one file:

    • No more searching through the entire Sonic disassembly to replace chunks, layout, palette, music, and other things. Just open Pointer.asm located in each level folder;
  • Many original subroutines have been replaced with faster equivalents. These new subroutines do not break compatibility with the original Sonic 3 & Knuckles. Therefore, there is no need to worry about this:

    • Updated Ultra DMA Queue subroutines and compression algorithms(Kosinski Plus, Kosinski Plus Module, Updated Enigma) have optimized S3K's performance very well;
  • I rewrote the code of all the screens, objects, and other things to get maximum performance:

    • Poorly written object code can significantly reduce game performance, regardless of whether other subroutines have been optimized very well. All code has been rewritten in S3K style. If you are familiar with Sonic 3 & Knuckles disassembly, you will have no problems with the S1S3/SCE code;
  • The size of the object slots is now 0x50 bytes:

    • Additional free bytes will facilitate work on complex objects;
    • You can easily change the object slot size without breaking anything, since there's no slot-size-based multiplication like in Sonic 1 and Sonic 2;
  • Various sound drivers:

    • There are Z80 Sound Flamedriver and M68K Sonic 2 Clone Driver v2 (Mega PCM 2.0 version). It all depends on your tasks.

Changes for the Sonic 1 in Sonic 3 & Knuckles (S.C.E. Version)

  • New game engine. The original Sonic 1 has serious performance issues, so the game runs much better now;

  • Some things are kept in the style of Sonic 3 & Knuckles. There is a mix of graphics and music from Sonic 1 and Sonic 3 & Knuckles;

  • Playable Tails and Knuckles. You can play as Sonic and Tails or Knuckles and Tails. The villain switches between Eggman and Eggrobo depending on which character you choose to play;

  • All level layouts have been updated to match Sonic 1 2013 and Sonic Origins. New paths for Tails and Knuckles in MZ3, SYZ2 and SLZ1, new secrets pretty much everywhere else;

  • New artwork for bosses and other stuff;

  • New settings menu;

  • Seven Special Stages. Special Stages are now only available through Star Posts, but only if you have 50 rings. The player will lose 50 rings for entering the stage;

  • You can get 7 Chaos Emeralds and use Super/Hyper Transformations;

  • Many minor improvements in polish, such as added SFX or boss intros.

Cheats and Secrets

  • S1 Level Select: U, D, L, R, A+Start on the Title Screen;

  • S.C.E. Level Select: U, D, L, R, A+C+Start on the Title Screen;

  • Hidden Credits: Hold A+C on the Sega Screen;

  • Debug Mode: 1, 9, 9, 1, 0, 6, 2, 3 in the Sound Test of any Level Select;

  • All Emeralds: 4, 1, 2, 6 in the Sound Test of any Level Select;

  • Results skip: A, B or C during Got Through/Special Stage screens.

Additional links

If you are interested in the Sonic 1 in Sonic 3 & Knuckles (S.C.E. Version) with the Sonic 2 Clone Driver v2 (Mega PCM 2.0 version):

Main repository:

Sonic Clean Engine (S.C.E.) Extended version:

How to build the ROM

To build this, use build.bat if you're a Windows user, or build.sh if you're a Linux user. The built ROM will be called 'S1S3.gen'. Use build_debug for debug things. The built ROM will be called 'S1S3.debug.gen'.

Quick start

Current issues

  1. S.C.E. uses Kosinski Plus algorithm, but Flex2 program does not support Kosinski Plus Module. Therefore, Flex2.json project file is partially useless. SonMapEd program does not support Kosinski Plus at all. You can only open uncompressed graphics.

Solution: Use the fork from Nichloya:

Alternative programs:

FAQ

How do I add levels from previous Sonic games?

How do I make different text for Title Card?

  • If you want to make different text for the Title Card, you need to open the Constants.asm file and look for
    Title Card zone names. There you'll find a list of zones whose names you can modify.

    ; ---------------------------------------------------------------------------
    ;  Title Card zone names
    ; ---------------------------------------------------------------------------
    
    TitleCardName_ZONE =					"ZONE"
    TitleCardName_GHZ =					"GREEN HILL"
    TitleCardName_MZ =					"MARBLE"
    TitleCardName_SYZ =					"SPRING YARD"
    TitleCardName_LZ =					"LABYRINTH"
    TitleCardName_SLZ =					"STAR LIGHT"
    TitleCardName_SBZ =					"SCRAP BRAIN"
    TitleCardName_FZ =					"FINAL"

If you still want to use direct mappings instead of a macro to create Title Card mappings S3TCG.

Where can I find other SMPS music?

Why don't mappings use MapMacros?

  • Unfortunately, not all programs support MapMacros, so I wanted to maintain compatibility with older programs. I don't want to just throw away SonMapEd. But there is support for MapMacros here, and you can use it if you want.

Tutorials

Here you can find tutorials for Sonic Clean Engine (S.C.E.):

Assembler

Sonic Clean Engine (S.C.E.) is designed for use with The Macro Assembler AS:

The assembler used here is Flamewing's modified version of The Macro Assembler AS, found here:

Why The Macro Assembler AS?

Answer

AS

The Macro Assembler AS issues

Why does the ROM take so long to build?

  • The speed of the ROM build process depends entirely on the power of your computer. A high-performance machine will build the ROM quickly, while a slower one will take significantly more time. If you're a Linux user and you're using Wine and Windows batch script, that will affect build speed too.

  • Always specify jump sizes for instructions. Writing code without specifying jump sizes will significantly slow down the ROM build. The Macro Assembler AS will perform multiple passes until it can successfully build the ROM, which increases build time.

Example of problematic code:

		beq	sub_1234	; and any other branch instructions
		bsr	sub_1234
		bra	sub_1234
		jsr	sub_1234
		jmp	sub_1234
		lea	sub_1234,a1
		pea	sub_1234

Example of correct code:

		beq.s	sub_1234	; and any other branch instructions
		bsr.s	sub_1234
		bra.s	sub_1234
		jsr	(sub_1234).l
		jmp	(sub_1234).l
		lea	(sub_1234).l,a1
		pea	(sub_1234).l

Pay close attention to your code to avoid such issues.

Here you can find more information about Macro Assembler AS and errors:

Warning

Please always specify the jump sizes for instructions. Macro Assembler AS may display random and misleading errors if the jump size is not specified. You will try to fix something that wasn't actually broken, but these errors are caused only because you didn't specify the jump size in the instruction.

Macro Assembler AS Passes

I've added console messages about Macro AS passes.

AS1

Try to keep 2 passes at all times. If you see 3, 4 or more passes, you should figure out what's causing the extra passes and try to fix it. This will save you a lot of time during the ROM build.

AS2

To-Do List

  • Act transitions. Levels have been edited to allow for these, but unfortunately they couldn't be implemented in time for SHC
  • Fix Knuckles' socks palette
  • SRAM
  • Fix and optimize all level chunks. At the moment it is difficult to create new layout because many chunks are available only in a certain act
  • Super/Hyper transformations
  • Flamedriver has some issues that need to be addressed. Music speed-up is reset after 1UP. Continuous SFX have conflicts with other SFX. Continuous flag is not reset when playing normal SFX
  • Tails' abilities (Flight cancel, Flight assist)
  • Tails tail does not flicker during invulnerability after taking damage
  • Change the art loading priority in PLC to avoid broken graphics during level appearance
  • Knuckles' animation sometimes breaks when he climbs to the wall
  • Rotating Junction does not shoot the character down

Credits

Red Miso Studios Staff

  • TheBlad768 — Project lead, sole programmer, S.C.E. Game Engine
  • Nichloya — Level art and level design edits, sprite art and other things
  • pixelcat — Sprite art, UI art and other things
  • FoxConED — S.C.E. Level Select font art
  • Dolphman — Robotnik head art

Testing and other help

  • giovanni.gen, KGL, DeltaW, Narcologer, CatswellMeow, Nintorch, FoxConED, lavagaming1, cuberoot, Vladikcomper, ProjectFM, MarkeyJester, VAdaPEGA

Special Support

  • cuberoot

Special Thanks

  • joshyflip for consulting on the artwork
  • Flamewing, devon, RealMalachi and others for bug fixing guides
  • Clownacy and other contributors for work on the Sonic Retro disassemblies
  • SSRG and Sonic Retro

Links

These projects are based on the Sonic Clean Engine (S.C.E.)

Sonic Vania (2025 Demo) by JvneTh

SHC Page

Sonic 3 Rebuilt by TomatoWave_0

SHC Page

Sonic The Hedgehog in Hellfire Saga (2023)

SHC Page     Source

Sonic 3 & Knuckles: Epilogue (2021)

SHC Page     Source

TishaProject (2019)

SHC Page

Sonic Virtual Adventure (2017) Cancelled
In the past I made the Sonic Clean Engine (S.C.E.) specifically for this project (:

Mini projects

Sonic With A Pogo Stick by RobiWanKenobi

SHC Page

Sunky MD by RobiWanKenobi

SHC Page

Check out the Sonic Retro Disassemblies