NSApplication* app;
-@interface OSECPUView : NSView {
+@interface OSECPUView : NSView
+{
unsigned char *_buf;
int _sx;
int _sy;
CGContextRef _context;
}
-- (id)initWithFrame:(NSRect)frameRect
-buf : (unsigned char *) buf
-sx : (int) sx
-sy : (int) sy;
-
+- (id)initWithFrame:(NSRect)frameRect buf:(unsigned char *)buf sx:(int)sx sy:(int)sy;
- (void)drawRect:(NSRect)rect;
@end
@implementation OSECPUView
-- (id)initWithFrame:(NSRect)frameRect
-buf : (unsigned char *) buf
-sx : (int) sx
-sy : (int) sy
+- (id)initWithFrame:(NSRect)frameRect buf:(unsigned char *)buf sx:(int)sx sy:(int)sy
{
self = [super initWithFrame:frameRect];
if (self) {
@end
-@interface Main : NSObject<NSWindowDelegate> {
+@interface Main : NSObject<NSWindowDelegate>
+{
int argc;
const unsigned char **argv;
char *winClosed;
}
- (void)runApp;
-- (void)createThread : (int)_argc
-args : (const unsigned char **)_argv;
+- (void)createThread:(int)_argc args:(const unsigned char **)_argv;
- (BOOL)windowShouldClose:(id)sender;
-- (void)openWin : (unsigned char *)buf
-sx : (int) sx
-sy : (int) sy
-winClosed : (char *)_winClosed;
-- (void)flushWin : (NSRect) rect;
+- (void)openWin:(unsigned char *)buf sx:(int)sx sy:(int)sy winClosed:(char *)_winClosed;
+- (void)flushWin:(NSRect)rect;
@end
@implementation Main
[pool release];
}
-- (void)createThread : (int)_argc
-args : (const unsigned char **)_argv
+- (void)createThread : (int)_argc args:(const unsigned char **)_argv
{
argc = _argc;
argv = _argv;
return YES;
}
-- (void)openWin : (unsigned char *)buf
-sx : (int) sx
-sy : (int) sy
-winClosed : (char *)_winClosed
+- (void)openWin:(unsigned char *)buf sx:(int)sx sy:(int) sy winClosed:(char *)_winClosed
{
NSWindow* window = [[NSWindow alloc] initWithContentRect: NSMakeRect(0, 0, sx, sy) styleMask: NSTitledWindowMask | NSMiniaturizableWindowMask | NSClosableWindowMask backing: NSBackingStoreBuffered defer: NO];
[window.contentView addSubview:_view];
}
-- (void)flushWin : (NSRect) rect
+- (void)flushWin : (NSRect)rect
{
[_view drawRect:rect];
}
env.preg[0x28].typ = 0; // TYP_CODE
env.preg[0x28].p0 = p28;
env.preg[0x28].p1 = p28 + 1;
- // env.preg[0x00].p = malloc(1024 * 1024) + (1024 * 1024 - 32);
+ //env.preg[0x00].p = malloc(1024 * 1024) + (1024 * 1024 - 32);
env.junkStack = malloc(stacksiz << 20);
env.junkStack1 = env.junkStack + (stacksiz << 20);
env.winClosed = 0;