Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- dBsee 4.6 - The Library - <b>dfdacset()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
dfDacSet()
Sets a single DAC register
------------------------------------------------------------------------------
Syntax:

     dfDacSet( <nReg>, <nRed>, <nGreen>, <nBlue>) --> NIL

Parameters:

     <nReg>     DAC register; a value between 0 and 255.
     <nRed>, <nGreen>, <nBlue> . Values to assign to the RGB components of
     the register; each values must be between 0 and 63.

Returns:

     NIL

Description:

     Sets the contents of a DAC register.

Example:

     * ##############################################
     PROCEDURE tDac()
     * ##############################################
     LOCAL nPalette, nGreen, nBlue, nRed, nScan, cChr
     
     CLS
     
     nPalette := 0
     nGreen   := dfDacGreen( dfPalette(nPalette) )
     nRed     := dfDacRed( dfPalette(nPalette) )
     nBlue    := dfDacBlue( dfPalette(nPalette) )
     
     WHILE LastKey() # 27
         @  0,1 SAY "Teo" COLOR "N"
         @  1,1 SAY "Teo" COLOR "B"
         @  2,1 SAY "Teo" COLOR "G"
         @  3,1 SAY "Teo" COLOR "BG"
         @  4,1 SAY "Teo" COLOR "R"
         @  5,1 SAY "Teo" COLOR "RB"
         @  6,1 SAY "Teo" COLOR "GR"
         @  7,1 SAY "Teo" COLOR "W"
         @  8,1 SAY "Teo" COLOR "N+"
         @  9,1 SAY "Teo" COLOR "B+"
         @ 10,1 SAY "Teo" COLOR "G+"
         @ 11,1 SAY "Teo" COLOR "BG+"
         @ 12,1 SAY "Teo" COLOR "R+"
         @ 13,1 SAY "Teo" COLOR "RB+"
         @ 14,1 SAY "Teo" COLOR "GR+"
         @ 15,1 SAY "Teo" COLOR "W+"
     
         ? cChr
         ? dfPalette(nPalette)
         ? nGreen
         ? nRed
         ? nBlue
     
         nScan := Inkey(0)
         cChr  := Chr(nScan)
     
         DO CASE
            CASE cChr == "G" ; nGreen++
            CASE cChr == "g" ; nGreen--
            CASE cChr == "R" ; nRed++
            CASE cChr == "r" ; nRed--
            CASE cChr == "B" ; nBlue++
            CASE cChr == "b" ; nBlue--
            CASE cChr == "P" ; nPalette++
             nGreen   := dfDacGreen( dfPalette(nPalette) )
             nRed     := dfDacRed( dfPalette(nPalette) )
             nBlue    := dfDacBlue( dfPalette(nPalette) )
            CASE cChr == "p" ; nPalette--
             nGreen   := dfDacGreen( dfPalette(nPalette) )
             nRed     := dfDacRed( dfPalette(nPalette) )
             nBlue    := dfDacBlue( dfPalette(nPalette) )
         ENDCASE
      dfDacSet( dfPalette(nPalette), nRed, nGreen, nBlue )
     END
     
     RETURN

See also:

     dfDacRest(), dfDacSave(), dfPalette()

See Also: dfDacRest() dfDacSave() dfPalette()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson