You are definitely right about the non-reliability of 0040:0084, but I'm 
not super sure about it being consistently set to 0 on non-EGA 
systems... Although it is set to 0 indeed on my 8086.

About detecting CGA/EGA/VGA - it's no as bad as it sounds. Actually I 
recently found a very cool article from the PC Magazine 1989 that 
explains it very nicely. I scanned it and retranscribed it below:

gopher://gopher.viste.fr/1/myinfobase/?disp2015-05-20%20detecting%20video%20adapter%20type

(the original scan is available there, too)

Mateusz




On 27/05/2015 21:01, Edouard Forler wrote:
>
> Actually 0040:0084 is not reliable.
>
> 0040:0084 is populated by the EGA/VGA bios only. All variables after
> 0071 are not standardized and you cannot, generally speaking, rely on
> them. You might want to re-read the PC Bible by Michael Tischer ;-) I
> have an original copy available.
>
> Anyway, the patch is easy. I guess the value is 0 on pre-EGA machines,
> as this area is zeroed at boot time. Which is consistent with the one
> line display if I read your code correctly. Detecting the video card
> before EGA/VGA is not simple. You need to make some tests. Again, the PC
> Bible provides an example of routine to do so, but I think this would be
> over-engineering in our case. Better keep this for a benchmark tool or
> if you have a diagnostic tool in freedos and just check for 0 at 0040:0084.
>
>
>
> Le 27.05.2015 20:35, JAYDEN CHARBONNEAU a écrit :
>> Huh.I thought all screens had the same columns and rows (Different
>> scales,obviously),but the same text slots.Apparently CGA monitors are
>> different.
>>
>> On Wed, May 27, 2015 at 2:20 PM, Mateusz Viste <[email protected]
>> <mailto:[email protected]>> wrote:
>>
>>      On 25/05/2015 06:33, Ralf Quint wrote:
>>       >> DIR: When using DIR/P, DIR seems to think that the screen is
>>      1-row high,
>>       >> and asks for a keypress for every line (the screen is
>>      CGA-based, 25
>>      rows).
>>       > That must be some issue with your PC, works fine for me and
>>      should not
>>       > be related to 8086 code or not at all...
>>
>>      Hi, I had a few minutes of time to look into this. And what I was
>>      half-guessing two days ago seems correct: my PC is fine, that's
>>      FreeCOM
>>      who's buggy.
>>
>>      Here is an extract of what makes the DIR command wait after a page of
>>      text (extracted from SVN's trunk and slightly reformatted for better
>>      mail readability):
>>
>>      /* increment our line if paginating, display message at end of
>>      screen */
>>      static int incline(void) {
>>         if (!optP) return E_None;
>>         if (++line >= MAX_Y) {
>>           line = 0;
>>           return pause();
>>         }
>>         return 0;
>>      }
>>
>>      Now the obvious question of course is "what is MAX_Y?". And one grep
>>      later, I've got the answer:
>>
>>      $ grep 'MAX_Y' -R *
>>      cmd/dir.c:  if (++line >= MAX_Y)
>>      include/misc.h:#define MAX_Y (*(unsigned char far*)MK_FP(0x40, 0x84))
>>      include/misc.h:#define SCREEN_ROWS (MAX_Y + 1)
>>      (...)
>>
>>      This is exactly what I was implying in my previous message - FreeCOM
>>      doesn't care about CGA, and assumes that the screen's height will
>>      always
>>      be available under 0040:0084, which is true only for EGA+.
>>
>>      Mateusz
>>
>>


------------------------------------------------------------------------------
_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to