don't click here

The hacking of Sonic 3 problems

Discussion in 'Engineering & Reverse Engineering' started by Guardian, Feb 6, 2006.

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

    Guardian

    Pending Member
    23
    0
    0
    Sonic & Mario
    I see here on these boards that most hacks are done on S1 & S2. Hacks like the one Stealth did to put in Knuckles in S1, etc is pretty damn good. S3 seems to be more of a bitch to hack. Tiles are scattered everywhere. And locating some of the onsets of sprites in perticular are a real pain. Most of the best hack tools are for those two games.

    Upon research, the program Soniksprite works wonders for sprite editing. However, is unable to edit other sprites like tails in the background of the title screen, very small, special stage running, and even the victory jump when you beat the game.

    Then I was interested in hacking robotnik/eggman's sprite as well. His can't seem to be located to edit. I was wondering if anyone here knows where the onsets for his location are for me to hack?
    Below is just a sample of what I'm working on at the moment.
    [​IMG]
    It's not a photoshop fake. And I intend on making it much more unique.

    To the experts here who know the program, "Sega Data Compressor" I've like figured out half and half of that program. The only way that I see to hack robotniks sprites is to decompress his offsets, then edit them in Tile Layer Pro.

    I've found that his hex offsets locations in "Nemesis" are
    - 1800A2 - Another explosion
    - 18041E - Robotnic in his main ship
    - 18097A - Robotnic's head
    - 180BEC - Robotnic
    - 181002 - More robotnic

    On to my question. I'm new at this just to let you know. I go to N-Decompressor, theres a source file & destination file. Now correct me if I'm wrong. The source file is the rom itself, "Sonic The Hedgehog 3 (U) [!]" right? Now in the destination file, is it the same rom or a copy of the rom? Furthermore, I did a copy of the rom in the destination file: The result was a bin file, but in 1.00 KB. And I was able to edit it in Tile layer pro, heres where I'm asking for assistance.

    After you do changes and save in TLP, you have to compress it back into the 2.00 MB rom I understand. You go into Nemesis, what goes into source data and destination file? I've tried putting the 2.00 mb bin rom into the source data and the 1.00 KB bin file in destination. Didn't work. A problem eccurs and the program is forced to close. I tried it the other way, the file was overwritten, but it turned out to be from 2.00 mb to 654 kb. What exactly am I doing wrong?
     
  2. Rika Chou

    Rika Chou

    Tech Member
    5,276
    169
    43
    When decompressing:
    Source file: Your ROM
    destination file: Make a new filename, this file is the decompressed file

    When compressing:
    source file: the new file you got when decompressing.
    destination file: Yet another new filename, this is the same file but it is compressed and ready to be used in the ROM again.

    To put your file in the ROM again, you need a hex editor.
     
  3. Tom41

    Tom41

    Pheer the baby EggRobo! Oldbie
    291
    0
    0
    UK
    If you're going to put Mario into Sonic, or Sonic into a Mario game, you'll need to do some resizing. Sonic's sprite is much bigger than Mario's (as evidenced by that screenshot), so you'll probably need to increase the size of the Mario sprite.
    You could also shrink the Sonic sprite, but that's not recommended as it would cause some pixels to be lost, and also the smaller sprites wouldn't 'fit' with the size of the terrain.

    Also, I'm sure there was a utility that let you put your modified, compressed sprites back in the ROM without having to enter everything manually with a hex editor...
     
  4. Guardian

    Guardian

    Pending Member
    23
    0
    0
    Sonic & Mario
    Yes, people have been telling me that as well. Looks like I might just have to resize him after all. I also wanted to replace S3 intro with S2 intro instead. And take out tails flying sound and replace it. Stealth did that with Knuckles intro in S1. Again, I have no idea how he did that. If he can do that with S1, then the S2 intro can most certainly put into the S3 intro. Mario's sprite which you see in the picture is the 8-bit color. That too is going to have to go through some changes with the 16-bit sprite instead.

    If there is a way to put compressed art back into a rom without using a hex editor, I have no idea which program that would be. However Elusive's rom hacking guide is seems to be getting the job done thus far.
     
  5. LocalH

    LocalH

    roxoring your soxors Tech Member
    3,314
    35
    28
    Nunya
    Rock Band 3 Deluxe
    If you're wanting to do something that major, you will have to learn ASM, no way around it. That was the crux of how Stealth made KiS1 - he disassembled KiS2 and worked with an S1 disassembly (dunno if he used Hive's disasm or did it himself, but that doesn't matter in this discussion).

    If you want some larger Mario sprites, you might look at the graphics from that Super Mario World pirate (the one based on Chip'n'Dale). You'd have to implement them with the Sonic mapping standard, but it should be possible. You'd also have to do a bit of custom artwork if you want anything other than a standard Super Mario, and of course the additional frames of animation to make Mario fit within the Sonic playfield (rotation for loops, etc).
     
  6. Guardian

    Guardian

    Pending Member
    23
    0
    0
    Sonic & Mario
    Since this board is about hex editing. I have some questions if you don't mind. I have read the board below Enginnering & Reverse and I'm at a barracade so to speak. LocalH, if this does not belong here, I truly apologize. Upon reading Tweaker's and Elusive's guide to hack with hex. It is a problem that I'm having trouble getting around to.

    Elusive's hacking tutorial fifteen steps are fantastic. I got all the steps down perfectly from one to thirteen. Step number fourteen is where the the problem is at hand.

    Offset# 18041E is what I'm working on. That's found in Sonic 3 of Nemesis section in Sonic Data compressor, aka, (Robotnic in his main ship). Taken and edited in Tile layer pro, his sprite has been changed and recompressed. Step 13 completed. In Hex workshop. Which is the program I'm currently using. Sonic3 & the compressed art from TLP have been uploaded. Elusive worked on the example signpost #03A53E from sonic 2 and placing it in S1. He said it was located at 0001D978 using the 'pointer'? 18041E needs to be located in S3.

    I'm just an amatuer at this, don't be too harsh on me for not knowing my shit. How exactly do you come to those numbers from 03A53E to 0001D978? What do you press in the menu step by step? Elusive didn't put up pictures for that one step only. Which I wish he did. The end of the S1 rom he was working on, ends at 00080000. Sonic 3 rom ends at 001FFFF8. Check this picture if I'm correct or not. End of Sonic3

    Tweaker & Elusive say that you must go to the pointer. Meaning I must find 18041E pointer in the "Sonic3 rom" and replace it with 001FFFF8?? Then go to my compressed art, copy it and paste it at the end of 001FFFF8 behind the four FFFF's next to 001FFFF8? Save and load up rom and the changes will be there. I don't understand. Can anyone here assist me please? I really am wanting to learn this and get this right correctly.
     
  7. Tweaker

    Tweaker

    Banned
    12,387
    2
    0
    Right, changing a pointer. This is simple.

    If you've already found the pointer for the art, then all you need to do is change the offset it points to. Your 18041E pointer will appear as 00 18 04 1E in ROM. You want to change this to your new art offset, 1FFFF8. So go ahead and change "00 18 04 1E" to "00 1F FF F8." Then just stick your new art at $1FFFF8, and you'll be good to go.

    Make sure you compressed it in the right format, just for clarity. Most art uses Nemesis format, and I'm assuming you decompressed it fine using Nemesis. So just make sure you recompressed in Nemesis, and not anything else.
     
  8. Guardian

    Guardian

    Pending Member
    23
    0
    0
    Sonic & Mario
    that's my problem Tweaker, finding the pointer. Observe.
    finding the pointer
    I assume you find it by going to Edit>Find? In Critera, Type should be Hex values highlighted and Value should be 00 18 04 1E or no? With the spaces between the two numbers? Hope my options are correct in Critera. I did infact tried this with the current settings in the picture above and the result it said on the bottom right was "9 instances of 0018041E found"
    offset reults
    Again, is this correct or no? I'm pretty sure your only supposed to have just one result only. The highlighted in yellow shows where they are.

    And yes, I did infact recompressed it in the correct format using Nemesis. It reads as a .BIN file.
     
  9. jman2050

    jman2050

    Teh Sonik Haker Tech Member
    634
    4
    18
    There's no guarantee that you'll only get one result. If you get multiple results, it either goes to that address multiple times or it's a coincidence.

    At this point, it's time to experiment and hope you get something that works.
     
  10. Tweaker

    Tweaker

    Banned
    12,387
    2
    0
    If there are multiple results, that means there are multiple references to the data. Change all of them.
     
  11. Guardian

    Guardian

    Pending Member
    23
    0
    0
    Sonic & Mario
    Alright, I'm back. And I'm getting somewhere. Damn this hex stuff is very complicated. I'm almost there to getting down hex. As usual, I'm at a snag so to speak. Observe.

    [​IMG]
    The picture above was the only way I could find offset #0018041E. Look on the bottom left and it'll be circled in red. Forgive me for enhancing this image. It was too damn small for those of you to see. Look on the bottom left. It says "offset 1573918 [0x001841E]". Now look at the pointer. I assume it's called the pointer, at "8052". That's the small black vertical line next the 4-digit number alittle above the offset results if you can't see it. I had to manually scroll through the whole rom just to find it.

    Using the hex workshop program, I find that by going by the Edit>Find routine just doesn't cut it. Correct me if I'm wrong. If I'm doing it the harder way and if there's an easier way to find this. Please let me know what I'm doing wrong here so that my newbie ass knows what he's doing.

    Now let's try a different approach. The Edit>Find way in criteria. Hex values is highlighted. And now look at the picture below.
    [​IMG]
    Highlighted in yellow is of course 0018041E. But look to the left of the picture. Its really in the 0005B434, 0005b45C, etc offset's section and so on. Not the offset's that I want it to piont to. Now everyone here I see on this board says to place the end of the rom offset's AT the pointer to where I must place my compressed art. Tweaker explained thing's very clearly yesterday. The end of Sonic3 rom ends at 001FFFFF. Not 001FFFF8 in the above posts. But it's really 00200000 that it'll end that needs to be placed. Replacing all the current numbers in the above picture to 00200000 does not hack the rom I want it to. Because it can't be the correct offset.

    Determined to get this right. I copied and pasted my compressed art right in front of "8052" in the top picture. Saved. Opened the rom, and I got this below.
    [​IMG]
    As you can see in the picture above. This is the sprite I hacked with eggman. Replacing him with Dr. Wily. I was so happy that it finally worked. After I defeated the boss, a problem occurs. A purple screen comes up and the rom is absolutely unplayalbe from thereon. Hell, even the entire rom itself is unplayable. I had an already saved state to test this out to begin with. According to what Tweaker said. In most Nemesis compressed art, the edited file is larger than the original file. It seems that I'm overwritting some vital data it seems. Which I assume that's why the rom didn't want to play anymore afterthat. I am so close to getting this down. I know I'm doing something wrong. But I'm on the right track. I know it. 0018041E must be replaced with 00200000. THEN I paste my data in front of 00200000. Then I'm all set to go. Please explain it to me step by step on how to do this. Cause going by Edit>File in Critera doesn't seem to find it for me. I know it's supposed to be replaced. But how do I change it in the very top picture? I keep getting the results in the second picture above highlighted in yellow. Maybe I could give my compressed art file to a volunteer here and help me work on this hack so they can fix this problem for me? I dout anyone here is willing to do this for me. That would be highly appreciative. S2B, please help me.
     
  12. Tweaker

    Tweaker

    Banned
    12,387
    2
    0
    Right, try this...

    Hit Ctrl+H. Replace all instances of 0018041E with 00200000. Then take the compress Nemesis art and insert at offset $200000. Not $20000 -- $200000. This HAS to work -- it can't not work due to the way the game works. I can only assume you've been trying to overwrite something, but failed.

    If the old art location is still valid and the art isn't too big, then make sure you overwrite the amount of bytes the new art data is at $18041E. For example, if your new art is $56F bytes, then select $56F bytes at $18041E and paste over whatever is there. If you did this, then what is causing it to crash is indeed data after the art... I'm not sure what it is, though.
     
  13. LocalH

    LocalH

    roxoring your soxors Tech Member
    3,314
    35
    28
    Nunya
    Rock Band 3 Deluxe
    Guardian: Here's a recommendation to help make finding offsets faster when looking at a hex editor - resize your window so that you only see 8 words on each line (right now your screenshot shows 14 words per line). Once youve done that, then the offsets on the left-hand side will increase by $10 each line.
     
  14. Guardian

    Guardian

    Pending Member
    23
    0
    0
    Sonic & Mario
    Thank you Tweaker, LocalH. My dumbass self finally got it right. It works perfectly now. I truley thank you all from the bottom of my heart. :worship: Time to get hacking. Going to make my own hack guide soon on hex.
     
  15. Hivebrain

    Hivebrain

    Administrator
    3,065
    201
    43
    53.4N, 1.5W
    Github
    $200000 is the SRAM address in Sonic 3, meaning you can't put data there.
     
  16. Aurochs

    Aurochs

    Единый, могучий Советский Союз! Tech Member
    2,343
    0
    0
    Whatever catches my fancy
    Two words: bank switching.
     
  17. Tweaker

    Tweaker

    Banned
    12,387
    2
    0
    That's odd to hear, as I've done it before...

    Anyway, that could be fixed by remapping SRAM. No big deal.
     
  18. Guardian

    Guardian

    Pending Member
    23
    0
    0
    Sonic & Mario
    UPDATE:

    Ok, I got hexing down pretty good. Aparently, not good enough. Hexing a single game like Sonic3 I can do which I used to have problem's with. Now I want to pass over my work to the "Sonic3&Knuckles" rom. Here is some more trouble that I'm having. My compressed art from S3 "will not" show up in the converted rom, S3&K. Tweaker explained to me the details that I could follow.

    Again, my compressed offset number is 0018041E. To find it, you convert the S3 & S&K rom and read S3&K in a hex editor, it should show up in offset's 0038041E. How do you get that number? Tweaker said if you add 0018041E + 00200000 = 0038041E. Since both rom's end at 2mb, combined gets 4mb. Indeed, my compressed art does infact show up at that exact offset. But my art refuses to show up when playing the S3&K rom. It's like I'm back at square one again. Observe the pictures below.
    [​IMG]
    The above picture is my compressed artwork. Its half the picture just so you know. Now look at the picture below. I'm at offset 0038041E in S3&K rom.
    [​IMG]
    I've highlighted it, but not all of it, notice that its the same offsets from my art. From left to right 0052 8074, etc. Also circled in red as to where it show's the offset. This is another problem I'm having. The art won't view in the rom. I'm guessing that my compressed art must be in the S&K rom, as well as S3, then convert it and it should show up. Again, I'm on the right track, thanks to Tweaker's help. Is there a step I'm missing? Can anyone help out please?
     
  19. Stealth

    Stealth

    Tech Member
    594
    30
    28
    Sonic Mania, HCGE, Sonic Megamix, SonED2, [...]
    It seems like you didn't realize that the modified pointers in the Sonic 3 ROM don't affect the Sonic and Knuckles program. When Sonic 3 is shifted to the $200000-$400000 address space, all of the absolute references (32-bit address pointers) are invalid, because they're pointing to the original $000000-$200000 space, where Sonic and Knuckles is. This means that code with absolute jumps rather than branches can't be run, and lists of absolute pointers are meaningless. The entire program is run from the Sonic and Knuckles cartridge (with the exception of the level area events code for the original Sonic 3 levels, which use relative references), and any pointers to data that only exists in Sonic 3 have been re-listed to point to their new locations rather than where they'd be in Sonic 3 alone. In effect, you've only told Sonic 3 where to find your changes, not Sonic(3) and Knuckles
     
  20. Guardian

    Guardian

    Pending Member
    23
    0
    0
    Sonic & Mario
    I figured that was the cause of it. How can I correct this Stealth?
     
Thread Status:
Not open for further replies.