delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/11/11:45:26

From: Sinan_Unur AT mail DOT com (A. Sinan Unur)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: memset etc.
Date: 11 Aug 2000 15:41:14 GMT
Organization: Cornell University
Lines: 32
Sender: verified_for_usenet AT cornell DOT edu (asu1 on 128.253.251.163)
Message-ID: <8F8D7E2E1ASINANUNUR@132.236.56.8>
References: <8mu28b$202$1 AT nslave1 DOT tin DOT it>
NNTP-Posting-Host: 128.253.251.163
X-Trace: news01.cit.cornell.edu 966008474 7353 128.253.251.163 (11 Aug 2000 15:41:14 GMT)
X-Complaints-To: usenet AT news01 DOT cit DOT cornell DOT edu
NNTP-Posting-Date: 11 Aug 2000 15:41:14 GMT
User-Agent: Xnews/03.04.11
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

mpolve AT tin DOT it (ClaudioF) wrote in <8mu28b$202$1 AT nslave1 DOT tin DOT it>:

You might benefit from taking a look at simpld at 
http://www.unur.com/howto/c-examples.html. It demonstrates how to get into VGA 
mode 0x13, and use far pointers under djgpp to write your putpixel.

After you feel comfortable with that, however, I suggest you download Allegro.
...

>void PutPixel (int x, int y, char color)
> {
>  unsigned char *ScreenPointer;
>
>  ScreenPointer = (unsigned char *) 0x0a0000;
>  memset (ScreenPointer+(x + (y*320)), color, 1);              // 
>  Here's 
>the problem. I can't resolve it
> }

...

that is because, in protected mode, the screen resides in a different address 
space than the data segment of you program.

besides, it seems rather wasteful to use a block copy function to set a single 
address locations.

Sinan.
-- 
--------------------------------
A. Sinan Unur
http://www.unur.com/

- Raw text -


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