delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/25/19:41:45

Date: Sat, 25 Jan 1997 19:29:44 -0500
Message-Id: <199701260029.TAA23377@delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: jonklipp AT freenet DOT edmonton DOT ab DOT ca
CC: djgpp AT delorie DOT com
In-reply-to: <5cdtoq$li6$1@news.sas.ab.ca> (jonklipp@freenet.edmonton.ab.ca)
Subject: Re: 0xA0000000h

> 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