Posts

Using Retro68 on a Mac

I was looking at Retro68 for legacy Macintosh development. It is handy because I can use a modern IDE and compile stuff without coding straight into the emulator. It seems it also supports C++ beyond version 98 and it would include modern optimisations. I don't know. (I'm mediocre, not exceptional, remember? I'll figure out at some point and then I post here.) But there are no guides for this thing anywhere. There's a bloke using Linux and another using... Linux as well, I think. I don't know, it's all wrong, so I had to figure out one step at a time. Tutorial time! I am on macOS 15.1. My mac is an M2 mac. I got the regular developer junk installed, you know, XCode, those xcode tools and Homebrew and all that stuff. So first, we update Homebrew, because this thing is always outdated. (What's up with that? Stop adding shit to this tool! Weirdos.) $ brew upgrade # lots of unnecessary noise here $ brew install boost cmake gmp mpfr libmpc bison texinfo # 26 mi...

Bundles in Mac OS 9

I've skipped the transition from Mac OS 9 to Mac OS X. So while I was following the wyag tutorial to write a GIT my first step into the implementation was to figure out a way of assessing whether a path exists and whether it was a directory or a file. I got a lot of help from some clever people on the 68kmla forum and came up with a neat little code: https://github.com/sentient06/classic-mac-snippets/blob/master/Cpp%20Toolkit/FileFinder.cp Of course, that thing wouldn't work on my emulated mac, no matter what I did. I finally figured out the reason, though: some weird setting caused the generated app to be wrapped inside a bundle, very much like Mac OS X's app bundles. So as the binary lived inside that bundle, it wasn't able to find the files in the current directory because it was lookin at its own wrapper instead. Mystery solved. I shall resume my tutorials from the PowerPC Programmers Toolkit. They are immense and such a bore to write!

Note to self: resource forks on modern macOS

On a modern macOS system, you can investigate and log Type and Creator codes using the mdls (metadata listing) command in Terminal, like so: mdls /path/to/file This command lists all metadata associated with the file. The ones I want are: kMDItemFSTypeCode : This is the file type code. kMDItemFSCreatorCode : This is the creator code. These attributes can be verified on Classic with ResEdit.  

Classilla problems

So every time I download a file on Classilla, it corrupts the metadata. So the type is always "GIFf" and creator is always "ogle", which forces me to change the creator and type manually. Of course, I don't know these by heart, so I need to figure out every time it happens. I've been setting Mac OS 8.6 on SheepShaver to work along with Mac OS 9.2.2 on QEMU. The advantage is that SheepShaver copies the host's clipboard, so it's much easier to edit files. But then on Mac OS 9 I use FileType to address the metadata issues and, naturally, that doesn't work on SheepShaver because it requires Carbon. So now on Mac OS 8 I use BunchTyper. But it's a pain in the arse. I wish Classilla would just leave the metadata alone.

Books books books

 I started reading PowerPC Programmer's Toolkit by Tom Thompson from 1996. It's C. But it has extensive Toolbox information. The sad bit is that I don't have the CD-ROM that should accompany the book, so I have to type every block of code, and there's some seriously long ones. It's a good book. It didn't age well, with all those Copland boxes and comments, but it's almost what I needed. It will take a while to finish this one.

Data Forks

Image
I read that GIT actually doesn't track data forks. So if I create a GIT solution for Mac, I need to deal with that. My research took me into the realms of Rez and DeRez: the tools that Apple created to encode and decode data forks. Apparently these tools made into Mac OS X and might still live in modern systems in the form of a Unix binary. For the good old fashioned Mac OS, however, it can only be used on the Macintosh Programmers Workshop. I downloaded MPW from a mirror of Apple's FTP and got it installed on QEMU. Bloody hell, this thing is not very intuitive! So, the MPW shell is basically a text editor. But by typing commands, then using ⌘+ return, it executes as if it were a Unix shell, by printing the results below. If there's any text in the way, it simply pushes it down. It's kind of neat, but very easy to make a mess of things. So, the plan is... We create an invisible dot-GIT directory with all the standard stuff inside, then we make another invisible dot-Data...

Directory delimiters

So I was reading about GIT. I need to develop some sort of code to check the existence of directories, to create new directories and possibly delete directories. That's not too easy from the little I saw of the Toolbox. Then it downed on me: directory sections are separated on Mac OS with colons. GIT and Unix systems use slashes. Windows uses a backslash. Sure enough, Windows has a translation procedure on its implementation of GIT (which is actually Linux, but.. emulated? I don't know. Don't care.) So I need to translate between Mac OS directory delimiters and Unix as well. I'll just add this to the to-do list.