Mail Archives: djgpp/1996/05/22/17:56:01
I have a class called VirtualScreen that uses a BYTE Screen[200][320] array
(typedef unsigned char BYTE) and another class Lens that has an array BYTE
Buffer[32][32]. When I use VirtualScreen *VScreen = new VirtualScreen(); and
Lens *L = new Lens(); it places the Buffer array right in the middle of the
Screen array. I know this because I've filled Buffer with certain values, and
watched it on the screen when I flip Screen to the VGA screen. I use _djgpp_nearpointer_enable(), but not until after both of the 'new's. If I use BYTE
Buffer[64][64] or BYTE Buffer[128][128] it gives me a runtime error.
(General protection fault, I believe, or maybe page fault.). If I use BYTE
Buffer[256][256] it seems to run ok, but it is a waste of memory since I'm
only using 32*32 of the 256*256 values. Does anybody know what is going on
here? Any help would be greatly appreciated. Thanks.
_____ ___________
|\ \|\ \
_____ _____ | \ \ \ _____\
|\ \|\ \ \ \ \ \ \ |
| \ \ \ \ _____\ \ \ \______
\ \ \ \ \ |\ \ \ \
\ \ \ \ \ | \_____ \ \ _____\
_____\ \ \ \_____ \ | \ \ \ \ |
|\ \ \ \ \|______\ \ \ \___|
| \__________\ \_________\ |\ \ \ \
\ | | | | | \___________\ \____\
\|__________|\|_________| \ | | | |
\|___________|\|____|
- Raw text -