These SMSQ/E traps set the GD2 colour of paper, strip and ink.
Trap | Value in D0 | Action |
IOW_PAPP | $50 | Set paper colour using palette |
IOW_STRP | $51 | Set strip colour using palette |
IOW_INKP | $52 | Set ink colour using palette |
IOW_PAPT | $54 | Set true colour paper |
IOW_STRT | $55 | Set true colour strip |
IOW_INKT | $56 | Set true colour ink |
IOW_PAPN | $58 | Set native colour paper |
IOW_STRN | $59 | Set native colour strip |
IOW_INKN | $5A | Set native colour ink |
Call Parameters | Return Parameters |
D0.B | See above | D0.L | Error return |
D1.L | Colour | D1.L | Corrupted? |
D2.L | Stipple | D2.L | Preserved? |
D3.W | Timeout | D3.L | Preserved. |
A0.L | Channel ID | A0.L | Preserved. |
ERR_NC | Not complete. |
ERR_NO | Channel not open. |
The example below shows a window being opened and coloured using these traps.
wind bsr ope ; Open the window
moveq #-1,d3 ; Timeout
moveq #-1,d2 ; Solid colour
moveq #2,d1 ; Palette red
moveq #iow_papp,d0 ; Palette paper colour
bsr tp3 ; Do trap
moveq #0,d2 ; Stipple
move.l #$00FF0000,d1 ; True colour green
moveq #iow_papt,d0 ; You can mix colour types!
bsr tp3 ; 2nd call for stipple
moveq #1,d1 ; Palette white
moveq #-1,d2 ; Solid colour
moveq #iow_strp ; White strip
moveq #0,d1 ; Palette black
moveq #-1,d2 ; Solid colour
moveq #iow_inkp ; Black ink
moveq #-1,d2 ; Solid colour
moveq #4,d1 ; Blue
moveq #iow_blkp,d0 ; First call for border
bsr tp3
move.l #$30002,d2 ; Stipple 3 and border width 2
moveq #6,d1 ; Palette yellow
moveq #iow_blkp,d0 ; Second call for border
bsr tp3
moveq #sd_clear,d0 ; Clear the window
bsr tp3
tp3 trap #3
tp3_1 tst.l d0 ; OK? . .
bne error ; . . no!
rts ; return OK
ope moveq #-1,d1 ; This job
moveq #0,d3 ; Type of open
lea con,a0 ; The window
trap #2 ; Open the window
bra tp3_1 ; Test for errors and return
con dc.w 3
dc.b "con"