Thread
Macpaint and quickdraw source code posted
Not been here for a while...
I don't think this has been posted anywhere else. Via Daringfireball.net:
http://www.computerhistory.org/highlights/macpaint/
I don't think this has been posted anywhere else. Via Daringfireball.net:
http://www.computerhistory.org/highlights/macpaint/
Wow. Just ... wow.
This is big news, in two senses: firstly, considering how anal Apple have always been about sourcecode, the fact that they have released anything is great news, and hopefully the start of something.
Second, having access to the original source for Quickdraw surely opens up some interesting possibilities.
This is big news, in two senses: firstly, considering how anal Apple have always been about sourcecode, the fact that they have released anything is great news, and hopefully the start of something.
Second, having access to the original source for Quickdraw surely opens up some interesting possibilities.
QuickDraw is the Macintosh library for creating bit-mapped graphics / It consists of a total of 17,101 lines in 36 files, all written in assembler language for the 68000./
Bill was as concerned with whether human readers would understand the code as he was with what the computer would do with it. / "I'm a firm believer that the best way to prevent bugs is to make it so that you can read through the code and understand exactly what it's doing… "
Wow doesn't even begin to describe this Bunsen – "with the permission of Apple" ... Really!? Naw couldn't be. What's in it for Apple? Wouldn't someone have had to ask Steve? I can only imagine his eyes glaze over the instant he hears words like "MacPaint", or "Atkinson", or "history". How would anyone even get his ear to make such a request, much less have it granted?
If the code has been released, it means it can be compiled into working software. Doesn't this mean it is in the public domain, for all practical purposes (aside from commercial sale)? What's next? Could Apple really be softening its position on vintage software, now that it has been rendered utterly moot thanks to OS X and iOS?
If the code has been released, it means it can be compiled into working software. Doesn't this mean it is in the public domain, for all practical purposes (aside from commercial sale)? What's next? Could Apple really be softening its position on vintage software, now that it has been rendered utterly moot thanks to OS X and iOS?
Most emphatically not.Doesn't this mean it is in the public domain
Note: This material is Copyright ©1984 Apple Inc. and is made available only for non-commercial use.
Ah, missed that (or maybe I just didn't want to see it :beige: ). But that's a technicality. For all practical purposes it is, which is why Apple so actively prevented the obsolete System and application software from being freely distributed. It's not like anyone is going to use MacPaint, its code or any part of it for any serious commercial venture. Certainly the sale of the code, compiled or otherwise would be illegal. But freely distributed code and/or software for "non-commercial" uses, is pretty much all any of us have ever wanted with pre-System 7 software, and these days, pre-OS 8.1. "non-commercial use" allows for a wide array of use, including modifying it and freely sharing it with colleagues on forums like this. And once that cat is out of the bag, how do you put it back in?Note: This material is Copyright ©1984 Apple Inc. and is made available only for non-commercial use.
I mean besides actually selling the software, what is a "commercial use"? Using it to design floor-plans for your interior design firm? Make kitsch digital art for sale on the internet? And who is to say you made it from that particular code and not an original copy of the application you bought entitling you to use it for "commercial" purposes? Considering it is code, I suppose the limitation is aimed directly at someone who might modify it or include bits of it in their own commercial software, but seriously, how practical would that be today with all the open source alternatives? Anyway, not to start a debate about copyright, it is clearly protected. But unlike a decade ago, it is being freely distributed for just about anything that's practical to do with it in 2010. Let's hope for more ...
I'm still just slack-jawed by the whole revelation.
EDIT: Ahhhhhhhhh .... here's the background story from Bloomberg/Buisness Week.
And here's the most interesting quote:
What you’ll find are actually two files, one containing the source code of MacPaint itself, the other containing QuickDraw, which Hertzfeld calls “the single most important component of the original Macintosh technology.” It was a key enabling technology not only for MacPaint but for the entire Mac interface, and by itself amounts to about one-third of the source code for the original Macintosh operating system, Hertfeld said.
Also known as - the law.But that's a technicality.
Agreed.freely distributed code and/or software for "non-commercial" uses, is pretty much all any of us have ever wanted with pre-System 7 software / "non-commercial use" allows for a wide array of use
This is the money quote from that article, to me:
Also:Don Knuth called MacPaint “the best program ever written.”
So it was El Steevo who let the cat out of the bag in the endFinally / Hertzfeld saw / Steve Jobs, and told him of the stalled request for the source code. Within 24 hours, Jobs asked Apple’s new general counsel / to approve it.

Any word on whether or not Bill Atkinson had any input in the MacPaint code being released? Of all the old Mac designers he was probably my favorite, especially since he did so much yet never gets the recognition of the other members of that team.
Has anyone looked at this code yet? If so, what programs are you folks using?
Has anyone looked at this code yet? If so, what programs are you folks using?
Well, Andy Hertzfeld has pushed for years for Apple to open up the source, when someone whose name escapes me asked for it to do a class on programming.
Andy contacted BIll Atkinson, who found a copy of the source. Andy then tried to get it donated to Computer History Museum, going through Apple legal.
That's the last I had heard, that Andy had been trying.
According to one report on this, Andy went through multiple Apple legal people before finally cornering Jobs at some event earlier this year. He brought it up to Jobs, and according to Andy, Jobs immediately called up the head of Apple Legal and said "do it". It just took awhile.
So this was done with full knowledge of Steve Jobs.
As for "public domain". There is a very definite difference between "available" and "public domain".
The source code for Linux is "available to anyone", it is not "public domain".
Public Domain has a very specific meaning. It means that *NOBODY* holds any legal rights to it. For example, very old books like Alice in Wonderland, slightly more recent works whose creators didn't register the copyright properly (under older copyright laws, you had to re-register after only a few years, or the work fell into the public domain,) such as the original 1960 "Little Shop of Horrors", and 1959's cult-classic "Plan 9 From Outer Space"; along with works created by the U.S. Government. (So photographs taken by U.S. government employees as part of their job are automatically in the public domain; such as astronauts in space.)
That means that *ANYONE* can do *ANYTHING* with the work they want. (Within the normal bounds of legality of course.) Anyone can take Little Shop of Horrors, re-edit it, and sell it. Any company can take photos of the Earth taken by astronauts and use it in their advertising. No permission needed. That's what "Public Domain" means.
On the other hand, you have things that are released to the public, but not placed into the public domain. These are licensed. The creator still maintains copyright on it, they just choose to allow much more use than is considered "normal". The source code for Linux, for example, is actually fairly restrictive. You CAN'T do just anything with it. You must share any changes you make. Many photos you find on Flickr are tagged "CC-BY-NC", which means that the copyright holder says you can use it, but you have to make sure to give them proper attribution, and you can't use it for commercial purposes. (i.e. you can't sell something with that photo, you can't use it in your advertising, etc.) What apple has done is more like this last one. They say "here it is! Play with it, learn from it, just don't try to re-sell it."
So someone could try to recompile it for OS X and give it away for free. But they can't try to sell it.
Andy contacted BIll Atkinson, who found a copy of the source. Andy then tried to get it donated to Computer History Museum, going through Apple legal.
That's the last I had heard, that Andy had been trying.
According to one report on this, Andy went through multiple Apple legal people before finally cornering Jobs at some event earlier this year. He brought it up to Jobs, and according to Andy, Jobs immediately called up the head of Apple Legal and said "do it". It just took awhile.
So this was done with full knowledge of Steve Jobs.
As for "public domain". There is a very definite difference between "available" and "public domain".
The source code for Linux is "available to anyone", it is not "public domain".
Public Domain has a very specific meaning. It means that *NOBODY* holds any legal rights to it. For example, very old books like Alice in Wonderland, slightly more recent works whose creators didn't register the copyright properly (under older copyright laws, you had to re-register after only a few years, or the work fell into the public domain,) such as the original 1960 "Little Shop of Horrors", and 1959's cult-classic "Plan 9 From Outer Space"; along with works created by the U.S. Government. (So photographs taken by U.S. government employees as part of their job are automatically in the public domain; such as astronauts in space.)
That means that *ANYONE* can do *ANYTHING* with the work they want. (Within the normal bounds of legality of course.) Anyone can take Little Shop of Horrors, re-edit it, and sell it. Any company can take photos of the Earth taken by astronauts and use it in their advertising. No permission needed. That's what "Public Domain" means.
On the other hand, you have things that are released to the public, but not placed into the public domain. These are licensed. The creator still maintains copyright on it, they just choose to allow much more use than is considered "normal". The source code for Linux, for example, is actually fairly restrictive. You CAN'T do just anything with it. You must share any changes you make. Many photos you find on Flickr are tagged "CC-BY-NC", which means that the copyright holder says you can use it, but you have to make sure to give them proper attribution, and you can't use it for commercial purposes. (i.e. you can't sell something with that photo, you can't use it in your advertising, etc.) What apple has done is more like this last one. They say "here it is! Play with it, learn from it, just don't try to re-sell it."
So someone could try to recompile it for OS X and give it away for free. But they can't try to sell it.
I posted the link to the Bloomberg/Business Week article above that details the "official" story.According to one report on this
I believe that's what I said, but in so many fewer words. :beige:So someone could try to recompile it for OS X and give it away for free. But they can't try to sell it.
Surely the source for A/UX is right around the corner!
I never understand companies that are so reluctant to release source code for software/OS that haven't been used in a significant number of production systems for quite some time. What compelling reason could they have for not releasing it?
*snicker* I wouldn't hold my breath. Basically any commercial UNIX (With an emphasis on anything remotely based on System V) from the 80's is going to be confined to legal purgatory forever and ever and ever.Surely the source for A/UX is right around the corner!
(Or at least until the associated copyrights have indisputably lapsed a century or so from now, depending on whether Congress decides to extend it *again*.)
Frankly I don't even trust OpenSolaris, and if *anyone* had sufficient rights to completely open-source a System V Unix it was Sun. (God rest their souls.) But even they had to negotiate with other rights holders and remove a few things from the open-sourced product to do it.
Well, it has just been conclusively decided in court that Novell owns the code to "UNIX". So in theory, Novell could release it, which opens Apple up to release A/UX. (But, to paraphrase you, "as if".)
Of course, the real question is, is anyone going to do anything with this code?
There was some *ahem* small amount of sarcasm/cynicism in my post.*snicker* I wouldn't hold my breath. Basically any commercial UNIX (With an emphasis on anything remotely based on System V) from the 80's is going to be confined to legal purgatory forever and ever and ever.
Actually, I wouldn't even care so much about the Unix layer. Let them keep that locked up. If they released just the Sys7 environment, and the "glue" code that made it run atop Unix, that would be great.
I think some of it has to do with portions of the code not being owned by a particular company or the original source of a code being uncertain.
Let's use Word 5.1 as an example. I know not all of the code in Word 5.1 was developed by Microsoft. They would need permission from the other companies involved to release it free of charge even if Microsoft was OK with releasing their portion of 5.1 for free. This may be part of the holdup with some Mac products as well. MacDraw II and MacWrite II both had third party utilities included in the package and I'm pretty sure most later versions of the Mac OS did too. Also, the only fonts available on Apple's page are their four fonts, not the additional ones that came with the LaserWriters.
Lost ownership is another issue. I remember hearing once that this is the reason we may never see the original Oregon Trail and Number Munchers released for free. With SimCity, for example, we know who owns the code--Maxis was purchased by EA and many of the developers remain in contact with today's projects. This is how EA was able to release SimCity for the OLPC project. Oregon Trail and Number Munchers were both MECC products. There were countless buyouts here and lots of things were lost in the shuffle (I actually wrote to one of the Oregon Trail II team members, who was on board for many other MECC products, about some material from the game and he said lots of the original material that was researched for the game, including primary source documents from private families, was lost during the buyouts). If they can lose personal trail diaries from the 1840s and 1850s, losing copyright documents would be no problem whatsoever.
Of course, it's probably possible to look this stuff up in some sort of government-run database, but companies seem reluctant to do that for whatever reason. If the buyouts are documented, the rights holders should be easy enough to track down, although "lost ownership" will still be brought up all the time.
Personally, I think the copyright terms on software should be shortened. 75+ years is fine for books, movies, and music, since they don't become obsolete in two years (unless we're talking about atlases, travel books, computer books, and so forth). For computers, I'd say 15 years would be a good amount of time--most software is out of use by then and having older software in the public domain would help many (historians, people who cannot afford new software, schools, churches, nursing homes). If a company wanted to keep something copyrighted longer (say Microsoft with XP if it was still supported past that date), they could apply for a 5 year extension. There would be no limit for these extensions--if someone wanted a 75 year copyright, they would just have to apply for the extension. Additionally, if this law were to be enacted today, a provision would have to be that a work created prior to this date in 1995 would enter the public domain unless a rights holder stated otherwise, in which case it would be granted the 5 year extension.
This is just a dream for now, but I'm thinking of talking about it with my local congressman to see if it goes anywhere. For now, I'll keep purchasing new copies of Word 5.1 whenever I need to install it on an additional Mac.
Let's use Word 5.1 as an example. I know not all of the code in Word 5.1 was developed by Microsoft. They would need permission from the other companies involved to release it free of charge even if Microsoft was OK with releasing their portion of 5.1 for free. This may be part of the holdup with some Mac products as well. MacDraw II and MacWrite II both had third party utilities included in the package and I'm pretty sure most later versions of the Mac OS did too. Also, the only fonts available on Apple's page are their four fonts, not the additional ones that came with the LaserWriters.
Lost ownership is another issue. I remember hearing once that this is the reason we may never see the original Oregon Trail and Number Munchers released for free. With SimCity, for example, we know who owns the code--Maxis was purchased by EA and many of the developers remain in contact with today's projects. This is how EA was able to release SimCity for the OLPC project. Oregon Trail and Number Munchers were both MECC products. There were countless buyouts here and lots of things were lost in the shuffle (I actually wrote to one of the Oregon Trail II team members, who was on board for many other MECC products, about some material from the game and he said lots of the original material that was researched for the game, including primary source documents from private families, was lost during the buyouts). If they can lose personal trail diaries from the 1840s and 1850s, losing copyright documents would be no problem whatsoever.
Of course, it's probably possible to look this stuff up in some sort of government-run database, but companies seem reluctant to do that for whatever reason. If the buyouts are documented, the rights holders should be easy enough to track down, although "lost ownership" will still be brought up all the time.
Personally, I think the copyright terms on software should be shortened. 75+ years is fine for books, movies, and music, since they don't become obsolete in two years (unless we're talking about atlases, travel books, computer books, and so forth). For computers, I'd say 15 years would be a good amount of time--most software is out of use by then and having older software in the public domain would help many (historians, people who cannot afford new software, schools, churches, nursing homes). If a company wanted to keep something copyrighted longer (say Microsoft with XP if it was still supported past that date), they could apply for a 5 year extension. There would be no limit for these extensions--if someone wanted a 75 year copyright, they would just have to apply for the extension. Additionally, if this law were to be enacted today, a provision would have to be that a work created prior to this date in 1995 would enter the public domain unless a rights holder stated otherwise, in which case it would be granted the 5 year extension.
This is just a dream for now, but I'm thinking of talking about it with my local congressman to see if it goes anywhere. For now, I'll keep purchasing new copies of Word 5.1 whenever I need to install it on an additional Mac.
Sure, as posted above, it's going to be used in programming classes as an example of elegant coding for constrained systems. If you mean develop something from it/with it/for it ... that'd be up to us loonies, wouldn't it?Of course, the real question is, is anyone going to do anything with this code?
It's probably more a case of Steve wanting Andy to bugger off and stop hassling him about it - I doubt Apple will suddenly start releasing the back catalogue. (They're not Apple records or anything...)
Someone on here will now compile this for OSX. That's a direct order.
Someone on here will now compile this for OSX. That's a direct order.
Then he's an idiot...sheesh... :Don Knuth called MacPaint “the best program ever written.”
Yeah, I'm sure you're more qualified to make a judgement about it than he is:Then he's an idiot...sheesh... :![]()
http://en.wikipedia.org/wiki/Donald_Knuth
:beige:
I know who he is... If it's that great, I expect him to still use it every day.
Cost, essentially.I never understand companies that are so reluctant to release source code for software/OS that haven't been used in a significant number of production systems for quite some time. What compelling reason could they have for not releasing it?
If the code for a project is fully owned by Apple, for example, then even slapping on a small disclaimer like "this is for noncommercial educational use only" etc requires a few levels of internal authorisation and their own legal dept, as we've seen. For a project that's coming up to 30 years old, to even get to the state of knowing the code was entirely in-house may require digging through documentation - not all of which may exist by now - and validating that legal rights to the code do indeed lie with the company as it is today, and that's before checking that there aren't other issues with code release like trade secrets, in-house wilful copyright violations of competitors, or other illegal code. Who in a company really remembers precisely which code is unlawfully involved in making competitor's products look bad, if that were ever implemented in just a tiny fraction of coding projects?
For flagship products where the history is interesting in itself, like macpaint, that may be relatively simple and only require a small amount of digging. For the tens of thousands of jobs spanning five decades like Apple have, that could get really tedious really quickly.
Perhaps he does, I find it just as productive for some things as the latest graphics software. Nevertheless your reply holds him literally to the original MacPaint program released on January 26, 1984.If it's that great, I expect him to still use it every day.
A more reasonable interpretation is that he is referring to the concept of the software and the most current successors of it, regardless if it is a direct descendent, or another company's who built their code from the ground up, but still utilizes all the fundamental principles originally first introduced in MacPaint. Sure, newer programs are loaded with bells and whistles the original didn't have, but aside from that, has anything been written for the computer that is as revolutionary? Not yet as far as I can tell. We're still pretty much using the computer exactly the same way we were in 1984, just faster, slicker and more flavors of the same idea. I think iOS may open new avenues for revolutions in how we use the computer as groundbreaking as the GUI and MacPaint did, but only time will tell.
Some folks still do use older software if they consider it to be "the best". I remember a few years back someone reported Bill Atkinson still used HyperCard (it may have been MacWorld, but I'm not certain of the source). Interestingly, WordPerfect 5.1 for DOS is still in demand. Check the prices on eBay. (I know law offices used to love WordPerfect since it was easier to format documents properly, not sure if there are still some who have been reluctant to upgrade and I know there was a project not too long ago where drivers were being developed for newer printers so they could be used with 5.1).
Personally, I still use BannerMania because I feel it is top-notch, especially since it takes full advantage of the ImageWriter II's color printing capabilities and the output looks great. Anyone else out there still make dot matrix banners?
A better question--how many of you get called to produce banners for friends since you're the only one they know with a dot matrix printer?
Personally, I still use BannerMania because I feel it is top-notch, especially since it takes full advantage of the ImageWriter II's color printing capabilities and the output looks great. Anyone else out there still make dot matrix banners?
A better question--how many of you get called to produce banners for friends since you're the only one they know with a dot matrix printer?
Fair enough if that's what he meant, but it's not what he said. :A more reasonable interpretation is that he is referring to the concept of the software and the most current successors of it, regardless if it is a direct descendent, or another company's who built their code from the ground up, but still utilizes all the fundamental principles originally first introduced in MacPaint.
I actually still use HyperCard sometimes too. ;D It's the only thing I can program in, and heck, it does nearly everything I need anyway. I actually wouldn't have objected if Knuth had said it was the best programme ever, since there's not much else that does what it does.
Hyeah, I'll take Don Knuth's opinion over yours any day of the week and twice on Sundays.HyperCard / It's the only thing I can program in
Compiling this code for anything but a 68k Macintosh is a pretty tall order. Between Quickdraw and MacPaint over half of it is dense 68000 assembly language, and both the assembly and Pascal code makes raw calls to parts of the Mac OS and ROM APIs that we *don't* have the source code for. Porting this to a modern platform would mean translating all the assembly code to either x86 assembly or C (commercial tools exist to help with either, but the end result would need a lot of massaging to be at all useful), porting the archaic Pascal to something that works on a currently available compiler, fixing all the internal calls, and writing replacements for the Mac API elements not included. (Or patching the original code to use the modern OS's native API instead.)Someone on here will now compile this for OSX. That's a direct order.
On the bright side the assembly language seems to be pretty well commented. The Pascal... not so much.
There are a few things I'd like to find out from this code:
1. Why does MacPaint malfunction on color monitors? Many other older programs (including MacWrite) work fine.
2. Are there any hidden, unactivated, or otherwise experimental features lurking in this code?
3. What exactly conflicts with OS 9 in MacPaint? (I tried running it on OS 9 once but to no avail).
4. With regards to QuickDraw, was there any foundation for color in the original programming? I remember reading somewhere about the classic Macs having colors built in somewhere despite not being able to show them on the screen natively (I know there were some color boards available for older Macs many moons ago, not sure if they relied on QuickDraw, the ROM, or something else).
5. That being said, how hard would it be to add color capabilities (at least the equivalent of a CGA monitor on an IBM) to MacPaint?
I still haven't gotten a chance to examine what's in here, but I'm not sure how much of it I'd really find useful. I took courses in BASIC, C++, and JAVA, plus I know HyperCard very well, but have never studied regular C (not sure how different it is from C++) and don't have a good grip at all on assembly language. (I do want to learn a bit more about this down the line, perhaps I'll study it a bit this fall in my spare time).
1. Why does MacPaint malfunction on color monitors? Many other older programs (including MacWrite) work fine.
2. Are there any hidden, unactivated, or otherwise experimental features lurking in this code?
3. What exactly conflicts with OS 9 in MacPaint? (I tried running it on OS 9 once but to no avail).
4. With regards to QuickDraw, was there any foundation for color in the original programming? I remember reading somewhere about the classic Macs having colors built in somewhere despite not being able to show them on the screen natively (I know there were some color boards available for older Macs many moons ago, not sure if they relied on QuickDraw, the ROM, or something else).
5. That being said, how hard would it be to add color capabilities (at least the equivalent of a CGA monitor on an IBM) to MacPaint?
I still haven't gotten a chance to examine what's in here, but I'm not sure how much of it I'd really find useful. I took courses in BASIC, C++, and JAVA, plus I know HyperCard very well, but have never studied regular C (not sure how different it is from C++) and don't have a good grip at all on assembly language. (I do want to learn a bit more about this down the line, perhaps I'll study it a bit this fall in my spare time).
I remember reading on folklore.org that the original Macs supported "spot color" in some fashion in order to run the color Imagewriter, but undoubtedly someone else knows far more about that. Let's see... Here's a link to an InfoWorld review of a color board for the Macintosh SE. It mentions that it works with "... some programs that use Color Quickdraw, provided they support the Imagewriter in eight colors...4. With regards to QuickDraw, was there any foundation for color in the original programming? I remember reading somewhere about the classic Macs having colors built in somewhere despite not being able to show them on the screen natively (I know there were some color boards available for older Macs many moons ago, not sure if they relied on QuickDraw, the ROM, or something else).
A quick grep of the code shows definition blocks like this:
Code:
;-----------------------------------------------
;
; QuickDraw Color Separation:
;
normalBit .EQU 0 ;normal screen mapping
inverseBit .EQU 1 ;inverse screen mapping
redBit .EQU 4 ;RGB additive mapping
greenBit .EQU 3 ;for photos from screen
blueBit .EQU 2
cyanBit .EQU 8 ;CMYBk subtractive mapping
magentaBit .EQU 7 ;for ink jet printer
yellowBit .EQU 6
blackBit .EQU 5
None of it is in C, actually. The assembly language is very well documented, so even if you don't do assembly at all you can pretty much grasp what an individual function is doing. (Where it gets hard is there are a *lot* of variables and constants to keep track of, many of which appear to be globals. So tracking the code path across modules rapidly turns my brain into mush.) As for the MacPaint code I've never written Pascal but it "reads" fairly easily. Again, the issue is that there really isn't that much done inside the main program itself. It's essentially a huge collection of calls to EXTERNAL functions and API hooks, so to understand it you'll have to backtrace everything through the referenced assembly code or the "Inside Macintosh" API reference.I still haven't gotten a chance to examine what's in here, but I'm not sure how much of it I'd really find useful. I took courses in BASIC, C++, and JAVA, plus I know HyperCard very well, but have never studied regular C (not sure how different it is from C++) and don't have a good grip at all on assembly language. (I do want to learn a bit more about this down the line, perhaps I'll study it a bit this fall in my spare time).
I'll admit I have a terrible time following other people's code once it grows beyond a certain size. If you don't suffer that limitation it should be less daunting than I'm finding it.
Monkey. The DA for it is in Vault: http://macgui.com/downloads/?file_id=134452. Are there any hidden, unactivated, or otherwise experimental features lurking in this code?