🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: rec.games.programmer
Article #1072

Re: Buffer-> VGA Video Mem (again!)

#1072
From: morley
Date: Wed, 11 Nov 1992 00:12
38 lines
1895 bytes
In article <BxInLB.7CA@uxa.ecn.bgu.edu>, mucds@uxa.ecn.bgu.edu (Corey D. Stinson) writes:
>    I have posted this question in several different forms, unfortunely
> my question was rather complicated or unclear as I never got any
> answers which worked.  I posted some code I had written and received
> many helpful replies on a gramattical error I made but everyone seemed
> to overlook the question at hand.  I have two simple problems.
> 
>   I need to assign a pointer to the beginning of VGA (Mode 13h) video
> memory.  Then, I need two know how to correctly increment this
> pointer through the 0 - 64000 offset range of the VGA video buffer.
> I assume that the pointer will have to be of type char since I am
> loading byte-by-byte into video memory.  Please respond via email
> with any suggestions.  Thanx *much* in advance for any help!

A simple clear screen routine in Borland C...

void Clear( int color )
{
   unsigned  i = 64000;
   char far* VidMem = (char far*) 0xa0000000L;

   while( i-- )
      *VidMem++ = color;
}

A simple putpixel routine...

void PutPixel( int x, int y, int color )
{
   char far* VidMem = (char far*) 0xa0000000L;

   *(VidMem + x + y * 320) = color;
}

There... simple, eh?

MARK
morley@camins.camosun.bc.ca
Technical Details
Message-ID: <1992Nov10.161256.1@camins.camosun.bc.ca>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!sdd.hp.com!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!destroyer!cs.ubc.ca!news.UVic.CA!spang.Camosun.BC.CA!camins.camosun.bc.ca!morley
References: <BxInLB.7CA@uxa.ecn.bgu.edu>

Show Full Headers
Complete Article Headers
Newsgroups: rec.games.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!sdd.hp.com!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!destroyer!cs.ubc.ca!news.UVic.CA!spang.Camosun.BC.CA!camins.camosun.bc.ca!morley
From: morley@camins.camosun.bc.ca
Subject: Re: Buffer-> VGA Video Mem (again!)
Message-ID: <1992Nov10.161256.1@camins.camosun.bc.ca>
Lines: 39
Sender: news@spang.Camosun.BC.CA (Network News)
Nntp-Posting-Host: camins.camosun.bc.ca
Organization: Camosun College
References: <BxInLB.7CA@uxa.ecn.bgu.edu>
Date: Wed, 11 Nov 1992 00:12:56 GMT