Mail Archives: djgpp/1995/12/19/17:24:23
Xref: | news-dnh.mv.net comp.os.msdos.djgpp:3932
|
Path: | news-dnh.mv.net!mv!news.sprintlink.net!micro.internexus.net!micro.internexus.net!master
|
From: | master AT micro DOT internexus DOT net (Laszlo Vecsey)
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Pointer to video memory (0xA000)
|
Date: | 18 Dec 1995 20:31:19 GMT
|
Organization: | The Internet Nexus
|
Lines: | 26
|
Message-ID: | <4b4j2n$9mf@micro.internexus.net>
|
NNTP-Posting-Host: | micro.internexus.net
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Help! I get a general protection fault when accessing a pointer to video memory.
In Borland C++ I'm used to putting pixels to the screen as follows:
unsigned char far *videomemory = (unsigned char far*)(0xA0000000);
videomemory[320*y+x] = color;
I've found the following code in DJGPP to invoke VGA 320x200x256 just fine:
asm("movl $0x13, %eax
int $0x10
");
Unfortunately, DJGPP complains about the far keyword so I had to remove
it in order to get my program to compile. When I run the program i get a
general protection fault!
Any help would be appreciated..
--
/--------------------------------------------------------/-\
| The Internet Nexus - http://www.internexus.net/~master/ |
| --> Master? Master Lester? Master of what!? <-- / / -|
| finger master AT internexus DOT net | pgp -fka / \ \ / |
\__/---[ 3, 24, 50, 96, 496, 8128... ]---[ Les is More ]-\-/
- Raw text -