www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/27/01:43:27

From: "quark(particle)" <quark AT webspan DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: 0xA0000000h
Date: 27 Jan 1997 01:58:21 GMT
Organization: WebSpan Inc., New Jersey
Lines: 32
Message-ID: <01bc0bf5$aca1a8e0$9c589ace@Pquark>
References: <199701260029 DOT TAA23377 AT delorie DOT com>
NNTP-Posting-Host: usr3-10.bay.ny.webspan.net
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

use it like this

#include<nearptr.h>

char *video_buffer=(char*)(0xA0000 + __djgpp_conventional_base);

video_buffer[(y<<8)+(y<<6)+x]=color;

(i think it goes like this, if i remember correctly)

DJ Delorie <dj AT delorie DOT com> wrote in article
<199701260029 DOT TAA23377 AT delorie DOT com>...
> 
> > char *video_buffer = (char *)0xA0000; // 0xA0000, because it uses
32-bit
> >     protected mode addresses (or something, I'm not quite sure :))
> > 
> > then somewhere in your code, call:
> > 
> > __djgpp_nearptr_enable(); // turns off memory protection, lets you use
> > near pointers.
> > 
> > than you simply do video_buffer[y*320+x]=color; like you're normal
> > putpixel.  
> 
> Nope.  This will definitely crash, because 0xa0000 points TO YOUR
> PROGRAM, not to video memory.
> 
> When using nearptr, you MUST remember to add in the nearptr offset,
> which is the negative of your segment's base address.  This is
> documented in the info files.
> 

- Raw text -


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