www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/10/26/00:52:47

From: Jeff Weeks <pweeks AT mercury DOT execulink DOT com>
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
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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019