www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/28/06:39:11

Date: Thu, 28 May 1998 11:34:57 GMT
From: Junior System Administrator <pete AT restall DOT net>
Message-Id: <199805281134.LAA00308@restallnet.demon.co.uk>
To: djgpp AT delorie DOT com
Subject: Re: DJGPP and VGA Pointer ?

On Tue, 26 May 1998 21:29:07 GMT, Jose Hernandez did scribe:
> How can make a pointer to A000:0000 be made in DJGPP?  The only
> example I've seen that does this uses a macro not included with DJGPP,
> MK_FP().

Here's a DJGPP version of 'MK_FP()' (snatched from the FAQ :-):


-------------------->8 Cut here 8<--------------------
#include <sys/nearptr.h>
#include <crt0.h>


void *MK_FP(unsigned short seg, unsigned short off)
{
        if (!(_crt0_startup_flags & _CRT0_FLAG_NEARPTR))
                if (!__djgpp_nearptr_enable())
                        return((void *) 0);

        return((void *) (seg * 16 + off + __djgpp_conventional_base));
}
-------------------->8 Cut here 8<--------------------


Hope this helps,


	Pete =:-)




/*************** [burdock] ****************/
/* ____/|   pete AT restall DOT net              */
/* \ o.O|   http://www.restall.net/petes/ */
/*  =(_)=                                 */
/*    U     [FORGET THE ABOVE URL]        */
/******************************************/

/******************************* [Windoze 95] ********************************/
/* Windows 95: n.                                      (Author Unknown).     */
/*    32 bit extensions and a graphical shell for a 16 bit patch to an 8 bit */
/*    operating system originally coded for a 4 bit microprocessor, written  */
/*    by a 2 bit company that can't stand 1 bit of competition.              */
/*****************************************************************************/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019