mirror of https://github.com/stella-emu/stella.git
Fix TIA images saved in '1x' mode to not use TV effects (fixes #643).
This commit is contained in:
parent
148545bbf8
commit
a1d6d6ea41
|
@ -35,6 +35,9 @@
|
||||||
|
|
||||||
* Make NTSC custom phase shift not affect Yellow anymore.
|
* Make NTSC custom phase shift not affect Yellow anymore.
|
||||||
|
|
||||||
|
* Fixed '1x' snapshot mode; TV effects are now disabled. This mode
|
||||||
|
now generates a clean, pixel-exact image.
|
||||||
|
|
||||||
* A ROM properties file may now be placed next to the ROM (with the same
|
* A ROM properties file may now be placed next to the ROM (with the same
|
||||||
name as the ROM, except ending in .pro), and Stella will automatically
|
name as the ROM, except ending in .pro), and Stella will automatically
|
||||||
apply the properties to the ROM. [NOTE: this was present in 6.2, but
|
apply the properties to the ROM. [NOTE: this was present in 6.2, but
|
||||||
|
|
|
@ -179,7 +179,7 @@ void TiaOutputWidget::drawWidget(bool hilite)
|
||||||
bool visible = instance().console().tia().electronBeamPos(scanx, scany);
|
bool visible = instance().console().tia().electronBeamPos(scanx, scany);
|
||||||
scanoffset = width * scany + scanx;
|
scanoffset = width * scany + scanx;
|
||||||
uInt8* tiaOutputBuffer = instance().console().tia().outputBuffer();
|
uInt8* tiaOutputBuffer = instance().console().tia().outputBuffer();
|
||||||
TIASurface& tiaSurface(instance().frameBuffer().tiaSurface());
|
const TIASurface& tiaSurface = instance().frameBuffer().tiaSurface();
|
||||||
|
|
||||||
for(uInt32 y = 0, i = yStart * width; y < height; ++y)
|
for(uInt32 y = 0, i = yStart * width; y < height; ++y)
|
||||||
{
|
{
|
||||||
|
|
|
@ -148,32 +148,19 @@ const FBSurface& TIASurface::baseSurface(Common::Rect& rect) const
|
||||||
uInt32 tiaw = myTIA->width(), width = tiaw * 2, height = myTIA->height();
|
uInt32 tiaw = myTIA->width(), width = tiaw * 2, height = myTIA->height();
|
||||||
rect.setBounds(0, 0, width, height);
|
rect.setBounds(0, 0, width, height);
|
||||||
|
|
||||||
// Get Blargg buffer and width
|
|
||||||
uInt32 *blarggBuf, blarggPitch;
|
|
||||||
myTiaSurface->basePtr(blarggBuf, blarggPitch);
|
|
||||||
double blarggXFactor = double(blarggPitch) / width;
|
|
||||||
bool useBlargg = ntscEnabled();
|
|
||||||
|
|
||||||
// Fill the surface with pixels from the TIA, scaled 2x horizontally
|
// Fill the surface with pixels from the TIA, scaled 2x horizontally
|
||||||
uInt32 *buf_ptr, pitch;
|
uInt32 *buf_ptr, pitch;
|
||||||
myBaseTiaSurface->basePtr(buf_ptr, pitch);
|
myBaseTiaSurface->basePtr(buf_ptr, pitch);
|
||||||
|
|
||||||
for(uInt32 y = 0; y < height; ++y)
|
for(uInt32 y = 0; y < height; ++y)
|
||||||
{
|
|
||||||
for(uInt32 x = 0; x < width; ++x)
|
for(uInt32 x = 0; x < width; ++x)
|
||||||
{
|
|
||||||
if (useBlargg)
|
|
||||||
*buf_ptr++ = blarggBuf[y * blarggPitch + uInt32(nearbyint(x * blarggXFactor))];
|
|
||||||
else
|
|
||||||
*buf_ptr++ = myPalette[*(myTIA->frameBuffer() + y * tiaw + x / 2)];
|
*buf_ptr++ = myPalette[*(myTIA->frameBuffer() + y * tiaw + x / 2)];
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return *myBaseTiaSurface;
|
return *myBaseTiaSurface;
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
uInt32 TIASurface::mapIndexedPixel(uInt8 indexedColor, uInt8 shift)
|
uInt32 TIASurface::mapIndexedPixel(uInt8 indexedColor, uInt8 shift) const
|
||||||
{
|
{
|
||||||
return myPalette[indexedColor | shift];
|
return myPalette[indexedColor | shift];
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,14 +70,18 @@ class TIASurface
|
||||||
void setPalette(const PaletteArray& tia_palette, const PaletteArray& rgb_palette);
|
void setPalette(const PaletteArray& tia_palette, const PaletteArray& rgb_palette);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Get the TIA base surface for use in saving to a PNG image.
|
Get a TIA surface that has no post-processing whatsoever. This is
|
||||||
|
currently used to save PNG image in the so-called '1x mode'.
|
||||||
|
|
||||||
|
@param rect Specifies the area in which the surface data is valid
|
||||||
*/
|
*/
|
||||||
const FBSurface& baseSurface(Common::Rect& rect) const;
|
const FBSurface& baseSurface(Common::Rect& rect) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Use the palette to map a single indexed pixel color. This is used by the TIA output widget.
|
Use the palette to map a single indexed pixel color. This is used by the
|
||||||
|
TIA output widget.
|
||||||
*/
|
*/
|
||||||
uInt32 mapIndexedPixel(uInt8 indexedColor, uInt8 shift = 0);
|
uInt32 mapIndexedPixel(uInt8 indexedColor, uInt8 shift = 0) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Get the NTSCFilter object associated with the framebuffer
|
Get the NTSCFilter object associated with the framebuffer
|
||||||
|
@ -220,7 +224,7 @@ class TIASurface
|
||||||
bool mySaveSnapFlag{false};
|
bool mySaveSnapFlag{false};
|
||||||
|
|
||||||
// The palette handler
|
// The palette handler
|
||||||
unique_ptr<PaletteHandler>myPaletteHandler;
|
unique_ptr<PaletteHandler> myPaletteHandler;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
Loading…
Reference in New Issue