HARDWARE ManualVDP2 User's Manual
BackForward
VDP2 User's Manual

Chapter 13 Color Offset Function


The color offset function is a function that changes the screen color without changing the color RAM data by adding the offset value when outputting the color data of the sprite and each scroll screen, and is used for fade-in, fade-out, etc. increase.

■ 13.1 Color offset specification

For the color offset value, you can set two values, color offset A and color offset B, for each RGB, and you can specify which of these two values to use for each screen. The color offset value is 9-bit data corresponding to each of RGB, and in all cases where the color data as a result of adding to each of RGB becomes smaller than 00H, the color data is set to 00H and becomes larger than FFH. In all such cases, use FFH.

Since the processing of the color offset function is performed after the processing of the color calculation function, the color offset value is added to the color data of the result of the color calculation. Also, since the result screen of the color calculation is regarded as the screen of the top image, the color offset enable register is specified by the bit for the screen of the top image.

The color offset data is shown in Figure 13.1.

Figure 13.1 Color offset data
7 6 5 4 3 2 1 0
┌─┬─┬─┬─┬─┬─┬─┬─┐
│ Color data 8 bits │
└─┴─┴─┴─┴─┴─┴─┴─┘
 
+ 
 
8 7 6 5 4 3 2 1 0 
┌─┬─┬─┬─┬─┬─┬─┬─┬─┐
│ │ Color data 8 bits │
└─┴─┴─┴─┴─┴─┴─┴─┴─┘
Code 
↓ 
 
7 6 5 4 3 2 1 0 
┌─┬─┬─┬─┬─┬─┬─┬─┐
│ Output color data 8 bits │
└─┴─┴─┴─┴─┴─┴─┴─┘

● Color offset enable register

The color offset enable register specifies whether to use the color offset function for each screen. A write-only 16-bit register located at address 180110H. After turning on the power or resetting, the value will be cleared to 0, so be sure to set it.

CLOFEN 180110H
 15
 14
 13
 12
 11
 Ten
 09 09
 08 08
 ---
 ---
 ---
 ---
 ---
 ---
 ---
 ---

 07 07
 06 06
 05 05
 04
 03 03
 02 02
 01 01
 00
 ---
 SPCOEN
 BKCOEN
 R0COEN
 N3COEN
 N2COEN
 N1COEN
 N0COEN

Color offset enable bit : Color offset enable bit
(N0COEN, N1COEN, N2COEN, N3COEN, R0COEN, BKCOEN, SPCOEN)
Specifies whether to use the color offset function.

N0COEN 180110H Bit 0 For NBG0 (or for RBG1)
N1COEN 180110H Bit 1 For NBG1 (or for EXBG)
N2COEN 180110H Bit 2 For NBG2
N3COEN 180110H Bit 3 For NBG3
R0COEN 180110H Bit 4 For RBG0
BKCOEN 180110H Bit 5 For BACK
SPCOEN 180110H Bit 6 For sprites

xxCOEN process
0 Do not use the color offset function
1 Use the color offset function
[Note] The bit name xx contains N0, N1, N2, N3, R0, BK, or SP.

When using the color calculation function, specify it with the color offset enable bit on the screen on the top image side.

● Color offset select register

The color offset select register specifies the color offset register to use for each screen. A write-only 16-bit register located at address 180112H. After turning on the power or resetting, the value will be cleared to 0, so be sure to set it.

CLOFSL 180112H
 15
 14
 13
 12
 11
 Ten
 09 09
 08 08
 ---
 ---
 ---
 ---
 ---
 ---
 ---
 ---

 07 07
 06 06
 05 05
 04
 03 03
 02 02
 01 01
 00
 ---
 SPCOSL
 BKCOSL
 R0COSL
 N3COSL
 N2COSL
 N1COSL
 N0COSL

Color offset select bit : Color offset select bit
(N0COSL, N1COSL, N2COSL, N3COSL, R0COSL, BKCOSL, SPCOSL)
Specifies the color offset register to use when using the color offset function.

N0COSL 180112H Bit 0 For NBG0 (or for RBG1)
N1COSL 180112H Bit 1 For NBG1 (or for EXBG)
N2COSL 180112H Bit 2 For NBG2
N3COSL 180112H Bit 3 For NBG3
R0COSL 180112H Bit 4 For RBG0
BKCOSL 180112H Bit 5 For BACK
SPCOSL 180112H Bit 6 For sprites

xxCOSL process
0 Use the value of color offset A
1 Use the value of color offset B
[Note] The bit name xx contains N0, N1, N2, N3, R0, BK, or SP.

When using the color calculation function, specify it with the color offset select bit on the screen on the top image side.

● Color offset register

The color offset register specifies each RGB value of the color offset value. This is a write-only 16-bit register located at addresses 180114H to 18011EH. After turning on the power or resetting, the value will be cleared to 0, so be sure to set it.

COAR 180114H
 15
 14
 13
 12
 11
 Ten
 09 09
 08 08
 ---
 ---
 ---
 ---
 ---
 ---
 ---
 COARD8

 07 07
 06 06
 05 05
 04
 03 03
 02 02
 01 01
 00
 COARD7
 COARD6
 COARD5
 COARD4
 COARD3
 COARD2
 COARD1
 COARD0 

COAG 180116H
 15
 14
 13
 12
 11
 Ten
 09 09
 08 08
 ---
 ---
 ---
 ---
 ---
 ---
 ---
 COAGR8

 07 07
 06 06
 05 05
 04
 03 03
 02 02
 01 01
 00
 COAGR7
 COAGR6
 COAGR5
 COAGR4
 COAGR3
 COAGR2
 COAGR1
 COAGR0 

COAB 180118H
 15
 14
 13
 12
 11
 Ten
 09 09
 08 08
 ---
 ---
 ---
 ---
 ---
 ---
 ---
 COABL8

 07 07
 06 06
 05 05
 04
 03 03
 02 02
 01 01
 00
 COABL7
 COABL6
 COABL5
 COABL4
 COABL3
 COABL2
 COABL1
 COABL0 

COBR 18011AH
 15
 14
 13
 12
 11
 Ten
 09 09
 08 08
 ---
 ---
 ---
 ---
 ---
 ---
 ---
 COBRD8

 07 07
 06 06
 05 05
 04
 03 03
 02 02
 01 01
 00
 COBRD7
 COBRD6
 COBRD5
 COBRD4
 COBRD3
 COBRD2
 COBRD1
 COBRD0 

COBG 18011CH
 15
 14
 13
 12
 11
 Ten
 09 09
 08 08
 ---
 ---
 ---
 ---
 ---
 ---
 ---
 COBGR8

 07 07
 06 06
 05 05
 04
 03 03
 02 02
 01 01
 00
 COBGR7
 COBGR6
 COBGR5
 COBGR4
 COBGR3
 COBGR2
 COBGR1
 COBGR0 

COBB 18011EH
 15
 14
 13
 12
 11
 Ten
 09 09
 08 08
 ---
 ---
 ---
 ---
 ---
 ---
 ---
 COBBL8

 07 07
 06 06
 05 05
 04
 03 03
 02 02
 01 01
 00
 COBBL7
 COBBL6
 COBBL5
 COBBL4
 COBBL3
 COBBL2
 COBBL1
 COBBL0

Color offset value bit: Color offset data bit
(COARD8 ~ COARD0, COAGR8 ~ COAGR0, COABL8 ~ COABL0, COBRD8 ~ COBRD0, COBGR8 ~ COBGR0, COBBL8 ~ COBBL0)
Set the RGB values of color offset A and color offset B respectively. Negative numbers should be set in 2's complement.

COARD8 ~ COARD0 180114H Bits 8-0 For RED data with color offset A
COAGR8 ~ COAGR0 180116H Bits 8-0 For GREEN data of color offset A
COABL8 ~ COABL0 180118H Bits 8-0 For BLUE data with color offset A
COBRD8 ~ COBRD0 18011AH Bits 8-0 For RED data with color offset B
COBGR8 ~ COBGR0 18011CH Bits 8-0 For GREEN data of color offset B
COBBL8 ~ COBBL0 18011EH Bits 8-0 For BLUE data with color offset B


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