Japanese

★Line color



ListReference

function

slLineColTable


Set line color table address to register

Format

    #include "sgl.h"

    void *addr;

    void slLineColTable( addr );

argument

    void *addr - Line color table address in VRAM.

Return number

    void - returns nothing.

function

Set the line color table address in the register.
For addr, either an offset from the beginning of VDP2 or an absolute address can be used. (Only the lower 20 bits are valid.)

example

    slDMACopy ( src, ( void * )0x25e20000, 256 * sizeof( Uint16 ) );
                     :
    slLineColTable ( ( void * )0x25e20000 );

reference

 slLine1ColSet
 slLineColTable
 slColorCalc
 slColorCalcOn
 slLineColDisp
 slColorCalcMode
 slColRateLNCL
 VDP2_LCTA 



ListReference

function

slLine1ColSet


Line color screen settings

Format

    #include "sgl.h"

    void *addr;
    Uint16 color;

    void slLine1ColSet( addr, color );

argument

    void *addr - Line color table address on VRAM
Uint16 color - Color number.

Return number

    void - returns nothing.

function

Line color Makes the screen a single color and sets that color.
For addr, either an offset from the beginning of VDP2 or an absolute address can be used. (Only the lower 20 bits are valid.)

example

    Multiply the line color on NBG1. (Line color table is 25E20000H)
    slColorCalc ( CC_RATE | CC_2ND | NBG1ON );
    slColorCalcOn ( NBG1ON );

    slLine1ColSet( ( void * )0x20000, 128 );

reference

 slLineColTable
 slColorCalc
 slColorCalcOn
 slLineColDisp
 slColorCalcMode
 slColRateLNCL
 VDP2_LCTA 



ListReference

function

slLineColDisp


The screen that is affected by the line color when it becomes the top image

Format

    #include "sgl.h"

    Uint16 mode;

    void slLineColDisp( mode );

argument

    Uint16 mode - Screen affected by line color when it becomes the top image.

Return number

    void - returns nothing.

function

Set the screen that will be affected by the line color when it becomes the top image.
In mode, NBG0ON , NBG1ON , NBG2ON , NBG3ON , RBG0ON , LNCLON is entered.
If you want to set the drawing settings for multiple scroll planes at the same time, specify the mode for each plane by connecting them with "|".
If you want to set sprites, please use LNCLON .
(This is because the bit position is different from other registers)

example

    Multiply the line color on NBG1.
slColorCalcMode ( CC_RATE | CC_2ND ); slColorCalcOn ( NBG1ON ); slLineColTable ( ( void * )0x25e20000 ); slLineColDisp ( NBG1ON ); slColRateLNCL ( CLRate20_12 );

reference

 slLine1ColSet
 slLineColTable
 slColorCalc
 slColorCalcOn
 slColorCalcMode
 slColRateLNCL
 slLineColTable
 VDP2_LNCLEN 


★Color calculation



ListReference

function

slColorCalc


Set parameters for color calculation

Format

    #include "sgl.h"

    Uint16 mode;

    void slColorCalc( mode );

argument

    Uint16 mode - Parameters for color calculations (described later).

Return number

    void - returns nothing.

function

Set parameters for color calculation.
mode specifies the following parameters.
        CC_RATE | CC_ADD : Calculation method
        CC_TOP | CC_2ND : Calculation specification screen
        CC_EXT : Extended color calculation
        NBG0ON | NBG1ON | NBG2ON | NBG3ON | RBG0ON | LNCLON | SPRON : Registration screen
Connect the above values with "|" according to the function to be used. Please specify.

example

    Multiply the line color on NBG1.
slColorCalc ( CC_RATE | CC_2ND | NBG1ON ); slLineColTable ( ( void * )0x25e20000 ); slLineColDisp ( NBG1ON ); slColRateLNCL ( CLRate20_12 ); Extended color calculation with NBG0 and NBG1.
slColorCalc ( CC_RATE | CC_TOP | NBG0ON | NBG1ON | CC_EXT ); slColRateNbg0 ( CLRate6_26 ); slColRateNbg1 ( CLRate12_20 ); slPriorityNbg0 ( 7 ); slPriorityNbg1 ( 6 ); slPriorityNbg2 ( 5 );

Note

This function is equivalent to running both slColorCalcMode and slColorCalcOn .

reference

 slLineColTable
 slLine1ColSet
 slLineColTable
 slColorCalcOn
 slColorCalcMode
 slColRate
 slColRateNbg0
 slColRateNbg1
 slColRateNbg2
 slColRateNbg3
 slColRateRbg0
 slColRateLNCL
 slColRateBACK
 slColRateSpr0
 slColRateSpr1
 slColRateSpr2
 slColRateSpr3
 slColRateSpr4
 slColRateSpr5
 slColRateSpr6
 slColRateSpr7
 VDP2_CCCTL 



ListReference

function

slColorCalcMode


Setting the color calculation mode

