Mouse Driver for Pascal in Svga256 (640*480*256 or greater)

GuanoFun
GuanoFun used Ask the Experts™
on
I need a mouse driver for Turbo Pascal 7.0 in Svga mode w/ the resolution 640*480*256 or greater. None of the drivers i've found in net work. Can any1 help me w/ this problem?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
There might be a problem becouse i'm using Windows XP... or not.
dbruntonQuid, Me Anxius Sum?  Illegitimi non carborundum.

Commented:
Is the mouse driver for the Turbo Pascal IDE or an application running in 640 by 480 by 256 mode?

Author

Commented:
The mouse as itself is ok, and the graphics are running ok too. I can use a 1024*768*256 mode w/ no problems, and i can even load the mouse driver w/out showing it to the screen, or read the mouse coordinates, but as soon as i try to show the mouse on screen Pascal crushes. I have no idea why???
HTML5 and CSS3 Fundamentals

Build a website from the ground up by first learning the fundamentals of HTML5 and CSS3, the two popular programming languages used to present content online. HTML deals with fonts, colors, graphics, and hyperlinks, while CSS describes how HTML elements are to be displayed.

Author

Commented:
Increased points to 75

Author

Commented:
All i need to continue my work is a mouse unit w/ these attributes:

(*) It HAS TO RUN in 640*480*256 graphics mode using the SVGA256.TPU unit and the GRAPH.TPU unit.

(*) It has to have the following functions:
1. a function to load mouse
2. .. to unload mouse
3. .. to show mouse on screen
4. .. to hide mouse
5 ... to get the mouse x coordinte
6. .. to get the mouse y coordinte
7. .. to set the mouse x,y coordinate to a chosen place on screen
8. a function that reads if the mouse buttons are pressed
9. and finally: a functions to change the mouse cursors

dbruntonQuid, Me Anxius Sum?  Illegitimi non carborundum.

Commented:
How actually are you doing the mouse bit a the moment.

Generally you go into graphics mode and then check for mouse and then reset it.

Most mouse units should have no problem.
dbruntonQuid, Me Anxius Sum?  Illegitimi non carborundum.

Commented:

Author

Commented:
i've read that posting before and another1 just like it, but they don't work for me. I'm loading the mose driver correctly. I said that i don't have any problems using the mouse in 640*480*16 mode, but as soon as i load the svga256 driver in initgraph the mouse won't work anymore. I can send u an example of the program so u can see what's happening. where can i get your e-mail?

Author

Commented:
i've read that posting before and another1 just like it, but they don't work for me. I'm loading the mose driver correctly. I said that i don't have any problems using the mouse in 640*480*16 mode, but as soon as i load the svga256 driver in initgraph the mouse won't work anymore. I can send u an example of the program so u can see what's happening. where can i get your e-mail?

Author

Commented:
increased points to 90

Author

Commented:
dbrunton i've found a program that work's w/ mouse in 1024*768*256 colors, but that guy is using a different method to load his stuff

could u help me figure out what's happening in his program so i can convert it mine?

my e-mail is: GuanoFun@yahoo.com
dbruntonQuid, Me Anxius Sum?  Illegitimi non carborundum.

Commented:
Get back to you in a couple of days.
dbruntonQuid, Me Anxius Sum?  Illegitimi non carborundum.

Commented:
Yeah.  Found the same posting.  Think it's this one.

ftp://x2ftp.oulu.fi/pub/msdos/programming/hardware/azzam10.zip

Playing with a unit that offers a wide range of resolutions.  The trouble is at the low resolutions the mouse shows but as it goes higher the mouse disappears.

Hmm, he's using the Jordan Hargraphix unit and Hargraphix did a lot of other units as well (these are the ones I'm playing with).

I've got to go do some more playing cause I may have a mouse driver that does the trick cause it looks like it does 256 colours with a Hargraphix unit.
Quid, Me Anxius Sum?  Illegitimi non carborundum.
Commented:
Yes, well it looks like the only way to get it to work is to handle the mouse drawing yourself.

