Actions

SCHG How-to

Edit the Level Order in Sonic 2 with ASM

From Sonic Retro

Revision as of 06:32, 9 September 2008 by Shobiz (talk | contribs) (+GuideBy)

(Original guide by Malevolence and Metal_Man88)

Well, since a few people have been asking me lately how to edit the level order in ASM, I figure I might as well created a document which may be able to help some of you out there.

First of all, open your asm files and search for Main game level order. For this part, you'll have to know what each zone's ID is, here's a chart:

<z80>$0-Emerald Hill Zone $1-Unused $2-Unused (Wood Zone in Beta) $3-Unused $4-Metropolis Zone acts 1 and 2 $5-Metropolis Zone acts 3 and 4 (4 is unused) $6-Wing Fortress Zone $7-Hill Top Zone $8-Unused (Hidden Palace in Beta) $9-Unused $A-Oil Ocean Zone $B-Mystic Cave Zone $C-Casino Night Zone $D-Chemical Plant Zone $E-Death Egg Zone $F-Aquatic Ruin Zone $10-Sky Chase Zone And $FFFF is the ending</z80>

Okay, so, now go to the main game level order. The zones go in the order above, and there are two acts for every zone. Each act tells which act and zone to go to next. For the first one you have dc.w 1. Think of it as 001. Since this is in Emerald Hill Zone's (act 1) spot, it's telling it where to go after Emerald Hill Zone act 1. 0 is the zone to go to (Emerald Hill Zone) and 01 is the act (act 2). Here is a list of the order with comments of where to go to:

<z80> dc.w 1 ; Emerald Hill Zone act 1 to Emerald Hill Zone (0) act 2 (01) dc.w $D00 ; 1 ; Emerald Hill Zone act 2 to Chemical Plant Zone (D) act 1 (00) dc.w 0 ; 2 ; Unused level to Emerald Hill Zone (0) act 1 (00) (it doesn't matter where it goes, you aren't playing this in the game unless you change it yourself) dc.w 0 ; 3 ; Unused level to Emerald Hill Zone (0) act 1 (00) dc.w $201 ; 4 ; Unused level (was Wood Zone act 1) to Unused level (Wood Zone) (2) act 2 (01) dc.w $400 ; 5 ; Unused level (was Wood zone act 2) to Metropolis Zone (4) act 1 (00) dc.w 0 ; 6 ; Unused level to Emerald Hill Zone (0) act 1 (00) dc.w 0 ; 7 ; Unused level to Emerald Hill Zone (0) act 1 (00) dc.w $401 ; 8 ; Metropolis Zone act 1 to Metropolis Zone (4) act 2 (01) dc.w $500 ; 9 ; Metropolis Zone act 2 to Metropolis Zone (now 5, act 3 uses a different ID because there are two acts per zone ID) act 3 (00, uses a new zone ID, so it's the first act) dc.w $1000 ; 10 ; Metropolis Zone act 3 to SCZ (10) act 1 (00) dc.w 0 ; 11 ; Metropolis Zone act 4 (unused) to Emerald Hill Zone (0) act 1 (00) dc.w $E00 ; 12 ; Wing Fortress Zone act 1 to Death Egg Zone (E) act 1 (00) dc.w 0 ; 13 ; Wing Fortress Zone act 2 (unused) to Emerald Hill Zone (0) act 1 (00) dc.w $701 ; 14 ; Hill Top Zone act 1 to Hill Top Zone (7) act 2 (01) dc.w $B00 ; 15 ; Hill Top Zone act 2 to Mystic Cave Zone (B) act 1 (00) dc.w $801 ; 16 ; Unused level (was Hidden Palace Zone act 1) to Unused level (Hidden Palace Zone) (2) act 2 (01) dc.w $A00 ; 17 ; Unused level (was Hidden Palace Zone act 2) to Oil Ocean Zone (A) act 1 (00) dc.w 0 ; 18 ; Unused level to Emerald Hill Zone (0) act 1 (00) dc.w 0 ; 19 ; Unused level to Emerald Hill Zone (0) act 1 (00) dc.w $A01 ; 20 ; Oil Ocean Zone act 1 to Oil Ocean Zone (A) act 2 (01) dc.w $400 ; 21 ; Oil Ocean Zone act 2 to Metropolis Zone (4) act 1 (00) dc.w $B01 ; 22 ; Mystic Cave Zone act 1 to Mystic Cave Zone (B) act 2 (01) dc.w $A00 ; 23 ; Mystic Cave Zone act 2 to Oil Ocean Zone (A) act 1 (00) dc.w $C01 ; 24 ; Casino Night Zone act 1 to Casino Night Zone (C) act 2 (01) dc.w $700 ; 25 ; Casino Night Zone act 2 to Hill Top Zone (7) act 1 (00) dc.w $D01 ; 26 ; Chemical Plant Zone act 1 to Chemical Plant Zone (D) act 2 (01) dc.w $F00 ; 27 ; Chemical Plant Zone act 2 to Aquatic Ruin Zone (F) act 1 (00) dc.w $FFFF ; 28 ; Death Egg Zone act 1 to the ending (FFFF) dc.w 0 ; 29 ; Death Egg Zone act 2 (unused) to Emerald Hill Zone (0) act 1 (00) dc.w $F01 ; 30 ; Aquatic Ruin Zone act 1 to Aquatic Ruin Zone (F) act 2 (01) dc.w $C00 ; 31 ; Aquatic Ruin Zone act 2 to Casino Night Zone (C) act 1 (00) dc.w $600 ; 32 ; Sky Chase Zone act 1 to Wing Fortress Zone (6) act 1 (00) dc.w 0 ; 33 ; Sky Chase Zone act 2 (unused) to Emerald Hill Zone (0) act 1 (00)</z80> It's as simple as that, for all zones except for SCZ, WFZ, and DEZ, which will be noted later. Otherwise... if you wanted to change something, let's say CPZ act 2 to WFZ act 1, you go to where CPZ act 2 is ($D-CPZ, $D in decimal=13, 13x2=26 (because there are two acts) and then go down one more because it's the second act, so 27) then change $F00 (ARZ normally) to $600, and it'll go to WFZ.

