5748210 [rkeene@sledge /home/rkeene/devel/archive/quickbasic]$ cat -n mse.bas
   1: DECLARE SUB Lightup (sm!, X%, y%)
   2: DECLARE SUB Pause ()
   3: DECLARE SUB MouseStatus (lb%, rb%, xMouse%, yMouse%)
   4: DECLARE SUB MouseRange (x1%, y1%, x2%, y2%)
   5: DECLARE SUB MousePut (X%, y%)
   6: DECLARE SUB MouseHide ()
   7: DECLARE SUB MouseDriver (ax%, bx%, cx%, dx%)
   8: DECLARE SUB MouseShow ()
   9: DECLARE FUNCTION MouseInit% ()
  10: DECLARE FUNCTION SetOnExit%(byval ProcedurePointer???)
  11: SHARED Mouse$
  12: x=SetOnExit%(Bye1)
  13: Mouse$ = SPACE$(57)
  14: FOR I% = 1 TO 57
  15: READ A$
  16: H$ = CHR$(VAL("&H" + A$))
  17: MID$(Mouse$, I%, 1) = H$
  18: NEXT I%
  19: DATA 55,89,E5,8B,5E,0C,8B,07,50,8B,5E,0A,8B,07,50,8B
  20: DATA 5E,08,8B,0F,8B,5E,06,8B,17,5B,58,1E,07,CD,33,53
  21: DATA 8B,5E,0C,89,07,58,8B,5E,0A,89,07,8B,5E,08,89,0F
  22: DATA 8B,5E,06,89,17,5D,CA,08,00
  23: CLS
  24: ms% = MouseInit%
  25: IF NOT ms% THEN
  26: PRINT "Mouse not found"
  27: END
  28: END IF
  29: SCREEN 0
  30: MouseShow
  31: 1 MouseStatus lb%, rb%, y%, X%
  32: GOTO 1
  33: 
  34: SUB Lightup (sm, X%, y%)
  35: AAA = 176
  36: IF sm = 0 GOTO ZERO
  37: IF sm = 12 GOTO TW
  38: TW:
  39: LOCATE X% / 15, y% / 8: PRINT CHR$(AAA)
  40: AAA = AAA + 1
  41: IF AAA > 179 THEN A = 219
  42: IF AAA = 220 GOTO 2222
  43: GOTO TW
  44: ZERO:
  45: LOCATE X% / 7.5, y% / 7.8: PRINT CHR$(AAA)
  46: AAA = AAA + 1
  47: IF AAA > 179 THEN A = 219
  48: IF AAA = 220 GOTO 2222
  49: GOTO ZERO
  50: 2222 END SUB
  51: 
  52: SUB MouseDriver (ax%, bx%, cx%, dx%)
  53: DEF SEG = VARSEG(Mouse$)
  54: Mouse% = -32546
  55: 'CALL ABSOLUTE m (ax%, bx%, cx%, dx%, Mouse%
  56: END SUB
  57: 
  58: SUB MouseHide
  59: ax% = 2
  60: MouseDriver ax%, 0, 0, 0
  61: END SUB
  62: 
  63: FUNCTION MouseInit%
  64: ax% = 0
  65: MouseDriver ax%, 0, 0, 0
  66: MouseInit% = ax%
  67: END FUNCTION
  68: 
  69: SUB MousePut (X%, y%)
  70: ax% = 4
  71: cx% = X%
  72: dx% = y%
  73: MouseDriver ax%, 0, cx%, dx%
  74: END SUB
  75: 
  76: SUB MouseRange (x1%, y1%, x2%, y2%)
  77: ax% = 7
  78: cx% = x1%
  79: dx% = x2%
  80: MouseDriver ax%, 0, cx%, dx%
  81: ax% = 8
  82: cx% = y1%
  83: dx% = y2%
  84: MouseDriver ax%, 0, cx%, dx%
  85: END SUB
  86: 
  87: SUB MouseShow
  88: ax% = 1
  89: MouseDriver ax%, 0, 0, 0
  90: END SUB
  91: 
  92: SUB MouseStatus (lb%, rb%, xMouse%, yMouse%)
  93: ax% = 3
  94: MouseDriver ax%, bx%, cx%, dx%
  95: lb% = ((bx% AND 1) <> 0)
  96: rb% = ((bx% AND 2) <> 0)
  97: xMouse% = cx%
  98: yMouse% = dx%
  99: END SUB
 100: 
 101: SUB Pause
 102: 'This sub used for demo, not needed for mouse calls
 103: PRINT "Press any key to continue..."
 104: G$ = INPUT$(1)
 105: PRINT
 106: END SUB
 107: 
 108: Sub Bye
 109: Print "Bye!"
 110: End Sub
5748211 [rkeene@sledge /home/rkeene/devel/archive/quickbasic]$

Click here to go back to the directory listing.
Click here to download this file.
last modified: 2000-05-09 21:05:31