🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Finding the MCGA in Quick C 2.01

#1909
From: Julian Cowley
Date: Fri, 17 Aug 1990 04:51
29 lines
1390 bytes
I've just come over from comp.lang.c where this request drew a
blank expression from the members of the newsgroup.  What I'm
trying to do is access the MCGA screen at A000:0000.  Here was
my first attempt:

PutPixel (int x, int y, unsigned char c)
{
  unsigned char far *mem;

  FP_SEG (mem) = 0xa000;
  FP_OFF (mem) = 320 * y + x;

  *mem = c;		/* <-- this line gives a run-time error */
}

The commented line caused run-time error R6013: illegal far
pointer use.  (Unfortunately, I do not have the manuals to look
up the cause, even though this is a legitimate copy of Quick
C.)  The help page for the FP_* macros says that the macros
won't work under certain conditions in small and medium models,
but this happens in large model also.

So my question boils down to this: what is the cleanest way of
accessing an absolute address such as 0xa0000 in Quick C?

julian cowley
university of hawaii at manoa
julian@uhccux.uhcc.hawaii.edu
julian@uhccux.bitnet
Technical Details
Message-ID: <9042@uhccux.uhcc.Hawaii.Edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!snorkelwacker!bu.edu!xylogics!samsung!munnari.oz.au!uhccux!julian

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!snorkelwacker!bu.edu!xylogics!samsung!munnari.oz.au!uhccux!julian
From: julian@uhccux.uhcc.Hawaii.Edu (Julian Cowley)
Newsgroups: comp.os.msdos.programmer
Subject: Finding the MCGA in Quick C 2.01
Message-ID: <9042@uhccux.uhcc.Hawaii.Edu>
Date: 17 Aug 90 04:51:57 GMT
Organization: University of Hawaii at Manoa
Lines: 29