The drawings on the screen are produced by a proprietary chip called Video Display Processor or 'VDP'. Internally, it shares the same design as the Texas Instruments TMS9918 (used in the SG-1000) , though it has been enhanced with features which we will discuss in the following sections.
Organising the content

Memory architecture of the VDP.
Connected to the VDP are 16 KB of Video RAM (VRAM), which only the VDP can access using a 16-bit data bus (Sega modified the original design to access two memory chips with 8-bit buses simultaneously ). If you look at the motherboard picture again, you'll notice that both RAM and VRAM chips are roughly the same, except that VRAM uses the chip model ending in '20', which offers lower latency .
For the Master System, VRAM houses everything the VDP requires for rendering (except Colour RAM). The CPU fills VRAM by writing to specific VDP registers, which in turn forward the values to VRAM. Since the VDP is accessed through I/O ports, the CPU must use IN and OUT instructions.
Constructing the frame
The VDP renders frames with a resolution of up to 256x192 pixels. Later revisions added support for 256x224 px and 256x240 px. However, to maintain compatibility with all models, developers adhered to the standard resolution. This chip has the same modus operandi as Nintendo's PPU; in other words, graphics are rendered on the spot.
Furthermore, the VDP has four different modes of operation. These alter the characteristics of the frame (colour depth and resolution):
- Mode 0 to III: Inherited from the TMS9918 found on the SG-1000. They are included for backwards compatibility, although any SMS game can use them.
- Mode IV: The native mode of the Master System, which enables access to all the state-of-the-art features of the VDP. For this analysis, we will focus on this mode!
Let us now examine how a frame is drawn step by step. For this, I'll borrow Sonic The Hedgehog's assets. Also, to make explanations easier, this analysis will focus on the standard memory layout that Sega suggests for organising the graphics content (just remember that the VDP is very flexible, allowing games to optimise the layout).
Tiles

A single tile.
Mode IV is based on the tile system. To recall previous explanations about tile engines, tiles are just 8x8 pixel bitmaps that the renderer retrieves to draw the game's graphics. In the case of the VDP, the frame consists of two planes: the background layer and the sprite layer.
Inside VRAM, there is an area dedicated to tiles called Character generator (Sega refers to tiles as 'Characters'), and it's set to be 14 KB long. Each tile occupies 32 bytes, so we can store up to 448 tiles.
Each tile contains 64 pixels, and the VDP rules that each pixel must use 4 bits, allowing 16 colours to be chosen. These bits reference a single entry in Colour RAM or 'CRAM', which is located within the VDP and stores the colour palettes. Colour palette systems reduce the size of tiles in memory and enable programmers to alternate their colours without storing multiple copies.
Colour RAM stores two palettes of 16 colours each. Each entry is 6 bits wide, with each 2-bit set defining one colour from the RGB model. This provides a total of 64 colours to choose from.
Background Layer

Allocated Screen map with selected area marked.
The background layer is a large plane where static tiles are drawn. To place something here, there is another area in VRAM called Screen map, which takes 1.75 KB.
This allows developers to build a layer of 896 tiles (32x28 tiles) , but if we do the math, we see that this layer is larger than the display resolution of the console. The reality is, only 768 tiles (32x24 tiles) are visible, so the visible area is manually selected at the programmer's will. Also, by slowly alternating the X and Y coordinates of the selected area, a scrolling effect is achieved.
Each entry in the map is 2 bytes wide (matching the width of the VDP's data bus) and contains the address of the tile in the Character generator, along with the following attributes:
- Horizontal and Vertical flip.
- The priority bit (determines whether to draw some or all the tile in front of sprites).
- The colour palette used.
Curiously enough, there are three unused bits in the entry that the game can use for other purposes (e.g., extra flags to assist the game engine).
Sprites
Sprites are essentially tiles that can move freely. The VDP can raster up to 64 sprites using a single tile (8x8 px) or two tiles stacked vertically (8x16 px).
The Sprite Attribute Table is a 256-byte area in VRAM that contains an array of all the defined sprites. Its entries are similar to those of the background layer, except that each sprite contains two additional values representing the X/Y coordinates.
The VDP is limited to a maximum of eight sprites per horizontal scan-line . Also, if multiple sprites overlap, the first one in the list is displayed.
Result
The VDP automatically blends the two layers to form the final frame. The rendering process is performed scan-line by scan-line, so the VDP doesn't really know how the frame will look; that's only visible to the user once the picture is constructed on the TV.
If you examine the example image, you may notice a vertical column at the left side of the frame. This occurs because the screen map is tall enough to provide vertical scrolling without producing artefacts, but not wide enough for horizontal scrolling. To address this, the VDP can mask the left-most side with an 8 px column to prevent intermediate tiles from being displayed.
To update the graphics for the next frame without disrupting the image currently being displayed, the VDP sends two types of interrupts to the CPU. One notifies that the CRT TV has finished beaming a chosen number of scan-lines (called horizontal interrupt), while the other signals that the CRT has completed drawing the final scan-line (called vertical interrupt), indicating the frame is finished. During these events, the CRT's beam is repositioning to draw the next scan-line (blanking interval), so any alteration of the VDP's state won't tear the image. Horizontal blanking has a shorter time-frame than vertical blanking, yet it still allows to change, let's say, the colour palette. This still can produce certain effects.
Secrets and limitations
At first glance, the VDP may seem like another chip with minimal functionality that we now take for granted. Although, it still managed to draw significant attention away from Nintendo's offering at the time. Why was that?
Collision detection
First of all, the VDP could tell if two sprites were colliding. This was done by checking its status register . While it could not identify which sprites in particular were colliding, developers could 'triangulate' the location by reading other registers as well, such as the scan-line counter.
This feature was not new, actually, as the TMS9918 also included it. Thus, the SG-1000 also had collision detection.
The need for modularity
When I previously analysed the design of Nintendo's PPU, I emphasised its internal memory architecture. While limited, some constraints were somewhat beneficial as they enabled the system to be expanded with extra hardware included in the game cartridge, keeping the costs down in the process.
The VDP doesn't take advantage of this modular approach. Instead, Sega implemented a different solution that in turn saves cartridge costs. The smaller background layer and horizontal interrupts are examples of this.
3D glasses

Sega 3-D glasses . The American variant connected through the card port.
It turns out Sega also shipped '3D glasses' as an official accessory! The glasses worked in sync with the CRT. During gameplay, the game alternates the position of objects between frames. Each lens contains an LCD screen that turns black to block your vision. The correct combination of graphics flickering and alternating shutters eventually creates a stereoscopic image in your head, resulting in a '3D' effect.
The shutters are controlled via several memory addresses, but none of them indicate whether the glasses are actually plugged in. Therefore, games that support this accessory include a settings option to manually activate this feature.
The LCD controllers are interfaced with a jack cable, which plugs into the console. The European and American versions did not include the jack input, so they rely on the card port to connect an adaptor (we'll see more about the card slot later on).
Video Output
The video-out connector of this system is incredibly versatile. It exposes both composite and RGB signals, which can be considered the two 'extremes' of video quality.
The downside, however, is that it doesn't carry 'composite sync', so using the RGB output requires capturing the sync signal from composite, and its quality isn't optimal.


