Sonic and Sega Retro Message Board: The Sonic 3K Water Guide! - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
Page 1 of 1
    Locked
    Locked Forum

The Sonic 3K Water Guide! V2.00

#1 User is offline Caitlin 

  Posted 01 September 2006 - 09:34 AM

  • Mechromancer
  • Posts: 4447
  • Joined: 07-May 05
  • Gender:Female
  • Project:single mother
  • Wiki edits:35

Quote

Sonic 3K Water Guide

written by ThunderSpeed, inspired by RobJoe1107
Special Thanks to drx and SMTP, cause the water guide they made for Sonic 2 helped me with my explanations.
:----------------------------------------------------------:
      _.-Intro-._
:----------------------------------------------------------:
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.
:----------------------------------------------------------:
      _.-Table of Contents-._
:----------------------------------------------------------:
Switching the levels that have water in them (Easy)
Switching Underwater palettes (easy)
Adding water to more levels (advanced)
Adding more palettes for the water (advanced)
Useful Machine Code things (For our more technical aspects)
Zone ID Reference
The End
:----------------------------------------------------------:
_.-Switching the levels that have water in them-._
:----------------------------------------------------------:
$007892 - If the level is AIZ act 1, jump to $0078F2. (Enable water).
$00789A - If the level is AIZ act 2, jump to $0078F2. (Enable water).
$0078B2 - If the level is HCZ (either act), jump to $0078F2. (Enable water).
$0078BA - If the level is CNZ act 2, jump to $0078F2. (Enable water).
$0078CA - If the level is ICZ act 2, jump to $0078F2. (Enable water).
$0078D8 - If the level is LBZ act 2, jump to $0078F2. (Enable water).

Now, if you want to change which level has water, you'll see the following: 0C78 XXYY FE10 66ZZ. I'll explain:

XX = level id number
YY = act number (00 is act 1, 01is act 2)
ZZ = number of bytes to jump. If you're just changing the levels that have water in them, do NOT touch these.

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".

:----------------------------------------------------------:
  _.-Switching Water Palettes-._
:----------------------------------------------------------:
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

WW = Palette ID to load
XX = Level ID
YY = Act number (00 = Act 1, 01 = Act 2)
ZZ = number of bytes to jump. If you're just changing the levels that have water in them, do NOT touch these.

The first underwater palette loading is different. I've laid it out here.
70UU 0C78 WWXX FE10 6700 YYZZ

UU = Palette ID to load
WW = Level ID
XX = Act ID
YYZZ = Branch location. If you're just replacing the levels with water, do NOT touch.

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:
$007974 - If the level is AIZ act 1, load palette 2B and branch to location $0079FE, loading the Underwater Palette. This is the different one, so be careful.
$007980 - If the level is AIZ act 2, load palette 2C and branch to location $0079FE, loading the Underwater Palette.
$007992 - If the level is HCZ act 1, load palette 31 and branch to location $0079FE, loading the Underwater Palette.
$0079A4 - If the level is HCZ act 2, load palette 32 and branch to location $0079FE, loading the Underwater Palette.
$0079B6 - If the level is CNZ act 2, load palette 3A and branch to location $0079FE, loading the Underwater Palette.
$0079C8 - If the level is ICZ act 2, load palette 39 and branch to location $0079FE, loading the Underwater Palette.
$0079DA - If the level is LBZ act 1, load palette 2D and branch to location $0079FE, loading the Underwater Palette. This one seems to be unused.
$0079EC - If the level is LBZ act 2, load palette 2E and branch to location $0079FE, loading the Underwater Palette.
:----------------------------------------------------------:
  _.-Adding Water to more levels-._
:----------------------------------------------------------:
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 intensive 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:
:----------------------------------------------------------:
Changing the palettes around when adding water
:----------------------------------------------------------:
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.
:----------------------------------------------------------:
Extending the palette index.
:----------------------------------------------------------:
This part is rediculously 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:

$3DC0 = 1st reference to palette table / PalLoad1
$3DDC = 2nd reference to palette table / PalLoad2
$3DF4 = 3rd reference to palette table / PalLoad_Underwater
$3E10 = 4th reference to palette table / PalLoad4

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.

:----------------------------------------------------------:
  _.-Useful Machine Code things-._
:----------------------------------------------------------:
6600 = bne.s
6100 = bsr.s
6700 = beq.s
6600 0000 = bne.w
6700 0000 = beq.w
6100 0000 = bsr.w
4EF9 0000 0000 = jmp
4EB9 0000 0000 = jsr
B07C 0000 = cmp.w #$0000,d0
0C78 0000 XXXX  = cmp.w #$0000,($FFFFXXXX).w    ; XXXX = Ram Location
70XX  =  moveq #$XX,d0
4E75  =  rts
4E71  =  nop

:----------------------------------------------------------:
Level IDs
:----------------------------------------------------------:
Here is a listing of Level ID's.
Angel Island  = 00
Hydro City  = 01
Marble Garden = 02
Carnival Night = 03
Flying Battery = 04
Ice Cap  = 05
Launch Base  = 06
Mushroom Hill = 07
Sandopolis  = 08
Lava Reef  = 09
Lava Reef Boss = 16/Act Id 00 Hidden Palace
Sky Sanctuary = 0A
Death Egg  = 0B
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

