[comp.sys.ibm.pc] Ega Memory

pervect@bsu-cs.UUCP (Barrett Kreiner) (02/24/88)

Hi again.

From what I've read and been told, I made a mistake.

I have a Paradise EGA card that can emulate most of the common display
adapters.  I had played around with it in both EGA and CGA, the latter
referenceing the memory through $B800, and I NATURALLY assumed (Oy, the
WRONG thing to do with an IBM) that it was acessable from the full range
of $A000 to $BFFF.  I humbly ask to be forgiven for such actions.

:-)

I've been told that one can't create a 'blink' for EGA graphic modes, but
that you can flip between pages seamlessly, so how is this for a proposition:

What if you wrote your text character out to both pages, one normal, and
one reversed, and then hooked into the clock interrupt and at intervals
flipped the pages?

The only problem is that I don't have sufficent facilities (read in training
and Brains) to do it.  Anyone got a sugesstion?

thanx for all the help,
|---------------------------------------------------------------------------|
|Barrett Kreiner     UUCP:  <backbones>!{iuvax,pur-ee,uunet}!bsu-cs!pervect |
| Assistant software tech,  |-----------------------------------------------|
| Ball State U. Muncie, IN  | "I'll tell ya kid, the main problem with      |
|---------------------------| Pervish food is keeping the goo from crawling |
| out of the bowl while you're eating it"|  TOON: THE game for modern times |
| CGA: Cute Greenback Accumulator  EGA: ENHANCED Greenback Accumulator      |
| Disclamer: "I don't know them!  I'm a student, nobody listens to ME!"     |
|---------------------------------------------------------------------------|

chasm@killer.UUCP (Charles Marslett) (02/27/88)

In article <2197@bsu-cs.UUCP>, pervect@bsu-cs.UUCP (Barrett Kreiner) writes:
> Hi again.
> 
> From what I've read and been told, I made a mistake.

  Not very likely, see the program posted below for blinking, and note
that all IBM compatible EGA and VGA adapters should support the 128K
chained mode provided by IBM's EGA and VGA.  Early C&T based ones had
an error in the memory decoding PROM that prevented the use of this mode
but all more recent EGAs I know of work correctly.

> I have a Paradise EGA card that can emulate most of the common display
> adapters.  I had played around with it in both EGA and CGA, the latter
> referenceing the memory through $B800, and I NATURALLY assumed (Oy, the
> WRONG thing to do with an IBM) that it was acessable from the full range
> of $A000 to $BFFF.  I humbly ask to be forgiven for such actions.

  You're forgiven, since you were right in the first place (even if you
may be right for the wrong reason).

> I've been told that one can't create a 'blink' for EGA graphic modes, but
> that you can flip between pages seamlessly, so how is this for a proposition:
> 
> What if you wrote your text character out to both pages, one normal, and
> one reversed, and then hooked into the clock interrupt and at intervals
> flipped the pages?

  That works fine, and will let you blink all 16 colors as a matter of fact,
but the hardware blink can be used if you need only 8 colors or patterns.

> The only problem is that I don't have sufficent facilities (read in training
> and Brains) to do it.  Anyone got a sugesstion?
> 
> thanx for all the help,
> |---------------------------------------------------------------------------|
> |Barrett Kreiner     UUCP:  <backbones>!{iuvax,pur-ee,uunet}!bsu-cs!pervect |
> | Assistant software tech,  |-----------------------------------------------|
> | Ball State U. Muncie, IN  | "I'll tell ya kid, the main problem with      |
> |---------------------------| Pervish food is keeping the goo from crawling |
> | out of the bowl while you're eating it"|  TOON: THE game for modern times |
> | CGA: Cute Greenback Accumulator  EGA: ENHANCED Greenback Accumulator      |
> | Disclamer: "I don't know them!  I'm a student, nobody listens to ME!"     |
> |---------------------------------------------------------------------------|

  This is my stab at using the hardware blink: pick the blinking or non-
blinking patterns you wnat and embed 'em in the code.  The pageflipping takes
more code than I'd write without a use [yet!].

The following subroutine will perform one of several blinking operations
depending on the color of the pixel selected (each pixel on the screen
switches from the intensifed color to the unintensified color and back
and the color selected in each case is determined by the contents of that
color's attribute register) -- normally I'd reccommend doing this with
the BIOS for portability's sake, but most of the better BIOSes will not
let you write to the mode register directly, and once you've done that,
its better to use a single access method.  Note that there are only 8
possible pixel attributes in this mode (color 4 and color C simply
alternate with each other).

Call this routine after setting up your video mode (0Dh, 0Eh, 10h or
12h since the technique only works with the EGA compatible 16-color
modes).

blinkon()
    {
    inp(0x3DA);             /* Synchronize the Attribute Flop */

    outp(0x3C0, 0x10);      /* Select blinking graphics mode  */
    outp(0x3C0, 0x0F);

    outp(0x3C0, 0x08);      /* Black is not blinking          */
    outp(0x3C0, 0x00);

    outp(0x3C0, 0x01)    outp(0x3C0, 0x04);

    outp(0x3C0, 0x0D);      /* Magenta is true blinking(on/off)*/
    outp(0x3C0, 0x00);

    outp(0x3C0, 0x06);      /* Yellow is intense non-blinking */
    outp(0x3C0, 0x16);

    outp(0x3C0, 0x0F);      /* And ditto for white            */
    outp(0x3C0, 0x07);

    outp(0x3C0, 0x3F);
    }

Charles Marslett
Chief BIOS Guru and Coffee-cup-washer
STB Systems, Inc.
chasm@killer.UUCP

<<<<<< I speak for myself and all who fail to speak for themselves! >>>>>>