Welcome, Guest. Please login or register.

Author Topic: Deluxe Paint 1 source code released  (Read 16696 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline YasuTopic starter

  • Sr. Member
  • ****
  • Join Date: Mar 2012
  • Posts: 413
    • Show only replies by Yasu
Deluxe Paint 1 source code released
« on: July 23, 2015, 01:15:36 PM »
"With the permission of Electronic Arts, Inc. the Computer History Museum is pleased to make available, for non-commercial use, the source code to the 1986 version I of DeluxePaint. There are 89 files of C language source, comprising almost 17,000 lines of code in about 474 KB of text."

http://www.computerhistory.org/_static/atchm/electronic-arts-deluxepaint-early-source-code/
 

Offline olsen

Re: Deluxe Paint 1 source code released
« Reply #1 on: July 23, 2015, 04:17:49 PM »
Quote from: Yasu;792955
"With the permission of Electronic Arts, Inc. the Computer History Museum is pleased to make available, for non-commercial use, the source code to the 1986 version I of DeluxePaint. There are 89 files of C language source, comprising almost 17,000 lines of code in about 474 KB of text."

http://www.computerhistory.org/_static/atchm/electronic-arts-deluxepaint-early-source-code/
I had a quick look at the code and made a few interesting discoveries.

All the file names in the archive are using all upper case letters, e.g. "PRISM.C". Header file path names use '\' as a separator character, and not '/'. Path names are up to 8 characters long (e.g. '#include ' instead of '#include '). The "PRISM.TXT" file contains instructions for the linker, in particular how the overlay modules are set up, which allowed the program to run even on a 256KByte machine. The linker file references "lc.lib" which suggests that the Lattice 'C' compiler was used, which is not the same as the compiler used by Amiga, Inc.

All of this suggests strongly that "Deluxe Paint" was created using a cross compiler running under MS-DOS. At the time this was a cheaper alternative than to use a "Sun 2" or "Sun 3" as Amiga, Inc. at Los Gatos did. I remember reading that the MS-DOS based development system was used at Electronic Arts at the time, with curious consequences: "Arctic Fox" was developed on a machine with a wooden keyboard ;)

From my point of view the code uses the operating system very well. Unlike so many programs written in the early days, "Deluxe Paint" does not provide its own custom user interface but leverages what the operating system provides (this was not always possible at the time, though, as the toolbox for creating user interfaces was somewhat limited in the 1.x days). However, "Deluxe Paint" does use the Amiga hardware directly, such as for creating image masks (for brushes, stencils/friskets). The code does this cleanly in the prescribed manner: obtain ownership of the Blitter, set up the blitter, start it, wait for it to finish, yield ownership of the Blitter. On the other hand, testing which mouse buttons are currently being held down by the user involves peeking the hardware registers. There was no function for obtaining the current state of the mouse buttons until Kickstart 2.04, so that may have been a reason to go with the hardware access instead. Also, "Deluxe Paint" makes assumptions about the system and hardware architecture with regard to the layout and contents of bitmaps. These assumptions are made when read/writing files, performing data transformations (e.g. magnification) and when using the Blitter to move data. There was no abstraction for this in the operating system which "Deluxe Paint" could have used.

"Deluxe Paint" consists of 88 individual files. Each file is quite short and its contents are "functionally coherent", which means that they serve a common purpose and there is a reason why they sit together in the same file. This is how is should be done. In my opinion the code is well-documented and comparable to other code written professionally for the Amiga at the same time (1985).

Judging by the source code comments I would expect that the last changes were made to "Deluxe Paint" in November 1985. The year 1986 (publication) only appears in the copyright text which the program displays.

There are some bugs in the code, of course. The first one I spotted and which may have been far from obvious at the time is in that the mouse pointer images and the toolbox images which are part of the program itself are not stored in chip memory. Hence, if you start "Deluxe Paint" on an Amiga with true fast memory (or 'slow' fast memory, such as on an Amiga 500 with a 512 KByte memory expansion) then the user interface will become difficult to use. This "glitch" aside, "Deluxe Paint" properly asks for chip memory to be used for image data. There likely was no way to test the program with fast memory, back in 1985.

I venture that "Deluxe Paint" could be ported to a contemporary AmigaOS, if one finds a solution for the dependencies on the Blitter hardware. It could be done :)
 

Offline hishamk

Re: Deluxe Paint 1 source code released
« Reply #2 on: July 23, 2015, 04:25:54 PM »
Great analysis. Thanks for sharing.
2x A1000, 2x A2000, 1x A3000, 4x A1200, 3x A500, 1x CDTV, 1x CD32, 2x Pegasos II, 1x EFIKA
 

Offline kamelito

Re: Deluxe Paint 1 source code released
« Reply #3 on: July 23, 2015, 06:48:34 PM »
Exactly what can be done with the source code based on the licence.?
It's too cryptic to me.
Kamelito
 

guest11527

  • Guest
Re: Deluxe Paint 1 source code released
« Reply #4 on: July 23, 2015, 07:01:24 PM »
Quote from: kamelito;792981
Exactly what can be done with the source code based on the licence.?

From reading the license, you can download the source and modify it for your own purposes, but you may not distribute the modified versions or sell original or modified versions.
 

Offline kamelito

Re: Deluxe Paint 1 source code released
« Reply #5 on: July 23, 2015, 07:37:26 PM »
Quote from: Thomas Richter;792982
From reading the license, you can download the source and modify it for your own purposes, but you may not distribute the modified versions or sell original or modified versions.


Pretty limited but interesting as a Learning exercice.
But I suppose that you can distribute patches and build system so anyone can build it's own version on top of the original code.

Kamelito
 

Offline som99

  • Lifetime Member
  • Hero Member
  • *****
  • Join Date: Sep 2005
  • Posts: 1566
    • Show only replies by som99
    • http://www.som99.se
Re: Deluxe Paint 1 source code released
« Reply #6 on: July 23, 2015, 07:42:42 PM »
Thank you, my weekend is saved :)

@Olsen - Thanks for the analysis:)
 

Offline Minuous

Re: Deluxe Paint 1 source code released
« Reply #7 on: July 24, 2015, 03:37:31 AM »
Hopefully DPaint 5 AGA will be open sourced too; not sure why they went with such an old version...
 

Offline B00tDisk

  • VIP / Donor - Lifetime Member
  • Hero Member
  • *****
  • Join Date: Dec 2002
  • Posts: 1670
    • Show only replies by B00tDisk
    • http://www.thedelversdungeon.com
Re: Deluxe Paint 1 source code released
« Reply #8 on: July 24, 2015, 06:18:02 AM »
Quote from: Minuous;793012
Hopefully DPaint 5 AGA will be open sourced too; not sure why they went with such an old version...


"Because Electronic Arts," is why.  2015 EA sucks.
Back away from the EU-SSR!
 

guest11527

  • Guest
Re: Deluxe Paint 1 source code released
« Reply #9 on: July 24, 2015, 07:04:33 AM »
Quote from: B00tDisk;793019
"Because Electronic Arts," is why.  2015 EA sucks.

Hardly. Because the initiative was taken by a museum, and because the job of the museum (this one, in particular) is to preserve milestones of digital art. DPaint I certainly was, at its time, a breakthrough. All later versions were surely better, improved, nicer... but no longer pushed the limits by the same amount as DPaint I did.

The program does not sit there to give you a drawing program on the Amiga. If you want a decent one, there is PPaint.
 

Offline Trev

  • Zero
  • Hero Member
  • *****
  • Join Date: May 2003
  • Posts: 1550
  • Country: 00
    • Show only replies by Trev
Re: Deluxe Paint 1 source code released
« Reply #10 on: July 24, 2015, 07:56:11 AM »
I'm genuinely surprised by not only the release of the software but the news that EA has folks dedicated to preserving software internally. EA has claimed in the past that their Amiga software was effectively lost to time.
 

Offline warpdesign

  • Sr. Member
  • ****
  • Join Date: Feb 2008
  • Posts: 256
    • Show only replies by warpdesign
    • http://www.warpdesign.fr
Re: Deluxe Paint 1 source code released
« Reply #11 on: July 24, 2015, 07:59:55 AM »
The thing that surprised me is that it's C-only: there doesn't seem to be any ASM part in the sources. I guess the need for ASM came later.

In comparison, most Mac apps that have been open-sourced by the same museum (MacPaint, Photoshop,...) seem to include quite a large part of 68k assembly.
 

Offline olsen

Re: Deluxe Paint 1 source code released
« Reply #12 on: July 24, 2015, 11:05:49 AM »
Quote from: Thomas Richter;793025
Hardly. Because the initiative was taken by a museum, and because the job of the museum (this one, in particular) is to preserve milestones of digital art. DPaint I certainly was, at its time, a breakthrough. All later versions were surely better, improved, nicer... but no longer pushed the limits by the same amount as DPaint I did.
I would agree to that. However... "Deluxe Paint II" is not the "difficult second album" which would show whether the band which struggled to make the first album, that somehow became a hit, is here to stay. "Deluxe Paint II" was a major step up, both in terms of functionality and in documentation. It is a much more well-rounded product. It would be cool if one of these days "Deluxe Paint II" source code would be released, too, but my gut feeling is that the "Deluxe Paint" source code release was as much as we will likely ever see.

Quote

The program does not sit there to give you a drawing program on the Amiga. If you want a decent one, there is PPaint.
Well said :)
 

Offline olsen

Re: Deluxe Paint 1 source code released
« Reply #13 on: July 24, 2015, 11:15:20 AM »
Quote from: warpdesign;793028
The thing that surprised me is that it's C-only: there doesn't seem to be any ASM part in the sources. I guess the need for ASM came later.

In comparison, most Mac apps that have been open-sourced by the same museum (MacPaint, Photoshop,...) seem to include quite a large part of 68k assembly.
From what I learned by looking over the source code, the need to use assembly language was not acute because "Deluxe Paint" could harness the Blitter. It even hardly mattered that the 'C' compiler used in 1985/1986 was not an optimizing compiler. Most of the work done with "Deluxe Paint" is driven by user interaction, which is slow...

The Macintosh did not have a co-processor which would have helped the applications, hence the need to use (presumably hand-optimized) assembly language. Also, the Macintosh Pascal and 'C' compilers were just as poor at producing optimized code as the Lattice 'C' compiler used for "Deluxe Paint" at the time.

That said, the differences in these approaches even extends to the respective operating system. For example, the Amiga "graphics.library" is built around the co-processors (Denise, Agnus) and is written mostly in 'C' with significant portions rewritten or specifically written in assembly language. The original Macintosh QuickDraw by comparison was written entirely in assembly language, with no higher level language (Pascal) involved.
« Last Edit: July 24, 2015, 01:33:55 PM by olsen »
 

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: Deluxe Paint 1 source code released
« Reply #14 on: July 24, 2015, 12:18:19 PM »
Fascinating! Many thranks for looking the code over!