rubberduckycooly / sonic-1-2-2013-decompilation Goto Github PK
View Code? Open in Web Editor NEWA complete decompilation of Sonic 1 & Sonic 2 (2013) & Retro Engine (v4)
License: Other
A complete decompilation of Sonic 1 & Sonic 2 (2013) & Retro Engine (v4)
License: Other
Don't know what this is but it's preventing the application from running.
There's no call to load additional mappings, so the game will just use the ones included with SDL2.
This is also the case with the Sonic CD code.
Something like this would load the mappings (place it before SDL_Init)
// try loading an external gamecontroller mapping file
int nummaps = SDL_GameControllerAddMappingsFromFile("gamecontrollerdb.txt");
if (nummaps >= 0)
printf("loaded %d controller mappings from 'gamecontrollerdb.txt'\n", nummaps);
They should adapt to 4:3 considering the fact that Christian Whitehead himself debugged the game in 4:3, and the fact that the game came out at a time where most iPads in existence were 4:3
I don't know if this is only happens to me but, everytime i press B, the game makes the character jump while pausing the game.
This happens on the Sonic CD Decomp too, it's not really game breaking but it gets a bit annoying after a few minutes.
First, amazing job! The best way to play Sonic 2 on the PC for sure!
Not something game breaking, but the game hangs when selecting the dev Menu option on the pause menu. The Dev Menu opens but the program just hangs. I don't know if the controller (keyboard in my case) does not work on the menu or if the program really crashed. Was using the release version and Win 10;
I had multiple continues because of the Special Stages, went game over by losing lives in Scrap Brain Zone before the program suddenly quits instead of giving me the option to continue so it's possibly a bug?
MD5 hash of my Data file: F679E87477BBED17FF1BDB9A6793F49C
If in a position where camera Y is not against the bottom edge of the stage, when jumping immediately after releasing a spindash (in the time before the camera has finished catching up to Sonic) in either game, the camera starts tracking Sonic's jump at a height that is too low and as a result snaps down rather jarringly at the moment of the jump. This happens in either game.
This does not occur in the original mobile version of either game.
My checksums (both are pre-Sega Forever):
S1 Data.rsdk MD5: 10E320E8B3C1BA3B87B1E8EE01B2492C (v2.0.8)
S2 Data.rdsk MD5: 6F1244F8D6E3822778F69BCE2D1E8558 (v3.1.5)
If you end up getting 50000 as a result of a score tally from the zone or special stage results screen it'll cut the 1up jingle short and sometimes this also makes further 1up jingles cutting short too.
Could you add a config key that makes the game start in a specific save slot, similar to StartingCategory and StartingScene?
When selecting the time attack mode:
Casino Night Zone Act 1 Results in playing the Hill Top Zone Boss fight.
Casino Night Zone Act 2 results in playing Mystic Cave Zone Act 1.
Chemical Plant Zone Act 2 sends you straight into the Boss fight with visual glitches.
Hill Top Zone Act 1 sends you to Oil Ocean Zone right before the Boss fight.
These are just a few examples, but the bindings for Zones and their respective Acts aren't correct.
Note: I've only tested Sonic the Hedgehog 2 for this bug
As these ports are decomplication of the mobile release, I wonder if it would be possible to transfer my progress from the mobile version to these ports.
I had a back-up of a save from both games:
...\Android\data\com.sega.sonic1\SGame.bin
...\Android\data\com.sega.sonic2\SGame.bin
and I saw that the exe was saving its own save as SData.bin, so I simply copied the save backup to the folder and rename it SData.bin (old was kept as SData.bin.bak in case of issues).
As far I can see this work perfectly and all the progress I had on each mobile game is now available on the PC.
It would therefore be worth updating the readme file and/or front-end page to make others aware of this feature.
If S3 items are enabled from the game options in either game, when using the air dash granted by the fire shield, the camera "falls down" early before Sonic does. This happens in either game.
In the original mobile version of either game, the camera stops tracking Sonic and only starts tracking him again 15 frames (at 60 fps) after initiating the dash.
The pause in horizontal tracking is correctly reflected here, but the vertical behaviour is inconsistent.
I analysed this 60 fps YouTube video frame-by-frame to check various hypotheses: https://youtu.be/C0FQPNJOYf8. The framerate in this video is not entirely consistent, but some air dashes where the framerate does stay stable for the duration of the camera freeze are at 4:57 and 5:12.
I initially thought that vertical camera movement in the original was locked for a certain number of frames, too, but an occurrence at 5:22 debunks that, where Sonic does an air dash at ground level, where the camera tracks him vertically even during the initial horizontal camera-stop.
I've done some more research and the Sonic Physics Guide at Sonic Retro may shed more light on it: http://info.sonicretro.org/SPG:Camera#Flame_Shield.2FHyper_Sonic_Air_Dash
Having read this page, I believe vertical movement during the air dash may simply be a product of the "vertical border" rule.
My checksums (both are pre-Sega Forever):
S1 Data.rsdk MD5: 10E320E8B3C1BA3B87B1E8EE01B2492C (v2.0.8)
S2 Data.rdsk MD5: 6F1244F8D6E3822778F69BCE2D1E8558 (v3.1.5)
I tried testing out the Time Attack mode in both games and the only levels that load correctly are Green Hill Act 1 and Emerald Hill Act 1. Trying to load Emerald Hill Act 2 will load the Boss Attack. Loading Green Hill Act 2 will load one of the special stages. This trend continues for the rest of the levels loaded through time attack. It's consistent too. I've tested this with both the regular versions of the games and both Sega Forever versions of the games. the results are the same. Loading the stages through the Dev Menu works properly with has no issues.
Thanks for the great work on this!
I've tested this on two different AMD machines, and can reproduce it on both - when running at 1080p and using fullscreen mode, the game render texture has a triangle seam bisecting the image from top left to bottom right, which slightly shifts the pixels. This was present on two separate machines - one with a 1080p monitor, and another with a 1440p monitor. Leaving the 1440p monitor at native res, the issue isn't present (maybe it's a direct multiple of the base game res? I haven't done the math) but when switching to 1080p it then behaves exactly like the machine with a native 1080p display: seam is present.
I'm assuming this is because the render buffer is being stretched, but only made up of two triangles? Or maybe it's a just a quirk of the renderer this uses and can be fixed? Think of the PS1 affine texture distortion but not nearly as bad.
Hope that's clear.
Picking up speed shoes restart the BGM instead of speeding up the music from the point where you were at the time.
When I open the game and try to use my controller, nothing happens. However, if I unplug it and then plug it back in, it works exactly like I'd expect it to. It also works if I have the controller unplugged while launching the application then plug it in while it's running.
OS: Debian Linux (Stable)
Controller: Sony DualShock 3 (PlayStation 3 Controller)
If your data file SHA-256 hash (unless otherwise specified) is ONE OF THE FOLLOWING:
749D6369867CDD73075959A7832C0394662BB7A5E8C9702C5AF20F8E0D0D979E
6C6881E3DBDE73D4DD0B37F68996A700C1186B1F
90991207BFEFA09CF4DD0EE57365DFD2047172D531BE93AFC8FFF196078E034F
787E022A40FE2B3017DAE176ECC294CC752E2B765ED486B1C841C0F9F873334F
168B5490771F5C6DB5BCD12A194A2A6367ABC0A4645F165127F6F4831AE097BC
then they will crash upon loading a level and hang on the title screen (if S2.)
When opening the dev menu, I lose control over the application. Can't exit the menu or do anything.
Sonic 3.3.0 SHA-1: fde41461d57be5136bae6288c2696e8142848141
Sonic 1 2.0.4: SHA-1 - 6c6881e3dbde73d4dd0b37f68996a700c1186b1f
Title screen loads but crashes once level tries to load. Time Attack crashes when any level is chosen. You can add this version to the pinned issue.
I don't know if this fits here, but is there any way to start the game on a specific scene (for example, starting the game on level select)? I can see there are 2 keys on the config file (StartingScene and StartingCatergory) that seem to do this, but I don't know how to make it work.
if you start up a game with sonic alone, pause and exit to the main menu, start up a game with sonic & tails then exit to main menu again, start up a game with sonic alone again and tails still joins you anyways
edit : i've tried testing this on sonic 1 to see if it would happen again and i was right
I tried rebinding the controller inputs from the SDL config in settings.ini to match my controller's but it does not react in game or in the menu.
Turned Dev Mode off
No other application was running that took the controller input
It involves the SEGA Mega Drive/Genesis Mini 3B Controller (that is compatible with Windows natively as a DInput device, that should work with SDL)
Also, there seems to be no way of mapping axis?
My config:
A = 3
B = 2
C = 6
Start = 10
Up/Down/Left/Right should be -a4, +a4, -a3, +a3 but they get zeroed out upon initialising. (D-Pad is X/Y axis based, no buttons)
Also tried having them set at a lower button number to take a 0-index start into account, made no difference.
Edit:
For clarity, according to Windows, the following button layout is present with the 3B Controller:
A = 3, B = 2, C = 6, Start = 10, Up = Y up, Down = Y down, Left = X left, Right = X right. Only one analog stick was visible.
Every time I set StartingCategory and StartingScene to some ID and start the game, I get sent to the start menu instead of the specified scene. After this, StartingCategory and StartingScene automatically get set to true. I have tried different IDs and got the same result every time.
In the core games, if you change the options to S3 items in game, and then Game Over, when you go to Time Attack, the Elemental Shields are accessible in Time Attack. If you select Sonic + Tails and do the same thing, you also get Sonic + Tails in Time Attack.
In this version, doing the same thing does not get you the Elemental Shields in Time Attack, but it does give you Sonic + Tails.
Ideally the game options would just extend to Time Attack mode so there would be no need to Game Over at all.
I was playing and my screen started to dim to prepare the computer to go to sleep, that's because the graphics server noticed no input (I was playing with a gamepad and it doesn't check that). There are ways to make an app ask the OS to not go to sleep while it runs (e.g. video players do that) and we should do it here too.
Attempting to disable the spindash in the game options does not actually disable it.
This happens with the dev menu enabled or disabled, even when item type is set to exclusively S1.
MD5 of my Data.rsdk: 10E320E8B3C1BA3B87B1E8EE01B2492C (v2.0.8, pre-Sega Forever)
I was messing around to see what ridiculous resolutions I could run this at when I stumbled across this. Sonic's been walking in place for a couple minutes now. ScreenWidth is set to 570 (for 21:9 aspect) in this screenshot. Obviously this is not a big deal given the game was designed for 16:9 screens, but it's worth noting.
Softlocks:
Other issues:
In Hill Top Zone Act 2, in Sonic 2, enter the vertical cave with the rising lava. The shaking effects do start, and the lava does collide with & damage the player character, but said lava is invisible. I do not know what causes this issue - a similar area in Act 1 has visible lava.
What about GPL? Or MIT maybe?
After the Star Light Zone fadeaway, Nakamura's name popped up, but the next cutscene (Scrap Brain) failed to load and my game crashed.
I have a recording of this occurring here: https://youtu.be/mg4FFN7tzfg (Xbox Game Bar made it look crappy, my b on that end)
I also attached the log if that helps.
log.txt
I was only able to pull this off twice, once in CPZ2 and once in CNZ2, but after popping the capsule after the boss while Super, Knuckles reverted to normal while still having the same speed and jump as Super Knuckles. I think this might have to do with gliding/falling onto the capsule, as I was not able to pull it off in HTZ2 when I jumped on the capsule normally. I don't know if this affects other characters as well.
All of the files inside are movable but the I cant move the folder the game is in after opening it and closing it
The boss fight was going on as usual, but when i defeated Robotnik, i quickly went to the capsule pod to push the button so i could finish the stage, but the game crashed as soon as i pushed the button.
Maybe it was because Robotnik hadn't gotten out of his "explosion state" or whatever. Or maybe i was too fast.
When I try to run either Sonic 1 or 2, the game will keep a log file despite having turned off the dev menu in the settings.ini.
This feature is available in your Sonic CD decompilation, as 'EngineDebugMode=false'. Would love to see this added as well!
When entering a tube at a low enough speed to be pushed back out while holding the "inwards" direction, control is temporarily removed from the player upon exiting the tube.
Illustrated below, I am holding left for the entire duration of the GIF, yet you can see that Sonic stands still for a while upon exiting the tube despite the direction being held.
In the original mobile version you can move immediately after exiting the tube.
(Using Data.rsdk from v2.0.8)
I'm running the game in Fullscreen mode and tried with vsync both enabled and disabled, as well as limiting my framerate to 60 via RTSS, but the game stutters a lot. Happens in both Sonic 1 and Sonic 2.
Is there some setting I should be enabling to get smooth, stutter-free 60fps, or is this currently being worked on?
In Sonic 1, using this decompilation, accessing the Dev Menu through the Pause menu specifically will lock up the game, and require you to close the tab.
Actually this glitch can be done in the original mobile port, but here it is much weirder.
I first chose Sonic and Tails, ran through several levels, deleted the save file. Then I decided to play for Knuckles, but the same Sonic and Tails appeared again. I played around a bit, went to the same save file again and I'm playing as Knuckles and Tails now.
After I went back to the menu, Sonic and Tails were already displayed in the save select and you are already playing for them.
I tried using both 64-bit and 32-bit versions, but no dice. The Logfile says each time that it won't read anything that is in the RSDK file at all.
log.txt
Aquatic Ruin
There's also a similar problem with water splashes in ARZ see here
I haven't tested the bad ending. The planet looks red and Super Sonic is a light blue for a split second when the pixel art first appears.
Whenever you pause the game on any level in Sonic 1, then go to the dev menu, the sprites for the letters will become garbled up sonic sprites, and the game locks up.
I think it's a bit bothersome. If it's possible, could this be fixed in a later build?
IDK about other OSes but on Linux we can still see the mouse pointer when it's on the window, which is acceptable when the window is floating or maximized, but feels odd when it's fullscreened. We probably should hide the pointer on fullscreen.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.