alexb3d wrote on 2024-08-27, 17:28:
mkarcher wrote on 2024-08-21, 15:19:That's likely just an imprecise way you say it
I got this definition from wikipedia, but I did some research and found that in the original IBM VGA Technical Reference they call it "Double Scan and Border Support" and in the VGA/XGA "Double Scanning".
I have seen in other VGA manuals that call it line-doubling, maybe this is why the confusion.
I my "imprecise" was about you writing "everything below 240p" is double-scanned (or line-doubled), but the correct statement would be "everything up to and including 240p".
alexb3d wrote on 2024-08-27, 17:28:
I missed contextualizing, but I didn't think it was going to be that long. Experimenting with the shaders I realized that VGA doubles the vertical resolution and that greatly affects how the lines and mask look. Then I was curious to know what were the differences between SVGA and standalone adapters. Now I have many things clear, but also new doubts.
If I'm understanding correctly. 350p in EGA is drawn full screen because of the 21kHz of the monitor and 350p in VGA is drawn on the frame 400 lines and stretched to fill the screen, and adds some vertical blur.
I suspect you are confused by the way stuff works on modern LCD displays, in which stretching causes blur. That's not how 350 line modes in VGA work. Both EGA and VGA produce an image with 350 non-blank lines (I assume the overscan/border color is black). EGA produces lines at 21kHz and only a minimal amount of vertical blanking, to hit 60Hz. On the other hand, VGA always scans at 31.5kHz (while EGA monitors are dual-scan and can scan at 21kHz for 350-line modes and at 15.6kHz for 200 line modes, the horizontal scan frequency of VGA is fixed). The vertical refresh rate of VGA in 350 line modes and in 400 line modes is 70Hz, so the number of total lines (active lines + blanking) is identical in both modes. In fact, the 350 line mode is stretched compared to the 400 line mode, but not by digital image processing (the hardware at that time did not do any real-time scaling), but by the monitor drawing the lines further apart. Depending on the sharpness of the monitor, you might be able to see dark stripes between the lines in 350-line mode. VGA monitors should be able to draw 480 lines without noticable blur between the lines, so focus is supposed to be sharp enough that individual scanlines get visible at 350. On the other hand, focuse on EGA monitors should be adjusted that there are no noticeable gaps between the scan lines at 350 pixels.
The clear visibility of individual scan lines on VGA at 350 lines, will create a different image feel than the solid picture displayed on EGA monitors at 350 lines, but the result is not what I would call "blurriness".
alexb3d wrote on 2024-08-27, 17:28:
My question was if PCjr/Tandy connected to a VGA monitor produces double lines,although I suspect it is not possible to connect it.
The point is that VGA doesn't duplicate CGA, So, what uses VGA to play CGA? polarity of the sync signa?
PCjr/Tandy scans at 15.6kHz (like CGA and "NTSC" aka "TV system M"). VGA monitors only sync to 31.5kHz, so it's indeed not possible to a VGA monitor to a PCjr/Tandy system, even if you translate the digital PCjr/Tandy output to analog VGA levels. As you already know, VGA uses double-scanning in all 200-line modes. This includes CGA compatible graphics modes. This also applies to VGA cards in "CGA emulation mode". A standard VGA monitor can not display 200 lines modes using the whole CRT height. In CGA emulation mode, which is provided by most early 3rd-party VGA and SVGA cards, most CGA programs that directly program the CGA CRTC registers will work, but the output image will still be a double-scanned image, resulting in 400 lines at 31.5 kHz to the VGA monitor.
alexb3d wrote on 2024-08-27, 17:28:
leileilol wrote on 2024-08-21, 18:31:
When I mean all lines, I do mean the possibility of double-scan lines being split into half because that does happen for some games that have hardware scrolling, i.e. Shinobi. It's not just simply a doubling effect.
I do not understand this.
VGA does not "memorize" a full line for double scanning, but the same line is generated twice from the contents of the video memory. If something changes between the first time the line is scanned and the second time the line is scanned, the second "copy" of the line is not identical to the first copy. This "something" that could change are video memory contents (obviously), but also CRTC settings affecting the scan-out process, or palette values. At the moment, I don't see how "hardware scrolling" can change the second line copy in respect to the first copy, as the screen start address register is only sampled once per frame, and mid-frame changes to this register do not take effect until the next frame. Also, the "split screen" effect that resets the current scanout address to zero after the scan-line counter reaches a certain number can not trigger between the two copies of a scan-line (if "true double-scanning", a term I just made up to describe the double scanning enabled by setting bit 7 of CRTC register 9) is used. The trigger point for the reset of the scanout address is given as value of the row counter, which is not incremented between the two copies of a line in double-scanned modes.
On the other hand, there is another way to trigger multi-scanning in many EGA/VGA modes, which is independent of the "true double-scanning": If you tell the EGA/VGA CRTC that the 400-line image consists of (text) rows with a height of two pixels each (by setting the "maximum scanline register" to 1, causing one scan as "scan line 0" and a second scan of the same source data as "scan line 1"), this will result in a double-scanned picture if "scanning as line 0" and "scanning as line 1" produces identical results, for example because the in-character scan-line counter is ignored. Obviously, in text modes, that counter is not ignored, because it selects which row from the character bitmap data is used for a certain scan line. Also in CGA graphics mode, the scan-line counter is not ignored, because that counter selects between bank 0 (at B800) and bank 1 (at BA00). In EGA/VGA graphics mdoe, that counter is ignored, so a "fake double-scanning" effect is achievable using the maximum scanline number. VGA actually uses "fake double-scanning" in mode 13h (the 256-color mode), and the 16-color modes 320x200 and 640x200 can be reprogrammed from "true double-scanning" to "fake double-scanning". In fake double-scanning modes, the split screen functionality can hit between the two copies of a single scanline.
alexb3d wrote on 2024-08-27, 17:28:
For now, to start with I will create the ones supported by DOSBox, then I will add others or include the parameters in the configuration, to have all possibilities, like hercules emulated in VGA or (as I saw in this forum) EGA on a hercules monitor with single and double scan lines.
Hercules emulated on (S)VGA cards in emulation mode is "just another 350-line mode", and can be treated the same way as EGA 350-line modes.
EGA with hercules/MDA monitor is something very unique: EGA with an MDA monitor in text mode is very much just like MDA at the monitor side: It produces the same 720x350 image with 25 lines of 9x14 characters, yet providing many EGA capabilities on the computer interface side like 8 pages of text, soft scrolling, software-programmable fonts. As the video timing is identical to MDA, you will get 18kHz/50Hz in this configuration, which is never generated by EGA if a color monitor is connected. EGA does not provide a BIOS method to enable a Hercules-compatible 720x348 mode, and as it is not register compatible to the Hercules card, Hercules software will not be able to set that mode. On the other hand, the EGA hardware is perfectly able to generate that mode if programmed in a way that only works for EGA cards with an MDA monitor. That's why these emulation modes work: You just need to adapt the register interface, but the image display logic is already there.
Instead of the 720x348 Hercules mode, IBM decided to provide a 640x350 EGA-proprietary graphics mode (mode 0Fh) instead. That mode also uses MDA scan rates, and thus can not be displayed on an EGA color monitor. The video memory organization of that mode resembles the 640x350 EGA color mode (mode 10h), probably to make it easier to write software that supports both monochrom (0Fh) and color (10h) monitors in high resolution.