qdosmsq:traps:trap_3:palq

Differences

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

Link to this comparison view

qdosmsq:traps:trap_3:palq [2009/05/15 10:37] (current)
george.gwilt created
Line 1: Line 1:
 +====== IOW_PALQ & IOW_PAL8 ======
 +
 +
 +These traps define colour palettes.
 +^Trap^Value of D0.B^Action^
 +|IOW_PALQ|$60|Define a QL palette|
 +|IOW_PAL8|$61|Define 8 bit palette|
 +
 +
 +^Call Parameters^^Return Parameters^^
 +|D0.B|See above|D0.L|Corrupted?|
 +|D1.L|The first element to set |D1.L|Corrupted?|
 +|D2.L|The number of elements to set |D2.L|Corrupted?|
 +|A0.L|Channel ID |A0.L|Preserved?|
 +|A1.L|Address of Palette|A1.L|Corrupted?|
 +
 +===== 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.
 +  * A1.L points to an area containing the D2.L elements to be set.
 +  * The elements are colours in true colour format, left justified.
 +
 +===== Example =====
 +The example below shows the use of this trap call to set the QL palette. It is assumed that A0 contains the channel ID. 
 +
 +<code>
 +QL_pal  lea     paltte,a1       ; Address of elements
 +        moveq   #-1,d3          ; Timeout
 +        moveq   #iow_palq,d0    ; $60
 +        moveq   #0,d1           ; First element
 +        moveq   #8,d2           ; Set all elements
 +        trap    #3              ; Set the palette
 +        tst.l   d0              ; OK? . .
 +        bne     error           ; . . no!
 +
 +paltte  dc.l    $00000000       ; Black    0
 +        dc.l    $FFB6B600       ; Peach    1
 +        dc.l    $FF000000       ; Red      2  
 +        dc.l    $92B64900       ; Avocado  3
 +        dc.l    $00FF0000       ; Green    4
 +        dc.l    $0000FF00       ; Blue     5
 +        dc.l    $FF00FF00       ; Magenta  6
 +        dc.l    $FFFFFF00       ; White    7
 +
 +</code>
 +
  
  • qdosmsq/traps/trap_3/palq.txt
  • Last modified: 2009/05/15 10:37
  • by george.gwilt