Intermediate XenoGuide: How to separate Death Egg Zone into two acts in Sonic 2

Discussion in 'Tutorials Archive' started by ThomasThePencil, Jun 16, 2013.

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

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Alright, so I separated Death Egg Zone into two acts in my hack, and I figured other people may want to do this, too. So I'm going to write a guide. What makes this guide different from my past guides, you may ask? Well,

    a) it's complete, and

    b) I'm writing a version for each end of the rope (one for Xenowhirl, and one for Hg).

    This version covers the Xenowhirl disassembly. Follow closely.

    Step 1: Setting up

    First, we have to set up our disassembly to work with two acts of DEZ. Head to "level", then head to each of its sub-folders, copy the "DEZ" file, and rename the original to "DEZ_1" and the copy to "DEZ_2".

    Then comes the coding part. Head to "Off_Level:", and scroll down until you find this:


    dc.w Level_DEZ-Off_Level; 28
    dc.w Level_DEZ-Off_Level; 29

    Change it to this:


    dc.w Level_DEZ1-Off_Level; 28
    dc.w Level_DEZ2-Off_Level; 29 
    That's done. One more thing before initial setup is complete. Head to "word_142F8:" and scroll down until you see this:


    dc.w $FFFF ; 28
    dc.w 0 ; 29 
    And change it to this:


    dc.w $E01 ; 28
    dc.w $FFFF ; 29 
    Finally, initial setup is complete.

    However, we need to edit a few more things if we want this to work properly...

    Step 2: Fixing the title card and end-of-level results screen

    Next, we're going to fix the title card and end-of-level results screen so that they display in DEZ1.

    First up, the title card object. Specifically, the number controlled by the title card object. Head to "loc_13DEE:" and comment out or delete these lines:


    cmpi.b #$E,d0
    beq.s BranchTo9_DeleteObject

    After this, the number should display in DEZ.

    Now for the end-of-level results screen. First, go to "loc_14146:" and comment out or delete the indicated lines:


    cmpi.b #6,d0
    beq.s loc_1415E ; <-- this line
    cmpi.b #$E,d0 ; <-- this line
    bne.w sub_13E1C 
    All we've done here is removed the check for DEZ. Next, go to "loc_14168:" and comment out or delete the following bit of code:


    cmpi.b #$E,d0
    beq.w BranchTo9_DeleteObject 
    Again, we've removed the check for DEZ. Now the end-of-level results screen is fixed.

    Step 3: Miscellaneous fixes

    Just some miscellaneous fixes from this point onward. You may mix and match these for your liking if you so choose as long as you know what you're doing.

    Step 3.1: DEZ Level Events

    Find this:


    ; ===========================================================================
    ; loc_F446:
    LevEvents_DEZ:

    And add this after it:


    cmpi.b #1,(Current_Act).w ; are we on act 2?
    beq.w LevEvents_DEZ2 ; if so, branch
    rts
    ; ===========================================================================

    LevEvents_DEZ2:

    Now only DEZ2 will have level events, but you can set up your own level events if you wish. I won't tell you how to do that, though; that's up to you to decide and therefore figure out =P

    Step 3.2: Signpost loading

    This pretty much ties into the above fix, but whatever, I'm showing it anyway =P

    Go to "SetLevelEndType:" and find these two lines:


    cmpi.w #$E00,(Current_ZoneAndAct).w
    beq.s return_4C46 ; if DEZ, return

    I won't tell you what to do based upon your decision for the above fix, but I will tell you what this does. This is checking for the first act of DEZ, and if you're in it, it skips the signpost loading for DEZ1. Again, won't tell you how to change this since it should be self-explanatory from here.

    And that's all, folks! Comments, questions, and criticisms are welcome, and keep an eye out, because I'm posting the Hg version of this later today =D

    EDIT: Didn't realize the size for Step 2's heading was wrong, fixed now =)
     
    Last edited by a moderator: Jun 16, 2013
  2. Spanner

    Spanner The Tool Member

    Joined:
    Aug 9, 2007
    Messages:
    2,570
    If this guide is found out not to fucking work you are gone for a week.
     
  3. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Oh, don't worry. It does work, otherwise I wouldn't have two acts in my Death Egg Zone, because this is the exact method I used for my own hack, slightly changed to work with the Xenowhirl disassembly.
     
  4. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    At least it's complete, but you need to be specific a bit more.

    No, you need to say what bits to change. If I went to do this step you've explained in your guide, then all of a sudden, most of my other levels won't work. You're better off saying what part under "Off_Level:" needs changing. Say something like "It should look like this (code) and change that certain bit to this (more code)." Repeat for other steps.
     
    Last edited by a moderator: Jun 16, 2013
  5. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Ah, okay. Fixed now. Now it should be easier to follow =)
     
  6. JoenickROS

    JoenickROS ROS (bug fixing in progress) Member

    Joined:
    Feb 5, 2012
    Messages:
    929
    The Eggrobo still loads in act 1.

    Edit: With Glitched art and doesnt load in act 2.
     
    Last edited by a moderator: Jun 16, 2013
  7. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Odd...did you follow step 3.1?
     
  8. JoenickROS

    JoenickROS ROS (bug fixing in progress) Member

    Joined:
    Feb 5, 2012
    Messages:
    929
    Yes, the eggrobo loading is controled in the object itself but it works now since I made the object check if its act 2 to load all code if it is.
     
    Last edited by a moderator: Jun 16, 2013
Thread Status:
Not open for further replies.