1. Background Intensity

Read the following comments from the file intense.e.

As you see I did make one change that makes NO
difference in how the program runs.  I simply
eliminated a redundant include.  Euphoria automatically
does this, but I feel that this MAY save time !?

I will refer to these comments at the end of this
message.

-- NOTE: Slightly altered by Lucius L. Hilley III
--    INCLUDES:
--      Took out include graphics.e
--      graphics.e is included by image.e

-- intense.e v1.6
-- Use high-intensity text & background colors
-- David Cuny 1/6/97
-- Internet:  dcuny at hw1.cahwnet.gov
--
-- Thanks to Tom Riso for loaning me his ROM BIOS call book, and then
-- walking me through the process.
--
-- Euphoria does not allow direct access to high-intensity video, so
-- this is a bit of a kludge. But it gets the job done.
--
-- There are two problems with getting high-intensity colors: getting
them
-- to the screen, and displaying them as intense, instead of blinking.
--
-- The first is a problem because Euphoria only lets you set the
foreground
-- color with an extended attribute (why is this, Robert?). The second is
-- that your PC will display extended colors as blinking, not intense. If
-- you want intense colors, you've got to do a BIOS call.
--
--<BIOS CODE HERE>--
--
-- Next, we write the text to the screen. We can't do this directly with
-- fore_color and bk_color (aargh!), so we have to resort to getting it
-- directly to the screen. It's simplest to just poke it to the screen.
--
--
-- Remember that "blinking green" is the same as "intense green"; it's
all
-- a matter how the machine interprets the numbers.

Blinking green and Intense green are the same CORRECT!

When this code was written he may not have been able to access
blinking and intensity.  I don't know !!!

But now with Euphoria Version 1.5 I know that you can.

It works as follows:

foreground = 0 to 8
background = 0 to 8
BRIGHT = 8
BLINKING = 16
BK_BRIGHT = 16
NOW

Take the colors WHITE and BLUE

Foreground = WHITE
Background = BLUE

{BRIGHT+BLINKING+WHITE+, BLUE} is equal to
{BRIGHT+WHITE+BK_BRIGHT, BLUE}

Normally Intense Blinking White on Blue
but with intense background on
Bright White on Bright Blue.

--Lucius Lamar Hilley III
--  E-mail at luciuslhilleyiii at juno.com
--  I support transferring of files less than 60K.
--  I can Decode both UU and Base64 format.

new topic     » topic index » view message » categorize

2. Re: Background Intensity

re: 1.5 supports intense backgrounds.

I think I'm missing the point of your message.

The reason I wrote the code was because 1.4 did not support intense/blinking
background colors. For example:

    text_color( GREEN )
    bk_color( BRIGHT_WHITE )
    puts( 1, "This should be green on bright white" )

did *not* work. Instead, it displays green on /normal/ white. It seems that
puts() did not write background attributes higher than 15 to the screen.

However, if I /poked/ the attributes to the screen, it *did* work, only the
background color was /blinking/, not intense. The BIOS call is used to tell
the machine to show the attribute as intense, not blinking. To make my life
easier, I put together the routine put_colors(), which poked the data to the
screen (or to a buffer, if the write was deferred).

If I try the code snippet above in 1.5, it still does not work, even with
something like:

    bk_color( BRIGHT_WHITE + 8 )

or other permutations.

The puts() (for that matter, *none* of Euphoria display routines) will write
a background color greater than 15 to the screen.

Am I missing something?

Thanks!

 -- David Cuny

new topic     » goto parent     » topic index » view message » categorize

3. Re: Background Intensity

On Wed, 9 Apr 1997 04:57:04 PST "Cuny, David" <ATB.DCUNY at HW1.CAHWNET.GOV>
writes:
>
>re: 1.5 supports intense backgrounds.
>
>I think I'm missing the point of your message.
>
>The puts() (for that matter, *none* of Euphoria display routines) will
>write
>a background color greater than 15 to the screen.
>
>Am I missing something?
>
>Thanks!
>
> -- David Cuny

Yes you are missing something.

Blinking is a foreground attribute

include graphics.e
integer fg, bg, bright, blinking,
--fg = foreground
--bg = background

fg = WHITE
bg = BLUE

bright = 8
blinking = 16

clear_screen()
text_color(fg)
bk_color(bg)
puts(1, "White on Blue")

while get_key() = -1 do
end while

fg = fg + bright
text_color(fg)
puts(1, "Bright White on Blue")

while get_key() = -1 do
end while

fg = fg + blinking
text_color(fg)
puts(1, "Blinking Bright White on Blue")

--If you turn on intensity then you have
--Bright White on Bright Blue

new topic     » goto parent     » topic index » view message » categorize

4. Re: Background Intensity

I asked:

>Am I missing something?

Lucius replied:

>> Yes you are missing something.
>>
>> Blinking is a foreground attribute

Actually, the PC video will support blinking/intense BACKGROUND colors as
well. The problem is the Euphoria doesn't.

I ran across the problem when trying to get my editor to match the color
scheme of the DOS 7.0 (Win95) editor. The title bar is black against a
bright white background. Naturally, I tried:

    text_color( BLACK )
    bk_color( BRIGHT_WHITE )
    puts( 1, "This should be black on a bright white background." )

This *should* work, but it does not. It turns out that Euphoria will not
allow you to set ANY background color > 8. Robert says that he is making the
correct call to the C graphic toolkit that Euphoria is compiled in, but I
suspect that some setting is not right.

That's what the file INTENSE.E is all about: allowing you to use intense as
well as normal background colors. Incidentally, the file has been renamed to
SCREEN.E in the latest incarnation of the GUI, because there are so many
other tools I've added to the file.

 -- David Cuny

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu