Mail Archives: djgpp/1997/06/20/00:36:03
Shawn Hargreaves (Shawn AT talula DOT demon DOT co DOT uk) writes:
> Seby writes:
>>How I can access video memory from mouse interrupt handler ?
>>With nearptr i have no errors, but no drawings too!!!!!
>>Using farptr generate a "general protection" or "page fault" errors....
>>DAMNED DJGPP !!! :o)
>
> Well, the first obvious point to check is, are you sure the problem is
> related to being in an interrupt handler, ie. do these graphics routines
> work if run from your mainline code?
>
> Also, are you sure you've locked all the memory they touch?
>
> And what do you mean by mouse interrupt? Have you trapped the COM port
> IRQ directly, or are you using a callback from the int 0x33 driver?
> Whichever way you are doing it, my guess would be that your routine is
> taking too long to execute, so mouse movements are firing interrupts
> faster than you can deal with them, resulting in reentrant calls to your
> handler (the IRQ and RMCB wrappers produced by the libc functions are
> not reentrant). You could probably fix this by writing your own wrapper
> routines (look at irqwrap.s from Allegro for an example), but when I
> encountered this problem in writing the Allegro mouse handler, I found
> the only really stable solution was not to draw anything inside the
> mouse callback (I use int 0x33) at all! Instead, I just store the mouse
> position and set a flag in the callback function, and then later draw
> the pointer from my timer interrupt handler...
I guess the difference is the timer interrupt, which *you* control, is les
frequent than the mouse interrupt...and spaced further apart than the
execution time for the drawing handler?
--
.*. Where feelings are concerned, answers are rarely simple [GeneDeWeese]
-() < When I go to the theater, I always go straight to the "bag and mix"
`*' bulk candy section...because variety is the spice of life... [me]
Paul Derbyshire ao950 AT freenet DOT carleton DOT ca, http://chat.carleton.ca/~pderbysh
- Raw text -