From: Jeff Weeks Newsgroups: comp.os.msdos.djgpp Subject: optomizing cracks my code! Date: Fri, 25 Oct 1996 17:22:53 -0400 Organization: Code X software Lines: 27 Message-ID: <32712FAD.2F936030@mercury.execulink.com> NNTP-Posting-Host: ppp1.saturn.execulink.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp I've been working with some VESA 2.0 functions and I've gotten a putpixel function to use the protected mode interface but whenever I use the -O? switch the code no longer works! What's wrong. Here's a snippet of the code... // *** some relevent stuff *** void (*pm_bank)(char) = NULL; pm_bank = (void *)((char *)pm_info + pm_info->setWindow); // *** the putpixel fuction... *** long addr = (long)y * bytesperline + x; // int bank = addr >> 16; if(curbank != addr >> 16) { curbank = addr >> 16; pm_bank(addr >> 16); } _farpokeb(_dos_ds,0xA0000 + (addr & 0xFFFF), c); I tried a whole bunch of things with the code but nothing seems to work. What's happening is that the pm_bank function isn't being called when optomizations are on! Thanks, Jeff PS: Please reply via Email.