Wed, 21 May 2008

Path Change

The path to the HTML and RSS versions of the weblog has changed. Any URLs like:

www.vitaphone.net/weblog/geek/retro2007/foo...

Are now:

www.vitaphone.net/weblog/geek/hpc/foo...

Everything should re-direct automatically, but if anyone's still reading this, you might want to change your bookmarks or feed URLs.

posted at: 00:55 | path: /geek/hpc | permanent link to this entry


Progress (or lack thereof)

The last update to HappyPlusClock was in January, and the last update to this blog was in November. I have been working since then, however, and I hope to have version 1.0 out before long. Why am I not done yet?

posted at: 00:09 | path: /geek/hpc | permanent link to this entry


Tue, 13 Nov 2007

Compatibility

I found this entry that I'd written 3 Aug. 2007, but never pressed the button to post for some reason.


And one other note on writing retro Mac programs in general. You have a lot of freedom working on a dead system, because Apple isn't going to update Classic Mac OS any more. For example, hiding the menu bar involves fiddling with the GrayRgn and MBarHeight, both low-memory global variables. (Both of which I accessed through accessors, but they're still lowmem globals.) Apple finally, round about Mac OS 8.5, introduced HideMenuBar and ShowMenuBar system routines. I could test for their availability and use them if so, but why bother? The old way works on 9.2.2, the last verion of Classic Mac OS, and the unnecessary test just adds complexity.

You shouldn't take that approach on a live system (the old way, of course, stopped working entirely on OS X), but on a dead system, you can bend the rules a little more because you know things won't change.

Of course, you still need to look at the circumstances your program will be used in and be a good citizen. Classic Mac OS is dead in that there's no further development from Apple, but it's still very much alive in that it's being used by many people. On a Plus, I basically try to get as much CPU time as I can because the routines to draw the clock take a while on a 68000 and I want to be sure that updates are smooth. And on a 68000 system, you typically aren't going to have any other processes going while the clock is up, so it's not unfriendly.

That approach on a modern system just hordes the CPU unnecessarily, and, on a G4 or G5 (especially in Classic mode), probably wastes energy by defeating some of the power-saving measures built into those systems. So I do check for the 68000 case specially, and only run flat-out on a real 68000, allowing the program to sleep for split-second chunks of time on faster processors.

This project has been a wonderful opportunity to geek out in the magical land of Classic Mac OS.

posted at: 20:19 | path: /geek/hpc | permanent link to this entry


Wed, 15 Aug 2007

HappyPlusClock 0.84

Version 0.84 is now available.

This fixes another stupid clock drawing bug, which I introduced with 0.83, because I based 0.83 on my development branch rather than directly off of 0.82. I happened to be in the middle of re-factoring the analog clock drawing code, and forgot I wasn't finished. :(

In my present-day development, I'm used to working with version control: RCS, CVS, Git, and so on, and I know enough not to make stupid mistakes like that. (That's what branches are for.) But on this retro program and this retro development environment, I completely forgot all those advances.

I think I have MPW SourceServer laying around someplace. That's going to be a switch from Git...

posted at: 22:07 | path: /geek/hpc | permanent link to this entry


Wed, 08 Aug 2007

HappyPlusClock 0.83

Another bug fix: another stupid display bug in the digital clock. Nice little off-by-one error. Please, go download version 0.83 before you discover why I feel as silly as I do.

(Part of the code cleanup is adding better testing mechanisms, BTW.)

posted at: 23:01 | path: /geek/hpc | permanent link to this entry


Mon, 06 Aug 2007

Assertions

Okay, so one night I was complaining about the Pascal compiler, and I complained that macros didn't work. To my embarrassment and pleasure, I found that's not true. They work on CW Pro 4; I just wasn't using them correctly.

For the record, here's my (working) assertion macros:

{$IFC APH_DEBUG}

{$definec Assert(assertion) begin if not (assertion) then
    DebugStr('assertion failed;hc;sc') end}
{$definec AssertStr(assertion, str) begin if not (assertion) then
    DebugStr(str + ';hc;sc') end}

{$ELSEC}

{$definec Assert(assertion)}
{$definec AssertStr(assertion, str)}

{$ENDC}

I stumbled across an example of doing it correctly inside some Apple sample code, in the MoreSetup.p file of the MoreIsBetter package, still available at http://developer.apple.com.

posted at: 21:51 | path: /geek/hpc | permanent link to this entry


Holy Cripe! And Thanks!

Wow, you guys liked the clock! HappyPlusClock was named the best creation of Retro Challenge 2007!

As I mentioned, I'm going to continue to improve HappyPlusClock, and as soon as I get a couple bits of code in presentable shape, I'll release the Pascal source as well. I wrote it so I could put this great old Mac back into service doing something useful. As you can see, it's happily running on my Plus.

Thanks again, and I hope I can come up with something worthwhile for next year!


Congratulations to Oliver for winning for the best blog. I'm ashamed to say that I missed his site for most of the month, but it's no wonder he won... a IIgs, a Classic II with grayscale and a logic board transplant, and a "PIKO dat" electronic computer from 1969! And movies for everything.

posted at: 01:36 | path: /geek/hpc | permanent link to this entry


Fri, 03 Aug 2007

Things I've learned while writing HappyPlusClock

posted at: 14:38 | path: /geek/hpc | permanent link to this entry


End of RetroChallenge 2007

Well, July is over and the Retro Challenge 2007 ended with it. But it won't be the end of HappyPlusClock.

Since some of the code was rather rushed, I think what the program needs now is some clean-up. After that, I'll look at new features.

Thanks to everyone who wrote me about HappyPlusClock -- I really appreciate it and your messages have made the challenge fun.

posted at: 13:35 | path: /geek/hpc | permanent link to this entry


Sun, 29 Jul 2007

HappyPlusClock 0.82

A bug-fix release is now available for download. Somehow, I'd never noticed the display was incorrect from 12pm to 1pm. Sheesh.

posted at: 17:33 | path: /geek/hpc | permanent link to this entry