Board index » delphi » Graphics in text mode

Graphics in text mode

In article <344FB276.1...@rocketmail.com>,

Quote
FaNt0m  <fan...@rocketmail.com> wrote:
>Doug Lurie wrote:
>> Tim Boswell <t...@stealthmail.com> wrote in article
>> <344F9B78.6...@stealthmail.com>...
>> > Does anyone have any ideas on how to get a small graphic(about 32x32
>> pixels)
>> > into a tp program in text mode? My solution to date has been to create a
>> new
>> > DOS font, and design the icon by editing a few extended characters, but
>> this
>> > is obviously not an ideal solution. Any help would be appreciated

>> I, too, would like to know of a better method. Unfortunately, by the nature
>> of the beast, text mode requires a text font for display. However, this
>> would not be a really bad thing, except that space that the BIOS puts into
>> most letters severly limits how many characters that you can change.
>Well, in my opinion i would do like they do in the most recent bios's.
>When you boot up you usually see some logo like the engery thingy fade
>out, that is text mode and thats hwo i woudl do it.  First just change
>some foriegn letters to the graphic and then just change the colour of
>the character

>FaNt0m

What you are seeing when the computer boots up is actually graphics mode.
The mode is set to VGA (640x480x16c).  After the pic has faded out, the
screen is set to text mode.  On newer machines this happens so quickly
that you hardly notice.  On older machine you could see a minor flicker
when the mode was changed.

It is impossible to have the screen in both graphics and text mode.  The
memory address of the text mode starts in the 0b000h (or 0b800h) segment.
Graphics memory starts at 0a000h.  Because the graphics controller cannot
change the address it is scanning from until a reset, the best you would
be able to do is one frame be text and the next frame be graphics.  

One reason the above proposed method won't work is because you can only get
one or two colours per character.  This makes it difficult to do any
decent looking graphics in text mode... although the Future Crew did do
some neaat things in text mode :).  

The best solution is to use 640x480x16c or 640x480x8bpp and use the ROM
font to simulate text mode.

--Mark Iuzzolino
one of the mons...@monstersoft.com  |  "Who do you want to kill today?"
http://www.monstersoft.com

 

Re:Graphics in text mode


Quote
newor...@no.unm.spam.edu wrote:
> What you are seeing when the computer boots up is actually graphics mode.
> The mode is set to VGA (640x480x16c).  After the pic has faded out, the
> screen is set to text mode.  On newer machines this happens so quickly
> that you hardly notice.  On older machine you could see a minor flicker
> when the mode was changed.

Well, my system has an Award BIOS with the neat little graphic up on the
right hand side when it starts up.  And, no it's not in graphics mode.
It's in text mode using an 8x14 character cell size (EGA compatible).
It modifies character maps directly and just uses strategic placing of
color to create the various yellow and green areas of the graphic.  The
flicker, if any, is just the video card being initialized to VGA mode
for normal operation.

Quote
> It is impossible to have the screen in both graphics and text mode.  The
> memory address of the text mode starts in the 0b000h (or 0b800h) segment.
> Graphics memory starts at 0a000h.  Because the graphics controller cannot
> change the address it is scanning from until a reset, the best you would
> be able to do is one frame be text and the next frame be graphics.

True, but you can use the video BIOS to modify particular characters, or
you can remap video memory to linear mode (instead of the usual odd/even
planar mode used in text modes), and edit fonts on a bit-wise level.
Actually, you can even get some cool effects . . . e.g., I made a
swirling cursor which looks like a barbershop pole in one program I was
working on.

Quote
> One reason the above proposed method won't work is because you can only get
> one or two colours per character.  This makes it difficult to do any
> decent looking graphics in text mode... although the Future Crew did do
> some neaat things in text mode :).

FC did some neat things in *all* modes.  ;-)

Quote
> The best solution is to use 640x480x16c or 640x480x8bpp and use the ROM
> font to simulate text mode.

Always a possibility, but when all you want is a small 32x32 graphic,
using graphics mode will probably be a bit overkill (slow text output
and scrolling, and IMHO it takes a LOT more effort to rework a program
for text output in graphics mode than it does to modify a few characters
to create a small bitmap in text mode).

Quote
> --Mark Iuzzolino
> one of the mons...@monstersoft.com  |  "Who do you want to kill today?"
> http://www.monstersoft.com

--
Scott Earnest        | We now return you to our regularly |
set...@ix.netcom.com | scheduled chaos and mayhem. . . .  |

Re:Graphics in text mode


In article <3458369C.45CFD...@ix.netcom.com>,
Scott Earnest  <set...@ix.netcom.com> wrote:

