トップページ > プログラム > 2018年11月09日 > mgnuIu1c

書き込み順位&時間帯一覧

24 位/214 ID中時間01234567891011121314151617181920212223Total
書き込み数0000000000000001200000003



使用した名前一覧書き込んだスレッド一覧
352
懐かしのMS-DOSプログラミング ver.2

書き込みレス一覧

懐かしのMS-DOSプログラミング ver.2
353 :352[sage]:2018/11/09(金) 15:22:02.19 ID:mgnuIu1c
[VGA]
・640 x 480, 16色/モノクロ
・640 x 200, 16色/モノクロ (EGA 互換)

16色は、4BIT分使うから、(640*480*4/8)/1024 = 150 で、
640 x 480 x 4BIT は、150(KB)。また、
640*480*4/8 = 0x25800。

[EGA]
典型例:
・640 x 350, 64色中の16色/モノクロ
・640 x 200, 16色

[CGA]
text mode と graphic mode を持つ。
・320 x 200, 16色のうちの4色
・640 x 200, 2色

PC/AT の video memory は、古い仕様書では、0xA0000 - 0xBFFFF (128KB)と
なっているが、実際は 「RAM」だけでも、150(KB)以上あるはず。
仕様書的には典型的なアドレスは、
0xA0000 : EGA/VGA graphics modes (64 KB)
0xB0000 : monochrome text mode (32 KB)
0xB8000 : color text mode and CGA-compatible graphics modes (32 KB)
0xC0000 : Video BIOS の ROM ---> VGA の場合は、ROM ではなく、VRAMのはず。

となっており、VGA での text buffer は、0xB8000 となっている。
0xA0000 から 150KB までの領域は、最終アドレスが、0xC57FF となり、
0xB8000 と重なってしまう。なので、graphic と text の同時使用は出来
ないハズ。ただし、ネットで入手できる仕様書は概ね かなり古いようだが。
懐かしのMS-DOSプログラミング ver.2
354 :352[sage]:2018/11/09(金) 16:06:28.02 ID:mgnuIu1c
【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(ピクセル)。
懐かしのMS-DOSプログラミング ver.2
355 :352[sage]:2018/11/09(金) 16:41:28.91 ID:mgnuIu1c
>>351
見つけた。CGA では、排他使用しか出来なかったらしい。
多分、この伝統を VGA も受け継いでいたと考えられる:

【Register I/O】

03D8h: Mode control register

The following bits are used:

Bit 1: Graphics mode

If this bit is set, the display RAM will be treated as bitmap graphics rather than as text.

↑[I/O ポート、0x3D8]

BIT1 = 0 : display RAM will be treated as text.
     1 : display RAM will be treated as bitmap graphics.


※このページは、『2ちゃんねる』の書き込みを基に自動生成したものです。オリジナルはリンク先の2ちゃんねるの書き込みです。
※このサイトでオリジナルの書き込みについては対応できません。
※何か問題のある場合はメールをしてください。対応します。