home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 2: Collection B / 17Bit_Collection_B.iso / files / 1843.dms / in.adf / Mandelbrot / mandelmouse.jf < prev    next >
Encoding:
Text File  |  1992-03-31  |  3.1 KB  |  148 lines

  1. \ Copyright 1989 NerveWare
  2. \ No portion of this code may used for commercial purposes,
  3. \ nor may any executable version of this code be disributed for 
  4. \ commercial purposes without the author's express written permission.
  5. \ This code is shareware, all rights reserved.
  6. \ Nick Didkovsky  2/11/88
  7.  
  8. \ Change the shape of the mouse pointer 
  9.  
  10. getmodule includes
  11.  
  12. anew task-mandelmouseptr
  13.  
  14. variable WaitChipData
  15. variable CrossHairsChipData
  16.  
  17. variable WVP                     \ ViewPortAddress
  18.  
  19.  
  20. binary
  21.  
  22. create WaitData
  23. 0 w, 0 w,                        \ position, control
  24.  
  25. 111100000001111 w, $ 0 w,
  26. 011000010000110 w, $ 0 w,
  27. 001100111001100 w, $ 0 w,
  28. 000111101111000 w, $ 0 w,
  29. 000011000110000 w, $ 0 w,
  30. 000111101111000 w, $ 0 w,
  31.  
  32. 000000010000000 w, $ 0 w,
  33. 000000111000000 w, $ 0 w,
  34. 000001101100000 w, $ 0 w,
  35. 000011000110000 w, $ 0 w,
  36. 000111111111000 w, $ 0 w,
  37. 001100000001100 w, $ 0 w,
  38. 001100000001100 w, $ 0 w,
  39.  
  40.  0 w, 0 w, 
  41.  
  42. 001111111111000 w, $ 0 w,
  43. 001100110011000 w, $ 0 w,
  44. 000000110000000 w, $ 0 w,
  45. 000000110000000 w, $ 0 w,
  46. 001100110011000 w, $ 0 w,
  47. 001111111111000 w, $ 0 w,
  48.  
  49.   0 w, 0 w,
  50.  
  51. 001111111111000 w, $ 0 w, 
  52. 001100110011000 w, $ 0 w,
  53. 000000110000000 w, $ 0 w,
  54. 000000110000000 w, $ 0 w,
  55. 000000110000000 w, $ 0 w,
  56. 000000110000000 w, $ 0 w,
  57. 000001111000000 w, $ 0 w,
  58.  
  59.  0 w, 0 w,   
  60.  
  61. \ end of WaitData
  62.  
  63. decimal            
  64.  
  65. HERE WaitData - constant WaitDataSize
  66.  
  67.  
  68. create CrossHairsData
  69. 0 w, 0 w,                        \ position, control
  70.  
  71. $ 0140 w, $ 0140 w,
  72. $ 0140 w, $ 0140 w,
  73. $ 0140 w, $ 0140 w,
  74. $ 0140 w, $ 0140 w,
  75. $ 0140 w, $ 0140 w,
  76.  
  77. $ 7F7F w, $ 7F7F w,
  78.  
  79. $ 0 w, $ 0 w,
  80.  
  81. $ 7F7F w, $ 7F7F w,
  82.  
  83. $ 0140 w, $ 0140 w,
  84. $ 0140 w, $ 0140 w,
  85. $ 0140 w, $ 0140 w,
  86. $ 0140 w, $ 0140 w,
  87. $ 0140 w, $ 0140 w,
  88.  
  89. 0 w, 0 w,   
  90.             
  91. \ end of CrossHairsData
  92.  
  93. HERE CrossHairsData - constant CrossHairsDataSize
  94.  
  95. \ Sprite Data MUST be in CHIP RAM!
  96.  
  97. : ALLOC.MOUSE.SPACE ( -- )
  98.   WaitChipData off
  99.   MEMF_CHIP MEMF_CLEAR | WaitDataSize AllocBlock ?dup
  100.   IF WaitChipData ! ( rel-data-addr)
  101.   ELSE ." Not enough CHIP ram for wait pointer!" cr ABORT
  102.   THEN
  103.   CrossHairsChipData off
  104.   MEMF_CHIP MEMF_CLEAR | CrossHairsDataSize AllocBlock ?dup
  105.   IF CrossHairsChipData ! ( rel-data-addr)
  106.   ELSE ." Not enough CHIP ram for crosshairs pointer!" cr ABORT
  107.   THEN
  108. ;
  109.  
  110.  
  111. \ Used after successful CHIP ram allocation, copy data to CHIP ram
  112.  
  113. : COPY.MOUSE.SPRITE.DATA ( -- )
  114.   Waitdata WaitChipData @ WaitDataSize MOVE
  115.   CrossHairsData CrossHairsChipData @ CrossHairsDataSize MOVE
  116. ;
  117.  
  118. : GetWVP
  119.   gr-curwindow @ >abs call intuition_lib ViewPortAddress WVP !
  120. ;
  121.  
  122. : WAIT.POINTER ( -- )
  123.   gr-curwindow @ >abs WaitChipData @ >abs 28 15 -7 -7 
  124.   callvoid intuition_lib SetPointer
  125. ;
  126.  
  127. : CROSSHAIRS.POINTER ( -- )
  128.   gr-curwindow @ >abs CrossHairsChipData @ >abs 13 15 -11 -7 
  129.   callvoid intuition_lib SetPointer
  130. ;
  131.  
  132. : NORMAL.POINTER ( -- )
  133.   gr-curwindow @ >abs callvoid intuition_lib ClearPointer
  134. ;
  135.  
  136. : MOUSE.PTR.INIT ( -- )
  137.   WaitChipData off
  138.   CrossHairsChipData off
  139.   alloc.mouse.space
  140.   copy.mouse.sprite.data
  141. ;
  142.  
  143. : FREE.MOUSE.DATA ( -- )
  144.   WaitChipData @ ?dup IF freeblock WaitChipData off THEN
  145.   CrossHairsChipData @ ?dup IF freeblock CrossHairsChipData off THEN
  146.   ." Mouse pointer chip data freed" cr
  147. ;
  148.