about summary refs log tree commit diff stats
path: root/html/070table.mu.html
Commit message (Expand)AuthorAgeFilesLines
* 3713 - cross-link calls with definitions in htmlKartik K. Agaram2016-12-261-16/+16
* 3710Kartik K. Agaram2016-12-261-109/+109
* 3709 - line numbers in htmlKartik K. Agaram2016-12-261-112/+136
* 3688Kartik K. Agaram2016-11-251-0/+4
* 3621Kartik K. Agaram2016-11-041-2/+2
* 3619Kartik K. Agaram2016-10-311-6/+25
* 3618Kartik K. Agaram2016-10-311-2/+2
* 3617Kartik K. Agaram2016-10-311-21/+21
* 3613Kartik K. Agaram2016-10-311-6/+5
* 3569Kartik K. Agaram2016-10-231-34/+34
* 3431Kartik K. Agaram2016-09-301-6/+6
* 3430Kartik K. Agaram2016-09-281-7/+7
* 3395Kartik K. Agaram2016-09-171-22/+22
* 3355Kartik K. Agaram2016-09-151-2/+2
* 3158Kartik K. Agaram2016-07-271-0/+125
/ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
fn draw-circle screen: (addr screen), cx: int, cy: int, radius: int, color: int {
  var x: int
  var y: int
  var err: int
  # x = -r
  var tmp/eax: int <- copy radius
  tmp <- negate
  copy-to x, tmp
  # err = 2 - 2*r
  tmp <- copy radius
  tmp <- shift-left 1
  tmp <- negate
  tmp <- add 2
  copy-to err, tmp
  #
  var tmpx/ecx: int <- copy 0
  var tmpy/edx: int <- copy 0
  {
    # pixel(cx-x, cy+y)
    tmpx <- copy cx
    tmpx <- subtract x
    tmpy <- copy cy
    tmpy <- add y
    pixel screen, tmpx, tmpy, color
    # pixel(cx-y, cy-x)
    tmpx <- copy cx
    tmpx <- subtract y
    tmpy <- copy cy
    tmpy <- subtract x
    pixel screen, tmpx, tmpy, color
    # pixel(cx+x, cy-y)
    tmpx <- copy cx
    tmpx <- add x
    tmpy <- copy cy
    tmpy <- subtract y
    pixel screen, tmpx, tmpy, color
    # pixel(cx+y, cy+x)
    tmpx <- copy cx
    tmpx <- add y
    tmpy <- copy cy
    tmpy <- add x
    pixel screen, tmpx, tmpy, color
    # r = err
    tmp <- copy err
    copy-to radius, tmp
    # if (r <= y) { ++y; err += (y*2 + 1); }
    {
      tmpy <- copy y
      compare radius, tmpy
      break-if->
      increment y
      tmpy <- copy y
      tmpy <- shift-left 1
      tmpy <- increment
      add-to err, tmpy
    }
    # if (r > x || err > y) { ++x; err += (x*2 + 1); }
    $draw-circle:second-check: {
      {
        tmpx <- copy x
        compare radius, tmpx
        break-if->
        tmpy <- copy y
        compare err, tmpy
        break-if->
        break $draw-circle:second-check
      }
      increment x
      tmpx <- copy x
      tmpx <- shift-left 1
      tmpx <- increment
      add-to err, tmpx
    }
    # loop termination condition
    compare x, 0
    loop-if-<
  }
}

fn draw-disc screen: (addr screen), cx: int, cy: int, radius: int, color: int, border-color: int {
  var r/eax: int <- copy 0
  {
    compare r, radius
    break-if->=
    draw-circle screen, cx cy, r, color
    r <- increment
    loop
  }
  draw-circle screen, cx cy, r, border-color
}