www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/31/18:30:31

From: Thomas Harte <T DOT Harte AT btinternet DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: 640 x 400
Date: Mon, 31 Aug 1998 23:19:37 +0100
Organization: BT Internet
Lines: 26
Message-ID: <35EB2179.8A0437FF@btinternet.com>
References: <01bdd031$0b208f20$0818d3d4 AT billy>
NNTP-Posting-Host: host5-99-57-67.btinternet.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

> Could someone please tell me how to get into a 640 x 400 screen. I can get
> into 320 x 200 using the screen mode 0x00013 and textmode 3.

    I'm not sure how this correlates to C code right now, but if my memory
serves me, this sequence should do it in 16bit mode anyway :

    put 4f02h into ax, and 100h into bx, and then call interrupt 10h. This
will do the old vesa setting to mode 100h. Now, switch the display off for a
moment to prevent breaking your monitor, and write the value 1h to port 3c4h.
Read port 3c5h, binary or it with 20h and write it back. That is the display
turned off. Now write the value 0604h (as a word of course) to port 3c4h and
14h (also as a word) to port 3d4h. That just flipped the chain-4 bit and
turned off 'word' mode. It is sort of normal to leave a few hundred
millisecond pause now while your video card sorts itself out. Now just turn
the display back on by writing 1h back to port 3c4h, then reading 3c5h, binary
or'ing dfh and writing it again.

    Unfortunately this is a banked mode, so to write a random pixel you will
have to determine and select the correct bitplane to write to. This is easily
achieved by writing whatever 100h shifted left x binary anded with 3, then
added to two is to good old port 3c4h. Then put your byte into memory at (y *
640) + (x / 4) memory positions after the normal video start (a000 . . .
whatever it becomes in protected mode).

        -Thomas

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019