THE SonED2 thread

Discussion in 'Engineering & Reverse Engineering' started by Stealth, Sep 2, 2006.

  1. Stealth

    Stealth

    Tech Members Tech Member
    593
    0
    0
    Sonic Mania, HCGE, Sonic Megamix, SonED2, [...]
    I didn't want to make another small release, but since interest in Sonic 1 seems to have spontaneously exploded, I don't suppose it will stay relatively unnoticed if I keep putting this off.

    SonED2 V1.03

    v1.02
    This version does away with the Sonic 1 sprite saving error. There was a mistake in the save routine related to the support I tried to add for the "Remember Sprite State" flag in 1.01. It's been fixed so the sprites save with proper ID and proper flag setting, so there shouldn't be any disappearing/wrong sprites in the level in newly-created files. V1.00 disabled the flag during load, and enabled it during save for all sprites. V1.01 corrupted some sprites and didn't save the flag. Loading files generated with either of those two versions will load the currupted data. Bad sprite settings will need to be corrected manually, however, all sprites' "Remember Sprite State" flag can be set to the default value for that object type by holding SHIFT and pressing 0

    v1.03
    This version is a quickfix to remove some early development code that was mistakenly included, which caused pressing 1, 2, 3, or 4 to effectively alter the editor's level size setting without correcting the level data array, meaning that accidental keypresses (and subsequent saving without correcting the issue) would cause loss/corruption of data. Ctrl+Arrows is and has been the proper method for resizing a level (for Sonic 1, Sonic 2's level system requires them to stay at a fixed size)

    -------------------------------------------------------

    So that there aren't a million threads with the word "SonED2" in them, this is the one place for posts that have strictly to do with SonED2. However, as always, and as with all of my projects:

    -I won't answer questions or talk about future releases

    -I won't answer questions that are covered in the documentation

    -I won't answer otherwise retarded questions

    -I won't honor "feature requests". Any such request will more likely end up on a "not-to-do list"

    -I won't distribute sourcecode full or in-part for any reason whatsoever

    -The publicity of SonED2 (or any other project of my own) is a courtesy, not a service

    Moreover:

    -SonED2 is not a "ROM Editor", It edits individual files. Some extraction tools for the original games are provided, but ROM images are not and will not be

    -SonED2 is not "for disassemblies". I will not provide materials or information regarding any existing "disassembled"/"reverse-engineered" code

    -SonED2 is a data editing tool. It will not "cause your ROM to crash" and it will not "cause ASM errors". It is the user's responsibility to manage the use of their created/modified data, and to understand how to do exactly that; Anyone without a fair level of understanding of basic software/hardware principals has no business whining about what they think the problem is. Applying new data to any program is not a SonED2-related matter


    More statements will be added to the above if necessary. Anything not listed may be up for discussion
     
  2. Shadow Fire

    Shadow Fire

    Ultimate victory! Member
    1,557
    0
    0
    The Land of Darkness
    Sonic: The Lost Land (Series), The GCN (site)
    Let's... have... buttsecks...





    Okay... maybe not. But this is awesome. I download it now, even though I've never come across the error yet in 1.01.
     
  3. Vangar

    Vangar

    Member Member
    Ah an excellent fix. Thank you!
     
  4. .hack//zero

    .hack//zero

    Member Member
    2,999
    0
    0
    Learning NES ASM, Finding a girlfriend.
    Thank you so much for fixing this problem.
     
  5. SMTP

    SMTP

    Tech Members Tech Member
    Thanks! Works perfect now.

    A feature I always wanted to see (I'm not requesting. :P )was a way to split the data from SonED 1 roms.

    Also why can't we change Sonic's start location in SonED2?
     
  6. StephenUK

    StephenUK

    Liquor in the front, poker in the rear Tech Member
    1,675
    0
    0
    Manchester, UK
    Quackshot Disassembly
    Coz it's not an object. It'd mean you'd have to either have the character start positions extracted into a seperate file, or it would have to directly edit the disassembly. It's not hard to edit them anyway.
     
  7. SMTP

    SMTP

    Tech Members Tech Member
    I know, I was just wondering why he decided not to add it into SonED2.
     
  8. LocalH

    LocalH

    roxoring your soxors Tech Member
    3,256
    0
    16
    wouldn't you like to know
    Super Guitar Hero II
    Topic pinned. This is Stealth's topic, and he calls the shots. Which means that if there are crap posts, they will be split off and either left in their own topic or outright trashed, as per his wishes.
     
  9. Robjoe

    Robjoe

    Delicious and nutritious. Member
    840
    0
    0
    Ludington, Michigan, US
    Brawl mods, Megamix Layouts, and messing with Sonic 3.
    Ah, excellent. Just excellent. Now I can finally use the thing for level editing, and move away from SonED1 completely (for Sonic 1 and Sonic 2, that is). Thank you so much for this awesome utility! =)
     
  10. Cinossu

    Cinossu

    Administrator Administrator
    2,815
    0
    16
    London, UK
    Sonic the Hedgehog Extended Edition
    This wouldn't really affect many people, as not many people are adding their own objects into Sonic 1, and within the engine itself it self-rights this problem.

    In Sonic 1, if you have an object within a level with an ID over $80, it subtracts $80 from it to produce the object drawn. For example, rings have an object ID of $25. If you were to enter $A5 as the object ID in the object position file, it would self-right itself and draw a ring anyway.

    Now, here comes the fun part. There are already over $80 objects within Sonic 1. Some of the lower-end ones are ones not produced in levels, so the ones with IDs greater than $80 are catered for. However, go beyond this point, and it starts to loop itself.

    This is a fairly easy thing to solve within Sonic 1 itself, as it's just a few ASM lines to remove, and a little bit of fixing within object position files as and when they are needed. However, today I found out, within SonED2, it appears that Stealth also made the object list loop around itself, as I have signposts in place for the objects that should be +$80 in ID above it. Now, SonED2 does not have a source code to edit (unforunately!!), so.. I am now stuck if I want to add in my new objects to levels, unless I take the long way around and insert temporary objects, and editing the object position files myself after.

    Just some heads up for anyone wishing to seriously extend the object capacity within Sonic 1. :.
     
  11. Stealth

    Stealth

    Tech Members Tech Member
    593
    0
    0
    Sonic Mania, HCGE, Sonic Megamix, SonED2, [...]
    If something "strange" like that happens, you have to stop and ask yourself "why?". Cutting the number of sprite types they can store in the sprite list in half "for no reason" would be pretty stupid... Not to worry that I'm insulting you, though, because the problem with SonED2 1.00 came from a similar mistake on my part

    I have no doubt that you saw the code near address DA50 that "spawns" each individual sprite from the list into the SST, but what you probably didn't see (or understand) was the code above it, at the start of the routine (DA3C) where it first checks to see if that sprite has already been destroyed. First, it tests the sprite type. A "negative" (beyond $80) value is subject to further testing, while it just skips ahead to spawn the sprite if it's ID value is "positive" (below $80). That essentially makes the high bit a flag that's being tested at this point, and if that flag is on, the sprite is only put into the SST if it's not flagged as having been "destroyed" by it's entry in the "Persistence table" (the table at RAM address $FFFFFC00). This flag is what I've been referring to as the "Remember Sprite State Flag". Mistakenly setting or not setting the flag can cause some non-"destroyable" sprites to just disappear, and cause "destroyable" sprites to keep coming back. In Sonic 2 and above, the flag is stored in the upper bit of the Y position rather than the upper bit of the sprite type, and so, sprites with ID greater than $80 can be stored in the sprite layout list

    I don't appreciate subtle little stabs, though (intentional or unintentional as they may be), especially when you represent yourself to know better than I do, but are wrong. I'm sure you know which key statements (plural) from the first post apply
     
  12. Cinossu

    Cinossu

    Administrator Administrator
    2,815
    0
    16
    London, UK
    Sonic the Hedgehog Extended Edition
    It was not a stab at you, I promise you. It was just a little thing I found after I had been messing around with adding new objects, and found they loaded funny within SonED2. That was all. I apologise if it came out as an insulting post.
     
  13. Stealth

    Stealth

    Tech Members Tech Member
    593
    0
    0
    Sonic Mania, HCGE, Sonic Megamix, SonED2, [...]
    Well, that's not exactly what I was talking about, but since you didn't know, you must not have meant anything by it. No problem

    I did need to clear up that one issue, though, since that functionality has a purpose. I hope the explanation was decent
     
  14. Cinossu

    Cinossu

    Administrator Administrator
    2,815
    0
    16
    London, UK
    Sonic the Hedgehog Extended Edition
    It was, and thank you. I have altered my code so it works the same way as Sonic 2 now.
     
  15. BadCopNoDonut

    BadCopNoDonut

    O RLY? Oldbie
    785
    0
    0
    Sonic D T
    This has to do with SonED1, but I figured I'd put it in here anyway. How come it sometimes messes up to where when I try to draw a tile, it draws it like 3 tiles down or 2 tiles down from where I actually want it to go? I have to save, then exit, then reload SonED to get it back to normal, and it seems like after every few minutes, I have to do this again. Is there anything I can do to get it to not do this? (And before you say use SonED2, I can figure out how to use it, but I personally just outright prefer SonED1.)
     
  16. Stealth

    Stealth

    Tech Members Tech Member
    593
    0
    0
    Sonic Mania, HCGE, Sonic Megamix, SonED2, [...]
    That's not exactly a very detailed description of the problem (you didn't specify any details on re-creating the problem, and you didn't clarify which part of the editor you were using). The only problem I can re-create that sounds similar to what you're describing is in the tile editor, when drawing 16x16 blocks onto the 128x128 chunks, which causes the blocks to be drawn at an offset from the pointer, rather than at the block position you're pointing to. It has to do with the ability to view/edit different parts of Sonic 1's 256x256 chunks within the 128x128 viewing window. It wasn't supposed to affect Sonic 2, but although it doesn't affect the offset it's drawn at, it does affect the editing offset. If you press/bump the arrow keys for any reason, and this happens, count how many blocks away from the cursor's position the block was drawn or the selection was made, and press whatever arrow key will move it back toward the cursor that many times (If yours are being drawn 3 below, press up 3 times). Alternatively, you can just press up and left about a million times or until you feel comfortable if you can't/don't want to count. The offset won't move beyond zero

    If that isn't your problem, I can't imagine what it would be. All I know is that original SonED is filled with bugs and errors, some of which I still haven't been able to re-produce for myself, and I don't trust it. That's one of the reasons I made SonED2. I don't really know how anyone can still like SonED better.. the only thing it has going for it is that it hardly takes any brains whatsoever to change a few colors, quickly throw a few mis-matched tiles together, save, and parade the resulting ROM around like you're some kind of genius
     
  17. Rika Chou

    Rika Chou

    Tech Members Tech Member
    5,211
    0
    16
    The small arrows at the top-left of the 128x128 tile editor can be used to correct this. There are also keyboard keys that can change this, but I don't recall what keys they are.

    You probably get this problem by accidental pressing these keyboard buttons.
     
  18. BadCopNoDonut

    BadCopNoDonut

    O RLY? Oldbie
    785
    0
    0
    Sonic D T
    Yeah, that solves the problem. Thanks guys.
     
  19. Rockman Zero

    Rockman Zero

    Hello there, my little friend. Member
    1,030
    0
    16
    Videos for Hellfire Commentaries.
    Is there a way that I can show the pre-existing level art on SonED2?
     
  20. Varion Icaria

    Varion Icaria

    He's waiting.... Tech Member
    1,010
    0
    0
    S4: Cybernetic Outbreak
    Edit: Nevermind already Stated.