CLOCK2.BA v1.1 - by Gary Weber for the Model 100, Tandy 102, NEC PC-8201A/8300.

Your multi-hundred dollar Model T computer can now serve the role of a $20 digital alarm clock!

This originally started as just an NEC conversion of the M100/T102 version of CLOCK2.BA (available on www.club100.org), but it turned into so much more than that.  I successfully completed the conversion, but I'd found that the calendar display routine has a severe bug, whereby if you go to a prior month and then back to the current month, the calendar is now busted and is displayed completely inaccurately.

This bug exists on the original when run on a M100 machine. The culprit is the algorithm for determining the days-of-the-week as linked with the month & day, which gets messed up when switching between months. I just couldn't release something new for the NEC with a glaring bug like this so it definitely had to be fixed, but refactoring the original spaghetti calendar code proved to be way too difficult, and I decided to cut out the original calendar and reimplement it entirely. And thus began my implementation of a ton of other enhancements to the program, because once I start making something that I think will be useful, I now need to add every lacking feature I can think of. It's one of those personality quirks of mine I guess.

After the new version for the NEC was complete, I also ended up back-porting all of the enchancements and bug-fixes back to CALNDR2.BA for the M100/T102, because I couldn't just leave that original version alone with that ugly calendar bug.

Here's some highlights of the new features:

* Alarm now has a snooze function, where it will add 9 minutes to the alarm time if you hit the spacebar during the alarm. Any other key will just cancel the alarm.
* Added the "Take Me Out To The Ballgame" song as one of the selectable alarms. This was borrowed from CLOCK.BA, also on www.club100.org.
* For the NEC, it uses the graphic LINE() extension to BASIC as provided by any of three methods:
    1) LINE.CO if you already have it loaded.
    2) SARDOS 1.72+ option ROM, which can load the LINE() code into the ALT-LCD buffer and hook it into BASIC.  It will also unhook LINE() when you exit CLOCK2.  (We can't leave it hooked, because anything can corrupt the ALT-LCD buffer including TELCOM!)
    3) DISK Basic 2.0 operating system for the NEC PC-8231A disk drive, which also adds LINE() to BASIC.
* You can now set both the current time & date from within the program; a feature the original version doesn't have.
* The new calendar allows you not only to go to previous and next months to display like the original version, but it also lets you key in an arbitrary date of ANY month and year and display an accurate calendar. Want to know what day of the week January 4, 1643 was?  Just type in "1/1643" in the date field and watch a full calendar render on the screen for that entire month. One keystroke gets you back to the current calendar, too.
* Turning the chime or cuckoo-chime on or off no longer requires the full graphic re-rendering of the entire clock screen; you instead see just those options change their state. Believe me, if you were familiar with the original version of CLOCK2.BA, that was an annoyance that you'll be glad to be rid of!
* The alarm is still monitored and will properly go off even while you're in the calendar function, unlike the original version of the program.

And....there's just one more thing:

* IT SPEAKS THE TIME! This program can announce the current time and date on demand if you have a DoubleTalk LT speech synthesizer connected to your serial port.  At anytime while the clock face is displaying, you can just hit your spacebar and it will send the voice command to your DoubleTalk LT, and you'll hear something like "The current time is 11:54 PM, on Saturday, June 20th."  Useful for those middle-of-the-night moments when all lights are off and you want to hear the time announced by your trusty Model T laptop computer on the nightstand.  Wait, doesn't everyone have one on their nightstand?

Full usage instructions are available on the HELP screen in the program when it is running.

- - -

To actually load the program, you'll want to use a DOS like "TS-DOS" and load the .BA file appropriate for your machine.  Or from BASIC, you can Load the .DO file using a null-modem cable attached to a remote computer.  The program is too large for the .DO file itself to exist in the file system and then tokenized on the machine.

Files contained in this ZIP:

NEC\CLOCK2.BA - Tokenized version of the compacted program - load using a TPDD DOS, like TS-DOS. This has been compacted using Cleuseau.
NEC\CLOCK2.DO - ASCII version of the BASIC-compacted program - can be loaded into BASIC from another computer via a Load "COM:" command.
NEC\CLOCK2.TXT - Commented and expanded source code, meant to be viewed/modified on a modern desktop computer.

M100\CLOCK2.BA - Tokenized version of the compacted program - load using a TPDD DOS, like TS-DOS. This has been compacted using Cleuseau.
M100\CLOCK2.DO - ASCII version of the BASIC-compacted program - can be loaded into BASIC from another computer via a Load "COM:" command.
M100\CLOCK2.TXT - Commented and expanded source code, meant to be viewed/modified on a modern desktop computer.
