fdave
Final Dave
Okay think I may have figured out this GigaDrive hang....
It's got something weird to do with when the emu it running fast, like not much to draw on the screen. Shows up a lot in Ghouls 'N' Ghosts at the start of level 1. So I *think* it's to do with when the time gone is less than one frame...
This hangs:
Timer=Frames=0;
while (!quit)
{
int ticks=0,i=0;
now=Timer;
ticks=now-done; done=now;
if (ticks<1) continue; //test
if (ticks>10) ticks=10; // Limit frame-skipping
for (i=0; i<ticks-1; i++) quit|=InputFrame();
if (ticks>=1)
{
// Point to the top-left of the screen:
OutLine=(unsigned short *)DrawSurface[Flip].ptbuffer;
OutLine+=232;
PicoScan=EmulateScan;
quit|=InputFrame();
//GpSurfaceFlip(DrawSurface+Flip); Flip^=1;
Frames++;
}
PicoScan=NULL;
}
And this works (notice the difference in the way the done=now is only done if the time passed is >0).
Timer=Frames=0;
while (!quit)
{
int ticks=0,i=0;
now=Timer;
ticks=now-done;
if (ticks<1) continue; //test
if (ticks>10) ticks=10; // Limit frame-skipping
for (i=0; i<ticks-1; i++) quit|=InputFrame();
if (ticks>=1)
{
// Point to the top-left of the screen:
OutLine=(unsigned short *)DrawSurface[Flip].ptbuffer;
OutLine+=232;
PicoScan=EmulateScan;
quit|=InputFrame();
//GpSurfaceFlip(DrawSurface+Flip); Flip^=1;
Frames++;
}
PicoScan=NULL;
done=now;
}
Now can anyone think why? There is subtley there but I think in both it should work. Any ideas as to what I (originally) did wrong to cause these hangs is welcome! Either way, am going to do some extensive testing (i.e. playing my GP32 in the next few days to see if the GigaDrive hangs are *really* gone. It does look promising though...
It's got something weird to do with when the emu it running fast, like not much to draw on the screen. Shows up a lot in Ghouls 'N' Ghosts at the start of level 1. So I *think* it's to do with when the time gone is less than one frame...
This hangs:
Timer=Frames=0;
while (!quit)
{
int ticks=0,i=0;
now=Timer;
ticks=now-done; done=now;
if (ticks<1) continue; //test
if (ticks>10) ticks=10; // Limit frame-skipping
for (i=0; i<ticks-1; i++) quit|=InputFrame();
if (ticks>=1)
{
// Point to the top-left of the screen:
OutLine=(unsigned short *)DrawSurface[Flip].ptbuffer;
OutLine+=232;
PicoScan=EmulateScan;
quit|=InputFrame();
//GpSurfaceFlip(DrawSurface+Flip); Flip^=1;
Frames++;
}
PicoScan=NULL;
}
And this works (notice the difference in the way the done=now is only done if the time passed is >0).
Timer=Frames=0;
while (!quit)
{
int ticks=0,i=0;
now=Timer;
ticks=now-done;
if (ticks<1) continue; //test
if (ticks>10) ticks=10; // Limit frame-skipping
for (i=0; i<ticks-1; i++) quit|=InputFrame();
if (ticks>=1)
{
// Point to the top-left of the screen:
OutLine=(unsigned short *)DrawSurface[Flip].ptbuffer;
OutLine+=232;
PicoScan=EmulateScan;
quit|=InputFrame();
//GpSurfaceFlip(DrawSurface+Flip); Flip^=1;
Frames++;
}
PicoScan=NULL;
done=now;
}
Now can anyone think why? There is subtley there but I think in both it should work. Any ideas as to what I (originally) did wrong to cause these hangs is welcome! Either way, am going to do some extensive testing (i.e. playing my GP32 in the next few days to see if the GigaDrive hangs are *really* gone. It does look promising though...