Fixed graphical corrution when saving snapshots in 1x mode

- Phosphor is now also disabled in this mode
This commit is contained in:
Stephen Anthony 2017-09-17 16:46:56 -02:30
parent 1d01b39f87
commit f442fae890
2 changed files with 7 additions and 18 deletions

View File

@ -35,6 +35,9 @@
information). In the case of 'saveses', the filename is now named information). In the case of 'saveses', the filename is now named
based on the date and time of when the command was entered. based on the date and time of when the command was entered.
* Fixed bug with saving snapshots in 'filtering disabled' mode; there
was graphical corruption in some cases.
* Added debugger pseudo-register '_fcycles', which gives the number of * Added debugger pseudo-register '_fcycles', which gives the number of
CPU cycles that have occurred since the frame started. CPU cycles that have occurred since the frame started.

View File

@ -122,8 +122,9 @@ const FBSurface& TIASurface::baseSurface(GUI::Rect& rect) const
{ {
for(uInt32 x = 0; x < tiaw; ++x) for(uInt32 x = 0; x < tiaw; ++x)
{ {
*buf_ptr++ = myFB.tiaSurface().pixel(y*tiaw + x); uInt32 pixel = myPalette[*(myTIA->frameBuffer() + y*tiaw + x)];
*buf_ptr++ = myFB.tiaSurface().pixel(y*tiaw + x); *buf_ptr++ = pixel;
*buf_ptr++ = pixel;
} }
} }
@ -133,22 +134,7 @@ const FBSurface& TIASurface::baseSurface(GUI::Rect& rect) const
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 TIASurface::pixel(uInt32 idx, uInt8 shift) uInt32 TIASurface::pixel(uInt32 idx, uInt8 shift)
{ {
uInt8 c = *(myTIA->frameBuffer() + idx) | shift; return myPalette[*(myTIA->frameBuffer() + idx) | shift];
if(!myUsePhosphor)
return myPalette[c];
else
{
const uInt32 p = myRGBFramebuffer[idx];
// Mix current calculated frame with previous displayed frame
const uInt32 retVal = getRGBPhosphor(myPalette[c], p);
// Store back into displayed frame buffer (for next frame)
myRGBFramebuffer[idx] = retVal;
return retVal;
}
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -