Japanese
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 an offset value when outputting the color data of sprites and each scroll screen, and can be used for fade in, fade out, etc. Masu.

■13.1 Color offset specification

Two color offset values, Color Offset A and Color Offset B, can be set for each RGB, and you can specify which of these two to use for each screen. The color offset value is 9-bit data corresponding to each RGB, and if the color data resulting from adding each RGB is smaller than 00H, that color data is set to 00H and becomes larger than FFH. In all such cases, FFH is used.

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 resulting from the color calculation. Also, since the color operation result screen is considered to be the top image screen, the color offset enable register is specified using the top image screen bits.

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   │
  └──┴──┴──┴──┴──┴──┴──┴──┴──┘
 Sign 
              ↓ 
   
   7  6  5  4  3  2   1  0 
  ┌──┬──┬──┬──┬──┬──┬──┬──┐
  │Output color data 8 bit│
  └──┴──┴──┴──┴──┴──┴──┴──┘

●Color offset enable register

The color offset enable register specifies whether to use the color offset function for each screen. This is a 16-bit write-only register located at address 180110H. The value is cleared to 0 after power-on or reset, so be sure to set it.

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

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

Color offset enable bit : Color offset enable bit
(N0COEN, N1COEN, N2COEN, N3COEN, R0COEN, BKCOEN, SPCOEN)
Specify 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 color offset function
1 Use the color offset function
[Note] xx in the bit name is N0, N1, N2, N3, R0, BK, or SP.

If you are using the color calculation function, specify it using 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. This is a 16-bit write-only register located at address 180112H. The value is cleared to 0 after power-on or reset, so be sure to set it.

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

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

Color offset select bit : Color offset select bit
(N0COSL, N1COSL, N2COSL, N3COSL, R0COSL, BKCOSL, SPCOSL)
Specify 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 color offset A value
1 Use color offset B value
[Note] xx in the bit name is N0, N1, N2, N3, R0, BK, or SP.

If you are using the color calculation function, specify it using the color offset select bit on the top image side screen.

●Color offset register

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

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

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

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

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

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

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

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

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

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

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

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

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

Color offset data bit
(COARD8〜COARD0, COAGR8〜COAGR0, COABL8〜COABL0, COBRD8〜COBRD0, COBGR8〜COBGR0, COBBL8〜COBBL0)
Set the RGB values for color offset A and color offset B. Set negative numbers using two'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 of 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 of color offset B


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