[Fuse-for-macosx-commits] SF.net SVN: fuse-for-macosx:[778] trunk/fuse/fusepb/models
Brought to you by:
fredm
From: <fr...@us...> - 2014-07-25 13:03:21
|
Revision: 778 http://sourceforge.net/p/fuse-for-macosx/code/778 Author: fredm Date: 2014-07-25 13:03:15 +0000 (Fri, 25 Jul 2014) Log Message: ----------- Handle nested pauses when a paused emulator uses a modal dialog. Modified Paths: -------------- trunk/fuse/fusepb/models/Emulator.h trunk/fuse/fusepb/models/Emulator.m Modified: trunk/fuse/fusepb/models/Emulator.h =================================================================== --- trunk/fuse/fusepb/models/Emulator.h 2014-04-11 12:35:21 UTC (rev 777) +++ trunk/fuse/fusepb/models/Emulator.h 2014-07-25 13:03:15 UTC (rev 778) @@ -34,7 +34,7 @@ @interface Emulator : NSObject { - BOOL isEmulating; + int isPaused; NSTimer* timer; CFAbsoluteTime time; float timerInterval; Modified: trunk/fuse/fusepb/models/Emulator.m =================================================================== --- trunk/fuse/fusepb/models/Emulator.m 2014-04-11 12:35:21 UTC (rev 777) +++ trunk/fuse/fusepb/models/Emulator.m 2014-07-25 13:03:15 UTC (rev 778) @@ -122,7 +122,7 @@ timer = nil; timerInterval = 1.0f / 50.0f; - isEmulating = NO; + isPaused = 0; optDown = NO; ctrlDown = NO; @@ -255,21 +255,21 @@ -(void) pause { fuse_emulation_pause(); - if( isEmulating ) { - if( timer != nil ) { - [self stopEmulationTimer]; - } - isEmulating = NO; + + if( isPaused++ ) return; + + if( timer != nil ) { + [self stopEmulationTimer]; } } -(void) unpause { fuse_emulation_unpause(); - if( !isEmulating ) { - isEmulating = YES; - [self startEmulationTimer]; - } + + if( --isPaused ) return; + + [self startEmulationTimer]; } -(void) reset @@ -688,8 +688,6 @@ return divide_eject( unit ); } -@synthesize isEmulating; - -(void) startEmulationTimer { if( timer == nil ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |