resend: small DOS vga improvement

Christian Costa titan.costa at
Mon Jan 20 14:58:59 CST 2003

Jukka Heinonen wrote:

>Christian Costa wrote:
>>Andreas Mohr wrote:
>>>So until there is further information about how to do it properly,
>>>I'll just remove the vga_refresh reset in the VGA_IsTimerRunning() case,
>>>and of course this makes Turbo Pascal 6 usable (although screen update is
>>>a bit slower than IDA, most likely due to using int 10h instead of video
>>>mem and also probing I/O port 0x3da).
>>Sure it will help your app but others that need video sync will not work 
>>properly. :-)
>>In your case, VGA_Poll_Text is called periodicaly and should be running
>>at 33 fps.
>>Since 33 fps is just half the standard speed (70Hz), all should be fine.
>>But is VGA_Poll_Text running at 33 fps?
>>I suspect this function is too slow (maybe due to the console code).
>Well, after some trivial searching, I found out that VGA register 0x3da 
>reports vertical retrace, horizontal retrace and some light pen stuff:
>  1xxx = Vertical retrace in progress if set
>  x1xx = Light pen switched on
>  xx1x = Light pen trigger set
>  xxx1 = Either vertical or horizontal retrace in progress if set
Damned! I didn't notice that two more bits (light pen trigger + 
horizontal retrace) was handled.
Since 3 bits are handled at the same time, it would be good to isolate 
the bit that helps TP6.
Personally, I don't think that the vertical retrace causes problem but 
maybe doing the toggle at each
read for the other bits can do the job.

>The original code emulated vertical retrace handling more or less correctly.
>The patch by Andreas Mohr on the other hand emulates horizontal retrace.
>Unfortunately, in both cases the other retrace is emulated incorrectly.
>And I have no idea what to do with light pen bits.
>So, Andreas, as you now know how to do it properly, 
>can you prepare a patch that:
>- handles both vertical and horizontal retrace 
>  (and does something with light pen)
>- works even before any VGA mode has been initialized
>- includes the above documentation about 0x3da bits 
>  (so that the next person messing with 0x3da does have some
>   starting point)
>- does not use inlines unless it really makes a difference
>  (getting screen to update a few milliseconds faster is not worth making
>   the patch longer)

More information about the wine-devel mailing list