🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #5174

Direct output in C

#5174
From: Andrew Davenport
Date: Wed, 13 Mar 1991 18:55
38 lines
1532 bytes
    I am writing a program on an IBM AT compatible computer, and I want to
use direct input/output.  I wrote the following function, but it doesn't
work.  Can anyone give me a pointer as to why not?

--------------------------------- Cut Here ----------------------------------

int far *screen = (int far *)0xB8000000;

void dir_scr_write(int x, int y, char *str, char fore, char back)
{
    int c=0, temp=0, string[80];
    unsigned int attr=0;
    int far *tmp = screen;

    temp = strlen(str);
    attr = (((((int)back & 0x0f) << 4) | ((int)fore & 0x0f)) & 0x00ff);
    for(c = 0; c <= temp; c++)
    {
        string[c] = (int)str[c];
        string[c] <<= 8;
        string[c] &= attr;
    }
    tmp += (y * 80) + x;
    memcpy(tmp, string, (temp * 2));
}

--------------------------------- Cut Here ----------------------------------

Also, I want to read/write the cursor position directly...how might that be
done?

Please help!!!

Thanks in advance, and please e-mail responses to gandalf@valnet.UUCP, I'll be
happy to post a summary of replys if there's any interest...

Gandalf (a.k.a. Andrew Davenport)
Technical Details
Message-ID: <J4gRy2w163w@valnet>
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!caen!news.cs.indiana.edu!valnet!gandalf

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!caen!news.cs.indiana.edu!valnet!gandalf
From: gandalf@valnet.UUCP (Andrew Davenport)
Newsgroups: comp.os.msdos.programmer
Subject: Direct output in C
Message-ID: <J4gRy2w163w@valnet>
Date: 13 Mar 91 18:55:42 GMT
Organization: Valley BBS Network
Lines: 38
Disclaimer: Author responsible for contents