home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 320.lha / DiskSpeed_v2.0 / MakeBoxes.c < prev    next >
C/C++ Source or Header  |  1989-12-09  |  4KB  |  134 lines

  1. /*
  2.  *                          DiskSpeed v2.0
  3.  *                                by
  4.  *                           Michael Sinz
  5.  *
  6.  *             Copyright (c) 1989 by MKSoft Development
  7.  *
  8.  *
  9.  * Yes, this is yet another disk speed testing program, but with a few
  10.  * differences.  It was designed to give the most accurate results of the
  11.  * true disk performance in the system.  For this reason many of
  12.  * DiskSpeed's results may look either lower or higher than current disk
  13.  * performance tests.
  14.  *
  15.  * This program was thrown together in a few hours because I needed more
  16.  * accurate and consistent results for disk performance as seen from the
  17.  * application's standpoint.  This program has now served its purpose and
  18.  * I am now giving it to the rest of the Amiga world to play with as long
  19.  * as all of the files remain together in unmodified form.  (That is, the
  20.  * files DiskSpeed, DiskSpeed.info, DiskSpeed.c, DiskSpeedWindow.c,
  21.  * DiskSpeedWindow.h, MakeBoxes.c, MakeBoxes.h, StandardGadgets.c,
  22.  * StandardGadgets.h, RenderInfo.c, RenderInfo.h, DiskSpeed.doc, and
  23.  * MakeFile)
  24.  *
  25.  * Version 2.0 of this program added a few features and cleaned up the
  26.  * user interface.  I hope you like this...
  27.  *
  28.  ******************************************************************************
  29.  *                                          *
  30.  *    Reading legal mush can turn your bain into guacamole!              *
  31.  *                                          *
  32.  *        So here is some of that legal mush:                  *
  33.  *                                          *
  34.  * Permission is hereby granted to distribute this program's source          *
  35.  * executable, and documentation for non-commercial purposes, so long as the  *
  36.  * copyright notices are not removed from the sources, executable or          *
  37.  * documentation.  This program may not be distributed for a profit without   *
  38.  * the express written consent of the author Michael Sinz.              *
  39.  *                                          *
  40.  * This program is not in the public domain.                      *
  41.  *                                          *
  42.  * Fred Fish is expressly granted permission to distribute this program's     *
  43.  * source and executable as part of the "Fred Fish freely redistributable     *
  44.  * Amiga software library."                              *
  45.  *                                          *
  46.  * Permission is expressly granted for this program and it's source to be     *
  47.  * distributed as part of the Amicus Amiga software disks, and the          *
  48.  * First Amiga User Group's Hot Mix disks.                      *
  49.  *                                          *
  50.  ******************************************************************************
  51.  *
  52.  * Make border structures with the correct box info...
  53.  */
  54.  
  55. #include    <exec/types.h>
  56. #include    <intuition/intuition.h>
  57.  
  58. #include    "MakeBoxes.h"
  59.  
  60. /*
  61.  * Note:  The routines do fill in the '0' values even though
  62.  *      the array was, most likely, already zero'd
  63.  */
  64.  
  65. /*
  66.  * This function makes a top-left border array based on the
  67.  * x/y size of the box...
  68.  */
  69. VOID    FillTopLeft_Border(struct Border *bd,SHORT xSize,SHORT ySize)
  70. {
  71. register    SHORT    *xy;
  72.  
  73.     xy=bd->XY;
  74.     xy[0]=xSize-2;        xy[1]=0;
  75.     xy[2]=0;        xy[3]=0;
  76.     xy[4]=0;        xy[5]=ySize-1;
  77.     xy[6]=1;        xy[7]=ySize-2;
  78.     xy[8]=1;        xy[9]=1;
  79. }
  80.  
  81. /*
  82.  * This function makes a bottom-right border array based on the
  83.  * x/y size of the box...
  84.  */
  85. VOID    FillBottomRight_Border(struct Border *bd,SHORT xSize,SHORT ySize)
  86. {
  87. register    SHORT    *xy;
  88.  
  89.     xy=bd->XY;
  90.     xy[0]=1;        xy[1]=ySize-1;
  91.     xy[2]=xSize-1;        xy[3]=ySize-1;
  92.     xy[4]=xSize-1;        xy[5]=0;
  93.     xy[6]=xSize-2;        xy[7]=1;
  94.     xy[8]=xSize-2;        xy[9]=ySize-2;
  95. }
  96.  
  97. /*
  98.  * This function make a top-left double border array based on the
  99.  * x/y size of the box...
  100.  */
  101. VOID    FillTopLeftDouble_Border(struct Border *bd,SHORT xSize,SHORT ySize)
  102. {
  103. register    SHORT    *xy;
  104.  
  105.     xy=bd->XY;
  106.     xy[ 0]=0;        xy[ 1]=ySize-1;
  107.     xy[ 2]=0;        xy[ 3]=0;
  108.     xy[ 4]=xSize-2;        xy[ 5]=0;
  109.     xy[ 6]=xSize-3;        xy[ 7]=1;
  110.     xy[ 8]=1;        xy[ 9]=1;
  111.     xy[10]=1;        xy[11]=ySize-2;
  112.     xy[12]=2;        xy[13]=ySize-3;
  113.     xy[14]=2;        xy[15]=2;
  114. }
  115.  
  116. /*
  117.  * This function makes a bottom-right double border array based on the
  118.  * x/y size of the box...
  119.  */
  120. VOID    FillBottomRightDouble_Border(struct Border *bd,SHORT xSize,SHORT ySize)
  121. {
  122. register    SHORT    *xy;
  123.  
  124.     xy=bd->XY;
  125.     xy[ 0]=xSize-1;        xy[ 1]=0;
  126.     xy[ 2]=xSize-1;        xy[ 3]=ySize-1;
  127.     xy[ 4]=1;        xy[ 5]=ySize-1;
  128.     xy[ 6]=2;        xy[ 7]=ySize-2;
  129.     xy[ 8]=xSize-2;        xy[ 9]=ySize-2;
  130.     xy[10]=xSize-2;        xy[11]=1;
  131.     xy[12]=xSize-3;        xy[13]=2;
  132.     xy[14]=xSize-3;        xy[15]=ySize-3;
  133. }
  134.