don't click here

Sonic 1 REV01 BG effects

Discussion in 'Engineering & Reverse Engineering' started by jman2050, Jun 21, 2006.

  1. jman2050

    jman2050

    Teh Sonik Haker Tech Member
    634
    4
    18
    This one might take a while, so sit tight.

    Looking at the REV01 version of Sonic 1, I can see why it's Rev01. They pretty much completely overhauled the entire BG deformation part of the engine. The drawing system has been changed (and from what I've seen, more similar to the way Sonic 2 does things) and the deformation data for every level has been changed to fit this new code. Also, in every level besides SBZ2, it was used to enhance the deformation effects. To see the difference in your own Sonic 1 rom, you'll have to do the following:

    1. Download every text file below. They contain all the ASM you need to perform this conversion. note that if you edited code in any of the code you're about to replace, you're probably not gonna get those edits back without substantial recoding, so be wary.

    http://www.cgi101.com/~jman2050/lzwobble.txt
    http://www.cgi101.com/~jman2050/bgdraw.txt
    http://www.cgi101.com/~jman2050/bgscroll.txt
    http://www.cgi101.com/~jman2050/bgdeform.txt
    http://www.cgi101.com/~jman2050/blockscroll.txt

    2. First, we'll do the easiest change. Go to label Obj0A_WobbleData in hivebrain's 2005 disassembly and replace the entire block with what's in lzwobble.txt. The programmer's extended this array so it would also be usable by the deformation data even though it was designed to be used by the water bubbles.

    3. Next, we'll do the BGScroll data. Go to BGScroll_GHZ in the disassembly. Replace everything from there until the end of BGScroll_End with whatever is in bgscroll.txt. The starting deformation data for every stage needed to be changed. To be precise, it prevents bugs that occur in the scrolling in SBZ and SYZ, and prevents a bug that causes GHZ's bg not to appear at all.

    4. Next, we'll do the deformation data itself. Go to Deform_GHZ, and replace everything from there until the end of Deform_SBZ, straight down (right before ScrollHoriz) with the contents of bgdeform.txt

    5. The new Bg drawing system required a different method of scrolling the BGs themselves. Go to ScrollBlock1 and replace everything from there until the end of ScrollBlock4 with the contents of blockscroll.txt. Don't worry that there are six BGScroll functions now, that's taken cared of.

    6. Finally, the biggest part: the BG drawing code. Go to sub_6886 and replace everything from there until the end of LoadTilesFromStart2 (that's a VERY long way, up until MainLoadBlockLoad) with the contents of bgdraw.txt. This should also result in a duplicate label loc_6ED0 in the resize_GHZ3boss routine. Just replace both instances of that label in that area with whatever you like, and you should be good to go.

    7. Assuming you haven't changed the backgrounds of your levels, compile it and give it a go!

    I'd just like to credit Hivebrain for attempting this first, and Tweaker for his assistance when I had some issues to resolve. Tell me if I forgot anything, and put any questions or comments here.
     
  2. Tweaker

    Tweaker

    Banned
    12,387
    3
    0
    Excellent, now applied to my hack. Glad you got it to work. =)
     
  3. Hivebrain

    Hivebrain

    Administrator
    3,068
    204
    43
    53.4N, 1.5W
    Github
    Nice work! My last attempt at doing this was somewhat a failure.
     
  4. jman2050

    jman2050

    Teh Sonik Haker Tech Member
    634
    4
    18
    I should also mention that IIRC, Stealth did in fact do this with KiS1. If so, I credit him as well for actually doing it first :)
     
  5. drx

    drx

    mfw Researcher
    2,254
    350
    63
    :rolleyes:
    There is an easier way. :P Just look at my hacking cult demo...
     
  6. Cinossu

    Cinossu

    Administrator
    2,832
    46
    28
    London, UK
    Sonic the Hedgehog Extended Edition
    There's the easier way, and then there's the way it's already done. :P I didn't know your demo was open source, anyways. :.
     
  7. Tweaker

    Tweaker

    Banned
    12,387
    3
    0
    Your demos section is broken. =P
     
  8. ddrmaxromance

    ddrmaxromance

    Member
    477
    0
    0
    Perhaps someone could tell me how to make two copies of the background deformation for GHZ. I'm using SLZ graphics for my title screen background in my sonic hack, and it uses the GHZ system. When I load GHZ (the level), it uses SLZ (the title screen)'s deformation, which causes it look funky.

    Any tips?
     
  9. Rika Chou

    Rika Chou

    Tech Member
    5,276
    170
    43
    There is probobly a pointer that you need to change.
     
  10. drx

    drx

    mfw Researcher
    2,254
    350
    63
    :rolleyes:
    Didn't notice that hacks/demos were broken... thanks.

    I don't remember if my demo source was released or not, but it's not that hard to disassemble 2kb of code :P
     
  11. stormislandgal

    stormislandgal

    It's not a phase! Tech Member
    4,534
    10
    18
    Married life <3
    Code (Text):
    1. Title_LoadText:
    2.  &nbsp;............code............
    3.  &nbsp;bsr.w    LevelSizeLoad
    4.  &nbsp;bsr.w    DeformBgLayer
    5.  &nbsp;lea  ($FFFFB000).w,a1
    It probably has something to do with that. I'm not sure however.
     
  12. ddrmaxromance

    ddrmaxromance

    Member
    477
    0
    0
    Well, I made it so that there are two copies of the 16/256 art so the art could load seperately. The only thing I couldn't find was how to seperate the ghzbg.bin file in the levels folder. Take a look below to what I did (bold=new items):

    Each art runs off its own file, meaning:
    Title Screen: SLZ but hacked a bit (not GHZ)
    GHZ: GHZ (but with SLZ's BG file)
    SLZ: Still SLZ...intact

    [​IMG]
    Behold, it's happening! :) Yeah, I'll fix the foreground and such later on.

    [​IMG]
    Yeah, this is the end result...Any tips?
     
  13. Shadow Fire

    Shadow Fire

    Ultimate victory! Member
    1,557
    0
    16
    The Land of Darkness
    Sonic: The Lost Land (Series), The GCN (site)
    I've got a better idea...

    USE THE JAPANESE REV01A (02) ROM!

    *whistles and walks away*
     
  14. Cinossu

    Cinossu

    Administrator
    2,832
    46
    28
    London, UK
    Sonic the Hedgehog Extended Edition
    Okay, but only if you have it all disassembled, split, and fully labelled and commented. :P
     
  15. ddrmaxromance

    ddrmaxromance

    Member
    477
    0
    0
    Well, I'm currently using a Japanese ROM, but I want to be able to finish this title screen port with the disassembler, and then port them over into the JAP ROM.
     
  16. ICEknight

    ICEknight

    Researcher Researcher
    That might be the wierdest way to call v.1 ever.
     
  17. Shadow Fire

    Shadow Fire

    Ultimate victory! Member
    1,557
    0
    16
    The Land of Darkness
    Sonic: The Lost Land (Series), The GCN (site)
    Ordos and I were discussing the different Japanese Rev's.

    Rev 00 is the original.

    Rev 01 includes the cloud scrolling and water ripple effects, but not the spike bug fix.

    Rev 01a (AKA Rev 02) has the same effects as above, but also includes the spike bug fix. This ROM is the release ripped from Sonic Mega Collection, IIRC.
     
  18. Hivebrain

    Hivebrain

    Administrator
    3,068
    204
    43
    53.4N, 1.5W
    Github
    It's JAP02, not "Rev 01a". And there's no point hacking the JAP02 ROM, because it's just a hacked JAP01 ROM.
     
  19. LocalH

    LocalH

    roxoring your soxors Tech Member
    3,314
    35
    28
    Nunya
    Rock Band 3 Deluxe
    Technically, I consider them to be just revision 0, 1, and 2, since the region code within each ROM is JUE.
     
  20. ICEknight

    ICEknight

    Researcher Researcher
    And also, both versions were released in Japan. These are just v.0, v.1 and a modded v.1.


    By the way, wasn't the term "revision" just made up (and recently discarded) by Cowering for his "goodx" programs? That byte is just a version code, like in the SMS and GG games.