Applecorn icon indicating copy to clipboard operation
Applecorn copied to clipboard

SHR PLOT enhancements

Open bobbimanners opened this issue 2 years ago • 2 comments

Applecorn does not support all of the possible values of k for PLOT k,x,y statements.

Implemented:

  • k=0..7
  • k=64-71

Not implemented:

  • k=8-15 Should draw line with last point omitted
  • k=16-23 Dotted line
  • k=24-31 Dotted with last point omitted
  • k=72-79 Filling mode
  • k=80-87 Triangle filling

bobbimanners avatar Jan 17 '23 01:01 bobbimanners

I really should implement k=80-87 Triangle filling

bobbimanners avatar Jan 20 '23 01:01 bobbimanners

Triangle filling:

  • Store two previous points visited, not one as at present.
  • Triangle is made up of two previously visited points, plus the current plot point.
  • Sort the three vertices in y-coordinate order (top to bottom)
  • Divide the triangle into two halves, separated by a horizontal line extending from the middle y-coordinate
  • For each of the two half-triangles:
    • For each row of the half-triangle:
      • Compute coord of LHS using something Bresenham-ish
      • Compute coord of RHS using something Bresenham-ish
      • (Efficiently) plot a line from LHS to RHS in current row, using current GCOL action (and, or, xor, whatever)

bobbimanners avatar Jan 20 '23 19:01 bobbimanners