ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/MacOSX/Emulator.mm
(Generate patch)

Comparing BasiliskII/src/MacOSX/Emulator.mm (file contents):
Revision 1.5 by nigel, 2003-03-26T01:45:31Z vs.
Revision 1.6 by nigel, 2003-03-26T23:04:46Z

# Line 94 | Line 94
94          //[win setHasShadow: NO];               // This causes view & window to now be drawn correctly
95          [win useOptimizedDrawing: YES];                
96  
97 //      [win center];
97          [win makeKeyAndOrderFront:self];
98  
100 //      [self resizeWinToWidth:x Height:y];
101
99          if ( redrawDelay )
100                  [speed setFloatValue: 1.0 / redrawDelay];
101          else
# Line 147 | Line 144
144                  [self Resume: self];
145   }
146  
147 + #ifdef NIGEL
148 + - (IBAction) EjectCD: (id)sender;
149 + {
150 +        NSString        *path;
151 +        const char      *cdrom = PrefsFindString("cdrom");
152 +
153 +        if ( cdrom )
154 +        {
155 +        #include <sys/param.h>
156 +        #define KERNEL
157 +        #include <sys/mount.h>
158 +
159 +                struct statfs buf;
160 +                if ( fsstat(path, &buf) < 0 )
161 +                        return;
162 +
163 +                path = [NSString stringWithCString: cdrom];
164 +
165 +                [[NSWorkspace sharedWorkspace] unmountAndEjectDeviceAtPath: path];
166 + //              [path release];
167 +        }
168 + }
169 + #endif
170 +
171   - (IBAction) Interrupt: (id)sender;
172   {
173          WarningSheet (@"Interrupt action not yet supported", win);
# Line 177 | Line 198
198                  NSLog (@"%s - uae_cpu reset not yet supported, will try to fake it",
199                                  __PRETTY_FUNCTION__);
200  
201 < //              [screen blacken];
202 <                [screen setNeedsDisplay: YES];
201 >                [screen clear];
202 >                [screen display];
203  
204                  [emul terminate]; QuitEmuNoExit();
205  
206 +
207 +                // OK. We have killed & cleaned up. Now, start afresh:
208 +        #include <sys.h>
209 +                int     argc = 0;
210 +                char **argv;
211 +
212 +                PrefsInit(argc, argv);
213 +                SysInit();
214 +
215                  emul = [NNThread new];
216                  [emul perform:@selector(emulThread) of:self];
217                  [emul start];
218  
219                  if ( display_type != DISPLAY_SCREEN )
220                          [redraw resume];
191                uaeCreated = YES;
221          }
222   }
223  
# Line 351 | Line 380 | uint8 lastXPRAM[XPRAM_SIZE];           // Copy of
380          [redraw invalidate]; [redraw release]; redraw = nil;
381          [RTC    invalidate]; [RTC        release]; RTC    = nil;
382          [xPRAM  invalidate]; [xPRAM      release]; xPRAM  = nil;
354        if ( uaeCreated )
355                QuitEmuNoExit();
383   }
384  
385   - (void) emulThread
# Line 395 | Line 422 | uint8 lastXPRAM[XPRAM_SIZE];           // Copy of
422   {
423          if ( display_type == DISPLAY_SCREEN )
424          {
425 <                NSLog(@"Why was redrawScreen() called?");
425 >                NSLog(@"We are in fullscreen mode - why was redrawScreen() called?");
426                  return;
427          }
428          [barberPole animate:self];                      // wobble the pole
429          [screen setNeedsDisplay: YES];          // redisplay next time through runLoop
430          // Or, use a direct method. e.g.
431 <        //      [screen cgDrawInto: ...];
431 >        //      [screen display] or [screen cgDrawInto: ...];
432   }
433  
434   #include <main.h>                               // For #define INTFLAG_60HZ

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines