This page is a wiki. Please login or create an account to begin editing.


22 posts / 0 new
Last post
decafinatedtea's picture
Offline
Joined: 2020 Aug 27
C Development on Mac OS 9

Hi everyone,
I'm interested in making a G3 native application in C. I was wondering if there are any resources I can get my hands on? Particularly accessing the Macintosh Toolbox. I wouldn't mind doing this in Pascal either.
Cheers! Smile

Comments

WhosIt.There's picture
Offline
Joined: 2014 Aug 23

By the time of MacOS 9, the Mac programming language of choice was C, or one of it's varieties, using CodeWarrior.

Personally I'd still stick to using Think Pascal (maybe Think C, but I've never used it) as the better and easier to use development environment - no mucking about with separate editors and compilers, ability to test run without compiling, etc. The fools at Symantec had stopped development of both by MacOS 9, but they do still work, although it may depend on what toolbox routines you're trying to access.

Captain_Obvious's picture
Offline
Joined: 2013 Aug 25

Am I missing something? I'm not sure why you think users have to use separate editors & compilers in CodeWarrior. It's a completely integrated environment. Users have the option of using an external editor, but CodeWarrior's text editor is already excellent.

I never bothered using the Think tools, so I'm just going by what you've said here. And from what you said, it sounds like the Think dev tools were either doing continuous incremental compiling in the background as source is edited, or had an interpreter. Those are the only ways to run code without requiring the user to issue a "Build" command first. But honestly, that kind of thing really feels more like a gimmick than an essential feature to me: Because CodeWarrior's compilers and linkers are extremely fast and the IDE is smart about knowing what needs compiling and linking, so there's no inconvenience to me if it compiles before running when I issue the "Run" command (which can detect what needs compiling and does so before running the program).

WhosIt.There's picture
Offline
Joined: 2014 Aug 23

Just my personal opinion having tried both, Think Pascal was simply a much better and easier environment to program in than CodeWarrior (early versions anyway) which were cumbersome and horrible to use.

I don't remember whether it was interpreted or not, but Lightspeed / Think Pascal, and probably Think C let you test run your app, with user-definable break points, step-by-step running, and an "Observe" window to see what data was currently in variables ... you could easily see exactly what the code was doing. It did of course run a syntax check first to check for things like typos, etc., so possibly did some sort of background partial compile and partial interpret running. It is very simple, quick, and extremely useful, certainly not a 'gimmick' in any way.

It's sad than Symantec simply gave up on it.

Unlike say REALBasic (as an example), the final apps created were also very compact since they only included what was actually needed, rather than massive libraries of unnecessary stuff.

Captain_Obvious's picture
Offline
Joined: 2013 Aug 25

OK. I started using CodeWarrior when Gold 12 was the latest. I read somewhere that the Pascal problems had been fixed by the time Gold 10 was released. So it sounds like I "missed out" on the early days when it had problems with Pascal.

BTW: That "test run" feature you describe sounds almost identical to using the integrated debugger in CodeWarrior.

I'm curious: Did you ever use Instant Pascal on the Apple II? I just discovered that there was a Mac version of it called Macintosh Pascal. It's posted here: Macintosh Pascal

WhosIt.There's picture
Offline
Joined: 2014 Aug 23

On the Apple II, VIC20 and C64, I only BASIC (well, and LOGO and RobotWar). It was at university with the then-brand-new Macs that I started using Pascal (and COBOL on mainframe systems) - one of our assignments was to re-create the Puzzle Desk Accessory.

That "Macintosh Pascal" looks like an early version of "Think Pascal" ... it is made by Think Technologies, although I don't know how it fits in with Lightspeed Pascal, which from memory was the original name, before Symantec bought it up. "Think Pascal" is also available in various versions on here. It was eventually abandoned, partly due to C and C+ becoming more popular. Originally Pascal was THE language for programming the Mac. There was also a Think C, although I never used it and it too was abandoned.

That's about where CodeWarrior and C became the Mac standard for programming. I wouldn't be surprised if CodeWarrior "borrowed" many ideas from Think Pascal / C.

Duality's picture
Offline
Joined: 2014 Mar 1

I'm not fully aware of the timings, but THINK's Macintosh Pascal was an interpreted Pascal and THINK's Lightspeed Pascal was a compiled Pascal.

I believe Macintosh Pascal was marketed for learning Pascal and sold for less than Lightspeed, before Lightspeed simply became THINK Pascal.

There was one other THINK-developed tool for learning Pascal called Just Enough Pascal, a Desk Accessory. The manual for that one is on my scanning queue that hasn't budged in some time.

WhosIt.There's picture
Offline
Joined: 2014 Aug 23

Lightspeed Pascal, no idea what version number though, is what we first used at university and had all the features I've mentioned, plus the Drawing and Text windows shown in that Macintosh Pascal screenshot.

cbone's picture
Offline
Joined: 2011 Sep 17

I wish I had the coding 'DNA'! Laughing out loud

