Sim68K Graphics


TRAP #15 is used for I/O.  Put the task number in D0.

The output screen resolution is adjustable via Task 33. The top left corner of the window is position 0,0
Drawing outside the screen area is ignored.
The screen may be cleared with task 11.

 Task

 80

 Set pen color where D1.L is color as $00BBGGRR
    BB is amount of blue from $00 to $FF
    GG is amount of green from $00 to $FF
    RR is amount of red from $00 to $FF

 81

 Set fill color where D1.L is color as $00BBGGRR

 82

 Draw pixel in pen color at X,Y where X = D1.W & Y = D2.W
    The drawing mode is not used (see 92) . The drawing point is not moved (see 86).

 83

 Get pixel color at X,Y and place in D0.L where X = D1.W & Y = D2.W.

 84

 Draw line using pen color from X1,Y1 to X2,Y2
    where X1 = D1.W, Y1 = D2.W, X2 = D3.W, Y2 = D4.W

 85

 Draw line using pen color to X,Y where X = D1.W & Y = D2.W

 86

 Move to X,Y where X = D1.W & Y = D2.W (Task 84 & 85 also move drawing point)

 87

 Draw rectangle defined by (Left X, Upper Y, Right X, Lower Y). 
    where LX = D1.W, UY = D2.W, RX = D3.W, LY = D4.W
    The rectangle is drawn using pen color and filled using fill color.

 88

 Draw ellipse bounded by the rectangle (Left X, Upper Y, Right X, Lower Y)
    where LX = D1.W, UY = D2.W, RX = D3.W, LY = D4.W
    The ellipse is drawn using pen color and filled using fill color.
    A circle is drawn if the bounding rectangle is a square.

 89

 Flood Fill the area at X, Y with the fill color where X = D1.W & Y = D2.W

 90

 Draw unfilled rectangle defined by (Left X, Upper Y, Right X, Lower Y). 
    where LX = D1.W, UY = D2.W, RX = D3.W, LY = D4.W
    The rectangle is drawn using pen color and is not filled.

 91

 Draw unfilled ellipse bounded by the rectangle (Left X, Upper Y, Right X, Lower Y)
    where LX = D1.W, UY = D2.W, RX = D3.W, LY = D4.W
    The ellipse is drawn using pen color and is not filled.
    A circle is drawn if the bounding rectangle is a square.

 92

 Set drawing mode which affects pen and fill colors. D1.B is mode number as:
    0 - Draw color is always black, ignores pen and fill colors
    1 - Draw color is always white, ignores pen and fill colors
    2 - Move cursor but do not draw
    3 - NOT (background color) is drawn
    4 - The draw color is drawn (default)
    5 - NOT (draw color) is drawn
    6 - NOT (background color) OR (draw color) is drawn
    7 - NOT (background color) AND (draw color) is drawn
    8 - (background color) OR NOT (draw color) is drawn
    9 - (background color) AND NOT (draw color) is drawn
  10 - (background color) OR (draw color) is drawn
  11 - (background color) NOR (draw color) is drawn
  12 - (background color) AND (draw color) is drawn
  13 - (background color) NOT AND (draw color) is drawn
  14 - (background color) XOR (draw color) is drawn
  15 - (background color) NOT XOR (draw color) is drawn|
  16 - Turn off double buffering (default)
  17 - Enable double buffering. Draw on off screen buffer (Use Task 94 to display off screen buffer)
* The background color is whatever is already there.
* The draw color is the pen color or the fill color.

 93

 Set pen width where D1.B is width in pixels.

 94

 Repaint screen. Copies off screen buffer to visible screen.
 (Requires drawing mode 17 be set from task 92 above.)

 95  Draw the NULL terminated string of text at (A1) to screen location X,Y where X = D1.W & Y = D2.W.
 The text is drawn as graphics and may not be read using trap task 22. Control characters are ignored.
 X,Y specifies the location of the top left corner of the text.
 96  Get X,Y pen position where D1.W = X, D2.W = Y


Some color values:

BLACK equ $00000000
MAROON equ $00000080
GREEN equ $00008000
OLIVE equ $00008080
NAVY equ $00800000
PURPLE equ $00800080
TEAL equ $00808000
GRAY equ $00808080
RED equ $000000FF
LIME equ $0000FF00
YELLOW equ $0000FFFF
BLUE equ $00FF0000
FUCHSIA equ $00FF00FF
AQUA equ $00FFFF00
LTGRAY equ $00C0C0C0
WHITE equ $00FFFFFF