From ee33718ab57c5a041b55c70c0ae7e046b3d1592b Mon Sep 17 00:00:00 2001 From: fishsoupisgood Date: Tue, 28 May 2019 12:09:03 +0100 Subject: general tidy up add all the timex apps and the toebes apps and numpad --- from_toebes/3ball/3ball.asm | 1 + from_toebes/3ball/3ball.known_good | 1 + from_toebes/3ball/3ball.zap | 29 ++ from_toebes/3ball/3ball.zsm | 148 ++++++ from_toebes/Makefile | 46 ++ from_toebes/datahid2/Data Hider App Beta.txt | 43 ++ from_toebes/datahid2/datahid2.zap | 33 ++ from_toebes/dayfind/dayfind.asm | 384 ++++++++++++++++ from_toebes/dayfind/dayfind.known_good | 1 + from_toebes/dayfind/dayfind.zap | 31 ++ from_toebes/dayfind/dayfind.zsm | 375 +++++++++++++++ from_toebes/endoff/endoff.asm | 1 + from_toebes/endoff/endoff.known_good | 1 + from_toebes/endoff/endoff.zap | 25 + from_toebes/endoff/endoff.zsm | 145 ++++++ from_toebes/flash/flash.asm | 1 + from_toebes/flash/flash.known_good | 1 + from_toebes/flash/flash.zap | 25 + from_toebes/flash/flash.zsm | 135 ++++++ from_toebes/hello/hello.asm | 1 + from_toebes/hello/hello.known_good | 1 + from_toebes/hello/hello.zap | 25 + from_toebes/hello/hello.zsm | 83 ++++ from_toebes/hexdump/hexdump.asm | 1 + from_toebes/hexdump/hexdump.known_good | 1 + from_toebes/hexdump/hexdump.zap | 33 ++ from_toebes/hexdump/hexdump.zsm | 322 +++++++++++++ from_toebes/number/number.asm | 1 + from_toebes/number/number.known_good | Bin 0 -> 147 bytes from_toebes/number/number.zsm | 117 +++++ from_toebes/passwd/passwd.asm | 237 ++++++++++ from_toebes/passwd/passwd.known_good | Bin 0 -> 337 bytes from_toebes/passwd/passwd.zap | 25 + from_toebes/passwd/passwd.zsm | 232 ++++++++++ from_toebes/pick6/pick6.asm | 1 + from_toebes/pick6/pick6.known_good | 1 + from_toebes/pick6/pick6.zap | 33 ++ from_toebes/pick6/pick6.zsm | 335 ++++++++++++++ from_toebes/promdump/promdump.asm | 336 ++++++++++++++ from_toebes/promdump/promdump.known_good | 1 + from_toebes/promdump/promdump.zap | 33 ++ from_toebes/promdump/promdump.zsm | 336 ++++++++++++++ from_toebes/shipbell/shipbell.asm | 176 +++++++ from_toebes/shipbell/shipbell.known_good | 1 + from_toebes/shipbell/shipbell.zap | 27 ++ from_toebes/shipbell/shipbell.zsm | 176 +++++++ from_toebes/sound1/sound1.asm | 1 + from_toebes/sound1/sound1.known_good | Bin 0 -> 46 bytes from_toebes/sound1/sound1.spc | Bin 0 -> 50 bytes from_toebes/sound1/sound1.zsm | 83 ++++ from_toebes/spend0/spend0.asm | 1 + from_toebes/spend0/spend0.known_good | 1 + from_toebes/spend0/spend0.zap | 37 ++ from_toebes/spend0/spend0.zsm | 656 +++++++++++++++++++++++++++ from_toebes/spend0/spendset.exe | Bin 0 -> 28160 bytes from_toebes/testsnd/testsnd.asm | 155 +++++++ from_toebes/testsnd/testsnd.known_good | 1 + from_toebes/testsnd/testsnd.zap | 26 ++ from_toebes/testsnd/testsnd.zsm | 154 +++++++ from_toebes/tipcalc/tipcalc1.zap | 35 ++ from_toebes/update/update.asm | 1 + from_toebes/update/update.known_good | 1 + from_toebes/update/update.zap | 25 + from_toebes/update/update.zsm | 133 ++++++ 64 files changed, 5271 insertions(+) create mode 120000 from_toebes/3ball/3ball.asm create mode 120000 from_toebes/3ball/3ball.known_good create mode 100644 from_toebes/3ball/3ball.zap create mode 100644 from_toebes/3ball/3ball.zsm create mode 100644 from_toebes/Makefile create mode 100644 from_toebes/datahid2/Data Hider App Beta.txt create mode 100644 from_toebes/datahid2/datahid2.zap create mode 100644 from_toebes/dayfind/dayfind.asm create mode 120000 from_toebes/dayfind/dayfind.known_good create mode 100644 from_toebes/dayfind/dayfind.zap create mode 100644 from_toebes/dayfind/dayfind.zsm create mode 120000 from_toebes/endoff/endoff.asm create mode 120000 from_toebes/endoff/endoff.known_good create mode 100644 from_toebes/endoff/endoff.zap create mode 100644 from_toebes/endoff/endoff.zsm create mode 120000 from_toebes/flash/flash.asm create mode 120000 from_toebes/flash/flash.known_good create mode 100644 from_toebes/flash/flash.zap create mode 100644 from_toebes/flash/flash.zsm create mode 120000 from_toebes/hello/hello.asm create mode 120000 from_toebes/hello/hello.known_good create mode 100644 from_toebes/hello/hello.zap create mode 100644 from_toebes/hello/hello.zsm create mode 120000 from_toebes/hexdump/hexdump.asm create mode 120000 from_toebes/hexdump/hexdump.known_good create mode 100644 from_toebes/hexdump/hexdump.zap create mode 100644 from_toebes/hexdump/hexdump.zsm create mode 120000 from_toebes/number/number.asm create mode 100644 from_toebes/number/number.known_good create mode 100644 from_toebes/number/number.zsm create mode 100644 from_toebes/passwd/passwd.asm create mode 100644 from_toebes/passwd/passwd.known_good create mode 100644 from_toebes/passwd/passwd.zap create mode 100644 from_toebes/passwd/passwd.zsm create mode 120000 from_toebes/pick6/pick6.asm create mode 120000 from_toebes/pick6/pick6.known_good create mode 100644 from_toebes/pick6/pick6.zap create mode 100644 from_toebes/pick6/pick6.zsm create mode 100644 from_toebes/promdump/promdump.asm create mode 120000 from_toebes/promdump/promdump.known_good create mode 100644 from_toebes/promdump/promdump.zap create mode 100644 from_toebes/promdump/promdump.zsm create mode 100644 from_toebes/shipbell/shipbell.asm create mode 120000 from_toebes/shipbell/shipbell.known_good create mode 100644 from_toebes/shipbell/shipbell.zap create mode 100644 from_toebes/shipbell/shipbell.zsm create mode 120000 from_toebes/sound1/sound1.asm create mode 100644 from_toebes/sound1/sound1.known_good create mode 100644 from_toebes/sound1/sound1.spc create mode 100644 from_toebes/sound1/sound1.zsm create mode 120000 from_toebes/spend0/spend0.asm create mode 120000 from_toebes/spend0/spend0.known_good create mode 100644 from_toebes/spend0/spend0.zap create mode 100644 from_toebes/spend0/spend0.zsm create mode 100644 from_toebes/spend0/spendset.exe create mode 100644 from_toebes/testsnd/testsnd.asm create mode 120000 from_toebes/testsnd/testsnd.known_good create mode 100644 from_toebes/testsnd/testsnd.zap create mode 100644 from_toebes/testsnd/testsnd.zsm create mode 100644 from_toebes/tipcalc/tipcalc1.zap create mode 120000 from_toebes/update/update.asm create mode 120000 from_toebes/update/update.known_good create mode 100644 from_toebes/update/update.zap create mode 100644 from_toebes/update/update.zsm (limited to 'from_toebes') diff --git a/from_toebes/3ball/3ball.asm b/from_toebes/3ball/3ball.asm new file mode 120000 index 0000000..c89f401 --- /dev/null +++ b/from_toebes/3ball/3ball.asm @@ -0,0 +1 @@ +3ball.zsm \ No newline at end of file diff --git a/from_toebes/3ball/3ball.known_good b/from_toebes/3ball/3ball.known_good new file mode 120000 index 0000000..81bd3de --- /dev/null +++ b/from_toebes/3ball/3ball.known_good @@ -0,0 +1 @@ +3ball.zap.app \ No newline at end of file diff --git a/from_toebes/3ball/3ball.zap b/from_toebes/3ball/3ball.zap new file mode 100644 index 0000000..4dc2511 --- /dev/null +++ b/from_toebes/3ball/3ball.zap @@ -0,0 +1,29 @@ +TDL0831972¬ +3BALL¬ +3BALL¬ +An executive decision maker that will give a yes/no/maybe answer. Pressing Next will generate another answer and beep (since it will be the same answer sometimes). + +(c) 1997 Wayne Buttles (timex@fdisk.com). Compiled using tools and knowledge published by John A. Toebes, VIII and Michael Polymenakos (mpoly@panix.com). + Some enhancements by John Toebes... +¬ +watchapp.hlp¬ +100¬ +none¬ +Timex Data Link 150 Watch¬ +CC01B2139081CC0188139081819D9DD6014D81CC015E00031D0B0A1313140A1B0B0E1D1B0E051D1D15001D1D1D1F001F1D1D1D2C2D2C2B2A2B22261D22001B85001AFF008085001FFF0001FFFF1D128F1390B691A1802737A11B2733A11A2706AD33A403B761BE61D60149CD587EA617CD58A8A648CC584CC604C1A1082684AE05B662CD6B0DB76297D60143CC587E3F62129020D9B660AE5542AB19B76049494981A6C0B796B627B76081¬ +22325¬ +0¬ +3BALL¬ +3BALL¬ +An executive decision maker that will give a yes/no/maybe answer. Pressing Next will generate another answer and beep (since it will be the same answer sometimes). + +(c) 1997 Wayne Buttles (timex@fdisk.com). Compiled using tools and knowledge published by John A. Toebes, VIII and Michael Polymenakos (mpoly@panix.com). + Some enhancements by John Toebes... +¬ +watchapp.hlp¬ +100¬ +none¬ +Timex Data Link 150s Watch¬ +CC01B2139081CC0188139081819D9DD6014D81CC015E00031D0B0A1313140A1B0B0E1D1B0E051D1D15001D1D1D1F001F1D1D1D2C2D2C2B2A2B22261D22001B85001AFF008085001FFF0001FFFF1D128F1390B691A1802737A11B2733A11A2706AD33A403B761BE61D60149CD577FA617CD57A9A648CC574DC604C1A1082684AE05B662CD6B16B76297D60143CC577F3F62129020D9B660AE5542AB19B76049494981A6C0B796B627B76081¬ +52185¬ +0¬ \ No newline at end of file diff --git a/from_toebes/3ball/3ball.zsm b/from_toebes/3ball/3ball.zsm new file mode 100644 index 0000000..e98b2d8 --- /dev/null +++ b/from_toebes/3ball/3ball.zsm @@ -0,0 +1,148 @@ +;Name: 3BALL +;Version: 3BALL +;Description: An executive decision maker that will give a yes/no/maybe answer. Pressing Next will generate another answer and beep (since it will be the same answer sometimes). +; +;(c) 1997 Wayne Buttles (timex@fdisk.com). Compiled using tools and knowledge published by John A. Toebes, VIII and Michael Polymenakos (mpoly@panix.com). +; Some enhancements by John Toebes... +; +;HelpFile: watchapp.hlp +;HelpTopic: 100 +; +; (1) Program specific constants +; + INCLUDE "WRISTAPP.I" +; +; Program specific constants +; +CURRENT_TIC EQU $27 ; Current system clock tic (Timer) +LAST_ANS EQU $61 +RAND_SEED EQU $60 +MARQ_POS EQU $62 +START EQU * +; +; (2) System entry point vectors +; +L0110: jmp MAIN ; The main entry point - WRIST_MAIN +L0113: bclr 1,BTNFLAGS ; Called when we are suspended for any reason - WRIST_SUSPEND + rts +L0116: jmp FLASH ; Called to handle any timers or time events - WRIST_DOTIC +L0119: bclr 1,BTNFLAGS ; Called when the COMM app starts and we have timers pending - WRIST_INCOMM + rts +L011c: rts ; Called when the COMM app loads new data - WRIST_NEWDATA + nop + nop + +L011f: lda STATETAB,X ; The state table get routine - WRIST_GETSTATE + rts + +L0123: jmp HANDLE_STATE0 + db STATETAB-STATETAB +; +; (3) Program strings +; +S6_MSG timex6 "3 BALL" +S6_MAYBE timex6 "MAYBE" +S6_YES timex6 " YES" +S6_NO timex6 " NO" +S6_MARQ timex6 " +O+ " + +MARQ_SEL + DB S6_MARQ+2-START + DB S6_MARQ+3-START + DB S6_MARQ+2-START + DB S6_MARQ+1-START + DB S6_MARQ-START + DB S6_MARQ+1-START + +MSG_SEL DB S6_YES-START + DB S6_NO-START + DB S6_MAYBE-START + DB S6_YES-START +; +; (4) State Table +; +STATETAB: + db 0 + db EVT_ENTER,TIM2_16TIC,0 ; Initial state + db EVT_RESUME,TIM_ONCE,0 ; Resume from a nested app + db EVT_DNNEXT,TIM2_16TIC,0 ; Next button + db EVT_TIMER2,TIM_ONCE,0 ; Timer + db EVT_MODE,TIM_ONCE,$FF ; Mode button + db EVT_END +; +; (5) State Table 0 Handler +; This is called to process the state events. +; We see ENTER, RESUME, TIMER2 and NEXT events +; +HANDLE_STATE0: + bset 1,APP_FLAGS ; Indicate that we can be suspended + bclr 1,BTNFLAGS + lda BTNSTATE + cmp #EVT_DNNEXT ; Did they press the next button? + beq DOITAGAIN + cmp #EVT_ENTER ; Or did we start out + beq DOITAGAIN + cmp #EVT_RESUME + beq REFRESH +; +; (6) Select a random answer +; +SHOWIT + bsr RAND + and #3 ; go to a 1 in 4 chance + sta LAST_ANS +; +; (7) Display the currently selected random number +; +REFRESH + ldx LAST_ANS ; Get the last answer we had, and use it as an index + lda MSG_SEL,X ; And get the message to display + jsr PUT6TOP ; Put that on the top +BANNER + lda #S6_MSG-START + jsr PUT6MID + lda #SYS8_MODE ; And show the mode on the bottom + jmp PUTMSGBOT +; +; (8) This flashes the text on the screen +; +FLASH + lda CURRENT_APP ; See which app is currently running + cmp #APP_WRIST ; Is it us? + bne L0113 ; No, so just turn off the tic timer since we don't need it + ldx #5 + lda MARQ_POS + jsr INCA_WRAPX + sta MARQ_POS + tax + lda MARQ_SEL,X + jmp PUT6TOP +; +; (9) They want us to do it again +; +DOITAGAIN ; Tell them we are going to do it again + clr MARQ_POS + bset 1,BTNFLAGS + bra BANNER +; +; (10) Here is a simple random number generator +; +RAND + lda RAND_SEED + ldx #85 + mul + add #25 + sta RAND_SEED + rola + rola + rola + rts +; +; (11) This is the main initialization routine which is called when we first get the app into memory +; +MAIN: + lda #$c0 ; We want button beeps and to indicate that we have been loaded + sta WRISTAPP_FLAGS + lda CURRENT_TIC + sta RAND_SEED + rts diff --git a/from_toebes/Makefile b/from_toebes/Makefile new file mode 100644 index 0000000..93ce6f1 --- /dev/null +++ b/from_toebes/Makefile @@ -0,0 +1,46 @@ +TUTORIALS=hello number update flash passwd dayfind testsnd endoff hexdump promdump spend0 sound1 3ball shipbell pick6 +ZAPS=${wildcard */*.zap} +#tipcalc +#datahid2 + +STAMPS=${foreach appdir,${TUTORIALS},${appdir}/${appdir}.stamp} +APPS=${STAMPS:%.stamp=%.app} +PS=${APPS:%.app=%.p} +LSTS=${APPS:%.app=%.lst} +HEX=${APPS:%.app=%.app.hex} ${APPS:%.app=%.known_good.hex} +ZAPAPPS=${ZAPS:%.zap=%.zap.app} + + +CROSS=../../asl/ + +ZAP2APP=../tools/zap2app + +AFLAGS=-i ../include/dl150 -cpu datalink +AS=${CROSS}asl ${AFLAGS} + +P2BIN=${CROSS}p2bin + +default:${STAMPS} ${APPS} ${ZAPAPPS} + +%.stamp:%.app.hex %.known_good.hex + diff -uN ${@:%.stamp=%.app.hex} ${@:%.stamp=%.known_good.hex} && touch $@ + + +${HEX}:${ZAPAPPS} + +%.hex:% + yes '' | dd bs=272 count=1 | cat - $< | hexdump -C > $@ || /bin/rm -f $@ + +%.zap.app:%.zap + ${ZAP2APP} $< $@ + +.PRECIOUS:${APPS} + +%.app:%.p + ${P2BIN} $< $@ -r 0x110-\$$ + +%.p:%.asm + ${AS} -L ${@:%.p=%.lst} -o $@ $< + +clean: + /bin/rm -f ${APPS} ${PS} ${LSTS} ${HEX} ${STAMPS} ${ZAPAPPS} diff --git a/from_toebes/datahid2/Data Hider App Beta.txt b/from_toebes/datahid2/Data Hider App Beta.txt new file mode 100644 index 0000000..66a5bc5 --- /dev/null +++ b/from_toebes/datahid2/Data Hider App Beta.txt @@ -0,0 +1,43 @@ +From: John Toebes +Sent: Saturday, April 12, 1997 2:23 PM +To: 'datalink-developers@listproc.wsu.edu' +Subject: Data Hider App Beta + +Hi all, + Here's another useful app which I am nearly finished with, but wanted +people to have a chance to comment on it. What it does is allow you to +protect the entries in your watch so that they can't be seen unless +someone enters a password. The way it works is pretty simple: + Switch to the app. If the data is currently hidden, it says: + DATA + HIDDEN + J. TOEBES + Otherwise if you can actually see the phone numbers and list entries it +says: + DATA + HIDER + J. TOEBES + +To hide the data on your watch, press the next button. Once you exit +the app, you can't see any of the phone or list entries if they have +been hidden. To get them back, just go back to the Data Hider app and +press the SET button to enter the password. What password? Oh, the +default one is 1234. Once you have entered the password, the note +symbol will once again appear and allow you to unlock the entries. If +the note symbol is visible, you can change the password to anything else +by just pressing the SET button. + +Note that if you forget the password, there is no way to retrieve it (downloading another app will destroy where the password is stored!) or your entries. + +Possible enhancements: + 1) Add an automatic timeout to lock the watch after 1 minute + 2) Allow you to set the password before you download it to the watch + 3) Consider hiding the appointments and anniversaries. This has an +unfortunate side effect that they won't go off (or at least I haven't +figured out a way to trick the app into skipping them but still have +them go off). + + +---- John A. Toebes, VIII ---- toebes@southpeakcom +Vice President Research and Development +SouthPeak Interactive diff --git a/from_toebes/datahid2/datahid2.zap b/from_toebes/datahid2/datahid2.zap new file mode 100644 index 0000000..19a623c --- /dev/null +++ b/from_toebes/datahid2/datahid2.zap @@ -0,0 +1,33 @@ +TDL0724962¬ Applet file header +Data Hider¬ Applet friendly name +DATAHID2¬ Applet version # +Data Hider - by John A. Toebes, VIII + +To enter/set the password, press the set button. +If the password has been entered, pressing the NEXT button will toggle between hidden and non-hidden mode. +HINT: When the password is valid, the NOTE symbol will appear. + +TIP: Download your watch faster: Download a WristApp once, then do not send it again. It stays in the watch!¬ +WATCHAPP.HLP¬ Applet help filename +106¬ +none¬ Applet's parent's app name (if it exists - 'none' if it doesn't) +Timex Data Link 150 Watch¬ +CC01F5819D9D819D9D819D9DCC01F5D6015D81CC017F00CC01FE141D0D0A180A1D11010D0D0E1511010D0E171D0E15180E171D0C110A15100E190A1C1C20181B0D13321D180E0B0E1C00000C22001AFF001BFF0001FFFF02FF0100FF0038FFFF1D011AFF0186FF01A6FF0139FF001DB691A11B2735A10026453F613F620060171060C60109C70159C6010AC7015A4FC70109C7010A20270560241160C60159C70109C6015AC7010A20140160021560C604A1270A4FC704A1A638CD4E8981CD579FA61BCD587EA60EB71D016003056004181E2002191EA627016002A621CD58A8A641CC58451E963F613F623F6081128FB691A1862704129F2048C604C3A1022629046017B661C1015B261AB662C1015C2613146001600EAD60200AB661C7015BB662C7015CA639CC4E89C604C3A100274CA1032744A101270181B660A802B760139FCD579FCD595CCD5930BE61CD593ECD5910BE62CD593ECD5920A62D05600CC6015BB761C6015CB762A633CD587EA639CD5845AD25149081119F2002109F4FC704F4A663C704F5036006AE62A6072004AE61A605CD57C7189081036006AE62A6092004AE61A607CC55BF¬ +35029¬ +0¬ No data +Data Hider¬ Applet friendly name +DATAHID2¬ Applet version # +Data Hider - by John A. Toebes, VIII + +To enter/set the password, press the set button. +If the password has been entered, pressing the NEXT button will toggle between hidden and non-hidden mode. +HINT: When the password is valid, the NOTE symbol will appear. + +TIP: Download your watch faster: Download a WristApp once, then do not send it again. It stays in the watch!¬ +WATCHAPP.HLP¬ Applet help filename +106¬ +none¬ Applet's parent's app name (if it exists - 'none' if it doesn't) +Timex Data Link 150s Watch¬ +CC01F5819D9D819D9D819D9DCC01F5D6015D81CC017F00CC01FE141D0D0A180A1D11010D0D0E1511010D0E171D0E15180E171D0C110A15100E190A1C1C20181B0D13321D180E0B0E1C00000C22001AFF001BFF0001FFFF02FF0100FF0038FFFF1D011AFF0186FF01A6FF0139FF001DB691A11B2735A10026453F613F620060171060C60109C70159C6010AC7015A4FC70109C7010A20270560241160C60159C70109C6015AC7010A20140160021560C604A1270A4FC704A1A638CD4E7881CD5ACBA61BCD577FA60EB71D016003056004181E2002191EA627016002A621CD57A9A641CC57461E963F613F623F6081128FB691A1862704129F2048C604C3A1022629046017B661C1015B261AB662C1015C2613146001600EAD60200AB661C7015BB662C7015CA639CC4E78C604C3A100274CA1032744A101270181B660A802B760139FCD5ACBCD585DCD5831BE61CD583FCD5811BE62CD583FCD5821A62D05600CC6015BB761C6015CB762A633CD577FA639CD5746AD25149081119F2002109F4FC704F4A663C704F5036006AE62A6072004AE61A605CD56C8189081036006AE62A6092004AE61A607CC55AE¬ +13022¬ +0¬ No data \ No newline at end of file diff --git a/from_toebes/dayfind/dayfind.asm b/from_toebes/dayfind/dayfind.asm new file mode 100644 index 0000000..0cc1fcd --- /dev/null +++ b/from_toebes/dayfind/dayfind.asm @@ -0,0 +1,384 @@ +;Name: Day Finder +;Version: DAYFIND +;Description: This will allow you to determine the date for a given day of the week and vice-versa. +;by John A. Toebes, VIII +; +;Press the prev/next buttons to advance by a single day. Press SET to access the ability to advance/backup by +;weeks, months, days, and years. The MODE button advances through those different states +; +;TIP: Download your watch faster: Download a WristApp once, then do not send it again. It stays in the watch! +;HelpFile: watchapp.hlp +;HelpTopic: 106 + INCLUDE "WRISTAPP.I" +; +; (1) Program specific constants +; +FLAGBYTE EQU $61 +B_CLEAR EQU 0 ; Bit 0 indicates that we need to clear the display first +B_SCANUP EQU 1 ; Bit 1 indicates that we are scanning up +B_SCANNING EQU 2 ; Bit 2 indicates that we are in a fake scanning mode +DIGSEL EQU $62 ; Indicates which digit we are working on + ; 0 = DAY OF WEEK + ; 1 = Month + ; 2 = Day + ; 3 = Year +YEAR_DIG1 EQU $63 ; This is the first digit of the year to blink (the tens digit) +YEAR_DIG2 EQU $64 ; This is the second digit of the year to blink (the ones digit) +COUNTER EQU $65 ; A convenient counter for us to advance a week at a time +; +; +; (2) System entry point vectors +; +START EQU * +L0110: jmp MAIN ; The main entry point - WRIST_MAIN +L0113: rts ; Called when we are suspended for any reason - WRIST_SUSPEND + nop + nop +L0116: rts ; Called to handle any timers or time events - WRIST_DOTIC + nop + nop +L0119: rts ; Called when the COMM app starts and we have timers pending - WRIST_INCOMM + nop + nop +L011c: rts ; Called when the COMM app loads new data - WRIST_NEWDATA + nop + nop + +L011f: lda STATETAB0,X ; The state table get routine - WRIST_GETSTATE + rts + +L0123: jmp HANDLE_STATE0 + db STATETAB0-STATETAB0 +L0127: jmp HANDLE_STATE1 + db STATETAB1-STATETAB0 +; +; (3) Program strings +S6_DAY timex6 "DAY " +S6_FIND timex6 " FIND" +S8_TOEBES timex "J.TOEBES" +S8_DAYFIND timex "DAY FIND" +S8_WEEK db C_LEFTARR + timex " WEEK " + db C_RIGHTARR +S8_MONTH db C_LEFTARR + timex "MONTH " + db C_RIGHTARR +S8_DAY db C_LEFTARR + timex " DAY " + db C_RIGHTARR +S8_YEAR db C_LEFTARR + timex " YEAR " + db C_RIGHTARR +; +; (4) State Table +; +STATETAB0: + db 0 + db EVT_ENTER,TIM1_4TIC,0 ; Initial state + db EVT_TIMER1,TIM_ONCE,0 ; The timer from the enter event + db EVT_RESUME,TIM_ONCE,0 ; Resume from a nested app + db EVT_MODE,TIM_ONCE,$FF ; Mode button + db EVT_SET,TIM_ONCE,1 ; SET button pressed + db EVT_DNNEXT,TIM2_8TIC,0 ; NEXT button pressed + db EVT_DNPREV,TIM2_8TIC,0 ; PREV button pressed + db EVT_UPANY4,TIM_ONCE,0 ; The + db EVT_TIMER2,TIM2_TIC,0 ; The timer for the next/prev button pressed + db EVT_END + +STATETAB1: + db 1 + db EVT_RESUME,TIM_ONCE,1 ; Resume from a nested app + db EVT_DNANY4,TIM_ONCE,1 ; NEXT, PREV, SET, MODE button pressed + db EVT_UPANY4,TIM_ONCE,1 ; NEXT, PREV, SET, MODE button released + db EVT_USER2,TIM_ONCE,0 + db EVT_USER3,TIM2_8TIC,1 ; + db EVT_TIMER2,TIM2_TIC,1 ; + db EVT_END +; +; (5) State Table 0 Handler +; This is called to process the state events. +; We see ENTER, TIMER2, and RESUME events +; +HANDLE_STATE0: + bset 1,APP_FLAGS ; Indicate that we can be suspended + lda BTNSTATE ; Get the event + cmp #EVT_DNNEXT + beq DO_NEXT0 + cmp #EVT_DNPREV + beq DO_PREV0 + cmp #EVT_TIMER2 + beq DO_SCAN + cmp #EVT_ENTER ; Is this our initial entry? + bne REFRESH0 +; +; This is the initial event for starting us up +; +DO_ENTER +; +; (6) This code gets the current date from the system + + jsr ACQUIRE ; Lock so that it doesn't change under us + ldx #TZ1_MONTH ; Assume that we are using the first timezone + jsr CHECK_TZ ; See which one we are really using + bcc COPY_TZ1 ; If we were right, just skip on to do the work + ldx #TZ2_MONTH ; Wrong guess, just load up the second time zone +COPY_TZ1 + lda 0,x ; Copy out the month + sta SCAN_MONTH + lda 1,x ; Day + sta SCAN_DAY + lda 2,x ; and year + sta SCAN_YEAR + jsr RELEASE ; Unlock so the rest of the system is happy + + bclr B_CLEAR,FLAGBYTE ; Indicate that we need to clear the display + clr DIGSEL ; Start us off on the week advance + jsr CLEARSYM ; Clear the display + lda #S6_DAY-START + jsr PUT6TOP + lda #S6_FIND-START + jsr PUT6MID + lda #S8_TOEBES-START + jmp BANNER8 + +DO_SCAN + brclr B_SCANUP,FLAGBYTE,DO_PREV0 ; Were we scanning up or down? +DO_NEXT0 + bset B_SCANUP,FLAGBYTE ; We are now scanning up + jsr INCREMENT_SCAN_DATE ; Advance to the next date + bra SHOW_DATE ; Comment this out and use the next one if you want + ; jmp APPT_SHOW_SCAN ; to put the text 'SCAN' on the bottom when we are in scan mode + +DO_PREV0 + bclr B_SCANUP,FLAGBYTE ; We are now scanning down + jsr DECREMENT_SCAN_DATE ; Back up to the previous date + bra SHOW_DATE ; Show the date on the screen. + ; jmp APPT_SHOW_SCAN ; Use this if you want 'SCAN' on the bottom of the display +; +; We come here for a RESUME or TIMER2 event. For this we want to reset the display +; +REFRESH0 + brset B_CLEAR,FLAGBYTE,NOCLEAR0 ; Do we need to clear the display first? + bset B_CLEAR,FLAGBYTE ; Mark that the display has been cleared + jsr CLEARALL ; and do the work of clearing +NOCLEAR0 + lda #S8_DAYFIND-START ; Put up the name of the app on the display + jsr BANNER8 +SHOW_DATE + jsr APPT_SHOW_DATE ; Show the date on the screen + ldx SCAN_YEAR ; as well as the year + jmp PUTYEARMID +;-------------------------------------------------------------------------------- +; (7) State Table 1 Handler +; This is called to process the state events. +; We see SET, RESUME, USER3, TIMER2, DNANY4, and UPANY4 events +; We use the USER3 to trigger a delay which fires off a TIMER2 sequence of events. +; This allows us to have the PREV/NEXT buttons repeat for advancing the WEEK and YEAR +; since we can't use the UPDATE routines for them. +; +HANDLE_STATE1: + bset 1,APP_FLAGS ; Indicate that we can be suspended + lda BTNSTATE ; Get the event + cmp #EVT_TIMER2 ; Was it a timer for a repeat operation? + beq DO_UPD ; Yes, go handle it + cmp #EVT_USER3 ; Was it the USER3 event fired from the PREV/NEXT buttons? + bne TRY_UP ; No, try again + rts ; Yes, just ignore it, it will cause a timer to go off later +TRY_UP + bclr B_SCANNING,FLAGBYTE ; We can't be scanning any more, so turn it off + cmp #EVT_UPANY4 ; Was it any button being released? + bne TRY_DN ; No, try again + jmp REFRESH ; Yes, go refresh the screen (note that the branch is out of range) +TRY_DN + cmp #EVT_DNANY4 ; Is this our initial entry? + beq GET_DN ; No, try again + jmp FORCEFRESH ; Yes, go setup the screen (note that the branch is out of range) +GET_DN + lda BTN_PRESSED ; Let's see what the button they pressed was + cmp #EVT_PREV ; How about the PREV button + beq DO_PREV ; handle it + cmp #EVT_NEXT ; Maybe the NEXT button? + beq DO_NEXT ; Deal with it! + cmp #EVT_MODE ; Perhaps the MODE button + beq DO_MODE ; If so, handle it + ; It must be the set button, so take us out of this state + lda #EVT_USER2 + jmp POSTEVENT +; +; (8) Our real working code... +; We come here when they press the next/prev buttons. if we are in a timer repeat +; situation (triggered when they press prev/next for the WEEK/YEAR) then we skip right +; to processing based on the button that was previously pressed +; +DO_NEXT + bset 0,SYSFLAGS ; Mark our update direction as up + bra DO_UPD +DO_PREV + bclr 0,SYSFLAGS ; Mark our update direction as down +DO_UPD + lda DIGSEL ; Which digit mode are we in? + beq DO_UPD_DOW ; 0 - Handle the WEEK + cmp #2 + blo DO_UPD_MONTH ; <2 = 1 - Handle the MONTH + beq DO_UPD_DAY ; 2 - Handle the Day +DO_UPD_YEAR ; >2 = 3 - Handle the YEAR + brclr 0,SYSFLAGS,LASTYEAR ; Were we in the down direction? + ldx #99 ; Going up, let the WRAPX routine handle it for us + lda SCAN_YEAR + jsr INCA_WRAPX + bra SAVEYEAR +LASTYEAR + lda SCAN_YEAR ; Going down, get the year + deca ; Decrement it + bpl SAVEYEAR ; and see if we hit the lower end + lda #99 ; Yes, 2000 wraps down to 1999 +SAVEYEAR + sta SCAN_YEAR ; Save away the new year + bra SETUP_LAG ; And fire off an event to allow for repeating + +DO_UPD_DOW ; 0 - Day of week + lda #7 ; We want to iterate 7 times advancing by one day. + sta COUNTER ; (this makes it much easier to handle all the fringe cases) +WEEKLOOP + brclr 0,SYSFLAGS,LASTWEEK ; Are we going backwards? + jsr INCREMENT_SCAN_DATE ; Going forwards, advance by one day + bra WEEKLOOPCHK ; And continue the loop +LASTWEEK + jsr DECREMENT_SCAN_DATE ; Going backwards, retreat by one day +WEEKLOOPCHK + dec COUNTER ; Count down + tst COUNTER ; See if we hit the limit + bne WEEKLOOP ; and go back for more +; (9) Fake repeater +; This code is used for the Day of week and year modes where we want to have a +; repeating button, but the system routines won't handle it for us +; It works by posting a USER3 event which has a timer of about 1/2 second. +; After that timer expires, we get a timer2 event which then repeats every tic. +; The only thing that we have to worry about here is to not go through this +; every time so that it takes 1/2 second for every repeat. +SETUP_LAG + brset B_SCANNING,FLAGBYTE,INLAG ; If we were already scanning, skip out + bset B_SCANNING,FLAGBYTE ; Indicate that we are scanning + lda #EVT_USER3 ; and post the event to start it off + jsr POSTEVENT +INLAG + jmp SHOW_DATE ; Put the date up on the display +; (10) Update routine usage +DO_UPD_MONTH ; 1 - Handle the month + lda #MONTH_JAN ; The bottom end is January + sta UPDATE_MIN + lda #MONTH_DEC ; and the top end is December (INCLUSIVE) + sta UPDATE_MAX + lda #UPD_HMONTH ; We want the HALF-MONTH udpate function + ldx #SCAN_MONTH ; To update the SCAN_MONTH variable + bra SEL_UPD ; Go do it +DO_UPD_DAY ; 2 - Handle the day + lda #1 ; 1 is the first day of the month + sta UPDATE_MIN + jsr GET_SCAN_MONTHLEN ; Figure out how long the month is + sta UPDATE_MAX ; and make that the limit + lda #UPD_HDAY ; We want the HALF-DAY update function + ldx #SCAN_DAY ; to update the SCAN_DAY variable +SEL_UPD + jsr START_UPDATEP ; And prepare the update routine + bset 4,BTNFLAGS ; Mark that the update is now pending + rts +; (11) Making the mode button work +; when they press the mode button, we want to cycle through the various choices +; on the display. +DO_MODE + lda DIGSEL ; Figure out where we are in the cycle + inca ; advance to the next one + and #3 ; and wrap at 4 to zero + sta DIGSEL +REFRESH + brset B_CLEAR,FLAGBYTE,NOCLEAR ; Do we need to clear the display first? +FORCEFRESH + jsr CLEARALL ; Yes, clear everything before we start + bset B_CLEAR,FLAGBYTE ; And remember that we have already done that +NOCLEAR + clr BTNFLAGS ; Turn off any scrolling banners + lda #ROW_TD23 ; Turn off the dash from the week blink + sta DISP_ROW + bclr COL_TD23,DISP_COL + jsr SHOW_DATE ; Display the date +; (12) Establishing a blink routine +; This makes the appropriate section of the display blink based on what we are changing + lda DIGSEL ; Get the digit we are on + beq DO_BLINK_DOW ; 0 -> Update Day of week + cmp #2 + blo DO_BLINK_MONTH ; <2 = 1 -> Update month + beq DO_BLINK_DAY ; 2 - Update day of month + +DO_BLINK_YEAR ; 3: Year +; (13) Calling BLINK_SECOND +; For BLINK_SECONDS, the UPDATE_PARM points to the 2 character format for the year. + ldx SCAN_YEAR ; Get our year + jsr GETBCDHI ; And extract out the high digit of it + sta YEAR_DIG1 ; Save that away + ldx SCAN_YEAR ; Do it again + jsr GETBCDLOW ; to get the low digit + sta YEAR_DIG2 ; and save that away + ldx #YEAR_DIG1 ; the parm points to the first digit + lda #BLINK_SECONDS ; and we want a BLINK_SECONDS function + bra SETUP_BLINK ; so do it already + +DO_BLINK_DOW ; 0: Day of week: +; (14) Calling BLINK_SEGMENT +; Unfortunately, there is no blink routine to blink the upper two letters on the display. +; To get around this, I have chosen to blink a single segment on the display (the dash +; after the day of the week). This routine was designed to blink the AM/PM or other +; symbols, but it works quite fine for our purposed. You need to set UPDATE_POS to have +; the row to be updated and UPDATE_VAL holds the mask for the COLUMS to be XORed. +; In this way, you might have more than one segment blinking, but there are few segments +; on the same row which would achieve a reasonable effect. +; UPDATE_POS ROW_TD23 +; UPDATE_VAL (1<2 = 3 - Handle the YEAR + brclr 0,SYSFLAGS,LASTYEAR ; Were we in the down direction? + ldx #99 ; Going up, let the WRAPX routine handle it for us + lda SCAN_YEAR + jsr INCA_WRAPX + bra SAVEYEAR +LASTYEAR + lda SCAN_YEAR ; Going down, get the year + deca ; Decrement it + bpl SAVEYEAR ; and see if we hit the lower end + lda #99 ; Yes, 2000 wraps down to 1999 +SAVEYEAR + sta SCAN_YEAR ; Save away the new year + bra SETUP_LAG ; And fire off an event to allow for repeating + +DO_UPD_DOW ; 0 - Day of week + lda #7 ; We want to iterate 7 times advancing by one day. + sta COUNTER ; (this makes it much easier to handle all the fringe cases) +WEEKLOOP + brclr 0,SYSFLAGS,LASTWEEK ; Are we going backwards? + jsr INCREMENT_SCAN_DATE ; Going forwards, advance by one day + bra WEEKLOOPCHK ; And continue the loop +LASTWEEK + jsr DECREMENT_SCAN_DATE ; Going backwards, retreat by one day +WEEKLOOPCHK + dec COUNTER ; Count down + tst COUNTER ; See if we hit the limit + bne WEEKLOOP ; and go back for more +; (9) Fake repeater +; This code is used for the Day of week and year modes where we want to have a +; repeating button, but the system routines won't handle it for us +; It works by posting a USER3 event which has a timer of about 1/2 second. +; After that timer expires, we get a timer2 event which then repeats every tic. +; The only thing that we have to worry about here is to not go through this +; every time so that it takes 1/2 second for every repeat. +SETUP_LAG + brset B_SCANNING,FLAGBYTE,INLAG ; If we were already scanning, skip out + bset B_SCANNING,FLAGBYTE ; Indicate that we are scanning + lda #EVT_USER3 ; and post the event to start it off + jsr POSTEVENT +INLAG + jmp SHOW_DATE ; Put the date up on the display +; (10) Update routine usage +DO_UPD_MONTH ; 1 - Handle the month + lda #MONTH_JAN ; The bottom end is January + sta UPDATE_MIN + lda #MONTH_DEC ; and the top end is December (INCLUSIVE) + sta UPDATE_MAX + lda #UPD_HMONTH ; We want the HALF-MONTH udpate function + ldx #SCAN_MONTH ; To update the SCAN_MONTH variable + bra SEL_UPD ; Go do it +DO_UPD_DAY ; 2 - Handle the day + lda #1 ; 1 is the first day of the month + sta UPDATE_MIN + jsr GET_SCAN_MONTHLEN ; Figure out how long the month is + sta UPDATE_MAX ; and make that the limit + lda #UPD_HDAY ; We want the HALF-DAY update function + ldx #SCAN_DAY ; to update the SCAN_DAY variable +SEL_UPD + jsr START_UPDATEP ; And prepare the update routine + bset 4,BTNFLAGS ; Mark that the update is now pending + rts +; (11) Making the mode button work +; when they press the mode button, we want to cycle through the various choices +; on the display. +DO_MODE + lda DIGSEL ; Figure out where we are in the cycle + inca ; advance to the next one + and #3 ; and wrap at 4 to zero + sta DIGSEL +REFRESH + brset B_CLEAR,FLAGBYTE,NOCLEAR ; Do we need to clear the display first? +FORCEFRESH + jsr CLEARALL ; Yes, clear everything before we start + bset B_CLEAR,FLAGBYTE ; And remember that we have already done that +NOCLEAR + clr BTNFLAGS ; Turn off any scrolling banners + lda #ROW_TD23 ; Turn off the dash from the week blink + sta DISP_ROW + bclr COL_TD23,DISP_COL + jsr SHOW_DATE ; Display the date +; (12) Establishing a blink routine +; This makes the appropriate section of the display blink based on what we are changing + lda DIGSEL ; Get the digit we are on + beq DO_BLINK_DOW ; 0 -> Update Day of week + cmp #2 + blo DO_BLINK_MONTH ; <2 = 1 -> Update month + beq DO_BLINK_DAY ; 2 - Update day of month + +DO_BLINK_YEAR ; 3: Year +; (13) Calling BLINK_SECOND +; For BLINK_SECONDS, the UPDATE_PARM points to the 2 character format for the year. + ldx SCAN_YEAR ; Get our year + jsr GETBCDHI ; And extract out the high digit of it + sta YEAR_DIG1 ; Save that away + ldx SCAN_YEAR ; Do it again + jsr GETBCDLOW ; to get the low digit + sta YEAR_DIG2 ; and save that away + ldx #YEAR_DIG1 ; the parm points to the first digit + lda #BLINK_SECONDS ; and we want a BLINK_SECONDS function + bra SETUP_BLINK ; so do it already + +DO_BLINK_DOW ; 0: Day of week: +; (14) Calling BLINK_SEGMENT +; Unfortunately, there is no blink routine to blink the upper two letters on the display. +; To get around this, I have chosen to blink a single segment on the display (the dash +; after the day of the week). This routine was designed to blink the AM/PM or other +; symbols, but it works quite fine for our purposed. You need to set UPDATE_POS to have +; the row to be updated and UPDATE_VAL holds the mask for the COLUMS to be XORed. +; In this way, you might have more than one segment blinking, but there are few segments +; on the same row which would achieve a reasonable effect. +; UPDATE_POS ROW_TD23 +; UPDATE_VAL (1<