Shadow / Hilight Mode



Overview

The following is the result of my experiments under KGen98, and my own emulator.

While I believe most everything about this mode is discussed in detail, if you can provide more accurate information, or think something needs explaining, please let me know.

Effects on the Background

Shadow / hilight mode is enabled by setting bit 3 of VDP register #12.
When enabled, the following changes take place:

- All tiles and sprites without their priority bit set are shown at half intensity.
- All tiles and sprites with their priority bit set are shown at normal intensity.

To demonstrate this, here is an example:

         

The orb shaped object is not a sprite, but is part of plane A. The outer edges of the object use tiles with no priority, so they are shown at half intensity. The inner part of the object uses tiles that have priority, so they are shown at normal intensity.

In the case of a plane A tile with priority overlapping a plane B tile without priority, the plane B tile will be shown at normal intensity (instead of half). Here is an example:

         

All of the plane B tiles do not have priority, and therefore would be shown at half intensity. However, all the tiles on plane A (except for the middle section) have their priority bit set, which forces them, and the underlying plane B tiles, to be shown at normal intensity. This means that only the middle section will appear to be at half intensity.

Please take note that the actual pixel values of the tiles on plane A do not matter. The tiles you are seeing on either side of the middle part are blank, which is why the underlying graphics on plane B are not obscured.

Effects on Sprites

In shadow / hilight mode, sprite pixels using colors E and F from palette three have special meaning.

A pixel that uses color F will not be drawn. In it's place, any underlying graphics (plane A, plane B, the backdrop color, etc.) will be shown at half intensity, regardless of the underlying object's priority setting. This is the so-called "shadow" effect.

A pixel that uses color E will not be drawn. In it's place, any underlying graphics (plane A, plane B, the backdrop color, etc.) will be shown at double intensity, regardless of the underlying object's priority setting. This is the so-called "hilight" effect.

The following picture demonstrates a sprite using the hilight feature. The sprite itself (the one that looks like a swirl) is entirely composed of pixels using color E, though a sprite can have any combination (like both shadow and hilight pixels as well as 'normal' pixels).

         

In the case of overlapping sprites using the said special colors, the topmost sprite (the one with the highest inter-sprite priority level) determines the operation that takes place to the underlying data. The shadow / hilight effect only affects the backdrop and background planes, it does not affect sprites underneath other sprites.

Miscellaneous

Here is a test program I wrote to experiment with shadow / hilight mode, using the excellent SGCC compiler ported for Genesis use by Paul Lee. Press buttons A and B to toggle shadow / hilight mode.

Everthing that refers to plane A is also true for the window plane.

As far as I know, the color value stored in CRAM for indices E and F of palette 3 have absolutely no bearing on how the shadow or hilight effect works. I have noticed that some games tend to set one or both colors as maximum intensities (like 0xEEE or 0xE0E, etc.), though I don't think that is of any significance.

The changes in intensity due to a tile's priority setting will also affect any parts of the backdrop color that can be seen. For example, if all planes were completely blank, except for one tile on plane A or B having priority (say it's a blank tile composed entirely of zero value pixels), then the underlying 8x8 square of backdrop color in the same position of that tile will be shown at normal intensity. I don't know of any games that rely on this, however.

You probably noticed in the first picture on the left side, that the sprite links connecting to the orb shape seem to be miscolored. This is a bug in KGen, which computes the double intensity palette to be much brighter than it should. In terms of fitting colors to the VGA palette, it calculates the colors like so:

    Half intensity
    Component value = CRAM data << 2

    Normal intensity
    Component value = CRAM data << 3

    Double intensity
    Component value = (CRAM data << 2) | 0x20;
It's hard to spot this bug since the palette colors will look correct for 99% of the games out there.

Here are a list of games to check out that use shadow / hilight mode.

Lastly, if you use this information in a program such as an emulator, I'd appreciate if I could be given credit, since I spent a lot of time trying to figure all this stuff out. :)


Back to Index