HARDWARE ManualVDP1 User's Manual
BackForward
VDP1 User's Manual

Chapter 3 Processing flow


● Flow of drawing procedure

The flow of the drawing procedure using VDP1 is as follows.

step 1.
Power on the system.

Step 2.
Set the required value in the VDP1 system register.

Step 3.
Write the required character pattern table to VRAM.

Step 4.
Write the required color lookup table to VRAM.

Step 5.
Write the required Gouraud shading table to VRAM.

Step 6.
Write the required command table to VRAM.

Step 7.
At the same time as the frame change, drawing starts automatically in the frame buffer and is displayed at the next frame change.

Step 8.
Repeat steps 3-6 as needed.

● Table access

The steps for VDP1 to access and draw a table in VRAM are as follows:

step 1.
Controls drawing and display according to the instructions set in the system registers.

Step 2.
Fetch the command table with the start address of VRAM.

Step 3.
The fetched command table

(1) When the drawing end command is used, drawing ends. → Step 9

(2) When the jump format is skip, the command table is ignored. The reading of the table is finished and the table is not processed. → Step 8

(3) In cases other than (1) and (2) above, go to step 4.

Step 4.
In the case of the clipping coordinate setting command and the relative coordinate setting command, the processing is performed respectively. → Step 8

Step 5.
When the drawing command is specified, the Gouraud shading table and color lookup table are read.

Step 6.
When drawing a texture, the character pattern table is read and written to the frame buffer as specified. At this time, color mode processing, color calculation, inversion, scaling, and rotation are processed.

Step 7.
When drawing non-texture, write to the frame buffer as specified.

Step 8.
Follow the jump-style instructions to fetch the next command table and process the command table repeatedly. → Step 3

Step 9.
Drawing is repeated at the start of the frame. → Step 1

● Command table flow

For commands other than the draw end command, you can specify the jump format to the command table to be processed next. The jump formats are as follows.

The following is an example of the command flow in the jump format.

Figure 3.1 Command table flow
VRAM command table ┌──────────┐
│ Clipping coordinates │ ・
├──────────┤│
│ Relative coordinates │ │
├──────────┤│
│ Parts │ │
├──────────┤ ↓
│ Subroutine call │ └─┐ ・ The specified table is called a subroutine ├──────────┤ │
│ Parts │ ┌ ← ┼─┐
├──────────┤ │ │ │ │
│ Parts │ │ │ │ │
├──────────┤ ↓ │ │ │
│ Jump │ └─┼─┼─┐ ・ Move to the specified table ├──────────┤ │ │ │ │
│: │ │ │ │ │
├──────────┤ │ │ │ │
│ Parts │ ┌ ← ┘ │ │ │
├──────────┤ │ │ │ │
│ Parts │ │ │ │ │
├──────────┤ ↓ │ │ │
│ Return │ └───┘ │
├──────────┤ │
│: │ │
├──────────┤ │
│ Parts │ ┌ ← ──── ┘
├──────────┤│
│ Parts │ │
├──────────┤ ↓
│ Skip / Parts │ ・ Skip (this part is not drawn)
├──────────┤│
│ Parts │ │
├──────────┤│
│ Parts │ │
├──────────┤ ↓
│ Jump │ └─┐
├──────────┤ │
│ Parts │ │
├──────────┤ │
│ Parts │ │
├──────────┤ │
│ Jump │ │ │
├──────────┤ │
│: │ │
├──────────┤ │
│ Change clipping coordinates │ ┌ ← ┘
├──────────┤│
│ Parts │ │
├──────────┤│
│ Relative coordinate change │ │
├──────────┤│
│ Parts │ │
├──────────┤│
│: │ │
├──────────┤ ↓
│ End of drawing │ ・ End of drawing ├──────────┤
│: │
└──────────┘

● Table reference

The table stored in VRAM is referenced from the command table.

Figure 3.2 Table Reference
VRAM 
┌──────────────────┐
│: │
│: │
┣━━━━━━━━━━━━━━━━━━┫
┃Part drawing command ┃
┃: ┃
┠──────────────────┨
┃ Color mode, color calculation ┃
┠──────────────────┨
┃ Look-up table address ┃─┐
┠──────────────────┨ │
┃ Character address ┃─┼─┐
┠──────────────────┨ │ │ │
┃ Character size ┃ │ │ │
┠──────────────────┨ │ │ │
┃: ┃ │ │ │
┃: ┃ │ │ │
┠──────────────────┨ │ │ │
┃Guro shading table address ┃─┼┐│
┠──────────────────┨ │ │ │
┃: ┃ │ │ │
┣━━━━━━━━━━━━━━━━━━┫ │ │ │
│: │ │ │ │ │
│: │ │ │ │ │
┣━━━━━━━━━━━━━━━━━━┫ │ │ │
┃ Color look-up table ┃ ← ┘││
┃: ┃ │ │
┣━━━━━━━━━━━━━━━━━━┫ │ │
│: │ │ │ │
│: │ │ │ │
┣━━━━━━━━━━━━━━━━━━┫ │ │
┃Guro shading table ┃←─┘│
┃: ┃ │
┃: ┃ │
┣━━━━━━━━━━━━━━━━━━┫ │
│: │ │ │
│: │ │ │
┣━━━━━━━━━━━━━━━━━━┫ │
┃Character pattern table ┃←──┘
┃: ┃
┃: ┃
┣━━━━━━━━━━━━━━━━━━┫
│: │
│: │

BackForward
HARDWARE ManualVDP1 User's Manual
Copyright SEGA ENTERPRISES, LTD., 1997