If you are trying to change where SCZ, WFZ, or DEZ head to, you must do more than simply edit this list. Thankfully, the places to edit are in fairly intuitive places. Search your asm file for "loc_3A88E:" (without quotes); you'll see a move.w #$600,(Current_ZoneAndAct).w . Change the $600 to whatever zone you wish it to go to. For WFZ, the procedure is mostly the same, only you go to "loc_3AC40:" (again, without quotes) and change the move.w #$E00,(Current_ZoneAndAct).w thing's $#E00 to whatever act you want it to go to.

If you wish to change where Death Egg goes to, you must do a little bit more work, because it actually calls the ending and more from an object. Find "loc_3D9F2:" and notice the line which has the comment "=> EndingSequence" next to it. This "move.b #$20,(Game_Mode).w" will cause problems for you if left in as-is; but it can be easily fixed. Simply change the $20 to $C, which will cause it to re-assert the 'Zone play mode', since the game isn't going to end yet. Next, you'll need to add in a line; which changes the zone. Specifically, "move.w #$600,(Current_ZoneAndAct).w", where #$600 leads to whatever act you want. ($600 leads to Wing Fortress zone.) Because this is more complex, I have an example of the finished product.

<z80> move.b #$C,(Game_Mode).w ; => EndingSequence is averted bsr.w loc_3AC46 move.w #$600,(Current_ZoneAndAct).w ; Moves to Wing Fortress Zone bra.w JmpTo65_DeleteObject</z80>

If all goes well, you should be able to redirect even this zone to wherever you want.

If you have any questions or comments, feel free to contact me.