Sega Master System / Mark III / Game Gear|
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew
Displaying more than 32 colours - raster effectsPosted: Thu Apr 07, 2016 10:13 pm
Last edited by Maxim on Fri Apr 08, 2016 5:48 am; edited 1 time in total
A question I got via PM from someone who is worried about asking silly questions...
How can a game show more than 32 colours (including showing all 64 on the SMS)? What does it mean to say it's done using "raster effects"?
My answer will follow, feel free to add to it.
||Posted: Thu Apr 07, 2016 10:39 pm|
Raster effects is a general term across a bunch of systems to refer to changing something while the screen is being displayed.
On the earliest video games, the CPU was involved in the display generation. The Atari VCS effectively had the CPU emit the graphics on every line by manipulating the settings; this is kind of like raster effects because the code is changing the display for every line. If the CPU stopped doing this, the screen would be all the same. This means the CPU ends up spending the majority of its time updating the screen.
Later (or more expensive) systems had a "frame buffer" (video memory), where a video chip would generate the display based on some state set up by the CPU. If the CPU stopped doing anything, the video display would be stuck at the last state, but would be mostly correct. This means the CPU can spend very little time updating the screen when the view isn't changing.
These systems would have the video chip generating the screen display in parallel to the CPU doing other work, based on the settings in the video memory. What happens if the video memory is updated while this happens? Well, there are some interesting effects you can achieve, provided you understand when the video chip does certain things and what restrictions this implies.
In general, the display is generated one horizontal line at a time, to match the way the video signal (and old TVs) works. Also, in general, that means you can only change things from a certain line in the display, downwards. These lines are called "rasters" and thus the effects are raster effects.
First, you can update the palette RAM. The video chip reads this every time it needs to draw a pixel. While it's drawing the screen, that's almost all the time; and if the CPU writes to it, there's a glitch in the screen. You can try to time this glitch so it happens just where you can't see it, but then you can't update very many colours in the time. Sonic The Hedgehog does this to have the underwater parts of some levels be a different colour. It hides the glitches by drawing a "foamy" water surface. Other games only update one or two colours, for example to make the road appear to be moving in Hang On the Red and white colours are swapped during the display to make moving stripes. By extension, you could arrange to update enough colours each time the screen is drawn to show all 64 colours, but it is not very useful for a game.
Next, you can update the scroll settings. Lots of game do this to have a fixed status bar, or parallax effects. Racing games like Out Run do this a lot to get a curved Road effect. Whenever you get to that part where there's a big boss moving horizontally but the background is flat, it's a background image moving with raster effects.
The SMS VDP doesn't take consideration of vertical scrolling on raster effects. On systems where it does, you can get interesting vertical zoom effects.
You can update the sprites mid screen, which can allow you to exceed the 64 sprite limit with some limitations.
You can switch out some of the background table settings to get a vertical split screen effect. Road Rash does this to get a movable horizon.
You can turn the screen off to get a screen wipe effect (some Game Gear Sega logo effects) or a screen splitting bar (Cool Spot). While the screen is off, you have faster video memory access to do more other stuff (some Game Gear games do this for parts of the screen you can't see anyway).
You can even change video mode, although no games do this.