30. SCR_INK

*------------------------------------------------------------------------------
* NAME          SCR_INK
*------------------------------------------------------------------------------
* DEPENDENCY    None
* PURPOSE       Set the INK colour for the given channel ID.
* DESCRIPTION   Sets the ink colour for the screen channel whose ID is passed
*               in A0, to the colour code supplied in D0.W.
* INPUTS :
*               D0.W = colour code for ink colour
*               A0.L = Channel ID.
* OUTPUTS :
*               D0 = Error code
*               A0.L = channel ID (preserved)
*               Z flag set if no errors, unset otherwise.
*------------------------------------------------------------------------------
scr_ink         move.l   d1/d3/a1,-(a7) ; These will be corrupted by SD_SETIN
                move.w   d0,d1          ; Get the ink colour
                moveq    #sd_clear,d0   ; CLS (SD_SETIN defined in GWASL)
                moveq    #-1,d3         ; Infinite timeout
                trap     #3             ; Set INK colour
                move.l   (a7)+,d1/d3/a1 ; Restore corrupted registers
                tst.l    d0             ; Set Z flag if all ok, else not set
                rts