First thing I wanted to get setup was at least get the basics of my build pipeline installed. This is based on a blog post by Quinn Dunki, things have changed a bit and I wanted to verify the steps.
To get what we need, we will need to install the the following:
- cc65 – To compile the code
- AppleCommander – To put the compiled executable onto a floppy disk image
- Virtual ][ – To boot and test the image
Installing cc65 on the Mac is pretty easy as there is a bottle under Homebrew to install it directly. If you don’t have or have never used Homebrew, it’s a great way to install extra software in a way similar to MacPorts or Fink. Homebrew is easy to install, just follow the directions on their site.
Then to install cc65, simply do:
That’s it. Pretty simple. But, let’s try a simple test compile:
So far, so good.
For the build pipeline, we also need AppleCommander. Luckily, we can also install this with Homebrew by using this Apple II homebrew repository. First we need to “tap” the repository then we can install AppleCommander from there.
But, let’s make sure this part is working as well. Let’s put the “helloworld” executable on a DOS 3.3 bootable disk and try it out. You can get ”
Again, looks good so far. Next!
- The image created by -dos140 will not be bootable and, as you will see below, we will boot the DOS System Master 3.3 disk then run our image off the other disk. In the final, I’ll INIT the test disk before hand and reuse it as needed to boot
- When putting the executable on the disk, you’ll need to use -as (AppleSingle) flag when using AppleCommander. This replaces the -cc65 flag mentioned in Quinn’s post.
Installing Virtual ][
So far, we’ve been able to ride the build pipeline for free, but here is where need need to get off that train and pay piper (See what I did there?). To me, Virtual ][ is the go to emulator for the Mac and is worth every penny it costs. It 44USD for the full license. Like I said worth every penny. You can get Virtual ][ here.
Once you install it, you’ll need to get the correct ROM for the machine you want to run. I run an Apple //e as my physical machine, so I also like to run a //e as my virtual testing environment. You can find the ROM you need without a lot of digging, so I’ll leave that as a exercise for the reader.
The important part about using Virtual ][ that I’m not sure other emulators do, is that it has AppleScript support so it can be controlled from scripts. This is important to the build pipeline so it can load and boot the disk image as part of the build.
To verify Virtual ][, let’s boot the “Apple_DOS_3.3_Master.dsk” (found on Archive.org) in drive 1 and the image we created above in drive 2.
Everything looks good.
Notes/updates compared to Quinn’s post (i.e. TL;DR)
- cc65 can be installed via Homebrew.
- AppleCommander can be installed via Homebrew after adding the Apple II homebrew repository.
- The AppleCommand command line executable is “applecommander” not “ac”
- The “-cc65” flag has been removed and you need to use “-as” or “-dos” as appropriate. In our case, it’s “-as”
Next, I’ll be looking to generate a CMakefile (which CLion uses) to do similar work and link these together.