🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.msdos.programmer
Article #1252

Re: Quick Screen Access in C

#1252
From: Kaleb Keithley
Date: Tue, 02 Jan 1990 18:01
49 lines
1860 bytes
In article <3659@escargot.UUCP> chrisb@escargot.UUCP (Chris Bradley) writes:
>Greetings all,
>
>I have a need to do quick access to the video screen (instead of loading 
>ANSI.SYS and using printf(''); commands for video cursor control.) I know that
>QUICK Basic will absolutely scream with print's. Is there anything equivalent
>in C? By the way, I'm using MSC 5.1.
>
>-->Chris

Well, it's definitely not portable, but it's faster than anything else around,
and you can test for hardware in order to make it more portable, but this is
what I did for some dedicated software...

struct char_attr {
        char     ch;
        unsigned char attr;
};

struct Screen {
        struct char_attr screen[25][80];
};

main()

{

        int loop;
        struct Screen far *screen = 0xB8000000;

        for (loop = 0; loop < 25; loop++)
                screen->screen[loop][loop].ch = 'A';

}

This code is not intended to be the finest example of coding around, but if it
gives you any ideas...

Note: b8000000 is the address for all color monitors, in text mode, I believe
in either 25, 43, and 50 row mode.  for Herc mono, use 0xB0000000.

Have fun...



Chewey, get us outta here!
                 
kaleb@mars.jpl.nasa.gov             (818)354-8771
Kaleb Keithley
Technical Details
Message-ID: <2480@jato.Jpl.Nasa.Gov>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!snorkelwacker!usc!henry.jpl.nasa.gov!elroy.jpl.nasa.gov!jato!mars!kaleb
References: <3659@escargot.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!snorkelwacker!usc!henry.jpl.nasa.gov!elroy.jpl.nasa.gov!jato!mars!kaleb
From: kaleb@mars.jpl.nasa.gov (Kaleb Keithley)
Newsgroups: alt.msdos.programmer,comp.sys.ibm.pc
Subject: Re: Quick Screen Access in C
Message-ID: <2480@jato.Jpl.Nasa.Gov>
Date: 2 Jan 90 18:01:37 GMT
References: <3659@escargot.UUCP>
Sender: news@jato.Jpl.Nasa.Gov
Reply-To: kaleb@mars.UUCP (Kaleb Keithley)
Distribution: usa
Organization: Jet Propulsion Laboratory, Pasadena, CA.
Lines: 49