[comp.os.msdos.programmer] Accessing VGA using Mouse controll

heintze@grane.enet.dec.com (Siegfried Heintze) (08/30/90)

            
  I'm using MSDOS software interrupt 0x33, function 0x0c to establish a routine
(called ime) to be called by the mouse driver everytime the mouse changes state
(ie,
(ie, everytime a button is depressed or released or the position of the mouse
changes.)

This works because I can call the zortech routine "sound_click()" to verify
that it is working.

I remember reading somewhere that it is necessary to call interrupt 0x33
function
2 before writing to the VGA to prevent a conflict.   This function hides the
mouse pointer on the VGA to prevent the mouse driver and you from trying to 
access VGA simultaneously.  This is an important consideration because
writing to the VGA is not an atomic operation.  It consists of writing to 
multiple VGA registers via I/O ports.  Interrupting this sequence with
another write sequence would not be desireable.  So we tell the mouse
driver not update the mouse pointer on the VGA while we are accessing the
VGA display RAM and when we are done we use INT 0x33 func 1 to display the
mouse pointer again.

I tried just writing to the VGA display from the routine called by INT 0x33 
func 0x0c and it did not hang.   But when I tried to write a character
to the VGA display using a call to MSDOS (INT 0x10 function 9) it hangs.  No
surprise,
I probably needed to hide the mouse.    I have discovered that if I concentrate
on
not moving the mouse and very slowly depressing and releasing the mouse button,
I can update the VGA with out hanging.

So I call int 0x33 func 2 to hide the mouse inside  my function ime that is
called by
the mouse driver.   This hangs my
machine.   Why?  How do I diagnose this problem further?



                                       Sieg