Sun, 29 Jul 2007
Version 0.81 has been released!
The new feature is an optional date display along the top of the window. Not exactly a week's worth of work, but it's forward progress.
Thanks to everyone who's mailed me about HappyPlusClock. I'm really grateful for the feedback, and if I haven't answered yet, I will in the next day or so. You're thinking of all kinds of things which never occured to me. :)
Sat, 28 Jul 2007
I had intended to post HappyPlusClock 0.81 by now, with a date display, but I found a problem. The analog clock now crashes on my Plus. Not on my iMac, not on my SE/30, not on vMac emulating a Plus.
What's worse, MacsBug doesn't act correctly on my Plus, either -- it just locks up the system.
Update: Turns out it's a NIL handle bug, caused when I removed a now-unused debugging component. A bit of global data belonging to that component was no longer being initialized, and I ended up passing that to QuickDraw, which proceeded to go nuts. QuickDraw on later systems is much more tolerant to bad data. In this case, it hid a bug for a week.
HappyPlusClock 0.81 forthcoming!
Sun, 22 Jul 2007
The CodeWarrior Pro 4 Pascal compiler is so damned buggy.
Not "my code's crashing and I don't know why, so it must be the compiler's
fault" buggy, but "the manual says I can use anonymous types
macros just like so, but I get stupid compiler errors that go away when I
do it the old-fashioned way" buggy.
Features that CW Pro 4 claims to have but which don't actually work correctly:
- anonymous types -- only one works per unit, then the compiler gets confused when you try to define a second anonymous type
macros -- aren't recognized by the compiler
- unit initialization blocks -- never get executed
Update: Macros do work, I was just doing it wrong.
Having said this, if anyone out there knows that this stuff does work on CW Pro 4, let me know.
Even better, if you have the Pascal compilers for CW Pro 5, let me know. I have a licensed copy of CW Pro 5, but it wasn't originally released with Pascal compilers. They were supposed to have been released later, but I either never got them, or I lost them sometime in the last 8-9 years. Grrr.
Sat, 21 Jul 2007
HappyPlusClock version 0.80 is available for download!
All it has is the basic two clocks for this initial release. It should run well on any supported system (Classic Mac OS 4.2 or later on the Plus or newer). You don't actually need a Plus to run HappyPlusClock -- it runs just fine in a window under Classic on my G5 running 10.4.
It's available as a StuffIt file (had to dig around and find my old copy of StuffIt Lite 3.6) and as an 800K disk image, usable with Disk Copy 4.2 (or any later version, including on Mac OS X).
I've already had requests for feature additions — thanks Chris! — so this won't be the last version. A date display is obvious (so obvious that it never occured to me — D'oh!), and it's coming next.
An alarm feature requires a little more though. The Mac has a basic alarm feature (through the Alarm Clock DA). Anything more is going to require some thought about the user interface. The coding shouldn't be too hard.
If you decide to download and try it, please shoot me an e-mail at email@example.com just to let me know you did. That'd be really great.
Sun, 15 Jul 2007
So this clock program displays an analog clock (see picture), and a digital clock, and you can switch between them. The analog clock face is stored in a PICT resource, but the hands are drawn every second, of course.
I didn't have a good grasp of the speed of this process, so in my debug build, I calculate how long it takes to draw the analog clock (not including the extra time to copy it from the offscreen buffer onto the screen). The simplest way to measure sub-second time on the Plus is to use "ticks". A "tick" is 1/60th of a second. My routine takes about 35 ticks, meaning that it takes a little more than half a second to draw the clock.
This bothered me, and I wanted to see if I could get that time down. I
remembered the clock face picture. It's a 512 x 342 bitmap in a PICT, and
DrawPicture basically just does a full-screen
CopyBits to draw it. I
CopyBits takes a while, so I thought that I might replace it with
direct calls to QuickDraw -- I'd programmatically draw the entire analog
clock, and not just the hands.
I spent a couple of nights on this. It was a pain in the neck to replicate the clock face exactly. I'd drawn most of it in ClarisWorks, although I drew the angled marks on the clock face (for :05, :10, :20, and so on) programmatically to get the angles right. Then I took a screenshot and pasted them in. Anyway, getting everything to look right programmatically was a pain.
So I plugged in my new routine and ran the program: 55 ticks. It was now taking almost a whole second to draw the clock, and the second hand was visibly jumping two seconds at a time at places. Ugh.
Maybe 35 ticks ain't so bad...
Sun, 08 Jul 2007
As I mentioned, I'd worked on the clock program a little before the Challenge started. My floppy disks came in, so I thought I'd see if the program which ran well enough in vMac ran on a real Plus.
Turns out it does. :)
The picture shows, left to right: my main workstation (a G5 tower), my SE/30, my Plus (running the clock in analog mode), and the Bondi iMac where I've written most of the code. The two PCs under the desk run OpenBSD and Debian GNU/Linux.
The SE/30 serves as a bridge machine -- it has an Asante ethernet card, so it can talk to the iMac and G5, and it can make floppies for the Plus.
(I arranged and turned all the machines on just for this picture -- all six computers running at once is probably not a good idea, electrically.)
Wed, 04 Jul 2007
A few notes about my programming and testing setup.
Most of the code so far has been written on my iMac (Rev. A) running Mac OS 9. I wrote a little bit on my Power Mac G5. Since I can't yet transfer files onto my Plus to test with, I've been testing in Mini vMac. This is great, because through the magic of disk images, I can test with different OSen on the Plus. This is also a boon for the compile/crash/debug cycle -- vMac reboots a lot faster than a physical machine.
I'm primarily testing with System 4.2 (with and without MultiFinder 1.0),
System 6.0.8 (with and without MultiFinder), and System 7.1. I occasionally
boot 7.5 on the vMac Plus, but 7.5 is such a CPU hog, the analog clock just
barely keeps up! (I'm
CopyBits-ing the whole screen once a second, and
that takes some time. I'm going to work on optimizing that.)
I very much want the program to be compatible across as wide a range of Macs as possible. My release goal is for it to run unmodified on my Plus running System 4.2, and on my G5 tower running 9.2.2 in Classic mode.
Personally, I'm going to boot it on my 1 MB Plus (running either 4.2 or 6.0.8, doesn't much matter) and let it go. Man, I can see it already. :)
Mon, 02 Jul 2007
The first order of business is to get some floppies that will actually work in the Plus. I have exactly one 800K disk on the premises (see picture at right).
I've got a couple boxes of 1.4 MB disks, but no 800K disks. And those are what I need, since the Plus doesn't have a SuperDrive (FDHD).
As it happens, you can still buy those. I ordered a box from TigerDirect, and they should be here late this week.
Okay, so I have a Macintosh Plus. It was a "gift" from one of my previous employers, and had been destined to become an aquarium. But I never got around to that. And just as well.
So after some twelve years in service (circa 1987 to circa 1999!), it retired to a life of lesiure in the garden. (Okay, fine: I don't have a bootable disk right now, and without an action shot I was stuck for a way to make this somewhat interesting.)
So I'm going to turn it into a clock. That's an appliance. Maybe. Anyway, this is hardly a new idea, but in a market as lucrative as 68000 Mac freeware, I figure the potential return is definitely worth it. You know, name in lights, free trips to WWDC, and all that. :)
That, and it's a cool programming exercise. More on that in a bit.
Fri, 29 Jun 2007
Just stumbled across the webpage for the Retro Challenge 2007. This looks marvelous, and it so happens that I have an excuse to join!
I've been screwing around with a clock program for my Macintosh Plus, and this is a great reason to finish it up, package, and release it. Finally, a self-published freeware author! Just what I've always wanted to be!
Or something like that. Or maybe nothing like that.
At any rate, it apparently starts in two days, so I need to get going. Dust off the source code, get the Plus back off the shelf, and so forth.
Pictures and a proper first update forthcoming.