Board index » delphi » CRT unit shrinks screen size?

CRT unit shrinks screen size?

Does anyone know if the CRT unit for TP5 automatically senses screen
size and then adjusts itself based upon what it determines? And if it
does -- which I'm almost certain that it must be doing -- then is
there a way to turn that 'feature' off?

I have a file viewer that I wrote which uses however many lines are on
the screen to display data (80x25, 80x35, 80x43, etc). Except for
certain configurations the size of the window changes when the program
is run (BTW; I'm using DOS windows under NT4. I'm adjusting the number
of rows using the Properties menu on the individual windows
themselves).

When my program starts the DOS window size stays the same, so long as
it's 80x25, 80x28 or 80x50. All other sizes cause the actual DOS
window to get reset to the closest one of the aforementioned window
sizes (closest being a size which has a line count less than the
current window size). For example: if I have the window set as 80x35
TP actually shrinks the window size to 80x28 (or somehow instructs NT
to do so), runs my program, then resets it back to 80x35 after my
program ends. The reason I know that it's TP5 and not my program is
that I put a pause as the very first line of the program -- before any
of my code is run -- and the window still gets shrunk.

I'm at a loss about this one. Does anyone have any ideas?

Regards,
Jim Wilson
(Cheap spam protection in place: remove the 'SpamThis'
from my email ID to reply to me personally)

 

Re:CRT unit shrinks screen size?


Jim Wilson <mailto:SpamThis!jawil...@ix.netcom.com> said:

Quote
>Does anyone know if the CRT unit for TP5 automatically senses screen
>size and then adjusts itself based upon what it determines? And if it
>does -- which I'm almost certain that it must be doing -- then is
>there a way to turn that 'feature' off?

The start-up code checks for 40x25, 80x25, 80x43, 80x50 by checking the
video mode and if it does not find one of the above, it forces 80x25.

It can only be turned off by recompiling the source with the offending
assembler code removed. If you have the TP6 or 7 RTL this works with
TP5.

Alternatively, there are replacement units for CRT, including TP5 via
<URL: http://www.pedt.demon.co.uk/crt/> - one of the changes was to
detect different text mode screen sizes and not change the screen to
80x25 by default.

--
Information on Newsgroup posted weekly on Sunday - read before writing!
Contains links to    |  http://homepages.force9.net/pascal/faq/
helpful information  |  http://www.merlyn.demon.co.uk/clpb-faq.txt
and some guidelines  |  ftp://garbo.uwasa.fi/pc/doc-net/faqclpb.zip

Re:CRT unit shrinks screen size?


JRS:  In article <K2SOWHAEZUD4Y...@pedt.demon.co.uk> of Wed, 20 Oct 1999
05:34:12 in news:comp.lang.pascal.borland, Pedt Scragg

Quote
<newsmas...@pedt.demon.co.uk> wrote:
>Jim Wilson <mailto:SpamThis!jawil...@ix.netcom.com> said:

>>Does anyone know if the CRT unit for TP5 automatically senses screen
>>size and then adjusts itself based upon what it determines? And if it
>>does -- which I'm almost certain that it must be doing -- then is
>>there a way to turn that 'feature' off?

>The start-up code checks for 40x25, 80x25, 80x43, 80x50 by checking the
>video mode and if it does not find one of the above, it forces 80x25.

>It can only be turned off by recompiling the source with the offending
>assembler code removed. If you have the TP6 or 7 RTL this works with
>TP5.

>Alternatively, there are replacement units for CRT, including TP5 via
><URL: http://www.pedt.demon.co.uk/crt/> - one of the changes was to
>detect different text mode screen sizes and not change the screen to
>80x25 by default.

An observation that may have some bearing on things :

I have a program int_test which prompts for input in Bright White on
Blue.  When I run it in a Win 98 first release DOS box initially set to
dull white on black, and Quit, the screen is left in Bright White on
Black (which is actually useful) though in plain DOS 6.20 the original
colour is restored.  F-PROT, however, removes the Bright (alas) in the
Win box.

