Mail Archives: djgpp/1997/04/30/22:18:58
From: | brett AT allegro DOT cs DOT tufts DOT edu (Brett J. Wiesner)
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | i can't memcpy to screen memory
|
Date: | 1 May 1997 00:14:31 GMT
|
Organization: | Tufts University
|
Message-ID: | <5k8n97$hu0$1@d2.tufts.edu>
|
NNTP-Posting-Host: | allegro.eecs.tufts.edu
|
Lines: | 15
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
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.
- Raw text -