But I do wish you great fun and success in your quest to create for OS 9, just wish I could help (outside of beta testing, of course)! Smile

snes1423's picture
Online
Joined: 2020 May 13

i have never really given myself the chance to learn any but i was born with savant syndrome so if i focus on something it becomes reality

cbone's picture
Offline
Joined: 2011 Sep 17

you, and all of us really, are amazing in our own specific ways Smile but what makes the amazing gifts we possess something truly wonderful is when we share them with others... that's what makes this little Mac web spot so amazing to me Laughing out loud of course, life's wonders should not be limited to vintage Macs alone Wink which is totally arguable here, as you can surely imagine, lol!

cbone's picture
Offline
Joined: 2011 Sep 17

Having one thing on a 68k Mac OS that'd be a real treat is a version of A-Dock that could run on a 68k Macs!

And it really doesn't need half the things A-Dock does; simply the look-and-feel, dropping files on dock icons and auto-hiding would be more than enough; but alas, I have no idea if dumbing-it down would be a simple or complex programming operation.

MikeTomTom's picture
Offline
Joined: 2009 Dec 7

Very old but worth having: Inside Macintosh (PDF's) and Inside Macintosh (CD's)

Plus, browsing through here may turn up something interesting.

Duality's picture
Offline
Joined: 2014 Mar 1

I try to avoid advice telling people what they should do, since everybody's path is a little different. This thread turned out fine, as far as sharing other people's journeys in programming with Classic Mac tools.

My opinion is that the best and most accessible resources for classic Mac programming were in the System 6 and early 7 era, because that was about the peak gold rush for Macintosh programmers.

If you want to relate that to more contemporary events, System 6 is like iPhone OS 3, System 7 like iOS 5, in terms of capabilities and how easy the platform was to learn in that time. By the time you get to Mac OS 9, most resources and tools are acknowledging a multi-platform Windows world and dealing with the complexity of juggling Thread Manager, OpenGL, Appearance Manager, etc with Mac OS X porting-friendly technologies like Carbon. I don't think that's as fun.

Rather than try to dive straight into Mac OS 9, you can start with System 7 in the 1992 edition of Dave Mark's Macintosh C Primer. It's a good way of getting up to speed on THINK C and Macintosh Toolbox APIs before deciding where to go next. Volume 1 is on Vintage Apple. Volume 2 is not, but it is out there if you're interested in more of the same.

After that, you can redo the same System 7-aware lessons in CodeWarrior and decide where to go next on the G3. That's one possibility.

decafinatedtea's picture
Offline
Joined: 2020 Aug 27

I got Dave Mark's book. I have Volume I.. I'm on the look out for Volume II. I got it off ebay.

Captain_Obvious's picture
Offline
Joined: 2013 Aug 25

I recommend picking up a copy of "TOG On Interface" and the Apple HIG. They're worth their weight in gold.

"TOG on Interface" is worth getting in print.

You might have to resort to a digital copy of Apple's Human Interface Guidelines, since high quality used copies are currently going for around $600.

WhosIt.There's picture
Offline
Joined: 2014 Aug 23

There is a Volume 2 of Dave Mark's Macintosh C Primer on VintageApple.org ... in fact there are two editions. Ignore the misleading link titles, but the book scans themselves show one is the Fourth Printing, November 1991 and the other is the Fifth printing, July 1992.

I used his Pascal Primer which was also very good and still have fairly battered Volume 1 (never had Volume 2).

Duality's picture
Offline
Joined: 2014 Mar 1

Excellent. I came across a similar issue with VintageApple.org's copy of "Oh! Pascal", which is really a companion text to use Macintosh Pascal with the second edition of Oh! Pascal.

I believe the fellow who runs the site and does the scans is still active, might be responsive to feedback. Since I doubt most visitors are poking around the programming books (they are "a niche of a niche") it would be good to reach out, even to let him know how helpful that site is.

WhosIt.There's picture
Offline
Joined: 2014 Aug 23

You can try, but I have sent an email/message once before and gotten no response ... of course it may have gotten lost somehow and he never saw it.

Duality's picture
Offline
Joined: 2014 Mar 1

You may be right. I tried the web form. Clicking the "Submit" button three times didn't produce a response.

Since I seem to be having some luck with reaching people lately, I'll give it a day before I try the e-mail address on the lower left.

WhosIt.There's picture
Offline
Joined: 2014 Aug 23

Of course, the other thing you'll need for old MacOS programming is a resource editor of some sort - ResEdit or Resourcer being the usual choices. You'll need one of those to easily create the various resources your app uses, such as window definitions, dialog box definitions, icons, pict and sound resources, etc.

Bolkonskij's picture
Offline
Joined: 2009 Aug 3

Lots of right things have been said, maybe another consideration - if you plan on porting something and re-using code you'll definitely want to use the latest CodeWarrior version that supports your target as it supports a later standard of C.

With the old old C compilers you're stuck with ANSI C or whatever. Unless the code you wanna use stems back from the same years as your compiler, you'll end up fixing stuff (which I always found very annoying)