Program int-test does not use a full Crt unit, but it does use TextSet;
and the "font8x8" setting is not restored either in the Win98 box or in
DOS6.20.

I suppose that what I'm saying is that, for such delicate matters, it
may be necessary to suspect different results in different versions of
DOS, in particular in Boxes.

Perhaps it would be useful to have a general screen-setting changer
program covering the commonly available modes.

--
? John Stockton, Surrey, UK.  j...@merlyn.demon.co.uk   Turnpike v4.00   MIME. ?
 Web <URL: http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
 Proper 4-line sig. separator is as above, a line exactly "-- " (SonOfRFC1036)
 Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)

Re:CRT unit shrinks screen size?


In article <380d1901.452...@netnews.worldnet.att.net>,

Quote
Jim Wilson <SpamThis!jawil...@ix.netcom.com> wrote:
>Does anyone know if the CRT unit for TP5 automatically senses screen
>size and then adjusts itself based upon what it determines? And if it
>does -- which I'm almost certain that it must be doing -- then is
>there a way to turn that 'feature' off?

Use this unit before the CRT unit, and call the Done procedure at the
beginning of the code:

unit nomd;

interface

Procedure done;

implementation

var save:byte;

Procedure done;
begin
  mem[$40:$49]:=save;
End;

Begin
  save:=mem[$40:$49];
  mem[$40:$49]:=3;
end.

Osmo

Re:CRT unit shrinks screen size?


On 20 Oct 1999 23:28:51 +0300, ronka...@cc.helsinki.fi (Osmo Ronkanen)
wrote:

Quote
>In article <380d1901.452...@netnews.worldnet.att.net>,
>Jim Wilson <SpamThis!jawil...@ix.netcom.com> wrote:
>>Does anyone know if the CRT unit for TP5 automatically senses screen
>>size and then adjusts itself based upon what it determines? And if it
>>does -- which I'm almost certain that it must be doing -- then is
>>there a way to turn that 'feature' off?

>Use this unit before the CRT unit, and call the Done procedure at the
>beginning of the code:
> [snip]

Thanks Osmo, I'll give this a try.

But just to satisfy my own curiousity, exact what is this unit doing?
And what is the problem TP5 has?

Regards,
Jim Wilson
(Cheap spam protection in place: remove the 'SpamThis'
from my email ID to reply to me personally)

Re:CRT unit shrinks screen size?


On Wed, 20 Oct 1999 05:34:12 +0100, Pedt Scragg

Quote
<newsmas...@pedt.demon.co.uk> wrote:
>Jim Wilson <mailto:SpamThis!jawil...@ix.netcom.com> said:

>>Does anyone know if the CRT unit for TP5 automatically senses screen
>>size and then adjusts itself based upon what it determines? And if it
>>does -- which I'm almost certain that it must be doing -- then is
>>there a way to turn that 'feature' off?

>The start-up code checks for 40x25, 80x25, 80x43, 80x50 by checking the
>video mode and if it does not find one of the above, it forces 80x25.

>It can only be turned off by recompiling the source with the offending
>assembler code removed. If you have the TP6 or 7 RTL this works with
>TP5.

>Alternatively, there are replacement units for CRT, including TP5 via
><URL: http://www.pedt.demon.co.uk/crt/> - one of the changes was to
>detect different text mode screen sizes and not change the screen to
>80x25 by default.

Thanks for the tip. I'll grab the replacement CRT unit and give it a
try.

Regards,
Jim Wilson
(Cheap spam protection in place: remove the 'SpamThis'
from my email ID to reply to me personally)

Re:CRT unit shrinks screen size?


In article <380e5aab.994...@netnews.worldnet.att.net>,

Quote
Jim Wilson <SpamThis!jawil...@ix.netcom.com> wrote:

>Thanks Osmo, I'll give this a try.

>But just to satisfy my own curiousity, exact what is this unit doing?
>And what is the problem TP5 has?

