home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / mslang / moused / readme.txt < prev   
Encoding:
Text File  |  1994-03-15  |  12.3 KB  |  310 lines

  1.  
  2.  
  3.  
  4.       
  5.       
  6.       
  7.       
  8.       Visual Mouse Designer v. 1.0       MOUSED.EXE
  9.       ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  10.       (c) Arf Enterprises  1994
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.                  
  19.                  
  20.        ╔═════════════════════════════════════════════════════════════╗
  21.        ║                                                             ║
  22.        ║                                                             ║
  23.        ║                                                             ║
  24.        ║                        Users Manual                         ║
  25.        ║                                                             ║
  26.        ║                                                             ║
  27.        ║                                                             ║
  28.        ╚═════════════════════════════════════════════════════════════╝
  29.  
  30.  
  31.  
  32.     
  33.     
  34.     page 1
  35.  
  36.  
  37.  
  38.     What this program is
  39.     ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  40.  
  41.     This program is a frustrated DOS programmers response to all the
  42.     so-called "visual" programming tools for Windows programmers. I 
  43.     was programming mouse routines today and crunching all the numbers 
  44.     for the cursor bit mask when I realized I would be having a whole         
  45.     lot more fun it the computer would just tell me what the numbers         
  46.     should be. That's when I decided to write this program.        
  47.     
  48.     It behaves like many paint programs, though you will immediately 
  49.     notice there are no toolbars or color palettes. The reason for this 
  50.     is that the bitmap for a standard graphics mode cursor is small,
  51.     16 X 16, and you get four color selections, WHITE, BLACK, BACKGROUND
  52.     (which is whatever color is on the screen behind the cursor) and 
  53.     INVERTED (in which the color is determined by an XOR with the number
  54.     16). That's all you get folks, sorry, I don't write 'em, I just 
  55.     report 'em.
  56.  
  57.     After you are satisfied with the appearance of the cursor, select the 
  58.     Make ASM source or Make C++ source buttons. A file is created in the 
  59.     same directory as MOUSED.EXE titled "m_curs?.###" where "?" is the 
  60.     sequence number (0, 1, 2, 3...) depending on how many other created 
  61.     files are in the directory, and "###" = either ".ASM" or ".CPP", 
  62.     depending on the flavor you selected.
  63.  
  64.  
  65.  
  66.     How to Use the Visual Mouse Cursor Designer
  67.     ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  68.  
  69.     First all, the only input the program accepts is from the mouse. I 
  70.     made an assumption that anyone who was designing a mouse cursor has a 
  71.     mouse hooked up to their computer. Understanding that there may be a 
  72.     person or two using a computer to generate source code which will be 
  73.     compiled later on another machine who doesn't have a mouse available, 
  74.     all I can tell you is sorry but I put a lot of effort into this 
  75.     program for a $5.00 price tag. 
  76.       
  77.     When the program starts, there is a 16 X 16 grid displayed in the 
  78.     upper left area of the screen. This is the drawing area. There is a 
  79.     smaller rectangular area just to the right of the drawing area. This 
  80.     is called the display area. As you draw your cursor in the drawing 
  81.     area, an actual scale rendering is displayed in the display area. This 
  82.     is so you can see what the cursor is really going to look like.
  83.  
  84.  
  85.       
  86.       
  87.       
  88.     page 2
  89.  
  90.  
  91.     
  92.     At start up, all of the squares in the drawing area are BLUE, with the 
  93.     exception of the upper left square which is displayed in RED. The RED 
  94.     square just shows where the "hot spot" is (explained below) and the 
  95.     color is actually blue. The BLUE color is the BACKGROUND or DEFAULT 
  96.     color. Any square that is left BLUE when you generate a source code 
  97.     listing will show as whatever background color is underneath the 
  98.     actual mouse cursor when it is displayed in a program.
  99.  
  100.     The left mouse button, when the mouse cursor is touching the inside of 
  101.     a square in the drawing area, will toggle between three colors, WHITE, 
  102.     YELLOW (inverted) and BLUE (BACKGROUND). As with BLUE, YELLOW is not 
  103.     really YELLOW. YELLOW is BLUE inverted (XOR'd with 0ffh). Any part of 
  104.     the mouse cursor which shows YELLOW in the Visual Mouse Cursor 
  105.     Designer will show up as the inverted color of whatever color is under 
  106.     that part of the cursor.
  107.  
  108.     The right mouse button toggles between BLACK and BLUE (BACKGROUND).
  109.  
  110.     You can drag the mouse cursor with either button down. Regardless of
  111.     the color that is being changed the new color is the same as the 
  112.     first square painted when the mouse button was depressed.
  113.  
  114.     You can paint directly over a RED hot spot, the hot spot stays where 
  115.     it was last seen until you use the "Set" button under the drawing area. 
  116.     If you've painted over the hot spot and just want to see where you 
  117.     put it, use the "Show" button under the drawing area. Even though the 
  118.     square reappears RED, it is still whatever color was assigned to that 
  119.     square.
  120.     
  121.     You should set the hot spot to a position relevant to the cursor. On 
  122.     an arrow cursor this would typically be the tip of the arrow, the tip 
  123.     of a finger for a hand cursor, or the center of a cross hair cursor. 
  124.     The location of the hot spot is what is reported by DOS when you call 
  125.     for the location of the mouse cursor.
  126.  
  127.     After you have created your masterpiece, move the mouse cursor into 
  128.     the display box and click the left mouse button. The default arrow 
  129.     cursor is then replaced with your cursor. You can even use your new 
  130.     cursor to make changes in the drawing area. This will also give you 
  131.     an idea of what the inverted areas of the cursor will look like.
  132.  
  133.     To restore the cursor to the default cursor, just pass the cursor over 
  134.     any button. The cursor will appear as a hand, and then back to an 
  135.     arrow when the cursor has moved off of the button.
  136.  
  137.     Now that you are ready to produce the source code, select either the 
  138.     Make ASM Source or the Make C++ Source buttons. A file titled m_curs? 
  139.     with an ASM or CPP extension is created. The "?" is a number starting 
  140.     with 0 that is assigned depending on how many m_curs files already 
  141.     reside in your working directory.
  142.  
  143.  
  144.  
  145.  
  146.     page 3
  147.  
  148.  
  149.  
  150.     This is not "stand alone" code, though the functions created need 
  151.     little modification to work. For the C++ version, the function is 
  152.     listed as void mouse_curs();. You can leave that name and call it 
  153.     this way, but I recomend that you change it to whatever name you 
  154.     want. This function needs DOS.H included in the source, as well as 
  155.     an appropriate prototype.
  156.  
  157.     For the ASM version, there are three lines that should be changed to 
  158.     whatever name you want. These are 
  159.     
  160.          PUBLIC mouse_curs      (example PUBLIC mouse_hand_curs
  161.  
  162.          mouse_curs process far (example mouse_hand_curs process far)
  163.  
  164.          and
  165.  
  166.          mouse_curs    endp     (example mouse_hand_curs  endp)
  167.  
  168.     You are responsible for putting this code into the code segment of 
  169.     your program and ensuring adequate stack size. The ASM routine only 
  170.     takes up 64 bytes of stack space so this generally should not be a 
  171.     problem. This method is probably a tad slower than creating a data 
  172.     member and shooting a pointer at it, but the memor overhead is 
  173.     lessened, though in either case the net effect is undetectable. If 
  174.     you call the compiled ASM source from a C language program, use 
  175.     extern "C" void far mouse_curs(); as a prototype.
  176.  
  177.     You are not required to leave my comments in the source code listing 
  178.     or provide me with any royalties or acknowledgements in the programs 
  179.     you write.
  180.  
  181.  
  182.     Technical "Stuff"
  183.     ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  184.  
  185.     I made an assumption that anyone who finds this program useful would 
  186.     already know something about mouse programming. Nonetheless, here is 
  187.     the obligatory technical part of this manual which should give you 
  188.     an idea on how to utilize the produced source code.
  189.  
  190.     Before you can change the mouse cursor, you have to initialize the 
  191.     mouse driver. All mouse functions are related to interrupt 33H (0x33). 
  192.     In ASM it's easy.
  193.  
  194.         mov       ax, 0               ;function 0
  195.         int       33H                 ;its initialzed
  196.  
  197.         ret                           ;if AX = 0, then initializtion failed.
  198.                       ;any other value (ffffh) means OK
  199.  
  200.  
  201.  
  202.  
  203.     page 4
  204.  
  205.  
  206.  
  207.     In C++ you can use
  208.  
  209.         union REGS regs;
  210.  
  211.         regs.x.ax = 0;
  212.  
  213.         int86(0x33, ®s, ®s);
  214.  
  215.     //regs.x.ax can be examined, if 0 then initialization failed, if 
  216.     //0xffff we've got lift off, folks!
  217.  
  218.        Once initialzed, the mouse cursor needs to be turned on, though you 
  219.        can change the mouse cursor before it is displayed, it doesn't matter. 
  220.        You need to be aware that any change in the graphics mode (for example 
  221.        text mode to VGA) results in the mouse cursor being hidden and it will 
  222.        need to be displayed again. In ASM use 
  223.      
  224.           mov       ax, 01h
  225.           int       33h
  226.  
  227.        and provided the mouse driver was initialized as discussed above a 
  228.        mouse cursor will appear.
  229.  
  230.        Now, how does the code my program produces work? You may have noticed 
  231.        that there are 32 words pushed onto the stack (or 32 integers stored 
  232.        in an array in the C++ code). The mouse cursor is made up of two 
  233.        bitmaps of 16 X 16 bits each. Each word or integer comprises one row 
  234.        of each bitmap. This means there are two bits for every pixel in the 
  235.        mouse cursor, one from each bitmap, which determine the color of that 
  236.        bit. Accordingly there are four possibilities. The first bitmap is 
  237.        known as the screen mask, the second is known as the cursor map. The 
  238.        color is determined as follows 
  239.        
  240.         screen mask         cursor mask
  241.  
  242.          1                   0            = BACKGROUND (clear)
  243.          1                   1            = INVERTED
  244.          0                   1            = WHITE
  245.          0                   0            = BLACK
  246.  
  247.     The BACKGROUND and INVERTED colors are determined by the color of the 
  248.     pixel under the mouse cursor. If BACKGROUND the color is unchanged, 
  249.     if INVERTED the value of the color assigned to that pixel is XOR'd 
  250.     with value 16 (fh or 0xf).
  251.  
  252.     The location of the "hot spot" is mov'd into BX and CX, these values 
  253.     are relative to the bit field, i.e. 0,0 is the upper left most bit, 
  254.     1,0 is the next bit to the right, etc. The "hot spot" denotes the 
  255.     specific pixel in the mouse cursor which is viewed by DOS as the 
  256.     actual mouse location. If you read the location using function 5h 
  257.         
  258.  
  259.  
  260.  
  261.     page 5 
  262.     
  263.  
  264.  
  265.     this will tell you the location of the "hot spot". Generally you will 
  266.     want to assign this spot to a relevant position in the cursor, such as 
  267.     the tip of an arrow, the tip of a finger on a hand cursor, or the 
  268.     center of a target.
  269.  
  270.     Anyway, in the ASM model these values are pushed onto the stack, and 
  271.     the segment address of both bitmaps are placed in ES and the offset in 
  272.     DX. The same thing happens in the C++ model, only the values are placed 
  273.     in an integer array whose address is placed in sregs.es and regs.x.ax 
  274.     respectively. There are a number of books out there that explain mouse 
  275.     programming much better than I do so check out your local bookstore.
  276.  
  277.  
  278.  
  279.     What you get when you register
  280.     ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  281.  
  282.     Well, here comes the pitch. I don't really have anything to offer, 
  283.     other than the fact if I catch you using my product to produce 
  284.     software I'll sue you. Odds of that are pretty slim though. The price 
  285.     tag on this is $5.00. This is my third shareware program and nobody 
  286.     has sent me a dime. This means either I'm creating programs that 
  287.     nobody wants or needs, or people just like to rip me off. Either way, 
  288.     this could very easily be my last venture into Shareware because right 
  289.     now it's a bust. The only thing I can offer you for registering this 
  290.     program, besides the fact it happens to be the right thing to do, is 
  291.     "free" technical assistence in using this program or mouse programming 
  292.     questions in general. You can contact me at the various sources listed 
  293.     when my program terminates.
  294.  
  295.     I'm also available for contract programming either by myself or part 
  296.     of a team. I use C++ for both DOS and Windows programming, as well as 
  297.     assembly language. If push comes to shove I've been known to use a 
  298.     number of different flavors of BASIC as well. Appreciate you trying my 
  299.     product.
  300.  
  301.     Leonard Gragson
  302.     ARF Enterprises
  303.     P.O. Box 26413
  304.     Shawnee Mission, Kansas  66225
  305.  
  306.     (913) 764-9091
  307.     CompuServe    73131,1034
  308.     Prodigy       YBMY91A
  309.     Internet      ybmy91a@prodigy.com
  310.