Sonic the hedgehog 2

How to make a rotating pallet from scratch

Creating a new rotating pallet

By Sonic Hachelle-Bee on September 2004.
Information submitted on May 16 2005.
Let's start with creating a new rotating pallet under Sonic 2.

$19F4
Offset index for rotating pallets for each level.

To create (or modify) a new rotating pallet, read this VERY carefully:
You have to write this exactly at your level adress, in that order:
41 F9 XX XX XX XX
X: Adress where all your rotating colors are located.
53 78 F6 34 6A XX
X: Number of bytes to jump to the next rotating pallet for this level, or to 4E 75 if it's the last (Number of bytes to jump to the % sign in this post).
31 FC XX XX F6 34
X: Rotating speed (how many milliseconds to wait between each color). 00 is high speed.
30 38 F6 32
52 78 F6 32
02 40 XX XX E7 48
X: Rotating type. See the end of this post.
31 F0 XX XX YY YY
X: Starting color, where the rotation will begin (color 1, color 2, or color 3...?)
Number of bytes to jump to this color. 00 00 is the first color, 00 02 the second...
Y: Adress in RAM to replace one of 64 pallet colors with this rotating pallet (between FB 00 and FB 80).
(31 F0 XX XX YY YY)
Not needed.
If you want to have another color replaced with this rotating pallet, but with another starting point. Useful to make waterfalls.
(31 F0 XX XX YY YY)
A third one? A fourth? .....
...

%
Once this is completed, you can start another rotating pallet with different colors here. You will write:
41 F9 XX XX XX XX (and we are restarting the same thing)......
Or also 4E 75 to end all rotating pallets for this this level.
This is a bit difficult to understand, but this works pretty fine!

Rotating types (there is A LOT of them!):
From the starting color, we will count like this:
Starting color = color1
Next color = color2
Next = color3

......

There is the list of some rotating types:
00 00 No rotation.
00 01 color1-color4-color1-color4 (return)...
00 02 color1-color1-color9-color9 (return)...
00 03 color1-color5-color9-color13 (return)...
00 04 color1-color1-color1-color1-color13-color13-color13-color13 (return)...
00 05 color1-color5-color1-color5-color13-color14-color13-color14 (return)...
00 06 color1-color1-color9-color9-color17-color17-color21-color21 (return)...
...etc, there is a lot of them.

Example, the waterfall under EHZ ($1A18):
41 F9 00 00 1E 7A (waterfall colors, 16 colors)
53 78 F6 34 6A 2C
31 FC 00 07 F6 34 (write 00 00 instead of 00 07 to have an high speed!!!)
30 38 F6 32 52 78 F6 32
02 40 00 03 E7 48 (color1-color5-color9-color13 (return)...)
31 F0 00 00 FB 26 (Starting at the first waterfall color = color1-color5-color9-color13 (return)...)
31 F0 00 02 FB 28 (Starting at the second waterfall color = color2-color6-color10-color14 (return)...)
31 F0 00 04 FB 3C (Starting at the third waterfall color = color3-color7-color11-color15 (return)...)
31 F0 00 06 FB 3E (Starting at the fourth waterfall color = color4-color8-color12-color16 (return)...)
4E 75
You have now a nice waterfall!

Taking a rotating pallet from another level

By rika_chou.
Submitted by StephenUK.
Cycling palettes use an offset index, just like the layer deformations.

If you go to the offset $0019F4 and you will see:

0024 0022 0052 0022 0082 0082 03C2 0118 015C 0022 019E 01CC 01FA 0322 0322 0394 03C2

These groups of numbers listed are each relevant to a level ID, listed in order. For example, 0024 is for ID 00, which is EHZ. The next group is for ID 01 and so on.

The level IDs are as follows:

00 - EHZ
01 - UNUSED
02 - UNUSED (WZ)
03 - UNUSED
04 - MZ (acts 1+2)
05 - MZ (acts 3+4)
06 - WFZ
07 - HTZ
08 - HPZ
09 - UNUSED
0A - OOZ
0B - MCZ
0C - CNZ
0D - CPZ
0E - DEZ
0F - ARZ
10 - SCZ

Just replace a group (e.g 0024) with another group (e.g 03C2) to make it use the corresponding cycling palette. This combination used in the example would make EHZ use the cycling palettes from SCZ instead of it's usual one. Simple enough.


Back to: Sonic the hedgehog 2
Table of contents