TP checks if the video mode is 3 or 7. If it is not then it is set to 3.
This unit fools the CRT unit to think that the video mode is 3. After
the CRT has been initialized one can then return the original video mode
to where it is stored.

Osmo

Re:CRT unit shrinks screen size?


Osmo Ronkanen <mailto:ronka...@cc.helsinki.fi> said:

Quote
>In article <380e5aab.994...@netnews.worldnet.att.net>,
>Jim Wilson <SpamThis!jawil...@ix.netcom.com> wrote:

>>Thanks Osmo, I'll give this a try.

>>But just to satisfy my own curiousity, exact what is this unit doing?
>>And what is the problem TP5 has?

>TP checks if the video mode is 3 or 7. If it is not then it is set to 3.

The CRT unit actually checks for modes 0,1,2,3,7 and, of course, the
80x43 and 80x50 modes for 2 and 3 for EGA & VGA video cards.

Posted to c.l.p.b only as my software will not allow posting to two
different news servers.
--
Pedt

Year 2000 Managers do it by extra-century perception

Re:CRT unit shrinks screen size?


In article <$TBTvDAItxD4Y...@pedt.demon.co.uk>,
Pedt Scragg  <newsmas...@pedt.demon.co.uk> wrote:

Quote

>>TP checks if the video mode is 3 or 7. If it is not then it is set to 3.

>The CRT unit actually checks for modes 0,1,2,3,7 and, of course, the
>80x43 and 80x50 modes for 2 and 3 for EGA & VGA video cards.

True, it checks 0-3 and 7. I misread the code it said JBE and not JE.
There, however, is no specific check for different row counts. The
check for video mode does it all.

Following units prevent the mode change. One needs to use only the
first.

Unit Keepmode;

interface

uses KmSub,CRT;

implementation

{$ifndef msdos}
const Seg0040=$40;
{$endif}

begin
  if modesave<255 then mem[Seg0040:$49]:=Modesave;
End.

Unit KmSub;

interface

const modesave:byte=255;

implementation

{$ifndef msdos}
const Seg0040=$40;
{$endif}

begin
  if mem[Seg0040:$49] in [8,20..255] then begin
     Modesave:=mem[Seg0040:$49];
     mem[Seg0040:$49]:=3;
  End;
End.

The test handles VGA graphics modes (i.e. on them the mode is set to 3
by CRT) but SVGA garphics modes cause problems. There is no universal
way to tell them from the text modes by looking just the mode number.

Osmo

Re:CRT unit shrinks screen size?


On 21 Oct 1999 10:10:24 +0300, ronka...@cc.helsinki.fi (Osmo Ronkanen)
wrote:

Quote
>In article <380e5aab.994...@netnews.worldnet.att.net>,
>Jim Wilson <SpamThis!jawil...@ix.netcom.com> wrote:

>>Thanks Osmo, I'll give this a try.

>>But just to satisfy my own curiousity, exact what is this unit doing?
>>And what is the problem TP5 has?

>TP checks if the video mode is 3 or 7. If it is not then it is set to 3.
>This unit fools the CRT unit to think that the video mode is 3. After
>the CRT has been initialized one can then return the original video mode
>to where it is stored.

Thanks for the info.

Unfortunately, your unit didn't work -- I still have the exact same
problem. But now I'm not so certain that anything can be done about it
because Pedt's new CRT unit didn't make any difference either. I fear
that I will be forced to live with it the way it is, something I'd
rather not though. Makes you wonder if MS has done something screwed
up again...

Regards,
Jim Wilson
(Cheap spam protection in place: remove the 'SpamThis'
from my email ID to reply to me personally)

Re:CRT unit shrinks screen size?


On Wed, 20 Oct 1999 05:34:12 +0100, Pedt Scragg

Quote
<newsmas...@pedt.demon.co.uk> wrote:
>Alternatively, there are replacement units for CRT, including TP5 via
><URL: http://www.pedt.demon.co.uk/crt/> - one of the changes was to
>detect different text mode screen sizes and not change the screen to

