The Neil Young Fable

     While writing the oringial Magic Sac, the time came for me to code the keyboard & mouse driver.

    This was really hard, and I struggled over the design for a long time.  Problem was, on the Mac, the mouse was run directly by the 68000 via interrupts, through the SCC chip.  On the ST, the microprocessor, which periodically interrupts the 68000 to tell it where the mouse moved to.  Also, on both units, the keyboard was run by a standalone microprocessor, and the codes returned were totally different.  It was all totally different.

     I dreaded doing it.  I saw problems on top of the problems.  Interrupt conflicts, mouse resolution, keyboard mapping...  Finally, in desperation, I reached far back into my bag of programmer's tricks for the old axiom:  no pain, no gain.

    I extended this to:  If pain, gain.  Well, it's logical, right?

    So I looked through my record collection for something that would be true pain.  And I found it:  Neil Young, live in concert.  Off key, trembly voice, songs whose lyrics would depress a hyena.

    I put on the record player on automatic repeat, turned it on, and set to coding.  Six hours and 1,500 lines of code later, I was done.  I tried assembling it for the first time.  No errors.

     So I ran it.  The keyboard worked; I typed "a", and the Mac knew I typed "a".  I was really impressed.  so I got ready to debug the mouse code (which I was really dreading);  I moved the mouse to make room for a legal pad to take notes on... and the mouse pointer onscreen tracked with the mouse as I moved it.

     I played with the mouse in utter amazement for a few minutes.  It worked.

     This is the first piece of programming I have ever written that worked the first time.  As any programmer will tell you, this doesn't ever happen; it did for me, just this once.

     I attribute it all to Neil.  So, these days, I keep in reserve a cassette of Live Rust (no kidding, that's the name), and when the programming gets tough, Neil gets going.

     - Dave Small



(From page 21 of the Spectre 128 manual)

1