Quote
>newor...@no.unm.spam.edu wrote:
>> What you are seeing when the computer boots up is actually graphics mode.
>> The mode is set to VGA (640x480x16c).  After the pic has faded out, the
>> screen is set to text mode.  On newer machines this happens so quickly
>> that you hardly notice.  On older machine you could see a minor flicker
>> when the mode was changed.
>Well, my system has an Award BIOS with the neat little graphic up on the
>right hand side when it starts up.  And, no it's not in graphics mode.
>It's in text mode using an 8x14 character cell size (EGA compatible).
>It modifies character maps directly and just uses strategic placing of
>color to create the various yellow and green areas of the graphic.  The
>flicker, if any, is just the video card being initialized to VGA mode
>for normal operation.

If any portion of the bitmap is more than 2 colours, then it is in
graphics mode.  I know that some of the older BIOS did use this method
(I have the source code .. ).

[snip]

Quote
>True, but you can use the video BIOS to modify particular characters, or
>you can remap video memory to linear mode (instead of the usual odd/even
>planar mode used in text modes), and edit fonts on a bit-wise level.

Oki.. but does it still work when you are running the program in a DOS
box?  [In Win95] load up ScreamTracker and then hit alt-enter.  All of the
characters are totally messed up.  At least with a graphics mode program
this isn't an issue

Quote
>> The best solution is to use 640x480x16c or 640x480x8bpp and use the ROM
>> font to simulate text mode.

>Always a possibility, but when all you want is a small 32x32 graphic,
>using graphics mode will probably be a bit overkill (slow text output
>and scrolling, and IMHO it takes a LOT more effort to rework a program
>for text output in graphics mode than it does to modify a few characters
>to create a small bitmap in text mode).

One could easily rewrite write() and writeln() to output text in graphics
mode.  This really isn't all that difficult.  As for the speed, this isn't
that much of an issue either.  In our electronic magainze entitled BitDreams
we do text output in high-res using proportional fonts.  It will scroll
just like text mode, and it does it very quickly.  It isn't as fast as text
mode, but it certainly isn't slow.  To each their own, I suppose :).

--Mark Iuzzolino
one of the mons...@monstersoft.com  |  "Who do you want to kill today?"
http://www.monstersoft.com

Re:Graphics in text mode


Quote
> What you are seeing when the computer boots up is actually graphics mode.
> The mode is set to VGA (640x480x16c).  After the pic has faded out, the
> screen is set to text mode.  On newer machines this happens so quickly
> that you hardly notice.  On older machine you could see a minor flicker
> when the mode was changed.

No, not at my machine. I can make a Print-Screen and get odd characters
instead of the logo -> text mode is used. The flicker is because the screen
font is changed. Plus, most modern monitors automatically switch between
modes. VGA Text is 720*400@70Hz, VGA graphics is 640*480@60Hz, wich IS a
different mode for the autosync monitor. I never saw a monitor switching so
fast that I din't notice any re-synchronizing.

Quote
> It is impossible to have the screen in both graphics and text mode.  The
> memory address of the text mode starts in the 0b000h (or 0b800h) segment.
> Graphics memory starts at 0a000h.  Because the graphics controller cannot
> change the address it is scanning from until a reset, the best you would
> be able to do is one frame be text and the next frame be graphics.  

It cannot be both, but graphics can be "packed" into text characters
(actually this is also done also for "graphical" mouse cursors in some DOS
apps). And this is what had been proposed by the other people in thjis
thread.

Quote
> One reason the above proposed method won't work is because you can only
get
> one or two colours per character.  This makes it difficult to do any
> decent looking graphics in text mode... although the Future Crew did do
> some neaat things in text mode :).  

Two colors is right (back and foreground). However, the EPA logos usually
are only green or grreen with yellow under the main logo.
You can program the VGA adapter so that it allows you to use a
512-Character set (the 9th bit is stored in the colour byte), which allows
you to use 256 patterns of 8*16 pixels (the 9th pixel is equal to the 8th).
Quite enough for simple graphics!

Quote
> The best solution is to use 640x480x16c or 640x480x8bpp and use the ROM
> font to simulate text mode.

No, text mode usually is MUCH faster and makes far less trouble when
redrawing or clipping  things.

If you are looking for a book to do such thinks, I suggest "VGA and SVGA
programming", M. Uphoff, Addison-Wesley. There are all the VGA registers
exmplained and custom modes like 90*60 text mode or 512 character text mode
(working on every VGA card) are shown.

Arsne von Wyss
avonwyss @ beaulieu-software.ch

Visit my homepage: http://www.beaulieu-software.ch/avonwyss

******************************************************
*    I removed my reply address to avoid spamming.   *
* Please use the address above to reply or write me. *
******************************************************

Other Threads