I'm afraid to say that your new CRT unit didn't do the trick. It seems
that no matter what I do the window size gets reset. I also tried a
unit that Osmo had posted, but to no avail. I guess MS has done
something really non-standard this time (what a surprise, huh?).

BTW; your unit made my .exe bigger, not smaller. Was that supposed to
be the case?

Regards,
Jim Wilson
(Cheap spam protection in place: remove the 'SpamThis'
from my email ID to reply to me personally)

Re:CRT unit shrinks screen size?


In article <380fbd56.868...@netnews.worldnet.att.net>, Jim Wilson
<SpamThis!jawil...@ix.netcom.com> writes
Quote
>On Wed, 20 Oct 1999 05:34:12 +0100, Pedt Scragg
><newsmas...@pedt.demon.co.uk> wrote:

>>Alternatively, there are replacement units for CRT, including TP5 via
>><URL: http://www.pedt.demon.co.uk/crt/> - one of the changes was to
>>detect different text mode screen sizes and not change the screen to

>I'm afraid to say that your new CRT unit didn't do the trick. It seems
>that no matter what I do the window size gets reset. I also tried a
>unit that Osmo had posted, but to no avail. I guess MS has done
>something really non-standard this time (what a surprise, huh?).

If you like, I'll email you a slightly amended unit that'll report back
on the initialisation and a test program to compile and we'll see if we
can find where the problem is. Let me know via email if you want to to
have a go - use c...@pedt.demon.co.uk

I suspect it must be to do with NT4 and hardware access as I tried
Osmo's neat solution here in DOS plus full and part screen DOS boxes
under Win95 and it worked fine.

--
Information on Newsgroup posted weekly on Sunday - read before writing!
Contains links to    |  http://homepages.force9.net/pascal/faq/
helpful information  |  http://www.merlyn.demon.co.uk/clpb-faq.txt
and some guidelines  |  ftp://garbo.uwasa.fi/pc/doc-net/faqclpb.zip

Re:CRT unit shrinks screen size?


Quote
> Does anyone know if the CRT unit for TP5 automatically senses screen
> size and then adjusts itself based upon what it determines? And if it
> does -- which I'm almost certain that it must be doing -- then is
> there a way to turn that 'feature' off?

> I have a file viewer that I wrote which uses however many lines are on
> the screen to display data (80x25, 80x35, 80x43, etc). Except for
> certain configurations the size of the window changes when the program
> is run (BTW; I'm using DOS windows under NT4. I'm adjusting the number
> of rows using the Properties menu on the individual windows
> themselves).

> When my program starts the DOS window size stays the same, so long as
> it's 80x25, 80x28 or 80x50. All other sizes cause the actual DOS
> window to get reset to the closest one of the aforementioned window
> sizes (closest being a size which has a line count less than the
> current window size). For example: if I have the window set as 80x35
> TP actually shrinks the window size to 80x28 (or somehow instructs NT
> to do so), runs my program, then resets it back to 80x35 after my
> program ends. The reason I know that it's TP5 and not my program is
> that I put a pause as the very first line of the program -- before any
> of my code is run -- and the window still gets shrunk.

> I'm at a loss about this one. Does anyone have any ideas?

> Regards,
> Jim Wilson

hello, what i think your problem is not a bug, but rather a feature, as you
will know, there are multiple text screen modes, 80x25/80x43/50 etc...
(pascal doesn't know that is being run in a window, it can detect winblows
but winblows tells pascal it is being run as a fullscreen not in a window)
and just changes the text mode, winblows/nt automatically changes your
window around to accomodate the change in modes (i'd suggest running pascal
in fullscreen mode)... why it keeps changing is 'cos pascal stores the
current mode then changes it to 80x50 (unless you have it set to something
else) then when you run your program pascal automatically sets the screen
back to what it was before it changed it, then it changes it back it's own
mode after the program has terminated, so you can either ignore this or
change the textmode at the start of your program using textmode();

Ryan Jenkins
  -Silly Stuff 1999

Other Threads