28. SCR_PAPER

*------------------------------------------------------------------------------
* NAME          SCR_PAPER
*------------------------------------------------------------------------------
* DEPENDENCY    None
* PURPOSE       Set the PAPER colour for the given channel ID.
* DESCRIPTION   Sets the paper 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 paper colour
*               A0.L = Channel ID.
* OUTPUTS :
*               D0 = Error code
*               A0.L = channel ID (preserved)
*               Z flag set if no errors, unset otherwise.
*------------------------------------------------------------------------------
scr_paper       move.l   d1/d3/a1,-(a7) ; These will be corrupted by SD_SETPA
                move.w   d0,d1          ; Get the paper colour
                moveq    #sd_clear,d0   ; CLS (SD_SETPA defined in GWASL)
                moveq    #-1,d3         ; Infinite timeout
                trap     #3             ; Set PAPER colour (but not STRIP)
                move.l   (a7)+,d1/d3/a1 ; Restore corrupted registers
                tst.l    d0             ; Set Z flag if all ok, else not set
                rts