Format

    #include "sgl.h"

    Uint16 mode;

    void slColorCalcMode( mode );

argument

    Uint16 mode - Color calculation mode (described later).

Return number

    void - returns nothing.

function

This function only performs the mode setting part of the slColorCalc function.
Used in conjunction with the slColorCalcOn function.
mode specifies the following parameters.
CC_RATE | CC_ADD : Calculation method CC_TOP | CC_2ND : Calculation specification screen CC_EXT : Extended color calculation

example

    Multiply the line color on NBG1.
slColorCalcMode ( CC_RATE | CC_2ND ); slColorCalcOn ( NBG1ON ); slLineColTable ( ( void * )0x25e20000 ); slLineColDisp ( NBG1ON ); slColRateLNCL ( CLRate20_12 );

reference

 slLineColTable
 slLine1ColSet
 slLineColTable
 slColorCalc
 slColorCalcMode
 slColRate
 slColRateNbg0
 slColRateNbg1
 slColRateNbg2
 slColRateNbg3
 slColRateRbg0
 slColRateLNCL
 slColRateBACK
 slColRateSpr0
 slColRateSpr1
 slColRateSpr2
 slColRateSpr3
 slColRateSpr4
 slColRateSpr5
 slColRateSpr6
 slColRateSpr7
 VDP2_CCCTL 



ListReference

function

slColorCalcOn


Screen settings affected by color calculation controls

Format

    #include "sgl.h"

    Uint16 mode;

    void slColorCalcOn( mode );

argument

    Uint16 mode - Screen affected by color calculation control

Return number

    void - returns nothing.

function

Set the screen affected by the color calculation control.
In mode, NBG0ON , NBG1ON , NBG2ON , NBG3ON , RBG0ON , LNCLON , SPRON is entered.
If you want to set the drawing settings for multiple scroll planes at the same time, specify the mode for each plane by connecting them with "|".

example

    Multiply the line color on NBG1.
slColorCalcMode ( CC_RATE | CC_2ND ); slColorCalcOn ( NBG1ON ); slColRateNbg1 ( CLRate20_12 );

reference

 slLineColTable
 slLine1ColSet
 slLineColTable
 slColorCalc
 slColorCalcOn
 slColRate
 slColRateNbg0
 slColRateNbg1
 slColRateNbg2
 slColRateNbg3
 slColRateRbg0
 slColRateLNCL
 slColRateBACK
 slColRateSpr0
 slColRateSpr1
 slColRateSpr2
 slColRateSpr3
 slColRateSpr4
 slColRateSpr5
 slColRateSpr6
 slColRateSpr7
 VDP2_CCCTL 



ListReference

function

slGradationOn


Setting the blur function

Format

    #include "sgl.h"

    Uint16 mode;

    void slGradationOn( mode );

argument

    Uint16 mode - The surface on which the blur function is applied (described later).

Return number

    void - returns nothing.

function

Enable the blur function and specify the screen to be affected.
In mode, grdNBG0 , grdNBG1 , grdNBG2 , grdNBG3 , grdRBG0 , grdSPR , OFF Specify only one of the following.

example

    slColRAMMode ( CRM16_1024 );
            :
    slGradationOn ( grdNBG0 );
    slColorCalc ( CC_RATE | CC_TOP | NBG0ON );
    slColRateNbg0 ( CLRate20_12 );

Note

The blur function can only be used when the color RAM mode is 0.
Also, please note that the blur function will not work unless it is used in conjunction with color calculation.
To cancel the blur function, specify OFF as the argument, or Please use the slGradationOff function.

reference

 slLineColTable
 slLine1ColSet
 slLineColTable
 slColorCalc
 slColorCalcOn
 slColorCalcMode
 slColRate
 slColRateNbg0
 slColRateNbg1
 slColRateNbg2
 slColRateNbg3
 slColRateRbg0
 slColRateLNCL
 slColRateBACK
 slColRateSpr0
 slColRateSpr1
 slColRateSpr2
 slColRateSpr3
 slColRateSpr4
 slColRateSpr5
 slColRateSpr6
 slColRateSpr7
 slGradationOff
 slColRAMMode
 VDP2_CCCTL 



ListReference

macro

slGradationOff


Disable blur function

Format

    #include "sgl.h"

    void slGradationOff( void );

argument

    void - gives nothing.

Return number

    void - returns nothing.

function

Disable the blur function.

example

    slGradationOff ();

reference

 slLineColTable
 slLine1ColSet
 slLineColTable
 slColorCalc
 slColorCalcOn
 slColorCalcMode
 slColRate
 slColRateNbg0
 slColRateNbg1
 slColRateNbg2
 slColRateNbg3
 slColRateRbg0
 slColRateLNCL
 slColRateBACK
 slColRateSpr0
 slColRateSpr1
 slColRateSpr2
 slColRateSpr3
 slColRateSpr4
 slColRateSpr5
 slColRateSpr6
 slColRateSpr7
 slGradationOn 



