Name: | ğArbitrary lineĞ | ||||||||||||||||||||||||||||||||||
Line-A number: | $A003 | ||||||||||||||||||||||||||||||||||
Syntax: | See 'Bindings for draw_line' | ||||||||||||||||||||||||||||||||||
Description: | This Line-A function draws a straight line from top left to
bottom right. The following Line-A variables are used:
Note: Independent of the order of the coordinates, the line is drawn always from top left to bottom right. For a horizontal line there is a faster function $A004 Horizontal line available. The bindings of TC passes the line mask, writing mode and colour not to the draw_line function, but uses separate functions set_fg_bp, set_ln_mask and set_wrt_mode for setting the parameters in the Line-A parameter block. | ||||||||||||||||||||||||||||||||||
Return value: | The function does not return a result. The field ln_mask of the Line-A parameter block is shifted by the output algorithm. | ||||||||||||||||||||||||||||||||||
Availability: | All TOS versions. | ||||||||||||||||||||||||||||||||||
See also: | Binding LINEA Horizontal line |
Pure-C: | void draw_line(int16_t x1, int16_t y1, int16_t x2, int16_t y2); |
Assembler: | movem.l D0-D2/A0-A2,-(A7) ; Save registers move.l pParamblk,A0 ; Pointer parameter block LINEA move.w x1,(38,A0) ; First X-coordinate in LINEA.x1 move.w y1,(40,A0) ; First Y-coordinate in LINEA.y1 move.w x2,(42,A0) ; Second X-coordinate in LINEA.x2 move.w y2,(44,A0) ; Second Y-coordinate in LINEA.y2 move.w colbit0,(24,A0) ; Bit for first plane in LINEA.fg_bp_1 move.w colbit1,(26,A0) ; Bit for first plane in LINEA.fg_bp_2 move.w colbit2,(28,A0) ; Bit for first plane in LINEA.fg_bp_3 move.w colbit3,(30,A0) ; Bit for first plane in LINEA.fg_bp_4 move.w lnmask,(34,A0) ; Line style in LINEA.ln_mask move.w wmode,(36,A0) ; Writing mode in LINEA.wrt_mode move.w lstlin,(32,A0) ; Line style in LINEA.lstlin dc.w $A003 ; Line-A opcode movem.l (A7)+,D0-D2/A0-A2 ; Restore registers |