Skip to content
Permalink
Browse files

Temporary fix for #65.

It looks like that when we use the `Simple` output module, we get
weird errors when trying to load state for any game, most likely due to
memory corruption. AFAIK, it seems the frame buffer is not large enough
to render all components.

This issues does not appear when using OpenGL, or using the Simple with
any display filter available.
  • Loading branch information
denisfa authored and rkitover committed Jul 1, 2019
1 parent d585a61 commit c366907f64e04164c6db2184b04edbc614dc03b5
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/wx/panel.cpp
@@ -31,6 +31,7 @@ GameArea::GameArea()
, rewind_time(0)
, do_rewind(false)
, rewind_mem(0)
, num_rewind_states(0)
, loaded(IMAGE_UNKNOWN)
, basic_width(GBAWidth)
, basic_height(GBAHeight)
@@ -1860,6 +1861,7 @@ void DrawingPanelBase::DrawArea(uint8_t** data)
showSpeedTransparent);

free(buf);
buf = NULL;
} else
panel->osdtext.clear();
}
@@ -1978,9 +1980,11 @@ void DrawingPanelBase::OnSize(wxSizeEvent& ev)
DrawingPanelBase::~DrawingPanelBase()
{
// pixbuf1 freed by emulator
if (pixbuf2)
if (pixbuf1 != pixbuf2 && pixbuf2)
{
free(pixbuf2);

pixbuf2 = NULL;
}
InterframeCleanup();

if (nthreads) {
@@ -2004,7 +2008,7 @@ BasicDrawingPanel::BasicDrawingPanel(wxWindow* parent, int _width, int _height)
// 16 or 32, though
if (gopts.filter == FF_NONE && gopts.ifb == IFB_NONE)
// changing from 32 to 24 does not require regenerating color tables
systemColorDepth = 24;
systemColorDepth = 32;
if (!did_init) DrawingPanelInit();
}

0 comments on commit c366907

Please sign in to comment.
You can’t perform that action at this time.