Continuing the Icon Editing Guide
here because of hitting a post limit.
SNES Color Format
Most modern software deals with 24-bit RGB (red green blue) color, where each color channel gets 8 bits to define its intensity where the 8-bit-groupings are ordered red, green, blue from high to low. So 0xFF0000 is max red with no green or blue, 0x00FF00 is max green with no red or blue, 0x0000FF is max blue with no red or green, etc.
The Super Nintendo uses 15-bit BGR color, where each color channel gets 5 bits, and the colors are ordered blue, green, red from high to low. This means 0x7C00 is max blue, 0x03E0 is max green and 0x001F is max red. Which is confusing unless you look at the values in binary:
0111110000000000 is max blue
0000001111100000 is max green
0000000000011111 is max red
As far as I know, the SNES doesn't use the high bit in a 16-bit color value.
So, in an earlier step I listed the 5 colors for this icon as:
192 248 248
144 240 208
88 200 152
16 128 80
80 72 64
So, time to convert those 24-bit RGB colors to 15-bit BGR. You'll need a calculator that can do bit shifts
(the buttons often labeled "Lsh" and "Rsh"); Windows Calculator (at least on Win7) should work fine.
Common notation for shifts is >> for shift right and << for shift left.
We'll start with the first color, 192 248 248; the color order is red, green, blue, which we want to invert, so we'll start with the blue:
248 >> 3 = 31
This strips the 3 least significant bits.
31 << 10 = 31744
This moves the blue bits into their position near the top of the 16-bit value.
In hexadecimal that was:
0xF8 >> 0x3 = 0x1F
0x1F << 0xA = 0x7C00 (max blue)
For green, it's the same, but the left shift is only 5, and for red, since it's in the least significant bits position it doesn't need a left shift.
248 >> 3 = 31
31 << 5 = 992
0xF8 >> 0x3 = 0x1F
0x1F << 0x5 = 0x03E0 (max green)
192 >> 3 = 24
0xC0 >> 0x3 = 0x0018
Then you add the three results together (or more properly, Or them together, but the result will be the same in this case):
0x7C00 + 0x03E0 + 0x0018 = 0x7FF8
Personally, I convert the initial color number to hexadecimal first thing and do all the math in hexadecimal, but it's personal preference; you may have an easier time remembering to shift left by 10 rather than 0xA, for example, and whatever leads you to make less mistakes is the right choice.
All 5 colors need to be converted from 24-bit RGB to 15-bit BGR for use in the following steps.
Assigning Ring Menu Icon Palettes
Secret of Mana's icons, used in its ring menu system, use 5-color palettes located at 0x12C900 in an array. Each color is 2 bytes (15-bit, with the 16th bit unused), stored in little-endian order. 2 * 5 is 10, so each palette entry is 10 bytes long. These palettes are referenced by an index number, where the list of icons (also referenced by index number) and their associated palette index number are located near the end of bank 0x18. Specifically, item icons start at 0x18FEF0.
Continuing with modifying the unused item (0x0B), its icon definition is located at 0x18FF06 (0x18FEF0 + 0x0B * 2); each entry is two bytes, where the first is the icon number and the second is the palette number.
Vanilla data here is 0xA8 0x95; 0xA8 is the number for the unused icon graphic modified in previous steps, and 0x95 is the same palette as the Barrel item. Palette number 0xBF seems to be unused, so we'll overwrite it for the sake of this example. For future reference, palettes 0x8F - 0x94 are all the same, so they could be merged to free up 5 more palette entries for use. There is at least one more duplicate set I'm aware of as well (though it's a less suitable merge candidate).
Change 0x18FF07 from 0x95 to 0xBF to make the unused icon use the unused palette entry.
At this point, the icon would appear as a solid white silhouette since the unused palette is functionally 5 solid whites.
Modifying Ring Menu Icon Palettes
As mentioned previously, the ring menu icon palettes are located at 0x12C900 and are 10 (0xA) bytes each. Since we'll be modifying palette number 0xBF, the location of that palette can be calculated via:
0x12C900 + 0xA * 0xBF = 0x12D076
At 0x12D076 you'll find:
FFFF FFFF FFFF FFFF FFFF
The icon done in previous steps was set up with colors in order from lightest to darkest, so those 5 16-bit values will be replaced with the desired colors in that order.
Two steps ago, the lightest color was converted to the 15-bit color value of 0x7FF8. Keeping in mind that these palette entries are numbers in little-endian order, you'd replace the first color value, like so:
F87F FFFF FFFF FFFF FFFF
ZPS syntax allows the number to be specified as a whole 16-bit value if using the ADR.16 directive, like so:
ADR.16 #0x7FF8 ' 192 248 248
with the subsequent 4 colors each being on their own line following that one.
That might be everything necessary? I'll likely add on further clarifications as questions come up.