Japanese
HARDWARE ManualVDP1 User's Manual
BackForward
VDP1 User's Manual/Chapter 6 Command Table

■End code invalid

End-code disable bit: end-code disable (ECD), bit 7
Specifies whether to disable the character pattern end code. When set to 0, the end code is enabled; when set to 1, the end code is disabled.
The end code invalid bit is only valid for drawing sprites with character patterns. Set this bit to 1 for polygons, polylines, and lines.
If the end code is enabled (ECD=0), when the end code is read for the second time in the horizontal direction while drawing a character pattern, the drawing for that line will end there and the drawing will move to the beginning of the next line. The end code will not be drawn and its pixels will be transparent.
When end codes are disabled (ECD=1), end codes are treated like any other color code.
Horizontal drawing ends when the end code is read twice, and end processing is performed only in the horizontal direction of the character pattern; the vertical direction is not affected.
Processed independently of the Transparent Pixel Disabled bit (SPD).
Please note that if the end code is enabled (ECD=0), the end code cannot be used for color display, so the number of colors that can be used will be reduced by one.
Also, for sprites that shrink horizontally with HSS=1, disable the end code (ECD=1).

 HSS
 ECD
 End code processing
 0
 0
 End code is valid, horizontal drawing ends with the second end code,
End code will be transparent
 0
 1
 End code invalid, end code not processed,
The color comes out according to the code
 1 and
enlarge
 0
 End code is valid, horizontal drawing ends with the second end code,
End code will be transparent
 1 and
reduce
 0
 End code invalid, end code not processed,
The color comes out according to the code
 1
 1
 End code invalid, end code not processed,
The color comes out according to the code

The relationship between color mode and end code is as follows. The number of bits of the end code differs depending on the color mode.

 color mode
 end code
 0
 16 colors (color bank mode)
 FH (4 bits)
 1
 16 colors (lookup table mode)
 FH (4 bits)
 2
 64 colors (color bank mode)
 FFH (8 bit)
 3
 128 colors (color bank mode)
 FFH (8 bit)
 4
 256 colors (color bank mode)
 FFH (8 bit)
 5
 32768 colors (RGB mode)
 7FFFH (16 bit)

An example of end code processing is:

Figure 6.10(a) End code processing (Part 1)

Place only transparent pixels outside the end code to prevent drawing even if read from the left or right. Therefore, when ECD=0, be sure to set SPD=0. Do not use the combination of ECD=0 and SPD=1.
The drawing direction may be reversed during pre-clipping.
If you want to use an end code for the original picture, use it as follows.

Figure 6.10(b) End code processing (Part 2)

  1. Place transparent pixels outside the end code
  2. Place one end code on each side of the picture made of transparent pixels.
  3. Even if there are transparent pixels inside, the end code can only be placed in the outermost one.
  4. For lines with all transparent pixels, place two end codes at each end.
  5. Do not place end codes on lines that do not have transparent pixels at either or both ends.

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