Hi Everyone.

I started tweaking my 68K app with some ARM code and as a first example I
took BIG Pno test from CodeWarrior 9.3 update.
I see this example shows potential problem with Tungsten T/T3 devices and
there is a note that it solves them. However I can't find
in the code how was it accomplished.

The code worked fine on T3. Then I changed the code a bit to run not a small
inline routine but a huge Run() routine that has tons of
this inline funcs. The result was a fatal crash.

Can anyone please explain me that crash? I do not have it when I created the
same thing in 5.2 simulator.

This is a code from Big PNO test ARM part.  Palm part is fine.

Also I think it will be super if anyone can explain me how does this sample
solve code caching flush problems? (With volatile??)

Best regards,
                   Platon

inline void RunCore()
{
 // draw randomly-colored pixels on the screen
 for (Coord y = 16; y < 160; ++y)
 {
  for (Coord x = 0; x < 160; ++x)
  {
   RGBColorType RGB, prevRGB;
   RGB.index = 0;
   RGB.r = (UInt8)SysRandom(0);
   RGB.g = (UInt8)x;
   RGB.b = (UInt8)y;

   WinSetForeColorRGB(&RGB, &prevRGB);
   WinDrawPixel(x, y);
  }
 }
}

static unsigned long Run()
{
 RunCore(); RunCore(); RunCore(); RunCore(); RunCore();....
 ................. about 200 or 300 times
 return 0;
}

// ------------------------

unsigned long PNO_Main(
 const void *emulStateP,
 void *userData68KP,
 Call68KFuncType *call68KFuncP)
{
 InitPACEInterface(emulStateP, call68KFuncP);

 volatile int dontRun = 1; // I changed this to zero
 ^^^^^^^^^^^^^^^^^^

 if (!dontRun)
 {
  return Run();
 }
 else
 {
  RunCore();
  return errNone;
 }
}


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

Reply via email to