This involves saving the background, writing mouse to screen.  If the mouse moves then write the background back, save the new background and then write the mouse back to screen.

This is what is in two mouse units I've looked at.

There is the ryle bgi drivers unit at

http://www.ryledesign.com/bgivid.html

which does handle the mouse in high modes but it costs money.

Author

Commented:
Increased Points to 100

Author

Commented:
dbrunton: I think you're right. The "BGI SVGA Video Driver Toolkit" looks like the right thing, but $150 is way too much. I vould be willing to pay $15 (maybe).

and the other thing: if i draw the mouse w/ pixels or whatewer on the screen when i need it, doesn't it slow down the whole process a lot??

P.S. Can i get your e-mail? I'd like to send u sonthing u could take a look at.

Author

Commented:
I wrote an e-mail to Ryle Design about the mouse driver for XP, this is what i got in return:

"Greetings:

I assume you are interested in our BGI video drivers.  I regret that
these
are only compatible with MSDOS, and a drive to run your DOS programs in
SVGA
graphics mode under Windows XP is not possible.

Regards, Tom Leathley"

I guess i just have to try your idea about the mouse beeing drawn un screen everytime it's moving.

Author

Commented:
OK, my problem is solved for the moment. I just found a mouse unit that works on XP without showing the mouse to the screen and then created my own unit which draws the mouse to the screen, by saving the background with getpixel.
If any1 gets stuck with the same problem u can easely download my units or just email me directly.

Link: http://guano.yo.lv/programming/pascal/guano.zip
email: GuanoFun@yahoo.com
dbruntonQuid, Me Anxius Sum?  Illegitimi non carborundum.

Commented:
Had some joy with one particular unit.  This is svgabg55.zip.  Freely downloadable from various sites.

Got the mouse showing and moving but there is more coding required to show it properly.


Here are the alterations to the vgademo.pas file.  There are two sections of code here.

procedure ShowCursor;
var
  r : registers;
begin
  r.ax := 1;
  r.ah := 0;
  intr($33, r);
end;

procedure ResetMouse;
var
  r : registers;
begin
  r.ax := 0;;
  intr($33, r);
end;

procedure SetVideoMode(mode : integer);
var
  r : registers;
begin
  r.ax := 40;
  r.cx := mode;
  r.dx := 0;
  intr($33, r);
end;

function MouseInstalled : boolean;
var
  r : registers;
begin
  r.ax := 0;
  intr($33, r);
  if r.ax = 0 then
    MouseInstalled := false
  else
    MouseInstalled := true;
end;

function IsMouseAvailable : boolean;
var
  r : registers;
  p : ^byte;
begin
  IsMouseAvailable := true;
  r.ax := $0535;
  msdos(r);
  if ((r.ax = 0) and (r.es = 0)) then
    IsMouseAvailable := false
  else
    begin
      p := ptr(r.es, r.ax);
      if p^ = 207
        then IsMouseAvailable := false;
    end;
end;

*** *** ****
Here is the second section of code

*** *** ***

 ClrScr;
  writeln('VGA BGI Demo Program  Copyright(c) 1987,1989 Borland International, Inc.');
  writeln;
  if not IsMouseAvailable then                      { check for mousedriver }
    begin
      Writeln('Mousedriver not found');
      Halt(0);                                      { No mousedriver found }
    end;

  Initialize;
{  SetVideoMode($79);  }
  ResetMouse;
  ReportStatus;

The user needs to run the hgxmouse util included with the package first before the demo program.  This permits the mouse to be shown.  The demo requires some screens to be run in full screen mode or it won't work - Windows won't permit it.

The hack here shows the mouse or sometimes the mice but I think the problem is probably the mouse doesn't know how big the screen is.  Note you may have to move the mouse sometimes so that it appears.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial