don't click here

Sonic 2: S3 Edition

Discussion in 'Engineering & Reverse Engineering' started by Alriightyman, May 26, 2008.

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

    Endgame

    Formerly The Growler Member
    I still can't seem to get level select to work. I've put in 1-9-8-2, pressed start, then hold a+start [that *is* how it's done, right? haven't used it for so long! - ie. haven't needed to]
     
  2. Alriightyman

    Alriightyman

    I am back... from the dead! Tech Member
    357
    11
    18
    Somewhere in hot, death Florida
    0101001101101111011011100110100101100011 00000010: 0101001100000011 01000101011001000110100101110100011010010110111101101110
    It's set up like Sonic 3. Kind of like selecting sound test. At the title screen, push up from "1 player" (or down from "options)" and it should select "level selct". After you input the level select code that is.
     
  3. I just have a question..

    Could you update the link?

    It leads me to a blank page.
     
  4. Hint: Alrightyman, put the working link in the first post, be a dear.

    Have there been any other updates recently?
     
  5. I found the link on the 2nd page. Silly me.

    The hack has a weird bug that freezes the game sometimes after an act is completed.

    Just for reference.
     
  6. jman2050

    jman2050

    Teh Sonik Haker Tech Member
    634
    4
    18
    This isn't exactly correct, or at least it wasn't clear what you meant. All the graphics are the same size as they are in the normal levels. What's happening is that Sonic 2 is using the Genesis' double-resolution mode, which will output graphics as if the resolution were doubled. In other words, when it grabs the graphics data in VRAM, it interlaces those graphics into the final 8x8 cell. This is what causes the squished effect in the 2P mode. The thing is, since the Genesis *still* has to maintain it's 8x8 cell structure when displaying graphics on screen, it has to treat every two tiles in VRAM as a single cell while in double-res interlaced mode. The top four lines of the cell are interlaced from the first VRAM tile, while the bottom four are interlaced from the second tile. WHat this also means is that the way the tiles are referenced by the nametable is completely different. Also note that even though it's called "double res" mode, this isn't technically the case. The nametable structure is still exactly the same, the main difference being that each 2-byte tile reference in the nametable will draw the "equivalent" of 16 pixels vertically instead of 8. For the record, this is why this routine exists in S2:


    Code (Text):
    1.     lea (Block_Table).w,a1
    2.     move.w  #$BFF,d2
    3.  
    4. loc_E41A:
    5.     move.w  (a1),d0
    6.     move.w  d0,d1
    7.     andi.w  #$F800,d0; filter for upper five bits
    8.     andi.w  #$7FF,d1; filter for lower eleven bits (patternIndex)
    9.     lsr.w   #1,d1; dunno what this is about
    10.     or.w    d1,d0
    11.     move.w  d0,(a1)+
    12.     dbf d2,loc_E41A
    (found in loadZoneBlockMaps if you're using the newest disasm)

    Since in double-res mode every two tiles in VRAM is treated as a cell, the patternIndex counts by every TWO tiles instead of one. So if patternIndex were 4, it'd be referencing the eighth tile in VRAM, not the fourth as normal. Thus, when playing a 2-player stage in Sonic 2, it has to go through the 16x16 blocks and divide the patternIndex part of the word by 2.

    As for the 16x8 blocks you referred to? The original 16x16 blocks are basically just a list of four nametable entries arranged as a square (or "block", thus the name), with each entry drawing an 8x8 tile. However, as I said, in double-res mode each nametable entry uses two tiles for a cell, arranged vertically (turning an 8x16 "tile" into an 8x8 cell). This means that for a given 16x16 block, you only need to put two nametable entries instead of 4 to produce an equivalent 16x16 tile on screen (or, since it's been interlaced, a 16x8 tile in the end). The game just so happens to use the first two nametable entries in a given 16x16 block. Obviously, this also changes the way the game updates the nametable as you move, but that's a relatively minor change and not hard to understand if you examine LoadTilesAsYouMove closely.

    The last question is then how the graphics are displayed properly if the game simply ignores half of a 16x16 block definition? They arranged the VRAM tiles in a way so that it would work of course. Look at a sheet of the EHZ tiles, either in VRAM or TLP or wherever. Visualize every two tiles as a single 8x16 tile, both tiles being stacked on top of each other. What you visualize is exactly what the Genesis draws interlaced for every cell definition in the nametable. This is also why if you change and reorganize the EHZ tile sheet it'll look like a mess in 2P mode. You'll find a similar pattern in MCZ and CNZ.

    Sorry for the long-winded explanation, although really I'm just explaining stuff that people before me already figured out. In fact, I think someone else made a much better explanation of this some time ago on these forums, though I can't remember when.
     
  7. nineko

    nineko

    I am the Holy Cat Tech Member
    6,354
    513
    93
    italy
    It was Nemesis, though most people here can't see his post.
     
  8. Alriightyman

    Alriightyman

    I am back... from the dead! Tech Member
    357
    11
    18
    Somewhere in hot, death Florida
    0101001101101111011011100110100101100011 00000010: 0101001100000011 01000101011001000110100101110100011010010110111101101110
    Done.
    Be patient, It's not quite ready for a release yet.

    It's been fixed. Just not released yet.
     
  9. Endgame

    Endgame

    Formerly The Growler Member
    Oh yeah that's done it for me, thanks alot :(
     
  10. Alriightyman

    Alriightyman

    I am back... from the dead! Tech Member
    357
    11
    18
    Somewhere in hot, death Florida
    0101001101101111011011100110100101100011 00000010: 0101001100000011 01000101011001000110100101110100011010010110111101101110
    Ok, since I start school on Monday and I work all day tomorrow, I have decided to release what I've got so far.

    Sonic 2: S3 Edition Current Features
    1) Act transitions in all levels (Excluding sky chase, wing fortress, and death egg)
    2) Fully functional InstaShield (Even extends sonic's attack radius)
    3) Tails can fly and swim.
    4) Using S3K ring management system (Thanks to Shobiz)
    6) Slight changes to level design (makes transitions flow better)
    7) 2 player mode removed
    9) Double Jump to change into Super Sonic
    10) Slightly Modified Sonic 2 Sound Driver
    11) Level Transitions (In Progress EHZ is finished)
    12) Sonic 3K Shields (In Progress)
    13) Save Screen (almost finished)
    14) EHZ Mini Boss (GHZ boss port)

    Also lots of bug fixes and some new and modified objects!
    I'm a little lazy right now so no new pics.
    EDIT: Bugfix.
    Here is the link.
    There are still many bugs present. Also a lot of Tails' levels will NOT load. I am aware of this and am trying to fix it.
    Aside from that, comments are welcome and let me know of any other bugs found.
    Enjoy!
    Thanks to everyone who helped contribute something.
    Shobiz
    Hitaxas
    Irixion
    And anyone else I forgot!
    EDIT: Few things and some people I forgot to mention who helped me out with something or another.
     
  11. Azu

    Azu

    I must be stupid. Member
    Is there a debug code, or is it the same as sonic 2?
     
  12. Graxer

    Graxer

    Member
    Great hack! However I did notice a few problems.

    Firstly, when I completed the EHZ Act 1 Boss sonic kept on walking on air and took a while to go back to normal. Secondly I can't get past ARZ Act 1. The first time when I passed the signpost the game froze, and the second time it just sat there as if nothing had happened (except it stopped the timer) and didn't bring up the score card.
     
  13. filmzombie

    filmzombie

    The real spindash... Member
    155
    0
    0
    England- The Land of Tea
    Sonic Synthesis
    brilliant!

    I especially love the little detail of how the Electric Shield deflects the crab's claw in Metropolis.
     
  14. Spanner

    Spanner

    I used to do things... Member
    3,363
    182
    43
    United Kingdom
    I wish I knew...
    Wow, this is fucking awesome!
    You've seriously worked on this hack and I love how you ported the GHZ Boss and used it as a miniboss, in fact there hasn't been any minibosses in a Sonic 2 hack as far as I know. I attempted it but failed, as usual...
    Anyway, great work! Looking forward to see your next work.
     
  15. Diablohead

    Diablohead

    Indie dev Oldbie
    1,898
    88
    28
    Near London
    games
    Very cool although was I the only one expecting to see sonic 2 sprites and visuals just running on the sonic 3 engine? This is the first time I seen this topic so my mistake.
     
  16. synchronizer

    synchronizer

    Member
    2,294
    109
    43
    Nice. I have a small problem in Genesis Plus (Mac Emulator) though. If I jump after hitting the first sigpost in Emerald Hill Zone, he plays his end of Act pose in mid-air, and then I can run on an invisible path in the air until I jump.

    EDIT: Actually, I have a bigger problem. The transition between Aquatic Ruin 1 and 2 crashes the game. That is incomplete, right?
     
  17. Alriightyman

    Alriightyman

    I am back... from the dead! Tech Member
    357
    11
    18
    Somewhere in hot, death Florida
    0101001101101111011011100110100101100011 00000010: 0101001100000011 01000101011001000110100101110100011010010110111101101110
    Level Select is 1-9-8-2 (level select is selected through the title screen like the sound test in Sonic 3)
    Debug is the same 1-9-9-2-1-1-2-4

    EHZ boss walking on air problem will be fixed. I plan to update it as soon as I fix the ARZ crash.

    Thanks! However, I do plan on not using the GHZ boss and make it something else. I used it simply to test the falling signpost.

    Hopefuily I can get a bugfix update online soon. Thanks for the comments!
     
  18. djdocsonic

    djdocsonic

    Testing YOUR Hacks Since 2005... Member
    374
    0
    0
    Emerald Hill Zone
    Looking for a Rom Hack to Test.
    <!--quoteo(post=266262:date=Jan 11 2009, 05:46 AM:name=synchronizer)--><div class='quotetop'>QUOTE (synchronizer @ Jan 11 2009, 05:46 AM) [​IMG]
     
  19. Uberham

    Uberham

    King Of Oblivion Member
    The GHZ mini-boss can still hit you when he's exploding.

    When you're at the top, chemical plant's background glitches as seen in this vid: http://www.megaupload.com/?d=RRA9FZ7M (it's just over 1.3mb)
     
  20. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member
    Awesome work, as always. Nice improvements since the last beta you sent me. :)
     
Thread Status:
Not open for further replies.