Mail Archives: djgpp/1997/05/02/13:01:16
From: | Michael Goffioul <goffioul AT emic DOT ucl DOT ac DOT be>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: i can't memcpy to screen memory
|
Date: | Fri, 02 May 1997 10:54:41 +0200
|
Organization: | EMIC - UCL
|
Lines: | 35
|
Message-ID: | <3369ABD1.707C@emic.ucl.ac.be>
|
References: | <5k8n97$hu0$1 AT d2 DOT tufts DOT edu>
|
NNTP-Posting-Host: | ns2.emic.ucl.ac.be
|
Mime-Version: | 1.0
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Brett J. Wiesner wrote:
>
> i'm trying to write a vga lib, but i've reached a big blockade.
> i can't seem to address the screen memory.
> i use a pointer to the memory address of the screen like so:
> unsigned char *SCREEN = (unsigned char*) 0xa0000;
> is this correct? i belive it is.
> then i set up a "page" to write pixels to like this:
> paper = (unsigned char*) malloc(320 * 200);
> and then i try to memcpy paper to the screen like this:
> memcpy(SCREEN, paper, 320 * 200);
> the memcpy line crashes and throws me back into windows with an illegal
> operation at 00A7:1CB8
> it might be that screen memory isn't located at 0xa0000. i read somewhere
> that it was though.
> please help, if you can.
The screen memory is well at the 0xa0000 address but Djgpp is working in
protected mode. This means that you may not access directly the video
memory with the address 0xa0000 and the simple function memcopy.
For informations, check the following address
http://www.execulink.com/~pweeks/chapter.html at the section 'Vga mode
13h'
--
Michael Goffioul
EMIC - UCL
Batiment Maxwell
Place du Levant, 3
B-1348 Louvain-la-Neuve
Belgium
Tel.: +32 10 47 23 15
Fax.: +32 10 47 87 05
- Raw text -