QDOS Internals

Anything you never knew you wanted to know about the Sinclair QL.

User Tools

Site Tools


qdosmsq:traps:trap_3:blkp

Table of Contents

IOW_BLKP etc

These SMSQ/E traps draw blocks using GD2 colours.

TrapValue of D0.BAction
IOW_BLKP$5CDraw palette colour block
IOW_BLKT$5DDraw true colour block
IOW_BLKN$5EDraw native colour block
Call ParametersReturn Parameters
D0.BSee aboveD0.LError return
D1.L D1.LCorrupted?
D3.WTimeout D3.LPreserved.
A0.LChannel ID A0.LPreserved.
A1.LPointer to block definition.A1.LCorrupted?
A2.LPointer to colour definitionA2.LPreserved?

Errors

ERR_NCNot complete.
ERR_NOChannel not open.
ERR_ORBlock outside window

Notes

  • All registers not shown above are not used on entry and are probably preserved on exit.
  • A1.L points to a set of four words in the usual form:
    • X-size
    • Y-size
    • X-origin (relative to window origin)
    • Y-origin (relative to window origin)
  • A2.L points to three long words:
    • Stipple colour 1
    • Stipple colour 2
    • Stipple code (-1 to 3)

Example

The example below shows the use of this trap call to print a block. It is assumed that A0 contains the window's channel ID.

blck    moveq   #iow_blkt,d0    ; $5D
        lea     bk,a1           ; Block definition
        lea     cl,a2           ; Colour definition
        moveq   #-1,d3          ; Timeout
        trap    #3              ; Draw block
        tst.l   d0              ; OK? . .
        bne     error           ; . . no!

bk      dc.w    100,48          ; Size
        dc.w    10,10           ; Position in window

bk      dc.l    $B66D6D00       ; Brick (1st stipple colour)
        dc.l    $00FFFF00       ; Cyan  (2nd stipple colour)
        dc.l    3               ; Stipple code
qdosmsq/traps/trap_3/blkp.txt · Last modified: 2009/05/17 14:08 by george.gwilt