【CGA】

https://www.seasip.info/VintagePC/cga.html


[Graphics Modes]

In the two graphics modes, all memory is used for the framebuffer. Each row is 80 bytes.
At the beginning of memory are the first set of rows (0, 2, 4, ..., 198); offset by 8k are
the second set (1, 3, 5, ..., 199). This may have been to make it easier for the hardware
to produce an interlaced picture, but it's a pain to program.

グラフィック・モードでは、1ラインは、80バイトで、
0行目、2行目、4行目、・・・、198行目
と続いた後、先頭から 8KB 離れて、
1行目、3行目、5行目、・・・、199行目

となっていたらしい。

In low-resolution graphics mode (320x200), a byte corresponds to four pixels; in high-resolution
mode (640x200), a byte corresponds to 8. In each case, the highest-numbered bits correspond
to the leftmost pixel.

↑は、つまり、320x200 では、4色だから、1ピクセル当たり2BIT。
よって、8/2 = 4 で、1バイト当たりで、4ピクセル。
この場合、1行は、4(ピクセル/バイト) × 80(バイト) = 320(ピクセル)。

640x200 は、モノクロモードだから、8BIT で、8ピクセルに相当。
つまり、4色カラーモードでも、当初からパックド・ピクセル方式だったらしい。
この場合、1行は、8(ピクセル/バイト) × 80(バイト) = 640(ピクセル)。