Home Line-ALine-A Arbitrary lineArbitrary line Filled rectangleFilled rectangle

6.9 Horizontal line

Name: »Horizontal line«
 
Line-A number: $A004
 
Syntax: See 'Bindings for horizontal_line'
 
Description: This Line-A function draws a horizontal line. The following Line-A variables are used:
 
Variable Meaning
   
x1 X-coordinate of the first end-point
y1 Y-coordinate of the line
x2 X-coordinate of the second end-point
fg_bp_1 Bit value of the first plane for the colour that should be used for filling
fg_bp_2 Bit value of the second plane (only low or medium resolution)
fg_bp_3 Bit value of the third plane (only low resolution)
fg_bp_4 Bit value of the fourth plane (only low resolution)
patptr Pointer to a field with 16-bit line patterns
patmsk Number of line patterns - 1. Depending on the Y-coordinate, one pattern will now be chosen from the field of line patterns. The index of the line pattern used may be calculated with (y mod (patmsk + 1)). By specifying several line patterns and using multiple calls of this function for consecutive lines, it is easy to draw complex patterns as well.
wrt_mode Writing mode; the following modes are possible:
REPLACE 0 Replace
TRANS 1 Transparent (OR)
XOR 2 Inverse (XOR)
INVERS 3 Inverse Transparent (XOR with not(LN_MASK))
multifill 0 specifies that only the first colour plane is to be drawn, a value >0 that all colour planes are to be drawn

Note: This function is used internally for the area fill routines.
 
The binding from TC passes the line pattern, writing mode and colour not to the horizontal_line function, but uses separate functions set_fg_bp, set_wrt_mode and set_pattern for setting the parameters in the Line-A parameter block.
 
Return value: The function does not return a result.
 
Availability: All TOS versions.
 
See also: Binding   LINEA   Filled rectangle
 

6.9.1 Bindings for horizontal_line

Pure-C: void horizontal_line( int16_t x1, int16_t y1, int16_t x2 );
 
Assembler:
 
; Save registers
movem.l   D0-D2/A0-A2,-(A7)
; Pointer parameter block LINEA
move.l    pParamblk,A0
; First X-coordinate in LINEA.x1
move.w    x1,(38,A0)
; First Y-coordinate in LINEA.y1
move.w    y1,(40,A0)
; Second X-coordinate in LINEA.x2
move.w    x2,(42,A0)
; Bit for first plane in LINEA.fg_bp_1
move.w    colbit0,(24,A0)
; Bit for first plane in LINEA.fg_bp_2
move.w    colbit1,(26,A0)
; Bit for first plane in LINEA.fg_bp_3
move.w    colbit2,(28,A0)
; Bit for first plane in LINEA.fg_bp_4
move.w    colbit3,(30,A0)
; Writing mode in LINEA.wrt_mode
move.w    wmode,(36,A0)
; Line pattern in LINEA.patptr
move.w    patptr,(46,A0)
; Number patterns in LINEA.patmsk
move.w    patmsk,(50,A0)
; Writing mode in LINEA.multifill
move.w    mfill,(52,A0)
; Line-A opcode
dc.w      $A004
; Restore registers
movem.l   (A7)+,D0-D2/A0-A2

Home Line-ALine-A Arbitrary lineArbitrary line Filled rectangleFilled rectangle