[Fuse-for-macosx-commits] SF.net SVN: fuse-for-macosx:[594] trunk/fuse/fusepb
Brought to you by:
fredm
From: <fr...@us...> - 2009-02-04 12:14:20
|
Revision: 594 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=594&view=rev Author: fredm Date: 2009-02-04 11:40:57 +0000 (Wed, 04 Feb 2009) Log Message: ----------- Add pause menu option. Modified Paths: -------------- trunk/fuse/fusepb/controllers/FuseController.h trunk/fuse/fusepb/controllers/FuseController.m trunk/fuse/fusepb/nibs/MainMenu.nib/classes.nib trunk/fuse/fusepb/nibs/MainMenu.nib/info.nib trunk/fuse/fusepb/nibs/MainMenu.nib/keyedobjects.nib Modified: trunk/fuse/fusepb/controllers/FuseController.h =================================================================== --- trunk/fuse/fusepb/controllers/FuseController.h 2009-01-18 01:44:51 UTC (rev 593) +++ trunk/fuse/fusepb/controllers/FuseController.h 2009-02-04 11:40:57 UTC (rev 594) @@ -66,6 +66,7 @@ IBOutlet NSMenuItem *simple8Bit; IBOutlet NSMenuItem *zxatasp; IBOutlet NSMenuItem *zxcf; + IBOutlet NSMenuItem *pause; IBOutlet NSMenuItem *tapePlay; IBOutlet NSMenuItem *tapeRecord; IBOutlet NSMenu *recentSnaps; @@ -115,6 +116,7 @@ - (IBAction)nmi:(id)sender; - (IBAction)open:(id)sender; - (IBAction)open_screen:(id)sender; +- (IBAction)pause:(id)sender; - (IBAction)profiler_start:(id)sender; - (IBAction)profiler_stop:(id)sender; - (IBAction)psg_start:(id)sender; @@ -226,6 +228,7 @@ - (void)setDiskState:(NSNumber*)state; - (void)setTapeState:(NSNumber*)state; - (void)setMdrState:(NSNumber*)state; +- (void)setPauseState; - (void)showAlertPanel:(NSString*)message; - (void)showCriticalAlertPanel:(NSString*)message; Modified: trunk/fuse/fusepb/controllers/FuseController.m =================================================================== --- trunk/fuse/fusepb/controllers/FuseController.m 2009-01-18 01:44:51 UTC (rev 593) +++ trunk/fuse/fusepb/controllers/FuseController.m 2009-02-04 11:40:57 UTC (rev 594) @@ -30,6 +30,7 @@ #include <string.h> #include <ctype.h> +#import "DebuggerController.h" #import "FuseController.h" #import "KeyboardController.h" #import "LoadBinaryController.h" @@ -42,6 +43,7 @@ #import "DisplayOpenGLView.h" +#include "debugger/debugger.h" #include "event.h" #include "fuse.h" #include "if1.h" @@ -52,6 +54,7 @@ #include "settings_cocoa.h" #include "snapshot.h" #include "tape.h" +#include "timer.h" #include "ui.h" #include "uidisplay.h" #include "utils.h" @@ -99,6 +102,9 @@ static int profileStop = 0; static int playTape = 1; +/* True if we were paused via the Machine/Pause menu item */ +static int paused = 0; + static NSMutableArray *allFileTypes = nil; static NSMutableArray *dckFileTypes = nil; static NSMutableArray *ideFileTypes = nil; @@ -670,6 +676,31 @@ [[DisplayOpenGLView instance] unpause]; } +- (IBAction)pause:(id)sender +{ + int error; + + if( paused ) { + paused = 0; + ui_statusbar_update( UI_STATUSBAR_ITEM_PAUSED, + UI_STATUSBAR_STATE_INACTIVE ); + timer_estimate_reset(); + [[DisplayOpenGLView instance] unpause]; + } else { + [[DisplayOpenGLView instance] pause]; + + /* Stop recording any competition mode RZX file */ + if( rzx_recording && rzx_competition_mode ) { + ui_error( UI_ERROR_INFO, "Stopping competition mode RZX recording" ); + error = rzx_stop_recording(); if( error ) return; + } + + paused = 1; + ui_statusbar_update( UI_STATUSBAR_ITEM_PAUSED, UI_STATUSBAR_STATE_ACTIVE ); + } + [self setPauseState]; +} + - (IBAction)profiler_start:(id)sender { [[DisplayOpenGLView instance] profileStart]; @@ -821,7 +852,14 @@ - (IBAction)cocoa_break:(id)sender { - [[DisplayOpenGLView instance] cocoaBreak]; + if ( paused ) { + debugger_mode = DEBUGGER_MODE_HALTED; + paused = 0; + [[DebuggerController singleton] debugger_activate:nil]; + } else { + [[DisplayOpenGLView instance] cocoaBreak]; + } + [self setPauseState]; } - (IBAction)showRollbackPane:(id)sender @@ -1644,6 +1682,11 @@ { } +- (void)setPauseState +{ + [pause setTitle:paused ? @"Resume" : @"Pause"]; +} + - (void)showAlertPanel:(NSString*)message { NSRunAlertPanel(@"Fuse - Info", message, nil, nil, nil); Modified: trunk/fuse/fusepb/nibs/MainMenu.nib/classes.nib =================================================================== --- trunk/fuse/fusepb/nibs/MainMenu.nib/classes.nib 2009-01-18 01:44:51 UTC (rev 593) +++ trunk/fuse/fusepb/nibs/MainMenu.nib/classes.nib 2009-02-04 11:40:57 UTC (rev 594) @@ -1,125 +1,246 @@ -{ - IBClasses = ( - { - ACTIONS = { - fullscreen = id; - zoom = id; - }; - CLASS = DisplayOpenGLView; - LANGUAGE = ObjC; - SUPERCLASS = NSOpenGLView; - }, - { - CLASS = FirstResponder; - LANGUAGE = ObjC; - SUPERCLASS = NSObject; - }, - { - ACTIONS = { - "cocoa_break" = id; - "disk_eject_a" = id; - "disk_eject_b" = id; - "disk_eject_write_a" = id; - "disk_eject_write_b" = id; - "disk_new_a" = id; - "disk_new_b" = id; - "disk_open_a" = id; - "disk_open_b" = id; - "disk_write_protect_a" = id; - "disk_write_protect_b" = id; - "dock_eject" = id; - "dock_open" = id; - "export_screen" = id; - fullscreen = id; - "hard_reset" = id; - help = id; - hide = id; - "ide_commit" = id; - "ide_eject" = id; - "ide_insert" = id; - "if2_eject" = id; - "if2_open" = id; - "joystick_keyboard" = id; - "mdr_eject" = id; - "mdr_eject_write" = id; - "mdr_insert" = id; - "mdr_insert_new" = id; - "mdr_writep" = id; - nmi = id; - open = id; - openRecent = id; - "open_screen" = id; - "profiler_start" = id; - "profiler_stop" = id; - "psg_start" = id; - "psg_stop" = id; - quit = id; - reset = id; - resetUserDefaults = id; - "rzx_insert_snap" = id; - "rzx_play" = id; - "rzx_rollback" = id; - "rzx_start" = id; - "rzx_start_snap" = id; - "rzx_stop" = id; - saveFileTypeClicked = id; - "save_as" = id; - "save_options" = id; - "save_screen" = id; - showKeyboardPane = id; - showLoadBinaryPane = id; - showMemoryBrowserPane = id; - showPokeFinderPane = id; - showPreferencesPane = id; - showRollbackPane = id; - showSaveBinaryPane = id; - showTapeBrowserPane = id; - "tape_clear" = id; - "tape_open" = id; - "tape_play" = id; - "tape_record" = id; - "tape_rewind" = id; - "tape_write" = id; - }; - CLASS = FuseController; - LANGUAGE = ObjC; - OUTLETS = { - cart = NSMenuItem; - disk = NSMenuItem; - diskPlus3 = NSMenuItem; - diskPlus3WpA = NSMenuItem; - diskPlus3WpB = NSMenuItem; - diskPlusD = NSMenuItem; - diskPlusDWpA = NSMenuItem; - diskPlusDWpB = NSMenuItem; - diskTrDos = NSMenuItem; - diskTrDosWpA = NSMenuItem; - diskTrDosWpB = NSMenuItem; - divide = NSMenuItem; - dock = NSMenuItem; - ide = NSMenuItem; - if1 = NSMenuItem; - if1Wp1 = NSMenuItem; - if1Wp2 = NSMenuItem; - if1Wp3 = NSMenuItem; - if1Wp4 = NSMenuItem; - if1Wp5 = NSMenuItem; - if1Wp6 = NSMenuItem; - if1Wp7 = NSMenuItem; - if1Wp8 = NSMenuItem; - if2 = NSMenuItem; - recentSnaps = NSMenu; - saveFileType = NSPopUpButton; - savePanelAccessoryView = id; - simple8Bit = NSMenuItem; - tapePlay = NSMenuItem; - tapeRecord = NSMenuItem; - window = NSWindow; - zxatasp = NSMenuItem; - zxcf = NSMenuItem; - }; - SUPERCLASS = NSObject; - } - ); - IBVersion = 1; -} \ No newline at end of file +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>IBClasses</key> + <array> + <dict> + <key>ACTIONS</key> + <dict> + <key>fullscreen</key> + <string>id</string> + <key>zoom</key> + <string>id</string> + </dict> + <key>CLASS</key> + <string>DisplayOpenGLView</string> + <key>LANGUAGE</key> + <string>ObjC</string> + <key>SUPERCLASS</key> + <string>NSOpenGLView</string> + </dict> + <dict> + <key>CLASS</key> + <string>FirstResponder</string> + <key>LANGUAGE</key> + <string>ObjC</string> + <key>SUPERCLASS</key> + <string>NSObject</string> + </dict> + <dict> + <key>ACTIONS</key> + <dict> + <key>cocoa_break</key> + <string>id</string> + <key>disk_eject_a</key> + <string>id</string> + <key>disk_eject_b</key> + <string>id</string> + <key>disk_eject_write_a</key> + <string>id</string> + <key>disk_eject_write_b</key> + <string>id</string> + <key>disk_new_a</key> + <string>id</string> + <key>disk_new_b</key> + <string>id</string> + <key>disk_open_a</key> + <string>id</string> + <key>disk_open_b</key> + <string>id</string> + <key>disk_write_protect_a</key> + <string>id</string> + <key>disk_write_protect_b</key> + <string>id</string> + <key>dock_eject</key> + <string>id</string> + <key>dock_open</key> + <string>id</string> + <key>export_screen</key> + <string>id</string> + <key>fullscreen</key> + <string>id</string> + <key>hard_reset</key> + <string>id</string> + <key>help</key> + <string>id</string> + <key>hide</key> + <string>id</string> + <key>ide_commit</key> + <string>id</string> + <key>ide_eject</key> + <string>id</string> + <key>ide_insert</key> + <string>id</string> + <key>if2_eject</key> + <string>id</string> + <key>if2_open</key> + <string>id</string> + <key>joystick_keyboard</key> + <string>id</string> + <key>mdr_eject</key> + <string>id</string> + <key>mdr_eject_write</key> + <string>id</string> + <key>mdr_insert</key> + <string>id</string> + <key>mdr_insert_new</key> + <string>id</string> + <key>mdr_writep</key> + <string>id</string> + <key>nmi</key> + <string>id</string> + <key>open</key> + <string>id</string> + <key>openRecent</key> + <string>id</string> + <key>open_screen</key> + <string>id</string> + <key>pause</key> + <string>id</string> + <key>profiler_start</key> + <string>id</string> + <key>profiler_stop</key> + <string>id</string> + <key>psg_start</key> + <string>id</string> + <key>psg_stop</key> + <string>id</string> + <key>quit</key> + <string>id</string> + <key>reset</key> + <string>id</string> + <key>resetUserDefaults</key> + <string>id</string> + <key>rzx_insert_snap</key> + <string>id</string> + <key>rzx_play</key> + <string>id</string> + <key>rzx_rollback</key> + <string>id</string> + <key>rzx_start</key> + <string>id</string> + <key>rzx_start_snap</key> + <string>id</string> + <key>rzx_stop</key> + <string>id</string> + <key>saveFileTypeClicked</key> + <string>id</string> + <key>save_as</key> + <string>id</string> + <key>save_options</key> + <string>id</string> + <key>save_screen</key> + <string>id</string> + <key>showKeyboardPane</key> + <string>id</string> + <key>showLoadBinaryPane</key> + <string>id</string> + <key>showMemoryBrowserPane</key> + <string>id</string> + <key>showPokeFinderPane</key> + <string>id</string> + <key>showPreferencesPane</key> + <string>id</string> + <key>showRollbackPane</key> + <string>id</string> + <key>showSaveBinaryPane</key> + <string>id</string> + <key>showTapeBrowserPane</key> + <string>id</string> + <key>tape_clear</key> + <string>id</string> + <key>tape_open</key> + <string>id</string> + <key>tape_play</key> + <string>id</string> + <key>tape_record</key> + <string>id</string> + <key>tape_rewind</key> + <string>id</string> + <key>tape_write</key> + <string>id</string> + </dict> + <key>CLASS</key> + <string>FuseController</string> + <key>LANGUAGE</key> + <string>ObjC</string> + <key>OUTLETS</key> + <dict> + <key>cart</key> + <string>NSMenuItem</string> + <key>disk</key> + <string>NSMenuItem</string> + <key>diskPlus3</key> + <string>NSMenuItem</string> + <key>diskPlus3WpA</key> + <string>NSMenuItem</string> + <key>diskPlus3WpB</key> + <string>NSMenuItem</string> + <key>diskPlusD</key> + <string>NSMenuItem</string> + <key>diskPlusDWpA</key> + <string>NSMenuItem</string> + <key>diskPlusDWpB</key> + <string>NSMenuItem</string> + <key>diskTrDos</key> + <string>NSMenuItem</string> + <key>diskTrDosWpA</key> + <string>NSMenuItem</string> + <key>diskTrDosWpB</key> + <string>NSMenuItem</string> + <key>divide</key> + <string>NSMenuItem</string> + <key>dock</key> + <string>NSMenuItem</string> + <key>ide</key> + <string>NSMenuItem</string> + <key>if1</key> + <string>NSMenuItem</string> + <key>if1Wp1</key> + <string>NSMenuItem</string> + <key>if1Wp2</key> + <string>NSMenuItem</string> + <key>if1Wp3</key> + <string>NSMenuItem</string> + <key>if1Wp4</key> + <string>NSMenuItem</string> + <key>if1Wp5</key> + <string>NSMenuItem</string> + <key>if1Wp6</key> + <string>NSMenuItem</string> + <key>if1Wp7</key> + <string>NSMenuItem</string> + <key>if1Wp8</key> + <string>NSMenuItem</string> + <key>if2</key> + <string>NSMenuItem</string> + <key>pause</key> + <string>NSMenuItem</string> + <key>recentSnaps</key> + <string>NSMenu</string> + <key>saveFileType</key> + <string>NSPopUpButton</string> + <key>savePanelAccessoryView</key> + <string>id</string> + <key>simple8Bit</key> + <string>NSMenuItem</string> + <key>tapePlay</key> + <string>NSMenuItem</string> + <key>tapeRecord</key> + <string>NSMenuItem</string> + <key>window</key> + <string>NSWindow</string> + <key>zxatasp</key> + <string>NSMenuItem</string> + <key>zxcf</key> + <string>NSMenuItem</string> + </dict> + <key>SUPERCLASS</key> + <string>NSObject</string> + </dict> + </array> + <key>IBVersion</key> + <string>1</string> +</dict> +</plist> Modified: trunk/fuse/fusepb/nibs/MainMenu.nib/info.nib =================================================================== --- trunk/fuse/fusepb/nibs/MainMenu.nib/info.nib 2009-01-18 01:44:51 UTC (rev 593) +++ trunk/fuse/fusepb/nibs/MainMenu.nib/info.nib 2009-02-04 11:40:57 UTC (rev 594) @@ -2,21 +2,20 @@ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> - <key>IBDocumentLocation</key> - <string>998 637 356 240 0 0 1440 878 </string> - <key>IBEditorPositions</key> - <dict> - <key>29</key> - <string>201 691 392 44 0 0 1440 878 </string> - </dict> <key>IBFramework Version</key> - <string>489.0</string> + <string>672</string> + <key>IBLastKnownRelativeProjectPath</key> + <string>../Fuse.xcodeproj</string> + <key>IBOldestOS</key> + <integer>5</integer> <key>IBOpenObjects</key> <array> <integer>877</integer> - <integer>29</integer> + <integer>323</integer> </array> <key>IBSystem Version</key> - <string>9C7010</string> + <string>9G55</string> + <key>targetFramework</key> + <string>IBCocoaFramework</string> </dict> </plist> Modified: trunk/fuse/fusepb/nibs/MainMenu.nib/keyedobjects.nib =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |