home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / BEEHIVE / UTILITYS / PUDD.ARC / TOOLS4.PAS < prev    next >
Pascal/Delphi Source File  |  1991-08-11  |  9KB  |  139 lines

  1.  
  2. {*************************************************************************}
  3. procedure fillbar(x1,y1,x2,y2:integer);
  4. {........................................a rectangle is drawn with the    }
  5. {  lower left corner being at x1,y1 and the upper right corner at x2,y2.  }
  6. {  The area is drawn and filled as is determined by filltypes procedure.  }
  7.  
  8. begin
  9.    inline ($21/$00/$FF/             {ld  hl,0ff00h   put addr of addr in hl  }
  10.            $5E/                     {ld  E,(HL)      get half of the address }
  11.            $23/                     {inc HL          point to second half    }
  12.            $56/                     {ld  D,(HL)      get other half          }
  13.            $EB/                     { ex DE,HL       switch                  }
  14.            $ED/$5B/x1/       {ld  DE,(nn)     get the integer           }
  15.            $73/                   {ld  (HL),E     put in array              }
  16.            $23/                   {inc HL                                   }
  17.            $72/                   {ld  (HL),D    and the high byte          }
  18.            $23/                   {inc HL           (it's done in words)    }
  19.            $ED/$5B/y1/            {ld  DE,(nn)   get the integer            }
  20.            $73/                   {ld  (HL),E  put it in array              }
  21.            $23/                   {inc HL                                   }
  22.            $72/                   {ld  (HL),D  both parts                   }
  23.            $23/                   {inc HL        full word                  }
  24.            $ED/$5B/x2/            {ld  DE,(nn)     get the mode             }
  25.            $73/                   {ld  (HL),E     put in array              }
  26.            $23/                   {inc HL                                   }
  27.            $72/                   {ld  (HL),D    and the high byte          }
  28.            $23/                   {inc HL           (it's done in words)    }
  29.            $ED/$5B/y2/            {ld  DE,(nn)   get the integer            }
  30.            $73/                   {ld  (HL),E  put it in array              }
  31.            $23/                   {inc HL                                   }
  32.            $72/                   {ld  (HL),D  both parts                   }
  33.            $23/                   {inc HL        full word                  }
  34.            $0E/$09/               {ld  C,8h      get the function           }
  35.            $EF  );                {rst 28h                                  }
  36. end;
  37. {*************************************************************************}
  38.  
  39.  
  40. {*************************************************************************}
  41. procedure  filltypes(style,index,color:integer);
  42. {  ......................................... all three variables affecting }
  43. {   fillbar are set here:                                                  }
  44. {   STYLE        INDEX       RESULT                                        }
  45. {   0            0 thru 7    A hollow bar is created                       }
  46. {   1            0 thru 7    A solid bar is created                        }
  47. {   2            0 thru 7    Any one of 8 different intensities            }
  48. {                            is selected with 0 being lowest intensity     }
  49. {                            and 7 being highest intensity.                }
  50. {   3            0           vertical lines fill bar                       }
  51. {   3            1           horizontal lines fill bar                     }
  52. {   3            2           diagonal lines fill bar                       }
  53. {   3            3           left diagonal lines fill bar                  }
  54. {   3            4           vert & horz lines fill bar                    }
  55. {   3            5           vert & right diagonal lines fill bar          }
  56. {   3            6           vert & left diagonal lines fill bar           }
  57. {   3            7           crossed diagonal lines fill bar               }
  58. {                                                                          }
  59. { .... all of the above is drawn in black (color=0) or white (color=1)     }
  60.     
  61.  
  62.  begin
  63.    inline ($21/$00/$FF/             {ld  hl,0ff00h   put addr of addr in hl  }
  64.            $5E/                     {ld  E,(HL)      get half of the address }
  65.            $23/                     {inc HL          point to second half    }
  66.            $56/                     {ld  D,(HL)      get other half          }
  67.            $EB/                     { ex DE,HL       switch                  }
  68.            $ED/$5B/style/         {ld  DE,(nn)     get the integer           }
  69.            $73/                   {ld  (HL),E     put in array              }
  70.            $23/                   {inc HL                                   }
  71.            $72/                   {ld  (HL),D    and the high byte          }
  72.            $23/                   {inc HL           (it's done in words)    }
  73.            $0E/$0F/               {ld  C,8h      get the function           }
  74.            $EF/                    {rst 28h                                  }
  75.            $21/$00/$FF/             {ld  hl,0ff00h   put addr of addr in hl  }
  76.            $5E/                     {ld  E,(HL)      get half of the address }
  77.            $23/                     {inc HL          point to second half    }
  78.            $56/                     {ld  D,(HL)      get other half          }
  79.            $EB/                     { ex DE,HL       switch                  }
  80.            $ED/$5B/index/       {ld  DE,(nn)     get the integer           }
  81.            $73/                   {ld  (HL),E     put in array              }
  82.            $23/                   {inc HL                                   }
  83.            $72/                   {ld  (HL),D    and the high byte          }
  84.            $23/                   {inc HL           (it's done in words)    }
  85.            $0E/$10/               {ld  C,8h      get the function           }
  86.            $EF/                    {rst 28h                                  }
  87.            $21/$00/$FF/             {ld  hl,0ff00h   put addr of addr in hl  }
  88.            $5E/                     {ld  E,(HL)      get half of the address }
  89.            $23/                     {inc HL          point to second half    }
  90.            $56/                     {ld  D,(HL)      get other half          }
  91.            $EB/                     { ex DE,HL       switch                  }
  92.            $ED/$5B/color/       {ld  DE,(nn)     get the integer           }
  93.            $73/                   {ld  (HL),E     put in array              }
  94.            $23/                   {inc HL                                   }
  95.            $72/                   {ld  (HL),D    and the high byte          }
  96.            $23/                   {inc HL           (it's done in words)    }
  97.            $0E/$11/               {ld  C,8h      get the function           }
  98.            $EF  );                {rst 28h                                  }
  99.  
  100. end;
  101. {*************************************************************************}
  102.  
  103.  
  104.  
  105. {*************************************************************************}
  106. procedure fillhorz(y,x1,x2:integer);
  107. {........................................a single line is filled in  the  }
  108. {  current style, etc.  The line is y and is filled from x1 to x2.        }
  109.  
  110. var ylocal,x1local,x2local :integer;
  111. begin
  112.  ylocal := y;
  113.  x1local := x1;
  114.  x2local := x2;
  115.    inline ($21/$00/$FF/             {ld  hl,0ff00h   put addr of addr in hl  }
  116.            $5E/                     {ld  E,(HL)      get half of the address }
  117.            $23/                     {inc HL          point to second half    }
  118.            $56/                     {ld  D,(HL)      get other half          }
  119.            $EB/                     { ex DE,HL       switch                  }
  120.            $ED/$5B/ylocal/            {ld  DE,(nn)     get the integer           }
  121.            $73/                   {ld  (HL),E     put in array              }
  122.            $23/                   {inc HL                                   }
  123.            $72/                   {ld  (HL),D    and the high byte          }
  124.            $23/                   {inc HL           (it's done in words)    }
  125.            $ED/$5B/x1local/            {ld  DE,(nn)   get the integer            }
  126.            $73/                   {ld  (HL),E  put it in array              }
  127.            $23/                   {inc HL                                   }
  128.            $72/                   {ld  (HL),D  both parts                   }
  129.            $23/                   {inc HL        full word                  }
  130.            $ED/$5B/x2local/            {ld  DE,(nn)     get the mode             }
  131.            $73/                   {ld  (HL),E     put in array              }
  132.            $23/                   {inc HL                                   }
  133.            $72/                   {ld  (HL),D    and the high byte          }
  134.            $23/                   {inc HL           (it's done in words)    }
  135.            $0E/$07/               {ld  C,8h      get the function           }
  136.            $EF  );                {rst 28h                                  }
  137. end;
  138. {*************************************************************************}
  139.