[comp.lang.pascal] WEIRD MOUSE CURSOR ON VGA 640X480

zhou@brazil.psych.purdue.edu (Albert Zhou) (11/27/90)

	When I program the mouse on VGA, the cursor was normal under 640x200 
mode. Under 640x480 mode, however, it behaves weirdly in the way that part
of image to be put on to the screen was always deleted by the cursor, even
if I tried hiding it before putting image. Has anyone experienced the similar
problem?

paulg@bhpmrl.oz.au (Paul Gallagher) (11/28/90)

If I understand you right, you get wierd mouse cursor effects in graphics
mode even if you hide the cursor prior to drawing any object on the screen.

This sounds very much like a conflict between BGI and the mouse driver.

I can't add any more, except another question - directed to anyone. 

I program using Turbo Pascal mainly, and like many people,
I have a mouse unit the handles alL
the mouse functions (via int 33h). I even went out and bought the 
Microsoft Mouse Programmer's Guide. I got all the text mouse routines under
control in no time, but what I really wanted to do was implement a 
grapohics mouse (I had EGA at the time). The MS Mouse Programmer's Guide
had a short piece on EGA support, which basically said link EGA.LIB
with your program and do all your manipulation of the EGA registers via
the pseudo-registers in EGA.LIB. Well, Microsoft's Microsoft and Borland's
BorlanD, and anyone with any brains will never even try to mix products! 
(unlike me!). My first problem was trying to effect the link. I don't
think I ever firured it out! (can anyone enlighten me as to how it can
be done, or why it can't?) I tried binobj ---> EGA.OBJ {$L ... etc, no luck!
However, that wasn't the main concern: if you weren't supposed to 
buggerize around with the EGA regs direct, then that would mean chucking
BGI out the window. Iwasn't about to do that. 

(btw, have I mentioned that in all of the other - lower rez - graphics
modes the mouse was working fin, but when the same routines were tried
in EGA mode  - hi or lo rez - I got no cursor at all, and the mouse thought
the screen was only 200 pixels high)

Back to the story. I ended up keeping BGI (predictably) and writing a
substitute mouse interrupt service routine that handled all mouse events
I then used BGI to draw the mouse cursor. Had a few hairies getting 
around the re-entrancy problem, but it all eventually worked fine, you
might even say responsively. 

As you may have guessed, I gave up even trying to do it the way
Microsoft was recommending. However, I've never compared my experiences
with those of others. When I read some of the mail on the subject, I
sometimes get the impression that other people HAVEN'T had problems 
getting graphical mouse units off the ground using Turbo Pascal (using
EGA or VGA) I've often wondered whether it's just that my EGA card wasn't
100% IBM compatible.

I would be very interested to hear of other's experiences with graphical
mouse support, especially using Turbo Pascal.


     /\/\       Paul Gallagher, PC Support Officer,
    / / /\      Computer Systems Group,
   / / /  \     BHP Melbourne Research Laboratories
  / / / /\ \    245 Wellington Rd Mulgrave Vic 3170 AUSTRALIA
  \ \/ / / /    Phone : +61-3-560-7066,  Fax : +61-3-561-6709
   \  / / /     ACSnet  :  paulg@bhpmrl.OZ.AU        
    \/\/\/

bobb@vice.ICO.TEK.COM (Bob Beauchaine) (11/29/90)

In article <1990Nov28.073307.3210@bhpmrl.oz.au> paulg@bhpmrl.oz.au (Paul Gallagher) writes:
>I program using Turbo Pascal mainly, and like many people,
>I have a mouse unit the handles alL
>the mouse functions (via int 33h). 
 ...
>My first problem was trying to effect the link. I don't
>think I ever firured it out! (can anyone enlighten me as to how it can
>be done, or why it can't?) I tried binobj ---> EGA.OBJ {$L ... etc, no luck!
>However, that wasn't the main concern: if you weren't supposed to 
>buggerize around with the EGA regs direct, then that would mean chucking
>BGI out the window. Iwasn't about to do that. 
>

  No news here.  If you don't have assembly source code available, Turbo
  Pascal is very unforgiving about linking external object code.  Has to 
  do with segment naming conventions, initialized data, etc.  In other
  words, forget it.

>(btw, have I mentioned that in all of the other - lower rez - graphics
>modes the mouse was working fin, but when the same routines were tried
>in EGA mode  - hi or lo rez - I got no cursor at all, and the mouse thought
>the screen was only 200 pixels high)
>

  What version of the Mouse driver do you have?  I have successfully 
  programmed the mouse (mine's a Logitech) using the int 33 functions and
  following the guidlines shown in the MS Mouse Programmers Guide.  I 
  have had absolutely no problems with all graphics modes through VGA
  640x480x16. I do understand that old versions of the mouse driver 
  don't know about some of the later video modes, simply because they 
  didn't exist when the driver was written.

  I can from personal experience verify that the MS mouse calling conventions
  with int 33 and BGI do work.

  Caution:  All of the above is from memory.  Since I have never had the
  problems you describe, the only opinion that's really worth anything is
  that you can get BGI and the mouse to cooperate with no hassles.  I 
  would personally check my mouse driver before I worried about your
  graphics card, though.

  Bob Beauchaine
  bobb@vice.ICO.TEK.COM