(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/

Reply via email to