GBA: Fix hang when loading a savestate if sync to video is enabled
Jeffrey Pfau jeffrey@endrift.com
Wed, 22 Apr 2015 20:41:54 -0700
4 files changed,
13 insertions(+),
1 deletions(-)
M
CHANGES
→
CHANGES
@@ -33,6 +33,7 @@ - GBA Memory: Improve Thumb open bus behavior
- GBA Memory: Fix 32-bit loads from unaddress cartridge space - Qt: Fix multiplayer windows opening as the wrong size - Qt: Fix controllers sometimes not loading the right profile + - GBA: Fix hang when loading a savestate if sync to video is enabled Misc: - Qt: Show multiplayer numbers in window title - Qt: Handle saving input settings better
M
src/gba/serialize.c
→
src/gba/serialize.c
@@ -178,7 +178,7 @@ PNGReadPixels(png, info, pixels, VIDEO_HORIZONTAL_PIXELS, VIDEO_VERTICAL_PIXELS, VIDEO_HORIZONTAL_PIXELS);
PNGReadFooter(png, end); PNGReadClose(png, info, end); gba->video.renderer->putPixels(gba->video.renderer, VIDEO_HORIZONTAL_PIXELS, pixels); - GBASyncPostFrame(gba->sync); + GBASyncForceFrame(gba->sync); free(pixels); return true;
M
src/gba/supervisor/thread.c
→
src/gba/supervisor/thread.c
@@ -712,6 +712,16 @@ }
MutexUnlock(&sync->videoFrameMutex); } +void GBASyncForceFrame(struct GBASync* sync) { + if (!sync) { + return; + } + + MutexLock(&sync->videoFrameMutex); + ConditionWake(&sync->videoFrameAvailableCond); + MutexUnlock(&sync->videoFrameMutex); +} + bool GBASyncWaitFrameStart(struct GBASync* sync, int frameskip) { if (!sync) { return true;
M
src/gba/supervisor/thread.h
→
src/gba/supervisor/thread.h
@@ -138,6 +138,7 @@ void GBAThreadTakeScreenshot(struct GBAThread* threadContext);
#endif void GBASyncPostFrame(struct GBASync* sync); +void GBASyncForceFrame(struct GBASync* sync); bool GBASyncWaitFrameStart(struct GBASync* sync, int frameskip); void GBASyncWaitFrameEnd(struct GBASync* sync); bool GBASyncDrawingFrame(struct GBASync* sync);