Xref: news2.mv.net comp.os.msdos.djgpp:4149 From: jlouwere AT galaxy DOT csc DOT calpoly DOT edu (Jan Louwerens) Newsgroups: comp.os.msdos.djgpp Subject: What's wrong with this? Date: 22 May 1996 19:12:51 GMT Organization: Cal Poly Computer Science Dept. Lines: 25 Message-ID: <4nvovj$42q@waldorf.csc.calpoly.edu> NNTP-Posting-User: jlouwere AT galaxy DOT csc DOT calpoly DOT edu To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp 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. _____ ___________ |\ \|\ \ _____ _____ | \ \ \ _____\ |\ \|\ \ \ \ \ \ \ | | \ \ \ \ _____\ \ \ \______ \ \ \ \ \ |\ \ \ \ \ \ \ \ \ | \_____ \ \ _____\ _____\ \ \ \_____ \ | \ \ \ \ | |\ \ \ \ \|______\ \ \ \___| | \__________\ \_________\ |\ \ \ \ \ | | | | | \___________\ \____\ \|__________|\|_________| \ | | | | \|___________|\|____|