ListReference

function

slColRate



ListReference

macro

slColRateNbg0



ListReference

macro

slColRateNbg1



ListReference

macro

slColRateNbg2



ListReference

macro

slColRateNbg3



ListReference

macro

slColRateRbg0



ListReference

macro

slColRateLNCL



ListReference

macro

slColRateBACK



ListReference

macro

slColRateSpr0



ListReference

macro

slColRateSpr1



ListReference

macro

slColRateSpr2



ListReference

macro

slColRateSpr3



ListReference

macro

slColRateSpr4



ListReference

macro

slColRateSpr5



ListReference

macro

slColRateSpr6



ListReference

macro

slColRateSpr7


Specifying color calculation ratio

Format

    #include "sgl.h"

    Uint16 rate;
    Uint16 mode;

    void slColRate( mode, rate );
    void slColRateNbg0( rate );
    void slColRateNbg1( rate );
    void slColRateNbg2( rate );
    void slColRateNbg3( rate );
    void slColRateRbg0( rate );
    void slColRateLNCL( rate );
    void slColRateBACK( rate );
    void slColRateSpr0( rate );
    void slColRateSpr1( rate );
    void slColRateSpr2( rate );
    void slColRateSpr3( rate );
    void slColRateSpr4( rate );
    void slColRateSpr5( rate );
    void slColRateSpr6( rate );
    void slColRateSpr7( rate );

argument

    Uint16 mode - A plane that specifies the color calculation ratio (described later).
Uint16 rate - color calculation rate.

Return number

    void - returns nothing.

function

Specify the color calculation ratio for each screen.
In mode, scnNBG0 , scnNBG1 , scnNBG2 , scnNBG3 , scnRBG0 , scnLNCL , scnBACK Specify one of the following.
Specify rate in the range of CLRate31_1 to CLRate0_32 .
           rate       Top Screen : Second Screen
           CLRate31_1          31:1
           CLRate30_2          30:2
           CLRate29_3          29:3
           CLRate28_4          28:4
           CLRate27_5          27:5
           CLRate26_6          26:6
           CLRate25_7          25:7
           CLRate24_8          24:8
           CLRate23_9          23:9
           CLRate22_10         22:10
           CLRate21_11         21:11
           CLRate20_12         20:12
           CLRate19_13         19:13
           CLRate18_14         18:14
           CLRate17_15         17:15
           CLRate16_16         16:16
           CLRate15_17         15:17
           CLRate14_18         14:18
           CLRate13_19         13:19
           CLRate12_20         12:20
           CLRate11_21         11:21
           CLRate10_22         10:22
           CLRate9_23           9:23
           CLRate8_24           8:24
           CLRate7_25           7:25
           CLRate6_26           6:26
           CLRate5_27           5:27
           CLRate4_28           4:28
           CLRate3_29           3:29
           CLRate2_30           2:30
           CLRate1_31           1:31
           CLRate0_32           0:32

example

    slColRate ( scnNBG0 , CLRate29_3 );
    slColRateNbg2 ( CLRate2_30 );

reference

 slLineColTable
 slLine1ColSet
 slLineColTable
 slColorCalc
 slColorCalcOn
 slColorCalcMode
 slGradationOn
 slGradationOff
 VDP2_CCRNA 


★Back color screen



ListReference

function

slBackColTable


Setting the back screen color table and switching modes

Format

    #include "sgl.h"

    void *addr_A;

    void slBackColTable( addr_A );

argument

    void *addr_A - Absolute address indicating the back screen color table.

Return number

    void - returns nothing.

function

Set the color table for the back screen and set the mode to switch colors in raster units.

example

    ss_main() {
      Uint16 col[ 256 ] = {
        C_RGB ( 3, 6, 6 ), ...
      };
         :
      slDMACopy ( col, ( void * )( 0x25e40000 ), 256 * sizeof( Uint16 ) );
         :
      slBackColTable ( ( void * )( 0x25e40000 ) );
         :

Note

The argument given to this function specifies the VDP2 VRAM address as an absolute address.

reference

 slBack1ColSet
 VDP2_BKTA 



ListReference

function

slBack1ColSet


Back screen settings

Format

    #include "sgl.h"

    void *addr_A;
    Uint16 color;
    
    void slBack1ColSet( addr_A, color );

argument

    void *addr_A - Start address (absolute address) of VRAM to store the back color.
Uint16 color - Specify color data with 5 bits each of RGB.

Return number

    void - returns nothing.

function

Set the back screen. The back screen is the backmost drawing surface that is displayed where no other screens are drawn.

example

    Make the back screen white.
slBack1ColSet ( ( void * )0x25e00000, 0x7fff

Note

VRAM uses the VDP2 VRAM area, not color RAM.

reference

 slBackColTable
 VDP2_BKTA

return
Copyright SEGA ENTERPRISES, LTD., 1997