:----------------------------------------------------------:
The End
:----------------------------------------------------------:
This is the end to the S3K Water guide. I really hope my explanations didn't leave you confused, but I can't help it. I suck with explanations. If anyone feels they can explain it better, please do. =P


I didn't include water hieghts, as it was extremely confusing. If someone would like to document it, please do so.
This post has been edited by ThunderSpeed: 02 September 2006 - 12:26 PM

#2 User is offline SMTP 

Posted 01 September 2006 - 10:08 AM

  • Posts: 2146
  • Joined: 27-April 04
  • Gender:Male
  • Location:Ohio
  • Wiki edits:59
Very good Guide. Very helpful indeed. This may actually spark more intrest in Sonic3K hacking...

BTW thanks for the credits. =P

#3 User is offline Robjoe 

Posted 01 September 2006 - 03:33 PM

  • Delicious and nutritious.
  • Posts: 840
  • Joined: 11-September 05
  • Gender:Male
  • Location:Ludington, Michigan, US
  • Project:Brawl mods, Megamix Layouts, and messing with Sonic 3.
  • Wiki edits:1
Fairly good guide so far, however, you may want to add that if you want both acts of a zone to have water, instead of writing "0C78", you can write "0C38" instead. 0C38 is a BYTE compare, thus meaning it will only check your the zone value, and and ignore the act. When writing the "ZONE/ACT" portion, it will ignore the first byte, so keep it at 00. The second byte should be the value of the zone that needs the water. This is a nice trick to save tags. I hope you can understand that, as I suck at explanations. =P Stealth informed me of this, so he gets the credit.

Something I'd like to see get explained, though, is how to take a non-water tag (I.e., the tag that removes CNZ2's water for Knux), and use it to produce water. That'd be a big help to me.

#4 User is offline Caitlin 

Posted 01 September 2006 - 04:37 PM

  • Mechromancer
  • Posts: 4447
  • Joined: 07-May 05
  • Gender:Female
  • Project:single mother
  • Wiki edits:35
I was aware of that byte/word comparison, I should've put that in there.

As for the removing water with Knux, I believe all you would do is replace "0C78 0003 FF08" with "0C78/0C38 XXXX FE10", where X is the level ID. I'm not sure if changing the branch tag would be necessary, but possibly.

#5 User is offline Robjoe 

Posted 01 September 2006 - 04:46 PM

  • Delicious and nutritious.
  • Posts: 840
  • Joined: 11-September 05
  • Gender:Male
  • Location:Ludington, Michigan, US
  • Project:Brawl mods, Megamix Layouts, and messing with Sonic 3.
  • Wiki edits:1
I've tried that way myself, it's not that simple. =\ Although, the branch looks correct, so I don't know how to use it for water.

#6 User is offline SMTP 

Posted 01 September 2006 - 04:48 PM

  • Posts: 2146
  • Joined: 27-April 04
  • Gender:Male
  • Location:Ohio
  • Wiki edits:59
You don't need 0C38, if you just put the level ID to the first byte it will add water to both acts. At least it did for me..

#7 User is offline Caitlin 

Posted 02 September 2006 - 12:27 PM

  • Mechromancer
  • Posts: 4447
  • Joined: 07-May 05
  • Gender:Female
  • Project:single mother
  • Wiki edits:35
Updated.

Archive plz?

#8 User is offline SMTP 

Posted 02 September 2006 - 01:02 PM

  • Posts: 2146
  • Joined: 27-April 04
  • Gender:Male
  • Location:Ohio
  • Wiki edits:59
Now its an extremely good guide!

Archive? =P

#9 User is offline Robjoe 

Posted 02 September 2006 - 01:03 PM

  • Delicious and nutritious.
  • Posts: 840
  • Joined: 11-September 05
  • Gender:Male
  • Location:Ludington, Michigan, US
  • Project:Brawl mods, Megamix Layouts, and messing with Sonic 3.
  • Wiki edits:1
Ah, VERY sweet shit you've got there. I'll be trying that out soon.

EDIT: Yes, this should be achived once it dies. This is extremely helpful.
This post has been edited by Robjoe1107: 02 September 2006 - 01:04 PM

#10 User is offline drx 

Posted 04 September 2006 - 04:11 AM

  • <Shade> fuck MJ
  • Posts: 2157
  • Joined: 02-March 04
  • Gender:Male
  • Project::rolleyes:
  • Wiki edits:8
nice stuff ;)

#11 User is offline loftydog 

Posted 17 March 2009 - 03:01 PM

  • Posts: 35
  • Joined: 16-March 05
  • Gender:Male
  • Location:United Kingdom of the Slavic Republic of India
  • Project:Sonic 3K Neo
Sorry for the big bump but if Robjoe wants to add water for a zone with Knuckles, the same zone must have water for Sonic. E.g. AIZ Act 2 for Sonic has water, if you change:

0C78 0003 FF08 --> 0C78 0001 FF08 (for AIZ 2 Water for Knuckles) . I have tried this doing Carnival Night Zone and Mushroom Hill Zone.

Just something I noticed whilst hex editing.

Page 1 of 1
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users