Replacing water is easy, but doing it this way only allows 5 levels to have water. It can get a little confusing, since Knuckles is thrown into the mix. The game checks whether the character is Knuckles or not, and loads water in a slightly different manner. Remember, you need a basic knowledge of hex, or you're screwed when it comes to this guide. If you don't understand this, steer clear for a while.
Now, if you want to change which level has water, you'll see the following: 0C78 XXYY FE10 66ZZ. I'll explain:
So, for example, if you wanted Water in Marble Garden act 1, you would change XXYY to 0200. For other level ID numbers, Look at the subsection "Level ID numbers".
Starting at Location $007974, the underwater palettes are loaded.
Here is an example of the underwater palette loading.
70WW 21FC 0000 7502 F62E 0C78 XXYY FE10 67ZZ
The first underwater palette loading is different. I've laid it out here.
70UU 0C78 WWXX FE10 6700 YYZZ
I'm not sure what the difference between these two are, but the AIZ 1 MUST remain the way it is, or else the game will crash on that level.
Here are the locations:
This section is for advanced hackers that understand what they're doing. This allows for more levels to have water than normal. However, you will need to relocate stuff to other locations within the ROM. A good location is $00300000, the art for Sonic in Sonic 3. It isn't used, and provides PLENTY of space for use.
Let's start with the relocation. Let's select a new location for the code. Since S3K is 4 MB, you can't just place it at the end of the ROM. So, let's just put it at that location I just talked about, $00300000. For all intents and purposes, we'll be relocating to that offset. If you wish to move it elsewhere, go right ahead.
So, at offset $007892, select everything from there until you see "11FC 0001 F730". Don't copy that, just up to it. Your selection should be $60 bytes. Copy your selection and go to offset $00300000, and REPLACE $60 bytes. Don't insert, as it might mess up the game pretty badly. Chances are it will screw the game up. After that, type in "4EF9 0000 78F2". This jumps back to the water loading code.
Now, copy and paste the water tags for however many levels you want. I'll show you how to calculate the branches.(the bytes "67XX" and "66XX") First, find your branch. Then, go to the next byte, and start selecting until you reach "4EF9 0000 78F2". Count up how many bytes in a hex value that selection is, and that is your branch. example: if your selection was $58 bytes, then your branch would either be "6758", or "6658", depending on your branch type. The branch types should always remain the same way they were when dealing with the water.
Next, after you've created all the water tags you want and fixed all the branches, it's time to point to our new code. Go back to location $007892 and type in "4EF9 0030 0000" It's as simple as that.
Now, if you load it up for a test play, and it doesn't work, you screwed something up. If it does work, the palettes should be messed up. It's a simple fix if you've just replaced the water, but here it's a bit more complicated:
Now, go to offset $007980 and select $80 bytes. Copy that. Goto offset 003000A0. This may not be where your water loading code stops, but it's easier on me, the guy explaining it. So, REPLACE $80 bytes with what you copied. after that, type in "4EF9 0000 79FE". Now, copy and paste whatever you need for however many levels you need, then calculate the branches.
Go back to location $7980 and type in "4EF9 0030 00A0" or wherever you decided to place the code. Now if you take it for a test run, and it works, you'll notice the palettes are messed up for the levels you added water to. Now it's time to extend the palette index.
This part is ridiculously easy. Just go to the palette index at offset $0A872C. Then, select $210 bytes, and copy it. Go to offset $00300200 and REPLACE $210 bytes. Now, to change the pointers. There are four of them, and all of them need to point to the new offset table. The pointers are located at the following places:
Just replace "000A 872C" with "0030 0200" at each location. There isn't a need to test run, but you can to make sure the game works. Now, onto extending the offset table. I'll tell you the format to work with.
000A 893C FC00 001F
The first two pairs of bytes are the pointer. They point directly to the palette. The next pair of bytes is the RAM location to put the palette into. And finally, the last pair of bytes is always "00XX", where XX is your number of colors/2-1. So in that example, The palette can be found at $0A893C, goes into FC00 in RAM, and has $40 colors to it. Your underwater palette should follow that exact format, and not a different one. The only difference would be your pointer.
The default palette table has 65 different palettes. In a hex value, $41. So a new palette ID would be $42. Keep track of your palette IDs, as will help you with your underwater palettes.
AFTER This, you need to fix up your palette IDs within the "Changing Palettes around when adding water" section. Read into "Switching Water Palettes" for the appropriate formats. After this, if you haven't added your palettes, now is the time. Once you do that, load it up for a test run, to make sure everything works ok, and then edit your palettes to fit your level.
Here is a listing of Level ID's.
I doubt you'd have ANY reason whatsoever for having water in Doomsday Zone, but regardless, here's the ID = 0C. Act 2 is the final showdown between Sonic and Robotnik on the Death Egg.