★ Line color



ListReference

function

slLineColTable


Set the line color table address in the register

Form

    #include "sgl.h"

    void * addr;

    void slLineColTable (addr);

argument

    void * addr --Line color table address on VRAM.

Number of returns

    void --Nothing is returned.

function

    Set the line color table address in the register.
Either the offset from the beginning of VDP2 or the absolute address can be used for addr. (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

Form

    #include "sgl.h"

    void * addr;
    Uint16 color;

    void slLine1ColSet (addr, color);

argument

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

Number of returns

    void --Nothing is returned.

function

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

Example

    Multiply NBG1 by line color. (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

Form

    #include "sgl.h"

    Uint16 mode;

    void slLineColDisp (mode);

argument

    Uint16 mode --The screen that is affected by the line color when it becomes the top image.

Number of returns

    void --Nothing is returned.

function

    Set the screen that is 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 of each plane by connecting them with "|".
Use LNCLON if you want to set sprites.
(This is because the bit position is different from other registers)

Example

    Multiply NBG1 by line color.
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

Form

    #include "sgl.h"

    Uint16 mode;

    void slColorCalc (mode);

argument

    Uint16 mode --Parameters for color operations (see below).

Number of returns

    void --Nothing is returned.

function

    Set the 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 surface Connect the above values with "|" according to the function to be used. Please specify.

Example

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

caution


    This function is the same as 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


Color calculation mode setting

Form

    #include "sgl.h"

    Uint16 mode;

    void slColorCalcMode (mode);

argument

    Uint16 mode --Color calculation mode (described later).

Number of returns

    void --Nothing is returned.

function

    This function performs only the mode setting part of the slColorCalc function.
Use 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 NBG1 by line color.
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

Form

    #include "sgl.h"

    Uint16 mode;

    void slColorCalcOn (mode);

argument

    Uint16 mode --Screens affected by color arithmetic controls

Number of returns

    void --Nothing is returned.

function

    Sets 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 of each plane by connecting them with "|".

Example

    Multiply NBG1 by line color.
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


Blur function settings

Form

    #include "sgl.h"

    Uint16 mode;

    void slGradationOn (mode);

argument

    Uint16 mode --The surface that activates the blur function (described later).

Number of returns

    void --Nothing is returned.

function

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

Example

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

caution


    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 combination with color calculation.
To cancel the blur function, specify OFF as an argument or 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 the blur function

Form

    #include "sgl.h"

    void slGradationOff (void);

argument

    void --Do not give anything.

Number of returns

    void --Nothing is returned.

function

    Disables 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 the color calculation ratio

Form

    #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 surface that specifies the color calculation ratio (described later).
Uint16 rate --Color calculation rate.

Number of returns

    void --Nothing is returned.

function

    Specify the color calculation ratio of each screen.
In mode, scnNBG0 , scnNBG1 , scnNBG2 , scnNBG3 , scnRBG0 , scnLNCL , scnBACK Specify one of.
Specify the 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


Back screen color table set and mode switching

Form

    #include "sgl.h"

    void * addr_A;

    void slBackColTable (addr_A);

argument

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

Number of returns

    void --Nothing is returned.

function

    Set the color table on 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));
         ::

caution


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

reference

 slBack1ColSet
 VDP2_BKTA 



ListReference

function

slBack1ColSet


Back screen settings

Form

    #include "sgl.h"

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

argument

    void * addr_A --The start address (absolute address) of the VRAM that stores the back color.
Uint16 color --Specify color data with 5 bits each for RGB.

Number of returns

    void --Nothing is returned.

function

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

Example

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

caution


    VRAM uses the VRAM area of VDP2 instead of color RAM.

reference

 slBackColTable
 VDP2_BKTA

return
Copyright SEGA ENTERPRISES, LTD., 1997