diff --git a/Makefile.target b/Makefile.target
index db7f395..b2974f9 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -518,7 +518,7 @@ ifdef CONFIG_GDBSTUB
 VL_OBJS+=gdbstub.o
 endif
 ifdef CONFIG_COCOA
-COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
+COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit -framework CoreFoundation
 ifdef CONFIG_COREAUDIO
 COCOA_LIBS+=-framework CoreAudio
 endif
diff --git a/cocoa.m b/cocoa.m
index d26b452..06a5206 100644
--- a/cocoa.m
+++ b/cocoa.m
@@ -42,8 +42,8 @@
 #include "sysemu.h"
 
 NSWindow *window = NULL;
-NSQuickDrawView *qd_view = NULL;
-
+CGImageRef myImage;
+CGRect myRect;
 
 int gArgc;
 char **gArgv;
@@ -59,6 +59,11 @@ int qemu_main(int argc, char **argv);
 @interface QemuWindow : NSWindow
 { }
 @end
+@interface QemuView : NSView
+{
+}
+@end
+
 
 
 /*
@@ -76,21 +81,7 @@ static void cocoa_update(DisplayState *ds, int x, int y, int w, int h)
 {
     //printf("updating x=%d y=%d w=%d h=%d\n", x, y, w, h);
 
-    /* Use QDFlushPortBuffer() to flush content to display */
-    RgnHandle dirty = NewRgn ();
-    RgnHandle temp  = NewRgn ();
-
-    SetEmptyRgn (dirty);
-
-    /* Build the region of dirty rectangles */
-    MacSetRectRgn (temp, x, y,
-                        x + w, y + h);
-    MacUnionRgn (dirty, temp, dirty);
-
-    /* Flush the dirty region */
-    QDFlushPortBuffer ( [ qd_view  qdPort ], dirty );
-    DisposeRgn (dirty);
-    DisposeRgn (temp);
+    [[window contentView] setNeedsDisplay:YES];
 }
 
 /*
@@ -101,13 +92,23 @@ static void cocoa_update(DisplayState *ds, int x, int y, int w, int h)
 static void cocoa_resize(DisplayState *ds, int w, int h)
 {
     const int device_bpp = 32;
-    static void *screen_pixels;
+    static void *screen_pixels = NULL;
     static int  screen_pitch;
     NSRect contentRect;
+    CGColorSpaceRef colorSpace;
+    CGDataProviderRef imageProvider;
+
+    if(screen_pixels) {
+        free(screen_pixels);
+        CGImageRelease(myImage);
+    }
+
+     screen_pixels = malloc(w * h * 4);
 
     //printf("resizing to %d %d\n", w, h);
 
     contentRect = NSMakeRect (0, 0, w, h);
+    myRect = CGRectMake(0, 0, w, h);
     if(window)
     {
         [window close];
@@ -122,16 +123,24 @@ static void cocoa_resize(DisplayState *ds, int w, int h)
         exit(1);
     }
 
-    if(qd_view)
-        [qd_view release];
+    colorSpace = CGColorSpaceCreateDeviceRGB(); // CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
 
-    qd_view = [ [ NSQuickDrawView alloc ] initWithFrame:contentRect ];
+    imageProvider = CGDataProviderCreateWithData (NULL, screen_pixels, w * h * 4, NULL);
+    if(!imageProvider) { fprintf(stderr, "(cocoa) can't create image provider\n"); exit(1); }
 
-    if(!qd_view)
-    {
-         fprintf(stderr, "(cocoa) can't create qd_view\n");
-        exit(1);
-    }
+    myImage = CGImageCreate(w, 
+                  h, 
+                  8, 
+                  8*4, 
+                  w*4, 
+                  colorSpace, 
+                  kCGImageAlphaNoneSkipLast,
+                  imageProvider,
+                  NULL,
+                  NO,
+                  kCGRenderingIntentDefault);
+
+    [ window setContentView:[ [ QemuView alloc ] initWithFrame:contentRect ] ];
 
     [ window setAcceptsMouseMovedEvents:YES ];
     [ window setTitle:@"Qemu" ];
@@ -143,34 +152,14 @@ static void cocoa_resize(DisplayState *ds, int w, int h)
     /* set window position */
     [ window center ];
 
