delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/20/00:36:03

From: ao950 AT FreeNet DOT Carleton DOT CA (Paul Derbyshire)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Access video memory.
Date: 15 Jun 1997 06:05:00 GMT
Organization: The National Capital FreeNet
Lines: 37
Message-ID: <5o00mc$853@freenet-news.carleton.ca>
References: <339FA3B7 DOT FFEBA26F AT sr DOT flashnet DOT it> <SexnzXARHbozEwmG AT talula DOT demon DOT co DOT uk>
Reply-To: ao950 AT FreeNet DOT Carleton DOT CA (Paul Derbyshire)
NNTP-Posting-Host: freenet2.carleton.ca
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019