Sega Master System


Graphical Summary


Standard game resolution: 256x192 or 256x224

color range: The SMS uses 2 bits per color channel, providing a palette of 64 colors. When you choose the NES/Famicom project preset those 64 colors will be at the bottom of the color palette for you to easily copy colors from there to the first 32 indexes of the palette. You should only use the colors you copy from the bottom 64 colors into the top 32 color indexes, and be sure to follow the graphical limitations mentioned below.

Number of color indexes available:
typically 32 indexes used, but many are used for transparent so can't be used as a display color. Explained in greater detail below.

Background graphics color limitations:
Background graphics are always made from 8x8 pixel tiles. Every single tile can use any or all of the 16 colors from EITHER the 16 colors reserved for background graphics OR the 16 colors reserved for sprites! To clarify, each tile can use either color indexes 0 through 15 or color indexes 16 through 31. By default, indexes 0 through 15 are for backgrounds and sprites can ONLY USE indexes 16 through 31.

488 unique tiles can be used. Up to 1,792 horizontally or vertically flipped tiles possible in vram.

Background tiles CAN be flipped horizontally or vertically OR BOTH at the same time!

You can also draw one tile image directly on top of another in the same tile location. Clever SMS developers used this method to put very large moving characters on screen with no flicker! Using tiles drawn over background tiles instead of sprites for the games players, enemies etc. See the SMS longplay of Golden Axe: https://www.youtube.com/watch?v=OHbJLhumzUs You might notice, while allowing this 8-bit system to have many large moving objects on screen, the obvious trade-off is that every character or object made from tile drawing instead of sprites is forced to move in 8x8 tile increments instead of smoothly per pixel.

Each background tile can be set to display either behind or in front of the sprites!

NOTE: The SMS did not have any direct support for "dual playfield" layered scrolling, but there are two methods which some games put to use in order to create some fantastic parallax scrolling in their games.

The first method is to actually use animated tiles which change their appearance to look as though they are scrolling independently and at a different speed from the rest of the background. This is great when the background can be a small repeating pattern such as a brick wall etc. Be careful though. As this eats up your already limited number of available tile images quickly. For example: to allow a single 8x8 tile to look like a wall pattern which can scroll independently of the background, you need a total of 8 entire tile images. One image for each 1 pixel offset making the tile loop (scroll) horizontally. If you wanted your single 8x8 pixel tile to be able to scroll independently in both directions, you'd need all 8 vertical offset images for every horizontal offset! This would require a whopping 64 tiles! For this reason, most games which use this method limit the parallax effect to either horizontally or vertically and not both at the same time.

The second method doesn't use up any additional tile image space because it uses a trick to slice your background screen into horizontal segments, where each segment can be scrolled at a different speed! The slicing of the background screen has no effect on sprites, so don't worry, the player character won't be sliced in half, with their legs scrolling at a different speed than their upper body. This method can only slice the screen into horizontal strips, not vertically.

Here is some more detailed information about this method, though this page is for NES, the general methodology is the same: http://www.dustmop.io/blog/2015/12/18/nes-graphics-part-3/


Sprites
The SMS can display eight 8x8 pixel, 15 color (plus a "clear" index for transparent pixels) sprites per scan line (row of pixels on screen). You can have 64 sprites on screen in total, but any more than 8 per scan line will result in sprites flickering (becoming invisible). Sprites mist always use color indexes 16 through 31, with index 16 being used for transparent pixels.

You can choose a second sprite mode which switches all sprites to 8x16 pixels instead of 8x8 pixels (yes, you can still display 64 of these on screen even though they are twice as tall) BUT all sprites must be in the mode you choose (8x8 or 8x16).

The sega master system offers another awesome feature which allows you to set all sprites to "zoom mode". This doubles the horizontal and vertical pixel size,making them blocky, but also now 16x16 and 16x32 pixels in size on-screen. Like picking 8x16 sprite mode, if you turn on zoom mode, then ALL sprites will be zoomed.

Sprites can choose their image "tile" from either the 256 tile set or the 192 tile set. Sprite "tile" images CAN NOT be horizontally or vertically flipped or rotated!

IMPORTANT: You can actually use background tiles to represent objects in the game that can be interacted with! The SMS has an awesome feature which lets you draw 2 tile images (on top of the other) in a single tile space on-screen! This means you can draw tile-made enemies, coins, effects or other details on top of any actual background graphic! Clever game designers can use animated background tiles to create large enemies for the player to fight against with no sprite-flicker concerns.

For more detailed technical references:
http://www.smspower.org/Development/SMSOfficalDocs
http://www.smspower.org/Development/Index

sample projects


Last modified: 29 January 2023