Sonic the hedgehog 2

How to change the order that the levels come in

General case

Submitted by Sonic Hachelle-Bee on May 27 2005.
To change the order that the levels come in the game, you have to go at a specified address:

$142F8
Order that the levels come in.

For each level (according to the level slot number), you have 4 bytes. The first 2 bytes are used to say what level to load after the first act. The last 2 are the same, but for the second act.
Examples:
For EHZ, you have 00 01 0D 00. After the first act, level 00 01 (EHZ act 2) will be loaded. After the second act, level 0D 00 (CPZ act 1) will be loaded.
For HTZ, you have 07 01 0B 00. After the first act, level 07 01 (HTZ act 2) will be loaded. After the second act, level 0B 00 (MCZ act 1) will be loaded.


To say that the game is finished (to reset the game), write FF FF. For DEZ, you have FF FF 00 00.

After the one player game order, you have directly the 2 players game order following at $1433C. This one is useless.

Changing the starting level

Posted by rika_chou on May 27 2005.
To change the first level starting at the beginning of the game (usually EHZ), you have to change two things.

The starting level is set for the title screen and the options screen. Then, at $3CCA and $90AA, the starting level is set to the value already in D0 register (it's 00 00 at this point). To change this, you have to delocate your code somewhere else into the ROM file, because there isn't enough space to change it directly.

For both offsets $3CCA and $90AA:
First, chose a free space where to write data in the ROM. We will say it's at address $XXXXXXXX.
Then, at $3CC6 and $90A6, write a JSR (jump to subroutine), overwriting the data already in place:

4E B9 XX XX XX XX 4E 71

MOVE your level value manually to $FE10 in RAM, writing this at $XXXXXXXX:

70 00 31 C0 FF 8A 31 C0 FF D8 31 FC YY YY FE 10 4E 75

YY YY: Starting level and act.

Specific case: Wing Fortress zone to Death Egg zone

Submitted by Sonic Hachelle-Bee on May 27 2005.
This case is specific, and doesn't respect the order that the levels come in the game.

At the end of Wing Fortress zone, there is a small cutscene. To change the level that comes after (DEZ), you have to change the level value at $3AC42 (0E 00 is DEZ).


Back to: Sonic the hedgehog 2
Table of contents