Mail Archives: djgpp/1999/02/22/07:11:35
John Hosick writes:
> How do you get a mouse to work in SVGA mode? the mouse show
> function does not work as it does in Mode13h.
Do you mean the int 0x33 function #1 show mouse call? It's actually
not a good idea to use that in _any_ graphics mode: most drivers
do support standard VGA modes like 13h, and a small minority can
even handle SVGA resolutions, but there are some that will get
extremely confused in anything other than text modes, so it's better
not to rely on the driver for any pointer display at all.
The solution is a little bit hairy. You can get the int 0x33 driver
to trigger a callback whenever the mouse moves, which you can hook,
but you need to use DPMI functions to create a real mode callback
around this. You can't actually draw your pointer from the callback,
though, because in my experience it is very unstable if you call
drawing routines (in particular the VESA bank switching stuff) from
this context. So you have to hook the timer interrupt as well, use
the mouse driver callback to set some flags, and do the display
stuff from your timer handler.
See the Allegro file src/djgpp/mouse.c for a working implementation.
Shawn Hargreaves.
- Raw text -