[comp.os.msdos.programmer] How to write to VGA when called by INT 0x33 FUNC 0x0c?

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

  I'm new to VNEWS.  I though I already posted this yesterday but when I checked
today,
I could not find my own article.   Please forgive (and inform) me if I posted
this twice.

  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 func 9)
it hangs.  No surprise,  I probably needed to hide the mouse.  

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


                                       Sieg