The myth of the vertical retrace interrupt on EGA/VGA

Discussion about old graphics cards, monitors and video related things.

Re: The myth of the vertical retrace interrupt on EGA/VGA

Postby Jo22 » 2018-2-22 @ 19:08

Scali wrote:I've created a new version, which has an extra commandline parameter [..]

Thanks. :) I just tried that version. I'm sorry to say that the card still refuses to go stable.
I'm not sure if my card is just broken or an oddball version. When I did a closer examination of the PCB layout
(see photo; BIOS chips position, a group of resistors is not near the jumpers in the upper left corner), I noticed some differences
with the models at vgamuseum. Also, the REV marking doesn't show an actual revision (A, B, C, etc.)

What I did this time: I copyied your command line into autoexec.bat and ran the PC with different settings:
CMOS: Caches enabled/disabled, IRQ settings (legacy/PCI+PNP ISA), APM enabled/disabled, Shadow Memory,
Assign IRQ for VGA enabled/disabled, facory reset, etc.

I also removed the SB16 (MPU-401) and switched the card to different video modes, such as EGA and ran the Tseng diagnostics program.
A notable thing was that I got different status messages. Such as 3g, 5g, 6g, 7g (speaking under correction).

I'm not sure what to say. I would feel better if someone else could verify the behavior of the ET3000(AX).
To make sure it is not a defect on my particular ET3000 model.
Attachments
et3k_vret.jpg
et3k_vret.jpg (35.6 KiB) Viewed 729 times
et3k _6g.jpg
et3k _6g.jpg (32.08 KiB) Viewed 729 times
et3kax_card.jpg
et3kax_card.jpg (36.24 KiB) Viewed 729 times
"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//
User avatar
Jo22
l33t
 
Posts: 3558
Joined: 2009-12-13 @ 07:06
Location: Europe

Re: The myth of the vertical retrace interrupt on EGA/VGA

Postby Scali » 2018-2-22 @ 22:57

Okay, so my theory of the status being broken was wrong... it really doesn't generate the interrupts after a few tries.
Which is weird. Why would it stop randomly after a handful of interrupts?
Well... another explanation might be that the video chip isn't fast enough... my code toggles the interrupt bit immediately. Perhaps it needs a delay in between to get it working reliably.
Anyway, indeed, it would help if other people with ET3000s could test as well.
Scali
l33t
 
Posts: 4108
Joined: 2014-12-13 @ 14:24

Re: The myth of the vertical retrace interrupt on EGA/VGA

Postby Scali » 2018-2-25 @ 14:50

I have made a small change to the code of vretirq: https://www.dropbox.com/s/bzobfyhmppin4 ... q.zip?dl=0
It now masks all IRQs except for IRQ1 for the keyboard and the selected EGA/VGA IRQ.
Great Hierophant tested on a real EGA card, and it exhibited similar behaviour to the ET3000: it does generate IRQs, but it can randomly stop counting after a while.
So my question is: what can cause it to stop counting? The theory I came up with is that you might miss the IRQ when the system is busy handling other IRQs. And since the timer normally fires at 18.2 Hz, you could have this race-condition once every 3 frames roughly.
So if I just mask all IRQs, I rule out this scenario. If the counting on ET3000 and EGA is fixed with this modification, then that would prove my theory.
It would also explain why IBM moved to level-triggered IRQs, and why IBM and various other manufacturers decided to disconnect the IRQ on ISA systems.

I hope someone can test it on a PS/2 system though. I really wonder what those machines do.
Scali
l33t
 
Posts: 4108
Joined: 2014-12-13 @ 14:24

Re: The myth of the vertical retrace interrupt on EGA/VGA

Postby wbc » 2018-3-10 @ 18:12

