Wednesday, May 10, 2017

Night Mode

With the debug cheat active in either Sonic 2 or Sonic 3, holding down the C button while a level is starting enables one of the VDP's most esoteric features: Shadow/Highlight mode.


In this mode, every color appears dimmed, except for sprites and background patterns which are set to high priority. The practical effect is that a black, semi-transparent layer is inserted in front of the low priority layers, but behind the high priority ones. This is an extremely useful tool for debugging the priority data in a level: in the screenshot above, you can tell Sonic will walk in front of the blue flowers but behind the palmtree, without actually having to check.

The debug shortcut was removed in Sonic & Knuckles, likely because it has no real value as a cheat code.


Besides debugging, Shadow/Highlight finds use in the character select screen for Competition mode. The entirety of Plane A is set to high priority except for the square which contains the player sprites. The selected player is set to high priority, so it's shown at full brightness. The other sprites aren't, so they get shaded along with the background.


The drop shadows seen in a special stage use another feature of S/H mode: sprites painted with colors 14/15 of palette line 3 (the last two colors in CRAM) won't actually display those colors, but rather shade/highlight the underlying pixels. Shadow through color 14 works exactly the same as it does through priority, but offers better control over the resulting shape. Highlight isn't used in anywhere in Sonic games. It works the same as shadow does, but brightens colors rather than darken them.

Perhaps due to this feature, color 14 fails to be shaded correctly. This can be seen above in the first two screenshots, where it affects the darkest grey in the player sprites. The Competition menu avoids placing background colors in those indexes: they hold the colors for the yellow frames, which never get shaded anyway.

No comments:

Post a Comment