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>dfinw()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
dfInW()
Permits to get a word from a port
------------------------------------------------------------------------------
Syntax:

     dfInW(<nPort>) --> nVal

Parameters:

     <nPort>    Port from which to take the values

Returns:

     <nVal> Value taken from the port. 0 <= nValue <= 65535

Description:

     Permit to get a word from a port

Example:

     // Program of FADEIN
     
     LOCAL nCol, nPal, R, G, B
     
     FOR nCol:= 0 TO 63
       FOR nPal:= 0 TO 255
          dfGetPal(nPal,@ R,@ G,@ B)
          IF R<nCol; R+; ENDIF
          IF G<nCol; G+; ENDIF
          IF B<nCol; B+; ENDIF
          dfSetPal(nPal, R, G, B)
       NEXT
     NEXT
     
     * _____________________________________
     PROCEDURES dfGetPal(nCol, R, G, B)
     * _____________________________________
     
     dfOutB(dfHex2Dec(" 03C7") , nCol)
     R:= dfInW(dfHex2Dec(" 03C9") )
     G:= dfInW(dfHex2Dec(" 03C9") )
     B:= dfInW(dfHex2Dec(" 03C9") )
     
     RETURN
     
     * _____________________________________
     PROCEDURES dfSetPal(nCol, R, G, B)
     * _____________________________________
     
     dfOutB(dfHex2Dec(" 03C8") , nCol)
     dfOutB(dfHex2Dec(" 03C9") , R)
     dfOutB(dfHex2Dec(" 03C9") , G)
     dfOutB(dfHex2Dec(" 03C9") , B)
     
     RETURN

See also:

     dfFadeIn(), dfHex2Dec(), dfOutB()

See Also: dfFadeIn() dfHex2Dec() dfOutB()

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