I had quickly tested a bunch of my cards and got some interesting results:
  • S3 cards (ViRGE, Trio64V2/DX, Trio3D/2X) - doesn't work in any mode, and cards do not claim IRQ at all
  • Matrox Millennium (IS-MGA-2064W) - works in all modes at IRQ11, white line is exactly above "IRQs: xx" string
  • Tseng ET6000 - exactly same as Matrox card, works fine at IRQ11, white line is exactly above "IRQs: xx" string
  • NVidia cards (Vanta LT, GeForce 2 MX200, GeForce FX5200, GeForce 9600GSO) - doesn't work in any mode at any IRQ, despite IRQ11 is assigned to graphics card
  • Trident TVGA9000C - doesn't work in any mode, and IRQ9 trace is missing from ISA connector (but I assume chip supports vertical retrace IRQ, according to datasheet and 8900B testings. It can be tested by a bit of soldering, but I'm lazy :happy:)
  • Cirrus Logic CL-GD5401 (aka Acumos AVGA1) - doesn't work in any mode, and IRQ9 trace is also missing from ISA connector :dead:
  • ATi Rage 128 Pro - works in all modes at IRQ11, white line is exactly above"IRQs: xx" string
  • ATi Radeon Xpress 1150 (integrated into RS485 chipset) - works in all modes at IRQ3(!), white line is exactly above "IRQs: xx" string

EDIT: ouch, the white line is above "IRQs: xx" string, of course, since if it were below then IRQ will fire off on active display area :)
Last edited by wbc on 2018-3-12 @ 11:07, edited 1 time in total.
--wbcbz7
wbc
Member
 
Posts: 132
Joined: 2015-3-14 @ 14:51
Location: Russia \ Omsk

Re: The myth of the vertical retrace interrupt on EGA/VGA

Postby Scali » 2018-3-12 @ 11:00

Thanks for testing, wbc!
I suppose there are three interesting things in your observations:
1) The white line appears to be in the same place on all cards that work.
2) Quite a few cards seem to support it.
3) Two of the cards that don't support it, the TVGA9000C and CL-GD5401, don't have a trace, but we've seen related cards that do support it, so chances are these would work if they were connected.

So far I think only S3 and NV have not shown any cards that work yet. They might actually not support it.
Scali
l33t
 
Posts: 4108
Joined: 2014-12-13 @ 14:24

Re: The myth of the vertical retrace interrupt on EGA/VGA

Postby Gmlb256 » 2018-4-11 @ 15:44

Hello. Found this thread interesting.

S3 does supports the vertical retrace interrupt, however it is disabled by default. To enable it the extended S3 CRTC register 32h bit 4 must be set to 1 (this register must be unlocked before changes can be made), and make sure that the interrupt pin of the PCI, VLB or ISA card have a trace that connects to the interrupt pin of the S3 chip and the BIOS must assign an IRQ to the video card.

The S3 Trio64V+ datasheet shows the complete CRTC register 11h at page 16-29 and the extended register 32h at page 17-4: http://www.bitsavers.org/components/s3/DB018-A_Trio64V+_Integrated_Graphics_Video_Accelerator_Jul95.pdf

Also the S3 ViRGE datasheet mentions the registers 11h and 32h it at page 16-18 and 18-3: http://old.vgamuseum.info/images/stories/doc/s3/virge.pdf

Edit: Replaced the S3 Trio64V+ datasheet link, since the previous one now gets a 404 error.
Last edited by Gmlb256 on 2018-5-11 @ 14:57, edited 1 time in total.
Gmlb256
Newbie
 
Posts: 7
Joined: 2018-4-11 @ 15:33

Re: The myth of the vertical retrace interrupt on EGA/VGA

Postby Gmlb256 » 2018-4-11 @ 21:17

Did some test on the program:

- Trident TGUI9680-1 1MB: no IRQs although the BIOS assign IRQ to the card.
- AOpen PT 75 Plus II (S3 Virge/GX 4MB): no IRQs, this card doesn't have a trace from the S3 chip to the interrupt pin even through the BIOS has assigned a IRQ to it.
- Compaq S3 Virge/GX 2MB: IRQs on all three modes at IRQ 11, however the third mode display the white bar looks unusual, showing at the top and bottom of the screen. Is that normal?
- ATI Radeon 9250 128MB: IRQs on all three modes at IRQ 11.
- NVIDIA Geforce MX4000 64MB: no IRQs at all.

The first three cards were tested on a Pentium MMX computer with a CRT screen, the latter two on a Pentium 4 PC connected on a LCD TV screen.

Initially the Compaq S3 card got no IRQs on all three modes so I created a small program that modified the S3 register 32h which enables the vertical retrace interrupt, reran the test and got IRQs. However when the video mode is switched the IRQ gets disabled unless I run the small program I made again, so I made the program into a quick and dirty TSR that hooks the INT 10H and chained the BIOS interrupt into it in order to check the state of the register 32h of the S3 chip to make sure that the interrupt is enabled after chaning the video mode. Once again I ran the test and this time got IRQs working on all three modes!

I put the program with the source code in case one want with a S3 video card wants to try.

Edit: The program is now a proper utility just in case, written in assembly. It's now a vertical retrace interrupt manager for S3 Trio32/Trio64 or later.

Edit #2: Corrected a few typos and minor mistakes I accidentally made when checking for the DOS version and TSR status.

Edit #3: Fixed a bug when locking the extended registers after enabling or disabling the vertical retrace interrupt.
Attachments
S3VRTIRQ.ZIP
S3 Vertical Retrace Interrupt Manager
(6.3 KiB) Downloaded 8 times
Last edited by Gmlb256 on 2018-6-02 @ 20:44, edited 5 times in total.
Gmlb256
Newbie
 
Posts: 7
Joined: 2018-4-11 @ 15:33

Re: The myth of the vertical retrace interrupt on EGA/VGA

Postby Tiido » 2018-4-11 @ 23:00

This is really cool ~
User avatar
Tiido
Oldbie
 
Posts: 800
Joined: 2018-1-14 @ 04:40
Location: Estonia

Re: The myth of the vertical retrace interrupt on EGA/VGA

Postby Jo22 » 2018-4-11 @ 23:27

Hi, can you please also make an utility to enable CGA/HGC emulation ?
There's something about this written on page 16-22 of the ViRGE documentation.

Tiido wrote:This is really cool ~

I fully agree! :D
"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//
User avatar
Jo22
l33t
 
Posts: 3558
Joined: 2009-12-13 @ 07:06
Location: Europe

Re: The myth of the vertical retrace interrupt on EGA/VGA

Postby Gmlb256 » 2018-4-12 @ 01:36

Jo22 wrote:Hi, can you please also make an utility to enable CGA/HGC emulation ?
There's something about this written on page 16-22 of the ViRGE documentation.

Tiido wrote:This is really cool ~

I fully agree! :D


Thanks!

For the CGA/HGC emulation, that CRTC register is a standard EGA/VGA register unlike the register I set to enable the vertical retrace interrupt for S3 video cards.

Also I'm not experienced to make a serious utility like S3VBEFIX or S3VBE20 if you guys are expecting that, sorry.
Gmlb256
Newbie
 
Posts: 7
Joined: 2018-4-11 @ 15:33

Re: The myth of the vertical retrace interrupt on EGA/VGA

Postby Scali » 2018-4-17 @ 09:37

Thanks for the work on the S3 stuff!
Very interesting that they appear to have a 'safeguard' built into the hardware... It seems that manufacturers either deliberately disabled IRQ by just not connecting the pin at all, or design it as an 'opt in' feature, either by adding a jumper on the PCB, or a software switch like on the S3.
I wonder if the same goes for NV and other more modern GPUs... they don't have a jumper, and IRQ is not enabled by default. But perhaps there is a way to enable the IRQ via software. ATi seems to have it enabled by default anyway.
Scali
l33t
 
Posts: 4108
Joined: 2014-12-13 @ 14:24

Re: The myth of the vertical retrace interrupt on EGA/VGA

Postby Gmlb256 » 2018-4-17 @ 14:28

Glad I could help!

Scali wrote:I wonder if the same goes for NV and other more modern GPUs... they don't have a jumper, and IRQ is not enabled by default. But perhaps there is a way to enable the IRQ via software. ATi seems to have it enabled by default anyway.


I've been wondering about that too for other hardware like the Intel integrated GPUs and some 3dfx cards such as Voodoo Rush, Voodoo Banshee and Voodoo3. Unfortunately, I don't have any of those to test with. :depressed:
Gmlb256
Newbie
 
Posts: 7
Joined: 2018-4-11 @ 15:33

Re: The myth of the vertical retrace interrupt on EGA/VGA

Postby Gmlb256 » 2018-5-11 @ 15:14

I have decided to investigate a bit further about vertical retrace interrupt on S3 video cards and it seems that chips prior to Trio32 and Trio64 doesn't have the vertical retrace interrupt switch at the extended register 32h according to some S3 datasheets I have found (it's the same site where I found the Trio64V+ datasheet): http://www.bitsavers.org/components/s3/

I wonder if anyone could test those older S3 cards without requiring a software to enable the interrupt.
Gmlb256
Newbie
 
Posts: 7
Joined: 2018-4-11 @ 15:33

Re: The myth of the vertical retrace interrupt on EGA/VGA

Postby Gmlb256 » 2018-5-13 @ 02:30

The TSR program that I wrote is now a proper utility for S3 video cards, now it better cooperates with other TSR that hooks the INT 10h and consumes less memory. Also added a switch that allows the vertical retrace interrupt to be disable for convenience. May need a bit more testing to see if it is ready for regular use.
Gmlb256
Newbie
 
Posts: 7
Joined: 2018-4-11 @ 15:33

Re: The myth of the vertical retrace interrupt on EGA/VGA

Postby Jo22 » 2018-5-13 @ 10:13

Thank you very much, sir! It's people like you (and Scali) who keep the spirit alive.
"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//
User avatar
Jo22
l33t
 
Posts: 3558
Joined: 2009-12-13 @ 07:06
Location: Europe

Re: The myth of the vertical retrace interrupt on EGA/VGA

Postby NewRisingSun » 2019-3-01 @ 12:54

I missed this topic when it was originally posted last year, but let me add the following:

The VGA chipset's vertical retrace interrupt apparently was implemented on all IBM PS/2 machines that had the VGA chipset on-board. When IBM released the VGA chipset as an ISA bus card, under the confusing name "IBM Personal System/2 Display Adapter", it deliberately disabled that functionality, which was explicitly mentioned in that card's announcement letter:
The IBM Personal System/2 Display Adapter (IBM Display Adapter) provides new high content display modes together with compatibility modes and improved performance. It brings to the IBM Personal Computer, IBM Personal Computer XT (TM), IBM Personal Computer XT (TM) Model 286, IBM Personal Computer AT (R), and IBM Personal System/2 Model 30 the same level of function as the integrated display adapter provides for the IBM Personal System/2 Models 50, 60 and 80.
(...)
The IBM Display Adapter is functionally equivalent to the integrated display adapter in the IBM Personal System/2 Models 50, 60 and 80. Most applications written to the new display modes of the integral display adapter of these products will also run, but must be tested to ensure compatibility. Selected applications that use both color and monochrome modes, or that use the vertical re-trace interrupt feature, may require change.
Unfortunately, it does not state that why the feature was removed. I am skeptical about the explanation that it creates problems, because I have never heard of anybody having problems with the EGA's vertical interrupt feature. I would rather suspect IBM's well-known habit of intentionally crippling hardware to prevent cannibalizing their more expensive product lines.

As Scali mentioned, it would still be nice to have somebody run his test program
  • on an IBM PS/2 with the on-board VGA chipset;
  • on an ISA system with the original IBM PS/2 Display Adapter card.
NewRisingSun
Oldbie
 
Posts: 841
Joined: 2005-9-02 @ 02:26

Re: The myth of the vertical retrace interrupt on EGA/VGA

Postby Scali » 2019-3-01 @ 13:11

NewRisingSun wrote:Unfortunately, it does not state that why the feature was removed.


I may have a theory on that, and it involves the 8259 interrupt controller.
Namely, when IBM designed the PS/2, they also completely redesigned the bus, replacing the aging ISA standard with the MCA one.
The thing is, MCA works with level-triggered interrupts, where ISA worked with edge-triggered interrupts.

Now, if the VGA chip on the PS/2 display adapter is an unmodified chip as used in the PS/2 models, just stuck unto an ISA card, that would mean that it would still be generating interrupt signals designed for level-triggered interrupts, and that would lead to troublesome behavior on an ISA system, where the 8259 is set up for edge-triggered interrupts.
In which case it would indeed make sense to disconnect the IRQ on this specific card.

However, that does not explain why clone VGA cards would disconnect it, because I assume that all clone VGA chipsets would be designed mainly for ISA.

NewRisingSun wrote:because I have never heard of anybody having problems with the EGA's vertical interrupt feature.


Well, I don't know if my code is buggy or not, but Great Hierophant ran my program on a real IBM EGA card, and that had issues as well (but that would be a slightly different issue, because EGA was natively designed for ISA and edge-triggered interrupts).
It is also somewhat strange, since the PCjr is about as old as EGA, and its vertical retrace interrupt works flawlessly (and is not compatible with EGA).
Scali
l33t
 
Posts: 4108
Joined: 2014-12-13 @ 14:24

Re: The myth of the vertical retrace interrupt on EGA/VGA

Postby NewRisingSun » 2019-3-01 @ 13:25

Your explanation about the edge- vs. level-triggered interrupts sounds very plausible to me. Clone makers might have lazily thought that for ISA cards, they can save a few bucks by not implementing the feature when even IBM did not implement it either.

If your program does not run well with the EGA, then something must be wrong with the program, because several games --- Gauntlet, and Microprose's Gunship in versions before 429.5 are the ones that come to my mind immediately --- depend on the IRQ's proper functioning. I believe Great Hierophant also has an original IBM PS/2 Display Adapter ISA VGA card, so maybe he can try your VGA IRQ test program as well.

You asked earlier in the thread about the original IBM VGA manual. The original IBM VGA chipset is part of the "IBM Personal System/2: Hardware Interface - Technical Reference" manual, which I have downloaded from some publicly-available source (that I don't remember). There may or may not have been an extra manual for the ISA "IBM Personal System/2 Display Adapter" as well, but if it existed, I don't have it.
NewRisingSun
Oldbie
 
Posts: 841
Joined: 2005-9-02 @ 02:26

Re: The myth of the vertical retrace interrupt on EGA/VGA

Postby Scali » 2019-3-01 @ 14:41

NewRisingSun wrote:You asked earlier in the thread about the original IBM VGA manual. The original IBM VGA chipset is part of the "IBM Personal System/2: Hardware Interface - Technical Reference" manual, which I have downloaded from some publicly-available source (that I don't remember).


Ooh, thanks for the tip!
I found it, it was well hidden in there. The chapter is just called "Video subsystem (type 1)".
I did have a PS/2 manual, but it was a later revision, from 1992, including XGA as well.
The one I found now is a first edition from 1988, so this would be the first official documentation on VGA.
Scali
l33t
 
Posts: 4108
Joined: 2014-12-13 @ 14:24

Re: The myth of the vertical retrace interrupt on EGA/VGA

Postby SirNickity » 2019-3-04 @ 18:46

I'm curious -- what's the takeaway from this experiment? It's interesting from a technical perspective, but unfortunately not that useful from a practical standpoint. Results are mixed enough that you can't count on it being supported, so it wouldn't make much sense to write software that relies on it. At best, you could try to detect support and maybe gain some cycles on routines that really care about the blanking interval -- but it would still have to support non-functional cards, and so it's a perk at best.

Or are we just geeking out here? (I'm totally onboard with that. :-D)
SirNickity
Oldbie
 
Posts: 519
Joined: 2018-11-08 @ 04:51

PreviousNext

Return to Video

Who is online

Users browsing this forum: eric1992 and 1 guest