anthim wrote on 2023-01-27, 17:52:
As far as I understand it is 640x200 in 16 colors which is unusual given that Model D uses MC6845. I searched archive.org and there are a few docs about Model D but nothing explaining 640x200x16 mode. Do have any clues how this is possible? Does it mean that MC6845 has undocumented functionality?
The MC6845 ist not everything that makes a graphics card. Look at the IBM MDA or CGA: Those cards are full-sized cards, with the MC6845 on it. The kind of modes available depends on the electronics around the MC6845 much more than on the MC6845 itself. For example, the MC6845 doesn't know anything about colors at all. The job of the MC6845 is to provide the general sequence flow for displaying text screen. While the MC6845 was not made for graphic modes, building a graphic card based on the MC6845 is not that difficult, as the CGA card shows.
The MC6845 performs the following duties per "character" on the screen:
- it outputs the address of the current character, so that external logic can retrieve the character from video memory. The first address is freely programmable.
- it outputs the number of the scanline inside the current character, so external logic can retrieve the shape of the current scanline of the current character from a character generator ROM.
- it outputs a signal, whether the text cursor is to be displayed at the current position, so external logic can generate a cursor.
- it outputs a signal whether characters should be displayed or the electron beam is currently outside of the display area. External logic uses this signal to disable generating character signals, and possibly generating a fixed "overscan color" instead.
- it outputs horizontal and vertical sync signals that can be directly forwarded to the monitor. If external logic generates a non-black overscan color, typically the overscan is inhibited while any sync signal (horizontal or vertical) is active, to suppress "retrace lines" on the screen when the electron beam passes the visible area during beam retrace.
In the case of the CGA card a "character" is worth two bytes of video memory: In text mode, those bytes contain one character byte and one attribute byte. In 320x200 graphics mode, those bytes contain 8 pixels of 2 bits each, and in 640x200 mode, those bytes contain 16 pixels of 1 bit each. This allows the CRTC to run in a similar configuration in graphics modes (at least for the horizontal timing) as it uses in 40x25 text mode. This also explains why the "snow" issue of the CGA is limited to the 80x25 text mode: In that mode, the CRTC runs twice as fast than in all other modes (which is no issue fpr the CRTC at all), but in consequence, video memory is accessed (by the external logic) twice as often. In the CGA design, this means 100% of the video memory bandwidth is required for the CRTC to refresh the screen during the active display period. As the CGA card provides a horizontal sync period of around 64 microseconds (with an active display period of around 40µs), but the ISA bus may not be stalled longer than 16 microseconds, blocking video memory access until the display period is over was not possible, so the CGA designers decided that if there is a processor cycle pending, this cycle is performed instead of the cycle required for correct screen refresh. The result is that the screen refresh logic receives data from the location accessed by the processor, not data from the location required for correct screen refresh. This inappropriate data causes incorrect display, which is perceived as snow.
The Leading Edge Model D obviously contains more powerful, and likely higher integrated logic around the MC6845, which enables it to generate more advanced video modes.
EDIT: improved wording