home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 128 15 / q15.d81 / t.mousemover < prev    next >
Text File  |  2022-08-28  |  18KB  |  333 lines

  1.  
  2.  
  3.  
  4.  
  5.   
  6.  
  7.                                M O U S E    8 0
  8.  
  9.                               by Maurice Randall
  10.  
  11.      MOUSE 80 is a device driver for the Commodore 1351 mouse or
  12. compatibles.  It is designed to be used with the 128 in 80 column 'text
  13. mode' only.  This driver will fill a void that most people do not realize
  14. existed.  The 1351 mouse has been around for a while now, and there are
  15. mouse drivers for it.  The demo disk that comes with the mouse has an
  16. assortment of drivers for the 64 mode and the 128 mode, but the 128 mode
  17. driver is only for 40-column use.  It makes use of a sprite for the pointer
  18. that is visible on the screen.  Sprites are not available on the 80-column
  19. screen.  Sprites are easily simulated on the 128's 80-column graphic screen,
  20. but then you are limited to creating 'graphic text'.  GEOS works this way,
  21. and GEOS is an excellent system, but there is still a need for applications
  22. written to use the 128's native text mode.
  23.  
  24.      What makes this driver different is the fact that it moves the pointer
  25. about the text screen smoothly.  There have been other mouse drivers for the
  26. 80-column text screen, but these move the mouse pointer around the screen a
  27. full character at a time.  They work fine, but the smoothness of movement
  28. isn't there.  The only smooth mouse pointer I'm aware of for the 128 is
  29. incorporated into the Pocket Series software from Digital Solutions.  But
  30. their mouse routines are not available to the public.  Therefore, I have
  31. designed MOUSE 80 so that other software developers might make use of the
  32. 1351 mouse with a smooth moving pointer in their programs.  Any new
  33. development for the 128 should definitely make use of the new hardware that
  34. is available, and MOUSE 80 will help give a more professional appearance to
  35. the program.
  36.  
  37.      MOUSE 80 can be used with a BASIC or ML program.  It uses a jump table
  38. to call its routines and you can also read or change various variables that
  39. are used by MOUSE 80.  MOUSE 80 installs at $1300 but can be located
  40. anywhere in Bank 15 memory by using the 'MouseMover' utility that is
  41. included on this disk as a demo.  MouseMover will create a new version of
  42. MOUSE 80 for you.  The utility is very straightforward and does not require
  43. much documentation for its use.  It's written in BASIC and is fully
  44. commented and demonstrates a few of MOUSE 80's features.  To run
  45. 'MouseMover' choose Run It for MOUSE 80 or press R while you're reading this
  46. text.
  47.  
  48.      MouseMover requires two support files, one is 'mouse80.o', of course,
  49. and the other is 'mover.o', which supplies a few machine language routines
  50. to speed up some tasks that would be a little too slow for BASIC to handle. 
  51. MouseMover will create a file called 'mouse80.xxxx', where 'xxxx' equals the
  52. selected load address.  You can then use this new version of MOUSE 80 in
  53. your program if you need it to load at a different address than $1300.
  54.  
  55.      To use MOUSE 80, you would include the following statement in a BASIC
  56. loader:
  57.  
  58. bload"mouse80.o"
  59.  
  60.      Once your main program begins, you can use the various jump addresses
  61. and variables locations to initially install the mouse wedge into the IRQ
  62. interrupt sequence, turn the mouse pointer on and off, or to find or set the
  63. pointer on the screen.  You can locate the pointer according to its pixel
  64. location.  You can also confine the mouse to a defined region or 'window'. 
  65. You can tell if either button is being pressed.  You can also instruct MOUSE
  66. 80 to set up a jump address for the application to call if one of the
  67. buttons is pressed.
  68.  
  69.      If you don't like the looks of the mouse pointer, you can change its
  70. appearance by altering the eight bytes that make up its picture.
  71.  
  72.      There are four graphic characters from the upper/lower case set that
  73. are used by MOUSE 80.  If you need to use these characters, you can choose
  74. any other four characters instead.  It would be a very rare program that
  75. would have to use each of the 512 characters that are available.
  76.  
  77.      Whenever you are accessing the screen, you should 'hide' the mouse
  78. pointer to prevent garbage from appearing on the screen.  The 80-column VDC
  79. chip is very touchy, and does not like the mouse when the screen is
  80. scrolling, or if you are typing characters into the same location that the
  81. mouse is occupying.  So, just call 'HIDEMOUS' before any screen access and
  82. call 'SHOWMOUS' when finished.  When the mouse is hidden, the pointer is not
  83. displayed, but movement is still possible.  So, you could use this to your
  84. advantage for various things such as menus.  As the mouse is moved up and
  85. down, you could highlight the menu item that is being pointed at, much like
  86. what is usually done with the CRSR keys.  If you call the routine,
  87. 'STOPMOUS', then the pointer is not only hidden, but its location also is
  88. not updated.  It will remain frozen in the spot it was in when the routine
  89. was called.  The buttons are still active so that you can still check for
  90. either button being pressed.  Either 'SHOWMOUS' or 'HIDEMOUS' will then make
  91. the mouse active again.  'HIDEMOUS' will leave the pointer hidden.
  92.  
  93.      The following is a list of available routines and variables along with
  94. their locations in memory:
  95.  
  96. Name       ML           Basic       Description
  97. -------------------------------------------------------------------------
  98. INSTALL   JSR $1300    SYS 4864    Initially installs the mouse wedge
  99. REMOVE    JSR $1303    SYS 4867    Removes the mouse wedge from the system.
  100. HIDEMOUS  JSR $1306    SYS 4870    Hides the pointer from view.
  101. SHOWMOUS  JSR $1309    SYS 4873    Displays the pointer on the screen.
  102. STOPMOUS  JSR $130C    SYS 4876    Stops the mouse and hides it.
  103. CKSTATUS  JSR $130F    SYS 4879    Check location of mouse on screen.
  104. USERJUMP  JSR $1312    SYS 4882    User callable according to buttons.
  105.  
  106. (Locations $1315-$1317 are not used.  They are reserved for future use.)
  107.  
  108.      There are a number of variables that may be read or set.  Here is a
  109. listing of those variables, their location offset in relation to the
  110. starting address and a brief description.
  111.  
  112. The following bytes define the region in which to confine the mouse pointer.
  113. The default settings are for the entire screen.
  114.  
  115. LTXLIMIT         +24,25         Left border (lsb,msb) (0-319)
  116. UPYLIMIT         +26            Upper border (0-199)
  117. RTXLIMIT         +27,28         Right border (lsb,msb) (0-319)
  118. LOYLIMIT         +29            Lower border (0-199)
  119.  
  120. the following locations define the present location of the mouse.  These are
  121. best checked by machine language.  When using BASIC, the mouse could move
  122. between the time it takes to check the X position and the Y position.
  123.  
  124. XCHAR            +30            Column location of the mouse.
  125. YCHAR            +31            Row location of the mouse.
  126. CXPOS            +32,33         Horizontal pixel location of the mouse.
  127. CYPOS            +34            Vertical pixel location of the mouse
  128.  
  129. From BASIC, (or ML) you could check these locations after accessing the
  130. routine called 'CKSTATUS' at $130F with a SYS 4879.  The exact location of
  131. the mouse when 'CKSTATUS' is accessed is saved here until the next time the
  132. routine is accessed.
  133.  
  134. BXCHAR           +35            Column location.
  135. BYCHAR           +36            Row location.
  136. BCXPOS           +37,38         Horizontal pixel location.
  137. BCYPOS           +39            Vertical pixel location.
  138.  
  139. These next two locations may be set in order to place the mouse pointer at a
  140. specific location on the screen.  'SETXPOS' should be set to a two-byte
  141. value ranging from 0-319, and 'SETYPOS' should be 0-199.  Always POKE the
  142. value into SETXPOS+1 last, because after MOUSE 80 checks these bytes, bit 7
  143. of SETXPOS+1 will be set which makes MOUSE 80 ignore these values.  If you
  144. were to set this location before the other three (from BASIC), they would
  145. most likely be read before you are done setting the other bytes and so the
  146. mouse would not be placed in the desired location.  From machine language,
  147. it is not a problem since you can disable the interrupts first.
  148.  
  149. SETXPOS          +40,41         Place pointer at this X location.
  150. SETYPOS          +42            Place pointer at this Y location.
  151. LTBUTTON         +43            Current status of left