-    [ qd_view setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable ];
-    [ [ window contentView ] addSubview:qd_view ];
-    [ qd_view release ];
     [ window makeKeyAndOrderFront:nil ];
 
-    /* Careful here, the window seems to have to be onscreen to do that */
-    LockPortBits ( [ qd_view qdPort ] );
-    screen_pixels = GetPixBaseAddr ( GetPortPixMap ( [ qd_view qdPort ] ) );
-    screen_pitch  = GetPixRowBytes ( GetPortPixMap ( [ qd_view qdPort ] ) );
-    UnlockPortBits ( [ qd_view qdPort ] );
-    {
-            int vOffset = [ window frame ].size.height -
-                [ qd_view frame ].size.height - [ qd_view frame ].origin.y;
-
-            int hOffset = [ qd_view frame ].origin.x;
-
-            screen_pixels += (vOffset * screen_pitch) + hOffset * (device_bpp/8);
-    }
     ds->data = screen_pixels;
-    ds->linesize = screen_pitch;
+    ds->linesize = w*4;
     ds->depth = device_bpp;
     ds->width = w;
     ds->height = h;
-#ifdef __LITTLE_ENDIAN__
     ds->bgr = 1;
-#else
-    ds->bgr = 0;
-#endif
 
     current_ds = *ds;
 }
@@ -655,7 +644,6 @@ void cocoa_display_init(DisplayState *ds, int full_screen)
  ------------------------------------------------------
 */
 
-
 /*
  ------------------------------------------------------
     QemuWindow
@@ -691,25 +679,29 @@ static void QZ_SetPortAlphaOpaque ()
 }
 - (void)display
 {
-    /*
-        This method fires just before the window deminaturizes from the Dock.
+    /* let the window manager redraw controls, border, etc */
+    [ super display ];
 
-        We'll save the current visible surface, let the window manager redraw any
-        UI elements, and restore the SDL surface. This way, no expose event
-        is required, and the deminiaturize works perfectly.
-    */
+     /* trigger a fake update */
+    cocoa_update(NULL,0,0,0,0);
+}
 
-    /* make sure pixels are fully opaque */
-    QZ_SetPortAlphaOpaque ();
+@end
 
-    /* save current visible SDL surface */
-    [ self cacheImageInRect:[ qd_view frame ] ];
+@implementation QemuView
+- (id) initWithFrame: (NSRect) frameRect
+{
+        self = [super initWithFrame: frameRect];
 
-    /* let the window manager redraw controls, border, etc */
-    [ super display ];
+        return self;
+}
 
-    /* restore visible SDL surface */
-    [ self restoreCachedImage ];
+- (void) drawRect: (NSRect) rect
+{
+    if(myImage) {
+        CGContextRef myContext = [[NSGraphicsContext currentContext] graphicsPort];
+        CGContextDrawImage(myContext, myRect, myImage);
+    }
 }
 
 @end
diff --git a/configure b/configure
index 08f1720..4799e25 100755
--- a/configure
+++ b/configure
@@ -156,11 +156,11 @@ fi
 if [ "$cpu" = "x86_64" ] ; then
     OS_CFLAGS="-arch x86_64"
     LDFLAGS="-pagezero_size 0x1000000 -arch x86_64"
+    ARCH_LDFLAGS="-framework CoreFoundation -framework IOKit"
 #    CFLAGS="$CFLAGS -fomit-frame-pointer"
-else # no cocoa ported to 64 bit yet
-    cocoa="yes"
-    coreaudio="yes"
 fi
+cocoa="yes"
+coreaudio="yes"
 ;;
 SunOS)
     solaris="yes"
