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

From: jonklipp AT freenet DOT edmonton DOT ab DOT ca ()
Newsgroups: comp.os.msdos.djgpp
Subject: Re: 0xA0000000h
Date: 25 Jan 1997 21:25:46 GMT
Organization: Edmonton FreeNet, Edmonton, Alberta, Canada
Lines: 36
Message-ID: <5cdtoq$li6$1@news.sas.ab.ca>
References: <01bc0a29$44be7280$b27a388f AT JNTF DOT jntf DOT osd DOT mil>
NNTP-Posting-Host: fn2.freenet.edmonton.ab.ca
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Russ Hubbard (hubbardr AT jntf DOT osd DOT mil) wrote:
: How would I create an array for video memory in djgpp? 
: Currently I have:

: char far *video_buffer = (char far)0xA0000000L;

This is off the top of my head, but it should something like this:

#include <go32.h>
#include <dpmi.h>

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.  

At the end of your program, call __djgpp_nearptr_disable(); and it should
turn back on memory protection and disable nearptrs. 

Anyway, check the FAQ on this, it has a section on access video memory, I
might be wrong on some things, and I MIGHT have the nearptr_disable and
enable calls mixed up :)

later,
jon

--
jon klippenstein internet:  klip AT cryogen DOT com
                 uucp:      alberta!ve6kik!dparrot!{root,klip}
                 ham radio: ve6klp

- Raw text -


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