don't click here

Sonic 3K Save Editor 0.6

Discussion in 'Engineering & Reverse Engineering' started by Xeeynamo, Aug 25, 2010.

Thread Status:
Not open for further replies.
  1. Xeeynamo

    Xeeynamo

    Member
    38
    29
    18
    London
    Sonic and Knuckles Collection Save Editor. Nothing to say, just download and enjoy :v:

    Download location of savegame editor and SaveGameS3k lib source code:
    http://digitalwork.altervista.org/digitalw....php?page=s3kse

    [​IMG]
    Old video from 0.3 version
     
  2. Selbi

    Selbi

    The Euphonic Mess Member
    1,497
    48
    28
    Northern Germany
    Sonic ERaZor
    You can even select Blue Knuckles? Now this makes the whole thing a lot more interesting. I'm honestly looking forward to this. =)
     
  3. Namo

    Namo

    take a screenshot of your heart Member
    2,912
    0
    0
    Lookin' pretty spiff, there, Xeey. I haven't installed my Sonic and Knuckles PC copy in ages.
     
  4. Endri

    Endri

    Officer I don't have my drivers license with me. C Tech Member
    [​IMG]
    wat?!

    I've never seem that Flying Battery Zone icon. Also note that it shows when editing Sonic 3, and is remarked as ZONE 5. It is further evidence that Flying Baterry was indeed supposed to come after Carnival Night Zone and before Ice Cap Zone (and that the wicket at the end of Flying Battery Zone ACT 2 is what Sonic uses as a snowboard [​IMG]).
     
  5. DigitalDuck

    DigitalDuck

    Arriving four years late. Member
    5,349
    435
    63
    Lincs, UK
    TurBoa, S1RL
    This has been known for a while. I still wish they'd done it that way, though. I think we've also had theories to suggest that Flying Battery Zone originally had a dark palette in Act 1, to comply with time progression. (I.e. MGZ is late afternoon, sun sets towards the end, CNZ is night, FBZ would be early morning, ICZ is morning with sun rising in Act 2, etc.)
     
  6. Xeeynamo

    Xeeynamo

    Member
    38
    29
    18
    London
  7. The Shad

    The Shad

    ↑ & ↓ & ↻ Oldbie
    3,073
    8
    18
    This makes me wish someone would get a hack of Sonic 3 going to put Flying Battery back in like that.
     
  8. dsrb

    dsrb

    Member
    3,149
    0
    16
  9. Tiddles

    Tiddles

    Diamond Dust Tech Member
    471
    0
    0
    Leicester, England
    Get in an accident and wake up in 1973
    They both have the icon back in place already, but it's still for Zone 8. :)
    This is definitely a planned feature for Customizable. I don't have any plans to put it in Complete yet, but I haven't ruled it out.

    I had a go with the beta editor. It looks quite nice, but I had an issue - using a completed file I'd created with another editor in the past, the zone was presented as CLEAR but with a blank icon, and no apparent effect if I moved left or right on it. I couldn't edit the S3K emeralds either - I guess this isn't implemented yet? Editing the S3 ones worked fine and it's quite easy to fill up by pressing left, but editing a semi-complete game to have all the emeralds could take quite a bit of pressing left or right from the incomplete state! Maybe there could be a shortcut to completely empty/fill the emerald slots?

    I don't know if there could be an option for a double-size window, too - it's quite hard for me to read in its original size. :)

    I'll probably be able to provide more feedback once you finish Mega Drive SRAM editing functionality, because it could actually be quite useful for me for testing purposes - I don't use S&KC much so I only had a quick play around to get an idea. Keep up the good work!
     
  10. Xeeynamo

    Xeeynamo

    Member
    38
    29
    18
    London
    Thanks for the feedback Tiddles :). Can you post here or upload the savegame created with the other editor?
    Yes, S3K Emeralds editor isn't impemented yet because it have a stupid algorithm -.- it save the emeralds in 2 bytes with this binary structure: X1X2X3X4X5X6X7X8 (Eight emerald? Surely it's only a dummy). Initially the 2 bytes are 0 and when you collect for example the 2nd emerald, the X1X2X3X4X5X6X7X8 will be 1. When all 7 chaos emeralds will be obtained the binary structure will become 0101010101010100 (Last 8th emerald :P). Now if you enter in super giant ring, after the Hidden Palace's sequence all the emerald's data will be switched to left becoming 1010101010101000. Now when the player will gain the 2nd emerald the binary data will be 1011101010101000 obtaining the 2nd Super Emerald. I'm a bit lazy ( :ssh: ) and I'm dropped this feature in this beta. The only thing that I've implemented is the switching of data for enable Super Emerald's states pressing Shift.
    I know, the emeralds editor in Sonic 3 it's a bit annoying and the only fast way to fill the 7 emeralds it's to press left when you don't have any Chaos Emerald. I think that a fast way to edit emeralds is to use Q W E R A S and D to enable/disable every of 8 emeralds but some nations use different keyboard's layout (I'm using QWERTY). After I'll optimize the current bad way to edit emeralds of course.
    The double-size feature it's a good idea and it's the most easy thing that I can do xD. It's a good idea and I was stupid to not think this.
    MegaDrive SRAM support it's a bit hard to implement because it use a checksum to see if the savegame was corrupted by something. I've try everthing :\ sum, sub, mul, div, and, or, not using byte or word sizes. The savegame is long 512 bytes and the word-size values are reversed (the strange nature of 68K O.o).
     
  11. GerbilSoft

    GerbilSoft

    RickRotate'd. Administrator
    2,971
    76
    28
    USA
    rom-properties
    Regarding MD SRAM: Sonic 3's SRAM chip is only 8 bits wide, and is mapped to odd bytes. All the even bytes should be 0xFF (or 0x00 on some emulators). Gens (and Gens/GS) saves the SRAM in its native form. Kega and Regen have byteswapped SRAM, in which case the data is stored on even bytes instead of odd bytes.

    For chaos emeralds / super emeralds, it shouldn't be too hard to use bit-shifting. Here's some macros you can use. (flags is the 16-bit emerald flags variable; emerald is a number from 0-7, where 0 is the first emerald and 7 is the eighth emerald.) [I may have ordering backwards, in which case you'll simply need to subtract the actual emerald number from 7 before using these macros.]

    Code (Text):
    1. #define CLEAR_EMERALDS(flags, emerald) \
    2. do { \
    3. &nbsp;&nbsp;&nbsp;&nbsp;flags &= ~(1 << (emerald * 2 + 1)); \
    4. &nbsp;&nbsp;&nbsp;&nbsp;flags &= ~(1 << (emerald * 2)); \
    5. } while (0)
    6.  
    7. #define SET_CHAOS_EMERALD(flags, emerald) \
    8. do { \
    9. &nbsp;&nbsp;&nbsp;&nbsp;flags &= ~(1 << (emerald * 2 + 1)); \
    10. &nbsp;&nbsp;&nbsp;&nbsp;flags |=&nbsp;&nbsp;(1 << (emerald * 2)); \
    11. } while (0)
    12.  
    13. #define SET_TRANSFORMED_EMERALD(flags, emerald) \
    14. do { \
    15. &nbsp;&nbsp;&nbsp;&nbsp;flags |=&nbsp;&nbsp;(1 << (emerald * 2 + 1)); \
    16. &nbsp;&nbsp;&nbsp;&nbsp;flags &= ~(1 << (emerald * 2)); \
    17. } while (0)
    18.  
    19. #define SET_SUPER_EMERALD(flags, emerald) \
    20. do { \
    21. &nbsp;&nbsp;&nbsp;&nbsp;flags |=&nbsp;&nbsp;(1 << (emerald * 2 + 1)); \
    22. &nbsp;&nbsp;&nbsp;&nbsp;flags |=&nbsp;&nbsp;(1 << (emerald * 2)); \
    23. } while (0)
     
  12. Dark Sonic

    Dark Sonic

    Member
    14,631
    1,611
    93
    Working on my art!
    Also further support of this lies in the colors of the special stages. The 5th special stages uses a flying battery color theme, while the 4th uses a Carnival Night theme and the 6th uses and Ice Cap theme
     
  13. Tiberious

    Tiberious

    Yeah, I'm furry. Got a problem? Oldbie
    778
    15
    18
    I remember an old save editor I had that also allowed selecting Flying Battery in Sonic 3.

    What's funny is after beating the (fully-functional[!]) stage, it continued right on into Sandopolis, still using the Sonic 3 titlecard and music. Eventually, you played through the entire Sonic 3 & Knuckles game like it was always intended.
     
  14. Tiddles

    Tiddles

    Diamond Dust Tech Member
    471
    0
    0
    Leicester, England
    Get in an accident and wake up in 1973
    Certainly. FWIW, the S3K slots in this work fine in game, but the S3 ones don't properly recognise that all the emeralds have been collected - giant rings still lead to special stages for some reason. If your editor can sort that out correctly it would be a bonus - I haven't tried actually playing a game edited with it yet so I don't know.

    I feel your pain there. This is exactly why an editor would be helpful. :)
    I've taken to picking at savestates and forcing it to resave to SRAM when I need to edit something. I don't know if that might be a useful way to go about figuring out the checksum routine.

    This is because S&KC Sonic 3 is a "hack" of sorts built on top of its version of S3&K. The leftover Flying Battery entry from the save screen will happily take you into the final Flying Battery because it's still present in the master game (and always retained its intended Sonic 3 zone ID even though it never ended up being played in that order), you just never get there in S3 mode. And because you should never get into the S&K half of the game, there's no special code to stop you going further once you do break in. The same principle applies to hacked saves using Knuckles in S&KC S3 - Knuckles works fine, but he'll still be visiting the Sonic 3 versions of the level layouts, which are mostly uncompletable along his routes.

    It's just as possible to create an FBZ save in regular Sonic 3, in which case you'll get a title card for it and nothing more, since it's fairly comprehensively removed from the final game. Likewise a Knuckles game will mostly send you around as Sonic with some signpost and results screen references to Knuckles.
     
  15. Volpino

    Volpino

    Things are looking up! Member
    1,207
    0
    0
    A secret. >:3
    Sorry if I'm asking a stupid question but why does Knuckles turn blue? Can we also edit character pallets or something?
     
  16. theocas

    theocas

    Tech Member
    346
    0
    16
    Because the game doesn't know to load his correct pallet?
    If you wanted to edit the pallets, you'd have to edit them in the ROM, not using a save file.
     
  17. Tiddles

    Tiddles

    Diamond Dust Tech Member
    471
    0
    0
    Leicester, England
    Get in an accident and wake up in 1973
    I assume you're referring to the "Blue Knuckles" that shows up as an option in the save editor and can be save edited or game genied into the game. This is an artifact of selecting a character ID that is meaningless to the game, resulting in the game falling into a state of complete confusion and giving you Knuckles' character object with Sonic's palette (to start with at least) and Tails' name on the victory screen, along with a general heap of broken.
     
  18. Tidbit

    Tidbit

    Member
    And if I remember correctly, you'd have to restart because knuckles wouldn't be able to die after words.
     
  19. Ravenfreak

    Ravenfreak

    2 Edgy 4 U Tech Member
    3,086
    181
    43
    O'Fallon Mo
    Sonic 1 Game Gear Disassembly
    ^ That's because Blue Knuckles attempts to go to Knuckles' area in AI1, but since the game thinks you are playing as Sonic it loads Sonic's level boundaries and you die instantly.
     
  20. Xeeynamo

    Xeeynamo

    Member
    38
    29
    18
    London
    Simply Blue Knuckles is a bug and I've add it on my editor.

    00 = Sonic and Tails
    01 = Sonic
    02 = Tails
    03 = Knuckles
    03 > Blue Knuckles

    The game probably has these routines:

    This is why knuckles is blue
    This is why the game load knuckles sprites
    This is why the game doesn't allow knuckles paths

    @Tiddles:
    I've understand why the two editors aren't compatible each other:
    The other editor that you use set the ending game var to 0x7F. There are 5 ending modes:
    0x00 = Standard
    0x01 = Ending without chaos emeralds
    0x02 = Ending without super emeralds
    0x03 = Full Ending
    0x80 = Erased savegame.

    My editor doesn't recognize 0x7F but after 2 minutes of researches I've found that Sonic 3K read only the first 2 bits and the 8th bit. I can write 0x6F, 0x17, 0x03, 0x1F and I can say that there are the same things on the game. If the value is 0x80 or more the slot will be empty. The game set only first 2 bits when you finish the game and after this I can say that the other save editor isn't 100% accurate. However I've resolved this issue and... I've implemented the double-size window ;)

    @GerbilSoft:
    Wow, thanks for the macros :D
     
Thread Status:
Not open for further replies.