VOGONS


CGA pseudo-graphic modes

Topic actions

Reply 100 of 108, by pshipkov

User metadata
Rank l33t
Rank
l33t

I think softcat talks of hardware scrolling using virtual frame buffer, similar to how ega and vga planar modes can - basically moving the viewport through the larger canvas with preallocated pixels.

cga cannot do the above.
maybe some guru nerds can hack in some partial scrolling in a specific cga graphics mode by messing around with the crtc registers, but thats about it.

retro bits and bytes

Reply 101 of 108, by SoftCat

User metadata
Rank Member
Rank
Member
mkarcher wrote on 2025-09-28, 05:43:

I don't think so. While the CGA has an 8 bit wide memory bus, the logical organization is still a 16-bit system, fetching a 16-bit word per "character interval". Bits 1..12 are generated from the character counter in the 6845, bit 13 is generated by the character counter in text mode and by the scanline counter in graphics mode. Bit 0 generation is fixed (low on the first fetch, high on the second fetch). In Text mode, this 16-bit system will handle one character and one attribute byte per "character", in 4-color graphics mode, it will handle 8 pixels per "character" and in 2-color graphics mode, it will handle 16 pixels per "character". Increasing the start address will cause the image to scroll horizontally by a whole character, which is 16 pixels in 640x200 mode.

Thank you for your reply!
That is, if we make the video adapter's internal structure 32-bit, we can implement a 640x200, 16-color graphics mode on the same 6845 controller. That's 80 "characters" per line, 32 bits each. A character is 8 pixels wide, with 4 bits for the color code.

Reply 102 of 108, by SoftCat

User metadata
Rank Member
Rank
Member
pshipkov wrote on 2025-09-28, 05:53:

I think softcat talks of hardware scrolling using virtual frame buffer, similar to how ega and vga planar modes can - basically moving the viewport through the larger canvas with preallocated pixels.

cga cannot do the above.
maybe some guru nerds can hack in some partial scrolling in a specific cga graphics mode by messing around with the crtc registers, but thats about it.

Yes, I'm aware that scrolling on CGA is only possible by changing the start address. And there's no way to achieve smooth horizontal scrolling.

Reply 103 of 108, by mkarcher

User metadata
Rank l33t
Rank
l33t
SoftCat wrote on 2025-09-28, 21:56:

That is, if we make the video adapter's internal structure 32-bit, we can implement a 640x200, 16-color graphics mode on the same 6845 controller. That's 80 "characters" per line, 32 bits each. A character is 8 pixels wide, with 4 bits for the color code.

That's basically EGA mode 0Eh. Even if EGA uses an IBM designed proprietary 6845-inspired CRTC instead of the more basic original chip, the idea is the same.

Reply 104 of 108, by Benedikt

User metadata
Rank Oldbie
Rank
Oldbie
SoftCat wrote on 2025-09-28, 22:06:
pshipkov wrote on 2025-09-28, 05:53:

I think softcat talks of hardware scrolling using virtual frame buffer, similar to how ega and vga planar modes can - basically moving the viewport through the larger canvas with preallocated pixels.

cga cannot do the above.
maybe some guru nerds can hack in some partial scrolling in a specific cga graphics mode by messing around with the crtc registers, but thats about it.

Yes, I'm aware that scrolling on CGA is only possible by changing the start address. And there's no way to achieve smooth horizontal scrolling.

Depending on the monitor, you can do finer horizontal scrolling by varying the width of the HSYNC pulse, because many monitors from that era don't actually sync on the rising edge of the pulse.
That is a trick from the Amstrad CPC playbook.

Reply 105 of 108, by mkarcher

User metadata
Rank l33t
Rank
l33t
Benedikt wrote on Yesterday, 18:53:

Depending on the monitor, you can do finer horizontal scrolling by varying the width of the HSYNC pulse, because many monitors from that era don't actually sync on the rising edge of the pulse.
That is a trick from the Amstrad CPC playbook.

I vaguely remember that the CGA generates part of the horizontal timing in dedicated hardware instead of using the CRTC signals, and the width of the actual sync pulse might not be variable using the sync pulse width register of the CRTC. If this Amstrad trick doesn't work with a CGA card, it might not be a monitor issue, but possibly a CGA design issue as well.

Reply 106 of 108, by SoftCat

User metadata
Rank Member
Rank
Member
mkarcher wrote on 2025-09-29, 18:53:

That's basically EGA mode 0Eh. Even if EGA uses an IBM designed proprietary 6845-inspired CRTC instead of the more basic original chip, the idea is the same.

Yes, I understand about the EGA 0Eh mode. All EGA modes are possible on the 6845. The video RAM layout will just be different.

Reply 107 of 108, by SoftCat

User metadata
Rank Member
Rank
Member
Benedikt wrote on Yesterday, 18:53:

Depending on the monitor, you can do finer horizontal scrolling by varying the width of the HSYNC pulse, because many monitors from that era don't actually sync on the rising edge of the pulse.
That is a trick from the Amstrad CPC playbook.

The HSYNC pulse width is a multiple of the symbol clock width, which is 16 pixels in 640x200 graphics mode.

Reply 108 of 108, by Benedikt

User metadata
Rank Oldbie
Rank
Oldbie
SoftCat wrote on Yesterday, 22:04:
Benedikt wrote on Yesterday, 18:53:

Depending on the monitor, you can do finer horizontal scrolling by varying the width of the HSYNC pulse, because many monitors from that era don't actually sync on the rising edge of the pulse.
That is a trick from the Amstrad CPC playbook.

The HSYNC pulse width is a multiple of the symbol clock width, which is 16 pixels in 640x200 graphics mode.

If I understand it correctly, that CPC trick relies on analog effects in the monitor circuitry that delay the detection of the HSYNC pulse by a tiny fraction of its width.
I will have to try some day whether a similar effect can be observed with a typical CGA setup.
In any case, exploiting such an effect would be much harder than on a CPC that was always bundled with a known type of monitor.