RetroChallenge 2022/10


I intend on using this month to learn how to program for vintage Mac OS, specifically System 7 and Mac OS 8/9.
The final result will most likely be some simple game like Pong, or maybe some kind of useful utility application.
I've wanted to do this for a while but never had enough motivation, so RetroChallenge seems to be the perfect time to get started on this :3


Day 1 (Oct. 1st)

Signed up just in time!! I didn't know RetroChallenge was going on this month until I came across this 68kmla thread.
Let's start with the system that I intend to do my programming on. My computer of choice is a Power Macintosh 6500/275 running Mac OS 7.6.1. I tend to prefer System 7 over Mac OS 8 and 9, mainly because of the fond memories I have of using it, but I might have to end up using Mac OS 8 or 9 in order to use newer development tools and reduce the amount of pain I'm throwing myself into. I guess we'll see! :D

The tools I'm using are CodeWarrior Pro 4, ResEdit, and THINK Reference. THINK Reference is a handly little tool that comes with Symantec C++ 8.6. Even though I'm not using C++ or Symantec's tools, THINK Reference is still nice to have around because it's an easy way to look up Toolbox routines right from my classic Mac!

I've already had a tiny bit of prior experience with the Macintosh Toolbox, so I was able to quickly whip up a hello world application using the demo/template included with CodeWarrior:
(click the image to view it larger)

Photo of a hello world application

Day 2 (Oct. 2nd)

Last night and this morning I spent some time reading Foundations of Mac Programming by Dan Parks Sydow. This is an excellent book that covers exactly what the title says: the foundations of classic Mac OS programming! Using this book as a reference, I was able to expand my super basic "hello world" demo application into something ever-so-slightly more substantial:
(click the image to view it larger)

Photo of a hello world application, but with my fursona!

Yes that's right, my fursona is now trapped inside of a 1997 Macintosh, oh no!!
(drawn by my amazing girlfriend Lua)

An interesting thing about classic Mac OS is that it's primarily event-driven, and the application itself is responsible for calling various Toolbox routines to handle basic things, such as window dragging, in response to events that are queued by the OS. The event loop and mouse-down handler functions of my current hello world application look like this:

That's it for day 2, most of the work done today was behind the scenes, setting up the various event handlers and stuff. Hopefully tomorrow I'll have something more exciting to show you :3