From: cornet@zen.et.tudelft.nl (Jan-Pieter Cornet)
Subject: Bug in DV screen shadowing?
Keywords: DV, Shadowing
Organization: Delft University of Technology, Dept. of Electrical Engineering
Date: Tue, 28 Jul 1992 13:34:17 GMT


I have encountered a strange phenomenon regarding the shadow screen
buffer in DV. When I set "Writes text directly to screen" to Y, then the
(hardware) cursor won't move in that window as soon as some DV- aware
program has started shadowing via the AX=2B02/INT 21h call, unless via
a DV-specific cursor motion (ie. sending a window stream with opcode C0
in it). Note that the setting of "Virtualize text" makes no difference
at all, because I'm using a 286.

I mentioned this "hanging cursor" problem before in this group, but
nobody knew an answer at that time. To cure the problem while on the
command line, I've written a small program that does nothing more than
issuing a "stop shadowing" call (ie. AX=2B05h, CXDX="DESQ", INT 21h,
see Ralf's interrupt list for more info), but this of course is not a
decent solution. (In case anyone is interested in this 16 byte program
I could easily mail it or post it or ftp it or /dcc it, whatever...)

The funny thing is that when I set "Writes directly" to N, that the
same DESQview aware-program does function correctly (the cursor moves).
Is this a bug in DV or is it a bug in the DV-aware program?  What I
suspect what happens is: DV expects a "writes directly to screen" program
to be accompanied by a "virtualize" set to Y (taken care of by QEMM
which won't run on a 286), and then just waits for the OUTs to the video
chip registers to be trapped... on my 286, this gives the effect that
I occasionally see the cursor flash for a very short while on the correct
position (the OUTs do update the hardware cursor), but then immediately
DV resets screen and cursor to the state it believes is right...

Another shadowing-related problem is, that just after the "start
shadowing" call, DV apparently assumes that the screen is blank.
Writing spaces to the shadow buffer does not necessarily clear the
corresponding screen location, because DV thought the screen was already
blank at that point, and subsequently doesn't update the screen. Is this
another bug or a feature?

{Now the story about Terse and VB's LIST, which you might skip} I noticed
this behaviour in Yossi Gil's Terse. I didn't test this on 386 machines,
but I believe that setting "writes directly"=Y, and "virtualize video"=N
in DV/386 will show the same problems. Terse also leaves the shadowing
on, resulting in a "hanging" cursor even if you exit Terse. You can
also easily witness the "ghosting" of other text with this program.
The screen just won't be empty when you start the editor!

The other program in which this is noticable is Vernon Buerg's LIST, which
apparently will only use the DV shadow buffer when it is in the background
when started. When started this way, it will also show a hanging cursor,
and there will be lots of "holes" in the display, I don't know why,
maybe because there are still some routines like scrolling and screen
clearing that write directly to the screen.


If anyone can give me some hints or tips as to work around these problems,
I'd be very grateful. I was thinking that some of the problems might be
solved by installing a TSR that intercepts the "start shadowing" call,
then clears the screen, and starts updating the cursor regularly (from
INT 8 or INT 29h perhaps?). Does this seem feasable?

Thanks,

-- Jan-Pieter
cornet@duteca.et.tudelft.nl
Newsgroups: comp.os.msdos.desqview