all repos — mgba @ 242dc5067b2b06ed5197781971dec12661eec7aa

mGBA Game Boy Advance Emulator

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
commit

242dc5067b2b06ed5197781971dec12661eec7aa

parent

255242a66515aaef88e5b6c07cc866cdd32214c7

4 files changed, 13 insertions(+), 1 deletions(-)

jump to
M CHANGESCHANGES

@@ -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.csrc/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.csrc/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.hsrc/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);