qdosmsq:traps:trap_3:papp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

qdosmsq:traps:trap_3:papp [2009/05/17 11:26] (current)
george.gwilt created
Line 1: Line 1:
 +====== IOW_PAPP etc ======
 +
 +
 +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.|
 +
 +===== Errors =====
 +
 +|ERR_NC|Not complete.|
 +|ERR_NO|Channel not open.|
 +
 +
 +===== Notes =====
 +  * All registers not shown above are not used on entry and are probably preserved on exit.
 +  * The standard colour definitions are:
 +    *QL colour : a value from 0 to 7.
 +    *Palette colour: a value from 0 to 255.
 +    *True colour: 8 bit red, 8 bit green, 8 bit blue.
 +  * Native colour can be one of these or may be different, such as mode 32 or 33.
 +  * The value in D1.L must be right justified except for true colour when it must be left justified.
 +  * The value in D2.L determines the stipple. If D1 is -1 then the colour is solid. If the value is 0, 1, 2 or 3 then the colour in D1 is the stipple colour applied to the the existing solid colour. Thus, stipples require two calls, the first to set the solid colour and the second to apply the stipple. ​
 +
 +===== Example =====
 +The example below shows a window being opened and coloured using these traps.
 +
 +<​code>​
 +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" ​          
 +
 +</​code>​
 +
  
  • qdosmsq/traps/trap_3/papp.txt
  • Last modified: 2009/05/17 11:26
  • by george.gwilt