9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Jeff Sickel <jas@corpus-callosum.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] vx32 compilation for osx
Date: Sat, 10 May 2014 16:24:43 -0500	[thread overview]
Message-ID: <7FE9B946-A7E4-4E1C-AEE9-7B3998D69B68@corpus-callosum.com> (raw)
In-Reply-To: <83edb3fab7bc44bbfc99cea15e5d6d4e@brasstown.quanstro.net>

The issue on the OS X version is that Apple announced, 5 years or more ago,
that the 32-bit Carbon APIs were end of life and being decommissioned.
9vx uses those Carbon graphics APIs, so it stands to reason that when
Apple released Mavericks, those APIs were no longer supported or included
with the system.

There are three options:

 1) implement draterm-cocoa drawing techniques
 2) implement p9p’s devdraw interface and use devdraw-cocoa
 3) utilize the inferno drawing variant with the diff
% hg diff emu mkfiles
diff -r d8a878d9e6a1 emu/MacOSX/win.c
--- a/emu/MacOSX/win.c	Thu May 01 12:08:59 2014 +0100
+++ b/emu/MacOSX/win.c	Sat May 10 16:22:46 2014 -0500
@@ -573,10 +573,12 @@
 	QDBeginCGContext(GetWindowPort(theWindow), &context);
 	
 	// The sub-image is relative to our whole screen image.
-	CGImageRef subimg = CGImageCreateWithImageInRect(fullScreenImage, rbounds);
+	CGImageRef subimg = CGRectEqualToRect(rbounds, bounds) ?
+		CGImageCreateCopy(fullScreenImage):
+		CGImageCreateWithImageInRect(fullScreenImage, rbounds);
 	
 	// Drawing the sub-image is relative to the window.
-	rbounds.origin.y = winRect.bottom - winRect.top - r.min.y - rbounds.size.height;
+	rbounds.origin.y = winRect.bottom - winRect.top - rbounds.origin.y - rbounds.size.height;
 	CGContextDrawImage(context, rbounds, subimg);
 	CGImageRelease(subimg);
 	QDEndCGContext(GetWindowPort(theWindow), &context);
diff -r d8a878d9e6a1 mkfiles/mkfile-MacOSX-386
--- a/mkfiles/mkfile-MacOSX-386	Thu May 01 12:08:59 2014 +0100
+++ b/mkfiles/mkfile-MacOSX-386	Sat May 10 16:22:46 2014 -0500
@@ -24,7 +24,6 @@
 		-pipe\
 		-fno-strict-aliasing\
 		-no-cpp-precomp\
-		-mno-fused-madd\
 		-I$ROOT/MacOSX/386/include\
 		-I$ROOT/include\
 		$COPTFLAGS $CDEBUGFLAGS\




On May 10, 2014, at 9:20 AM, erik quanstrom <quanstro@quanstro.net> wrote:

> On Sat May 10 10:04:09 EDT 2014, aram.h@mgk.ro wrote:
>> It's easy to make it use clang directly (instead of gcc wrapper) and
>> compile it in 32-bit mode, the larger issue is that it uses an
>> obsolete devdraw implementation that doesn't compile in Mavericks any
>> more...
> 
> are you sure that there are (full) 32-bit apis for cocoa?  the even larger
> issue is that 9vx may be completely unsupportable with mavricks.
> help me old by 10 8 krufted executable, you're my only hope.
> 
> - erik
> 




      reply	other threads:[~2014-05-10 21:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-10 11:15 arisawa
2014-05-10 12:40 ` erik quanstrom
2014-05-10 13:59   ` arisawa
2014-05-10 14:02     ` Aram Hăvărneanu
2014-05-10 14:20       ` erik quanstrom
2014-05-10 21:24         ` Jeff Sickel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7FE9B946-A7E4-4E1C-AEE9-7B3998D69B68@corpus-callosum.com \
    --to=jas@corpus-callosum.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).