> Clicking on Debug leads me to: "PrvConvertDepth1To2BW"

There was a bug in that function that would have it fall off the end of a buffer
under certain circumstances. I attempted to code around it (that is, not display
an error message) when it was detected. However, I was under the impression that
that bug was only in Palm OS 3.3.

If it's also in Palm OS 3.1, you need to change the following Poser function (in
TrapPatches.h) from:

   static Bool HasConvertDepth1To2BWBug(void)
      { return OSMajorMinorVersion () == 33; }

to:

   static Bool HasConvertDepth1To2BWBug(void)
      { return OSMajorMinorVersion () <= 33; }

-- Keith Rollin
-- Palm OS Emulator engineer






"Prashant Verma" <[EMAIL PROTECTED]> on 08/08/2000 03:29:12 PM

Please respond to "Palm Developer Forum" <[EMAIL PROTECTED]>

Sent by:  "Prashant Verma" <[EMAIL PROTECTED]>


To:   "Palm Developer Forum" <[EMAIL PROTECTED]>
cc:    (Keith Rollin/US/PALM)
Subject:  RE: Misaligned BitBlt? - More Interesting facts



Hmmm. I should have debugged some more before posting...
Now, Poser does show the dialgo box("....Memory manager data
structures..."). Clicking on Debug leads me to:
"PrvConvertDepth1To2BW"<-"PrvMisAlignedForwardInnerBitBlt"<-"ScrCopyRectangl
e"<-"WinCopyRectangle"
Will get into the poser code now, and see if I can get more info on the
likely cause of this problem.

-Prashant

-----Original Message-----
From: [EMAIL PROTECTED]

> Now, if I change the drawoperation to "winInvert" from "winPaint" in the
> WinCopyRectangle() call, I'm able to do some more blits (ie do some amount
> of scrolling)

This part makes sense.  The code I was looking at was specifically for doing
a
copy (i.e., winPaint operation) from a 1-bit buffer to a 2-bit buffer.

> before poser gives up, and hangs silently this time, without
> any message.

This part I can't help you with.  There's simply not enough information.
And
I'm not familiar with any situations where Poser will just give up silently
while drawing.

-- Keith Rollin
-- Palm OS Emulator engineer






"Prashant Verma" <[EMAIL PROTECTED]> on 08/08/2000 02:57:32 PM

Please respond to "Palm Developer Forum" <[EMAIL PROTECTED]>

Sent by:  "Prashant Verma" <[EMAIL PROTECTED]>


To:   "Palm Developer Forum" <[EMAIL PROTECTED]>
cc:    (Keith Rollin/US/PALM)
Subject:  RE: Misaligned BitBlt? - More Interesting facts



(Interesting to me at least :-)  )
OK, so I think something's wrong with my blits. I'll try rebuilding poser as
you have suggested.
This set of code which has the error is my scrolling code. Based on stylus
movements on the display, I bitblt a rectangle from my offscreen window to
the main display.
Here's the code:
ShowRectToDisplayWindow(RectangleType* rect, Int16 x, Int16 y)
{
     WinHandle disp = WinGetDisplayWindow();
     WinHandle orig = WinSetDrawWindow(disp);


     WinCopyRectangle(wHand, disp, &rect,
                          x, y,
                          winPaint);
     // Restore Draw Window
     WinSetDrawWindow(orig);
}

This crashes in the first blit itself (copying the top, left rect from
offscreen to the display).
Now, if I change the drawoperation to "winInvert" from "winPaint" in the
WinCopyRectangle() call, I'm able to do some more blits (ie do some amount
of scrolling) before poser gives up, and hangs silently this time, without
any message.

-Prashant

-----Original Message-----
From: [EMAIL PROTECTED]

PrvMisAlignedForwardInnerBitBlt is a particularly tricky function (along
with
PrvMisAlignedBackwardInnerBitBlt). It has this habit of walking off the end
or
beginning of an allocated buffer while copying pixels from one place to
another.
As it turns out, it does so in a fairly safe fashion, and so Poser's
heuristics
for determining naughty behaviour report an error when there really is none.

Poser *does* check for characteristic memory accesses from those two
functions
and inhibits error messages when it looks like they're OK. However, Poser's
check is very narrow; it allows only for 16-byte reads (see line 1033 or so
of
Poser's MetaMemory.cpp source file). It's possible that you've found a
similar
case involving 8-bit reads. Looking at the Palm OS 3.1 source code, I can
see
that this might be the case.

If you want, you can rebuild Poser to allow for this possibility. Find the
lines
in MetaMemory.cpp:

          if (Patches::HasBlitBugs () &&
               info.result == Errors::kMemMgrAccess &&
               info.forRead &&
               info.size == sizeof (UInt16) &&
               (::InPrvCompressedInnerBitBlt () ||
                ::InPrvMisAlignedForwardInnerBitBlt () ||
                ::InPrvMisAlignedBackwardInnerBitBlt ()))
          {
               goto HideBug;
          }

And do something appropriate with that "info.size == sizeof (UInt16)" part,
like
 getting rid of it.

-- Keith Rollin
-- Palm OS Emulator engineer






--
For information on using the Palm Developer Forums, or to unsubscribe,
please
see http://www.palmos.com/dev/tech/support/forums/





--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/


--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/tech/support/forums/





-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to