Page 1 of 1

X16 "Wall Clock" 20x15 custom fonts (BASIC)

Posted: Wed Oct 04, 2023 6:24 am
by Xiphod
This example uses custom fonts and the tiny 20x15 text mode to display the current time and date.

In BASIC, type "MENU" on the X16 to set the time and date. Depending on the emulator configuration, they may startup with "00" time - but the "real X16" has a battery and will store the date/time once it is set.

Version 1 updates:
- Added an "animated banner" (programmatically scrolls any given font)
- Minor font revisions (on 1, 7, 0)

Version 2 updates:
- banner defaults to non-moving, press SPACE to toggle shifting the banner or not
- press S to toggle on/off the display of the SECONDS
- press C to toggle on/off playing of an hourly chime (the code is setup to have a different chime for each hour, but for now the data table is set to all the same for each hour)
- press B to toggle between some foreground/background color options
- press H (or F1) to show a brief help/status (modes that are on are highlighted; the help is mostly just a reminder on what keys do anything at all) - this HELP only appears for about 8 seconds before auto-disappearing to declutter the screen
- press P to toggle "PM" mode (i.e. showing AM/PM or instead showing 24-hour time)
- some more minor font updates (on 1, 3, 4, 5 and the slash shifted up one)
(no, the program won't "remember" your settings between restarts; sorry :D I tried to pick good defaults )


Try It Now!

Re: X16 "Wall Clock" 20x15 custom fonts (BASIC)

Posted: Wed Oct 04, 2023 3:19 pm
by kelli217
Shades of the old BIGCLOCK program for the PET. :)

Re: X16 "Wall Clock" 20x15 custom fonts (BASIC)

Posted: Wed Oct 04, 2023 6:03 pm
by ahenry3068
VPOKE 1,$F200,$ 0F:REM 00001111 Could easily be condensed to

VPOKE 1,$F200, %00001111 The leading % means binary the same way a leading $ means HEX and though it is not an issue for your code really, REM statements do take up some BASIC memory.

Re: X16 "Wall Clock" 20x15 custom fonts (BASIC)

Posted: Thu Oct 05, 2023 6:34 am
by Xiphod
Good call, plus the binary as part of the code makes it easier to adjust in-place for minor touch-up.

All that was auto-generated out of the X16FONTS tool here
<viewtopic.php?p=29499#p29499>

So i've updated that tool to do this binary format output as you've recommended.

Re: X16 "Wall Clock" 20x15 custom fonts (BASIC)

Posted: Thu Oct 05, 2023 9:20 am
by ahenry3068
I've been meaning to check out your font tool. But so many side projects :)

Re: X16 "Wall Clock" 20x15 custom fonts (BASIC)

Posted: Thu Oct 05, 2023 10:02 am
by Xiphod
kelli217 wrote: Wed Oct 04, 2023 3:19 pm Shades of the old BIGCLOCK program for the PET. :)
For sure! But now I've added some color and a scrolling banner (computed scroll, so it can banner any font).

Re: X16 "Wall Clock" 20x15 custom fonts (BASIC)

Posted: Sat Oct 07, 2023 7:45 am
by Xiphod
Various feature updates on the clock tool! Including some pre-selected FG/BG color options and using FMFREQ for an hourly chime.

Check it out in "V2" (updated in first post)