summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfishsoupisgood <github@madingley.org>2019-05-27 10:13:10 +0100
committerfishsoupisgood <github@madingley.org>2019-05-27 10:13:10 +0100
commit8110dec1577d9a9002119c15467d71d8a1f51bc8 (patch)
tree80cb75576c1aad9b30af6a8ac97fcc0bb2034cca
parente070d1885626a365099fac3caf0b537d04f4900e (diff)
downloadwristapps-8110dec1577d9a9002119c15467d71d8a1f51bc8.tar.gz
wristapps-8110dec1577d9a9002119c15467d71d8a1f51bc8.tar.bz2
wristapps-8110dec1577d9a9002119c15467d71d8a1f51bc8.zip
find original wristapp.i, and unmodify code back to it
-rw-r--r--3ball/3ball.asm4
-rw-r--r--Makefile2
-rw-r--r--dayfind/dayfind.asm12
-rw-r--r--dl150/include/wristapp.i (renamed from include/wristapp.i)232
-rw-r--r--dl150s/include/wristapp.i1508
-rw-r--r--flash/flash.asm2
-rw-r--r--from_pkg/Inc150/Wristapp.i1508
-rw-r--r--from_pkg/Inc150S/Wristapp.i1508
-rw-r--r--from_pkg/datahid.zsm239
-rw-r--r--from_pkg/dayfind.zsm374
-rw-r--r--from_pkg/endoff.zsm145
-rw-r--r--from_pkg/flash.zsm135
-rw-r--r--from_pkg/hello.zsm77
-rw-r--r--from_pkg/hexdump.zsm322
-rw-r--r--from_pkg/number.zsm110
-rw-r--r--from_pkg/passwd.zsm232
-rw-r--r--from_pkg/promdump.zsm336
-rw-r--r--from_pkg/sound.zsm135
-rw-r--r--from_pkg/sound1.zsm83
-rw-r--r--from_pkg/spend0.zsm656
-rw-r--r--from_pkg/testsnd.zsm144
-rw-r--r--from_pkg/tipcalc.zsm358
-rw-r--r--from_pkg/update.zsm133
-rw-r--r--number/number.asm2
-rw-r--r--password/password.asm6
-rw-r--r--update/update.asm2
26 files changed, 8201 insertions, 64 deletions
diff --git a/3ball/3ball.asm b/3ball/3ball.asm
index ad92603..73a3be4 100644
--- a/3ball/3ball.asm
+++ b/3ball/3ball.asm
@@ -63,9 +63,9 @@ MSG_SEL DB S6_YES-START
;
STATETAB:
db 0
- db EVT_ENTER,TIM_2_16TIC,0 ; Initial state
+ db EVT_ENTER,TIM2_16TIC,0 ; Initial state
db EVT_RESUME,TIM_ONCE,0 ; Resume from a nested app
- db EVT_DNNEXT,TIM_2_16TIC,0 ; Next button
+ 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
diff --git a/Makefile b/Makefile
index e06b22c..d8482f5 100644
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,7 @@ LSTS=${APPS:%.app=%.lst}
CROSS=../asl/
-AFLAGS=-i include -cpu datalink
+AFLAGS=-i dl150/include -cpu datalink
AS=${CROSS}asl ${AFLAGS}
P2BIN=${CROSS}p2bin
diff --git a/dayfind/dayfind.asm b/dayfind/dayfind.asm
index 974e438..9eed466 100644
--- a/dayfind/dayfind.asm
+++ b/dayfind/dayfind.asm
@@ -74,15 +74,15 @@ S8_YEAR db C_LEFTARR
;
STATETAB0:
db 0
- db EVT_ENTER,TIM_1_4TIC,0 ; Initial state
+ 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,TIM_2_8TIC,0 ; NEXT button pressed
- db EVT_DNPREV,TIM_2_8TIC,0 ; PREV 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,TIM_2_TIC,0 ; The timer for the next/prev button pressed
+ db EVT_TIMER2,TIM2_TIC,0 ; The timer for the next/prev button pressed
db EVT_END
STATETAB1:
@@ -91,8 +91,8 @@ STATETAB1:
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,TIM_2_8TIC,1 ;
- db EVT_TIMER2,TIM_2_TIC,1 ;
+ db EVT_USER3,TIM2_8TIC,1 ;
+ db EVT_TIMER2,TIM2_TIC,1 ;
db EVT_END
;
; (5) State Table 0 Handler
diff --git a/include/wristapp.i b/dl150/include/wristapp.i
index 699d2af..0ea942c 100644
--- a/include/wristapp.i
+++ b/dl150/include/wristapp.i
@@ -527,11 +527,73 @@ ROW_NOTE EQU $0E
;
; Character set
;
-C_0 EQU 0
-C_A EQU $0A
-C_SPACE EQU $24
-C_LEFTARR EQU $33 ; Symbol for the previous key
-C_RIGHTARR EQU $3D ; Symbol for the next key
+C_0 EQU $00
+C_1 EQU $01
+C_2 EQU $02
+C_3 EQU $03
+C_4 EQU $04
+C_5 EQU $05
+C_6 EQU $06
+C_7 EQU $07
+C_8 EQU $08
+C_9 EQU $09
+C_A EQU $0A
+C_B EQU $0B
+C_C EQU $0C
+C_D EQU $0D
+C_E EQU $0E
+C_F EQU $0F
+C_G EQU $10
+C_H EQU $11
+C_I EQU $12
+C_J EQU $13
+C_K EQU $14
+C_L EQU $15
+C_M EQU $16
+C_N EQU $17
+C_O EQU $18
+C_P EQU $19
+C_Q EQU $1A
+C_R EQU $1B
+C_S EQU $1C
+C_T EQU $1D
+C_U EQU $1E
+C_V EQU $1F
+C_W EQU $20
+C_X EQU $21
+C_Y EQU $22
+C_Z EQU $23
+C_BLANK EQU $24
+C_SPACE EQU $24
+C_EXCLAIM EQU $25
+C_DQUOTE EQU $26
+C_POUND EQU $27
+C_DOLLAR EQU $28
+C_PERCENT EQU $29
+C_AMPERSAND EQU $2A
+C_QUOTE EQU $2B
+C_LPAREN EQU $2C
+C_RPAREN EQU $2D
+C_TIMES EQU $2E
+C_PLUS EQU $2F
+C_COMMA EQU $30
+C_MINUS EQU $31
+C_PERIOD EQU $32
+C_SLASH EQU $33
+C_COLON EQU $34
+C_BACKSLASH EQU $35
+C_DIVIDE EQU $36
+C_EQUAL EQU $37
+C_BELL EQU $38
+C_QUESTION EQU $39
+C_UNDER EQU $3A
+C_CHECK EQU $3B
+C_PREV EQU $3C
+C_LEFTARR EQU $3C ; Symbol for the previous key
+C_NEXT EQU $3D
+C_RIGHTARR EQU $3D ; Symbol for the next key
+C_BLOCK EQU $3E
+C_SEP EQU $3F
C6_SPACE EQU $1d
; The basic timex character set is:
; 0 1 2 3 4 5 6 7 8 9 A B C D E F
@@ -582,46 +644,76 @@ EVT_UPGLOW EQU $A4 ; Indiglo button released
EVT_UPANY EQU $A5 ; Any of the four buttons Released
EVT_UPANY4 EQU $A6 ; Any button Released except indiglo
+ALARM_STATUS EQU $69 ; This is the status flags for the alarms. The low order bit indicates that it is enabled
+ ; The next bit seems to indicate that the alarm is temporarily masked or disabled
+ ; Apparently the next bit can be set, but I haven't seen any use for it.
+; EQU $69 ; Alarm 1 Status
+; EQU $69 ; Alarm 1 Status
+; EQU $6a ; Alarm 2 Status
+; EQU $6b ; Alarm 3 Status
+; EQU $6c ; Alarm 4 Status
+; EQU $6d ; Alarm 5 Status
+
+SCAN_MONTH EQU $7a ; The current SCAN month
+SCAN_DAY EQU $7b ; The current SCAN day
+SCAN_YEAR EQU $7c ; The current SCAN year
+
+MONTH_JAN EQU 1
+MONTH_FEB EQU 2
+MONTH_MAR EQU 3
+MONTH_APR EQU 4
+MONTH_MAY EQU 5
+MONTH_JUN EQU 6
+MONTH_JUL EQU 7
+MONTH_AUG EQU 8
+MONTH_SEP EQU 9
+MONTH_OCT EQU 10
+MONTH_NOV EQU 11
+MONTH_DEC EQU 12
+
+SYSTEMP0 EQU $A0
+SYSTEMP1 EQU $A1
+
TIM_ONCE EQU $ff ; No time interval. Operation is executed just once
-TIM_1_TIC EQU $00
-TIM_1_2TIC EQU $01
-TIM_1_3TIC EQU $02
-TIM_1_4TIC EQU $03
-TIM_1_HALFSEC EQU $04
-TIM_1_SECOND EQU $05
-TIM_1_SECHALF EQU $06
-TIM_1_TWOSEC EQU $07
-TIM_1_TWOSEC1 EQU $08
-TIM_1_12SEC EQU $09
-TIM_1_18SEC EQU $0a
+TIM1_TIC EQU $00
+TIM1_2TIC EQU $01
+TIM1_3TIC EQU $02
+TIM1_4TIC EQU $03
+TIM1_HALFSEC EQU $04
+TIM1_SECOND EQU $05
+TIM1_SECHALF EQU $06
+TIM1_TWOSEC EQU $07
+TIM1_TWOSEC1 EQU $08
+TIM1_12SEC EQU $09
+TIM1_18SEC EQU $0a
;
; Note that the second part of this table is happen-stance since it is really a rollover
; of the second table on top of the first one. But it might be useful to someone...
;
-TIM_1_TICA EQU $0b ; This is the typical scroll interval
-TIM_1_2TICA EQU $0c
-TIM_1_4TICA EQU $0d
-TIM_1_8TIC EQU $0e ; This is the normal blink interval
-TIM_1_12TIC EQU $0f ; Just over a second
-TIM_1_16TIC EQU $10 ; A second and a half
-TIM_1_24TIC EQU $11 ; Two and a half seconds
-TIM_1_32TIC EQU $12 ; Just over three seconds
-TIM_1_40TIC EQU $13 ; Four seconds
-TIM_1_48TIC EQU $14 ; Almost five seconds
-TIM_1_96TIC EQU $15 ; Almost ten seconds
+TIM1_TICA EQU $0b ; This is the typical scroll interval
+TIM1_2TICA EQU $0c
+TIM1_4TICA EQU $0d
+TIM1_8TIC EQU $0e ; This is the normal blink interval
+TIM1_12TIC EQU $0f ; Just over a second
+TIM1_16TIC EQU $10 ; A second and a half
+TIM1_24TIC EQU $11 ; Two and a half seconds
+TIM1_32TIC EQU $12 ; Just over three seconds
+TIM1_40TIC EQU $13 ; Four seconds
+TIM1_48TIC EQU $14 ; Almost five seconds
+TIM1_96TIC EQU $15 ; Almost ten seconds
-TIM_2_TIC EQU $80 ; This is the typical scroll interval
-TIM_2_2TIC EQU $81
-TIM_2_4TIC EQU $82
-TIM_2_8TIC EQU $83 ; This is the normal blink interval
-TIM_2_12TIC EQU $84 ; Just over a second
-TIM_2_16TIC EQU $85 ; A second and a half
-TIM_2_24TIC EQU $86 ; Two and a half seconds
-TIM_2_32TIC EQU $87 ; Just over three seconds
-TIM_2_40TIC EQU $88 ; Four seconds
-TIM_2_48TIC EQU $89 ; Almost five seconds
-TIM_2_96TIC EQU $8a ; Almost ten seconds
+TIM2_TIC EQU $80 ; This is the typical scroll interval
+TIM2_2TIC EQU $81
+TIM2_4TIC EQU $82
+TIM2_8TIC EQU $83 ; This is the normal blink interval
+TIM2_12TIC EQU $84 ; Just over a second
+TIM2_16TIC EQU $85 ; A second and a half
+TIM2_24TIC EQU $86 ; Two and a half seconds
+TIM2_32TIC EQU $87 ; Just over three seconds
+TIM2_40TIC EQU $88 ; Four seconds
+TIM2_48TIC EQU $89 ; Almost five seconds
+TIM2_96TIC EQU $8a ; Almost ten seconds
TIM_LONG1 EQU $01 ; Long shot time interval - Fires a $1F when the the timer expires
TIM_03 EQU $03 ; Unknown
@@ -631,6 +723,45 @@ TIM_SHORT EQU $82 ; Short timer - Fires a $1F event when the timer expires
TIM_MED EQU $83 ; Medium timer - Fires a $1E event when the timer expires
TIM_LONG EQU $84 ; Long timer - Fires a $1F event when the timer expires
TIM_86 EQU $86 ; ?Timer
+;-----------------------------------------------------------------------------------------
+TZ1_HOUR EQU $b0 ; Time zone 1 current hour (0-23)
+TZ1_MINUTE EQU $b1 ; Time zone 1 current minute (0-59)
+TZ1_MONTH EQU $b2 ; Time zone 1 current month of the year (1-12)
+TZ1_DAY EQU $b3 ; Time zone 1 current day of the month (1-31)
+TZ1_YEAR EQU $b4 ; Time zone 1 current year (mod 1900)
+TZ1_NAME EQU $b5 ; Time zone 1 name (3 TIMEX characters)
+; EQU $b6 ; " " " "
+; EQU $b7 ; " " " "
+TZ1_DOW EQU $b8 ; Time zone 1 day of week (0=Monday...6=Sunday)
+;-----------------------------------------------------------------------------------------
+TZ2_HOUR EQU $b9 ; Time zone 2 current hour (0-23) in Timezone 1
+TZ2_MINUTE EQU $ba ; Time zone 2 current minute (0-59)
+TZ2_MONTH EQU $bb ; Time zone 2 current month of the year (1-12)
+TZ2_DAY EQU $bc ; Time zone 2 current day of the month (1-31)
+TZ2_YEAR EQU $bd ; Time zone 2 current year (mod 1900)
+TZ2_NAME EQU $be ; Time zone 2 name (3 TIMEX characters)
+; EQU $bf ; " " " "
+; EQU $c0 ; " " " "
+TZ2_DOW EQU $c1 ; Time zone 2 day of the week (0=Monday..6=Sunday)
+;-----------------------------------------------------------------------------------------
+; Sound Support Values
+TONE_END EQU $00 ; END
+TONE_LOW_C EQU $10 ; Low C
+TONE_HI_C EQU $20 ; High C
+TONE_MID_C EQU $30 ; Middle C
+TONE_VHI_C EQU $40 ; Very high C
+TONE_HI_F EQU $50 ; High F (little bit lower than F)
+TONE_MID_F EQU $60 ; Middle F
+TONE_LO_F EQU $70 ; Low F
+TONE_VHI_GSHARP EQU $80 ; Very High G# (G Sharp)
+TONE_HI_GSHARP EQU $90 ; High G#
+TONE_MID_GSHARP EQU $A0 ; Middle G#
+TONE_LO_GSHARP EQU $B0 ; Low G#
+TONE_HI_D EQU $C0 ; High D
+TONE_MID_D EQU $D0 ; Middle D
+TONE_LO_D EQU $E0 ; Low D
+TONE_PAUSE EQU $F0 ; Pause
+SND_END EQU $80
;--------------------------------------------------------------------------------
SNDSTART EQU $4e4a ; Start playing the current sound in SYSSOUND
;--------------------------------------------------------------------------------
@@ -1069,6 +1200,15 @@ WRISTAPP_FLAGS EQU $96 ; System Flags
; Bit7 = Wristapp has been loaded (SET=LOADED)
NEST_PARM EQU $99 ; Holds the parameter passed to the current nested app
SYSSOUND EQU $9B ; Current sound to be played
+HW_FLAGS EQU $9e ; System Variable
+ ; Bit0 = Request state for Indiglo light (SET=ON)
+ ; Bit1 = Indicates the the SYS_07 hardware has been reset
+ ; Bit2 = <UNUSED>
+ ; Bit3 = Indicates that we want to load some code from the serial port at reset (SET=ON)
+ ; Bit4 = Set but never used. Mimics the state of 0,PORT_C_DATA & 0,PORT_C_DDR
+ ; Bit5 = Set but never used. Mimics the state of 1,PORT_C_DATA & 1,PORT_C_DDR
+ ; Bit6 = Indicates that INST_ADDR is a pointer into the EEPROM (SET=EEPROM Address)
+ ; Bit7 = Interrupts have been disabled (SET=DISABLED)
SYSFLAGS EQU $9F ; System flags
; Bit0 = Indicates the update direction. (SET=UP)
; Bit1 = Indicates that the screen needs to be cleared (SET=no need to clear)
@@ -1081,6 +1221,8 @@ SYSFLAGS EQU $9F ; System flags
; Bit7 = <UNUSED>
DATDIGIT1 EQU $A2 ; First digit parameter for PUTMIDnn/PUTTOPnn routines
DATDIGIT2 EQU $A3 ; Second digit parameter for PUTMIDnn/PUTTOPnn routines
+UPDATE_VAL EQU $a6 ; Temporary value passed to the update/blink routines
+UPDATE_PARM EQU $a7 ; Pointer to the data passed to the update/blink routines
;
; The sound in SYSSOUND can be set to one of the following values:
;
@@ -1116,6 +1258,8 @@ WRIST_NEWDATA EQU $011c ; This is the wristapp entry point called when n
WRIST_GETSTATE EQU $011f ; Entry to get a wristapp state table entry
WRIST_JMP_STATE0 EQU $0123 ; Wristapp entry point to call state 0
+INST_ADDRHI EQU $0437
+INST_ADDRLO EQU $0438
USER04a1 EQU $04a1
NESTED_APP EQU $04a2 ; Nested application (Only to run an application while a different one is running)
; This is used to handle alarms and appointments that go off while you are running something else
@@ -1240,7 +1384,7 @@ WRITE_FLAG_BYTE EQU $510A
FILL_EXTRACTBUF EQU $513E
SAVE_EXTRACTBUF EQU $515D
SYSTEM_RESET EQU $519B
-SND_OFF EQU $5286
+SND_OFF EQU $5286
DO_SOUND EQU $5298
SET_SYS_0f_4d EQU $5203
SET_SYS_0f_41 EQU $5208
@@ -1362,13 +1506,3 @@ APPT_SHOW_SCAN EQU $7454
APPT_SHOW_CURRENT EQU $7461
APPT_SHOW_UPCOMING EQU $748E
SAY_NO_APPT_ENTRIES EQU $74BD
-;
-;
-;
-TZ1_MONTH EQU $B2
-TZ2_MONTH EQU $BB
-SCAN_MONTH EQU $7A
-SCAN_DAY EQU $7B
-SCAN_YEAR EQU $7C
-MONTH_JAN EQU 01
-MONTH_DEC EQU 12
diff --git a/dl150s/include/wristapp.i b/dl150s/include/wristapp.i
new file mode 100644
index 0000000..13cac0b
--- /dev/null
+++ b/dl150s/include/wristapp.i
@@ -0,0 +1,1508 @@
+;
+; Wristapp.i - For the Datalink 150s
+; Copyright (c) 1997 by John A. Toebes, VIII. All Rights Reserved.
+;
+DISP_ROW EQU $1d ; Hardware register to select which row of the display is to be written to. You need to
+ ; Combine this with setting DISP_COL to cause the segment to change
+DISP_COL EQU $1e ; Hardware register to select which col of the display is to be written to. You must set
+ ; DISP_ROW first to cause the segment to change
+; It turns out that the segments on the display are readily accessible. You can turn on/off any segment
+; pretty easily.
+;
+; The top and middle lines are a series of segments which can be individually turned on to
+; achieve the different letters. I assign the segments as follows:
+; A
+; _____
+; | |
+; F | |H | B
+; | | |
+; ---G-
+; | | |
+; E | |I | C
+; |_____|
+; D
+;
+; Numbering the digits on the line from left to right we would get
+;
+;
+; 1A 2A 3A 4A 5A 6A
+; _____ _____ _____ _____ _____ _____
+; 1| |1 2| |2 3| |3 4| |4 5| |5 6| |6
+; F| |1 |B F| |2 |B F| |3 |B F| |4 |B F| |5 |B F| |6 |B
+; | |H | | |H | D23 | |H | D34| |H | D45 | |H | | |H |
+; --1G- --2G- --- --3G- -- --4G- --- --5G- --6G-
+; 1| |1 |1 2| |2 |2 3| |3 |3 4| |4 |4 5| |5 |5 6| |6 |6
+; E| |I |C E| |I |C E| |I |C E| |I |C E| |I |C E| |I |C
+; |_____| |_____| . |_____| |_____| . |_____| |_____|
+; 1D 2D P23 3D 4D P45 5D 6D
+;
+; AM PM Remind Night Alarm Note
+;
+;
+; 1A 2A 3A 4A 5A 6A
+; _____ _____ C23 _____ _____ _____ _____
+; 1| |1 2| |2 o 3| |3 4| |4 5| |5 6| |6
+; F| |1 |B F| |2 |B F| |3 |B F| |4 |B F| |5 |B F| |6 |B
+; | |H | | |H | D23 | |H | | |H | D45 | |H | | |H |
+; --1G- --2G- --- --3G- --4G- --- --5G- --6G-
+; 1| |1 |1 2| |2 |2 3| |3 |3 4| |4 |4 5| |5 |5 6| |6 |6
+; E| |I |C E| |I |C o E| |I |C E| |I |C E| |I |C E| |I |C
+; |_____| |_____| . |_____| |_____| . |_____| |_____|
+; 1D 2D P23 3D 4D P45 5D 6D
+;
+; Note the two dashes between segments 2&3 and 4&5. For convenience, I refer to these
+; as D23 and D45 or DASH23 and DASH45 respectively.
+; I prefix all of the items on the first row with a T and those on the middle row with a M.
+;
+; Pixels on the bottom line are addressed a little differently. For these, we have 8 5x5 sets of
+; segments. We can reference them as follows:
+;
+; S1 S2 S3 S4 S5 S6 S7 S8
+; 12345 12345 12345 12345 12345 12345 12345 12345
+; *****A *****A *****A *****A *****A *****A *****A *****A
+; *****B *****B *****B *****B *****B *****B *****B *****B
+; *****C *****C *****C *****C *****C *****C *****C *****C
+; *****D *****D *****D *****D *****D *****D *****D *****D
+; *****E *****E *****E *****E *****E *****E *****E *****E
+;
+; Hence, the lower right pixel is referenced as S8E5
+;
+
+; Value Bit0 Bit1 Bit2 Bit3 Bit4
+; ------ ------ ------ ------ ------ ------
+; 00 <none> <none> <none> <none> <none>
+; 02 S8E1 S8D1 S8A1 S8B1 S8C1
+; 04 S8E2 S8D2 S8A2 S8B2 S8C2
+; 06 S8E3 S8D3 S8A3 S8B3 S8C3
+; 08 S8E4 S8D4 S8A4 S8B4 S8C4
+; 0A S8E5 S8D5 S8A5 S8B5 S8C5
+; 0C <none> <none> <none> <none> <none>
+; 0E T6C T6B M6C M6B Note
+; 10 T6D T6G T6A <none> M6A
+; 12 T6I T6H M6I M6G M6H
+; 14 T6E T6F M6D M6E M6F
+; 16 <none> <none> <none> <none> <none>
+; 18 <none> <none> <none> <none> <none>
+; 1A <none> <none> <none> <none> <none>
+; 1C T5C T5B M5C M5B Alarm
+; 1E T5D T5G T5A <none> M5A
+; 20 T5I T5H M5I M5G M5H
+; 22 T5E T5F M5D M5E M5F
+; 24 TP45 TD45 MP45 MD45 <none>
+; 26 T4C T4B M4C M4B Night
+; 28 T4D T4G T4A <none> M4A
+; 2A T4I T4H M4I M4G M4H
+; 2C T4E T4F M4D M4E M4F
+; 2E T3C T3B M3C M3B TD34
+; 30 T3D T3G T3A <none> M3A
+; 32 T3I T3H M3I M3G M3H
+; 34 T3E T3F M3D M3E M3F
+; 36 TP23 TD23 MP23 MC23 <none>
+; 38 T2C T2B M2C M2B Remind
+; 3A T2D T2G T2A <none> M2A
+; 3C T2I T2H M2I M2G M2H
+; 3E T2E T2F M2D M2E M2F
+; 40 T1C T1B M1C M1B PM
+; 42 T1D T1G T1A <none> M1A
+; 44 T1I T1H M1I M1G M1H
+; 46 T1E T1F M1D M1E M1F
+; 48 <none> <none> <none> <none> AM
+;
+; For the ODD Bits, we have:
+;
+; Value Bit0 Bit1 Bit2 Bit3 Bit4
+; ------ ------ ------ ------ ------ ------
+; 01 S7D5 S7E5 S7A5 S7B5 S7C5
+; 03 S7D4 S7E4 S7A4 S7B4 S7C4
+; 05 S7D3 S7E3 S7A3 S7B3 S7C3
+; 07 S7D2 S7E2 S7A2 S7B2 S7C2
+; 09 S7D1 S7E1 S7A1 S7B1 S7C1
+; 0B S6D5 S6E5 S6A5 S6B5 S6C5
+; 0D S6D4 S6E4 S6A4 S6B4 S6C4
+; 0F S6D3 S6E3 S6A3 S6B3 S6C3
+; 11 S6D2 S6E2 S6A2 S6B2 S6C2
+; 13 S6D1 S6E1 S6A1 S6B1 S6C1
+; 15 S5D5 S5E5 S5A5 S5B5 S5C5
+; 17 S5D4 S5E4 S5A4 S5B4 S5C4
+; 19 S5D3 S5E3 S5A3 S5B3 S5C3
+; 1B S5D2 S5E2 S5A2 S5B2 S5C2
+; 1D S5D1 S5E1 S5A1 S5B1 S5C1
+; 1F S4D5 S4E5 S4A5 S4B5 S4C5
+; 21 S4D4 S4E4 S4A4 S4B4 S4C4
+; 23 S4D3 S4E3 S4A3 S4B3 S4C3
+; 25 S4D2 S4E2 S4A2 S4B2 S4C2
+; 27 S4D1 S4E1 S4A1 S4B1 S4C1
+; 29 <none> <none> <none> <none> <none>
+; 2B S3D5 S3E5 S3A5 S3B5 S3C5
+; 2D S3D4 S3E4 S3A4 S3B4 S3C4
+; 2F S3D3 S3E3 S3A3 S3B3 S3C3
+; 31 S3D2 S3E2 S3A2 S3B2 S3C2
+; 33 S3D1 S3E1 S3A1 S3B1 S3C1
+; 35 S2D5 S2E5 S2A5 S2B5 S2C5
+; 37 S2D4 S2E4 S2A4 S2B4 S2C4
+; 39 S2D3 S2E3 S2A3 S2B3 S2C3
+; 3B S2D2 S2E2 S2A2 S2B2 S2C2
+; 3D S2D1 S2E1 S2A1 S2B1 S2C1
+; 3F S1D5 S1E5 S1A5 S1B5 S1C5
+; 41 S1D4 S1E4 S1A4 S1B4 S1C4
+; 43 S1D3 S1E3 S1A3 S1B3 S1C3
+; 45 S1D2 S1E2 S1A2 S1B2 S1C2
+; 47 S1D1 S1E1 S1A1 S1B1 S1C1
+;
+;
+; Of course if you want to look it from the orientation of the segments on the display,
+; you can use this information. To make it more compact, I used the notation
+; bit:Value
+; where value is what you store in $1D and Bit is which bit to set/clear in $1E to get the effect
+;
+; T1A=2:40 T2A=2:38 T3A=2:2E T4A=2:26 T5A=2:1C T6A=2:0E
+; T1B=1:3E T2B=1:36 T3B=1:2C T4B=1:24 T5B=1:1A T6B=1:0C
+; T1C=0:3E T2C=0:36 T3C=0:2C T4C=0:24 T5C=0:1A T6C=0:0C
+; T1D=0:40 T2D=0:38 T3D=0:2E T4D=0:26 T5D=0:1C T6D=0:0E
+; T1E=0:44 T2E=0:3C T3E=0:32 T4E=0:2A T5E=0:20 T6E=0:12
+; T1F=1:44 T2F=1:3C T3F=1:32 T4F=1:2A T5F=1:20 T6F=1:12
+; T1G=1:40 T2G=1:38 T3G=1:2E T4G=1:26 T5G=1:1C T6G=1:0E
+; T1H=1:42 T2H=1:3A T3H=1:30 T4H=1:28 T5H=1:1E T6H=1:10
+; T1I=0:42 T2I=0:3A T3I=0:30 T4I=0:28 T5I=0:1E T6I=0:10
+;
+; TP23=0:34
+; TD23=1:34
+; TD34=4:2C
+; TD45=1:22
+; TP45=0:22
+;
+; M1A=4:40 M2A=4:38 M3A=4:2E M4A=4:26 M5A=4:1C M6A=4:0E
+; M1B=3:3E M2B=3:36 M3B=3:2C M4B=3:24 M5B=3:1A M6B=3:0C
+; M1C=2:3E M2C=2:36 M3C=2:2C M4C=2:24 M5C=2:1A M6C=2:0C
+; M1D=2:44 M2D=2:3C M3D=2:32 M4D=2:2A M5D=2:20 M6D=2:12
+; M1E=3:44 M2E=3:3C M3E=3:32 M4E=3:2A M5E=3:20 M6E=3:12
+; M1F=4:44 M2F=4:3C M3F=4:32 M4F=4:2A M5F=4:20 M6F=4:12
+; M1G=3:42 M2G=3:3A M3G=3:30 M4G=3:28 M5G=3:1E M6G=3:10
+; M1H=4:42 M2H=4:3A M3H=4:30 M4H=4:28 M5H=4:1E M6H=4:10
+; M1I=2:42 M2I=2:3A M3I=2:30 M4I=2:28 M5I=2:1E M6I=2:10
+;
+; MC23=3:34
+; MP23=2:34
+; MD45=3:22
+; MP45=2:22
+;
+; AM=4:46
+; PM=4:3E
+; Remind=4:36
+; Night=4:24
+; Alarm=4:1A
+; Note=4:0C
+
+COL_T1A EQU 2
+ROW_T1A EQU $40
+COL_T2A EQU 2
+ROW_T2A EQU $38
+COL_T3A EQU 2
+ROW_T3A EQU $2E
+COL_T4A EQU 2
+ROW_T4A EQU $26
+COL_T5A EQU 2
+ROW_T5A EQU $1C
+COL_T6A EQU 2
+ROW_T6A EQU $0E
+;
+COL_T1B EQU 1
+ROW_T1B EQU $3E
+COL_T2B EQU 1
+ROW_T2B EQU $36
+COL_T3B EQU 1
+ROW_T3B EQU $2C
+COL_T4B EQU 1
+ROW_T4B EQU $24
+COL_T5B EQU 1
+ROW_T5B EQU $1A
+COL_T6B EQU 1
+ROW_T6B EQU $0C
+;
+COL_T1C EQU 0
+ROW_T1C EQU $3E
+COL_T2C EQU 0
+ROW_T2C EQU $36
+COL_T3C EQU 0
+ROW_T3C EQU $2C
+COL_T4C EQU 0
+ROW_T4C EQU $24
+COL_T5C EQU 0
+ROW_T5C EQU $1A
+COL_T6C EQU 0
+ROW_T6C EQU $0C
+;
+COL_T1D EQU 0
+ROW_T1D EQU $40
+COL_T2D EQU 0
+ROW_T2D EQU $38
+COL_T3D EQU 0
+ROW_T3D EQU $2E
+COL_T4D EQU 0
+ROW_T4D EQU $26
+COL_T5D EQU 0
+ROW_T5D EQU $1C
+COL_T6D EQU 0
+ROW_T6D EQU $0E
+;
+COL_T1E EQU 0
+ROW_T1E EQU $44
+COL_T2E EQU 0
+ROW_T2E EQU $3C
+COL_T3E EQU 0
+ROW_T3E EQU $32
+COL_T4E EQU 0
+ROW_T4E EQU $2A
+COL_T5E EQU 0
+ROW_T5E EQU $20
+COL_T6E EQU 0
+ROW_T6E EQU $12
+;
+COL_T1F EQU 1
+ROW_T1F EQU $44
+COL_T2F EQU 1
+ROW_T2F EQU $3C
+COL_T3F EQU 1
+ROW_T3F EQU $32
+COL_T4F EQU 1
+ROW_T4F EQU $2A
+COL_T5F EQU 1
+ROW_T5F EQU $20
+COL_T6F EQU 1
+ROW_T6F EQU $12
+;
+COL_T1G EQU 1
+ROW_T1G EQU $40
+COL_T2G EQU 1
+ROW_T2G EQU $38
+COL_T3G EQU 1
+ROW_T3G EQU $2E
+COL_T4G EQU 1
+ROW_T4G EQU $26
+COL_T5G EQU 1
+ROW_T5G EQU $1C
+COL_T6G EQU 1
+ROW_T6G EQU $0E
+;
+COL_T1H EQU 1
+ROW_T1H EQU $42
+COL_T2H EQU 1
+ROW_T2H EQU $3A
+COL_T3H EQU 1
+ROW_T3H EQU $30
+COL_T4H EQU 1
+ROW_T4H EQU $28
+COL_T5H EQU 1
+ROW_T5H EQU $1E
+COL_T6H EQU 1
+ROW_T6H EQU $10
+;
+COL_T1I EQU 0
+ROW_T1I EQU $42
+COL_T2I EQU 0
+ROW_T2I EQU $3A
+COL_T3I EQU 0
+ROW_T3I EQU $30
+COL_T4I EQU 0
+ROW_T4I EQU $28
+COL_T5I EQU 0
+ROW_T5I EQU $1E
+COL_T6I EQU 0
+ROW_T6I EQU $10
+;
+;
+COL_TP23 EQU 0
+ROW_TP23 EQU $34
+;
+COL_TD23 EQU 1
+ROW_TD23 EQU $34
+;
+COL_TD34 EQU 4
+ROW_TD34 EQU $2C
+;
+COL_TD45 EQU 1
+ROW_TD45 EQU $22
+;
+COL_TP45 EQU 0
+ROW_TP45 EQU $22
+;
+;
+COL_M1A EQU 4
+ROW_M1A EQU $40
+COL_M2A EQU 4
+ROW_M2A EQU $38
+COL_M3A EQU 4
+ROW_M3A EQU $2E
+COL_M4A EQU 4
+ROW_M4A EQU $26
+COL_M5A EQU 4
+ROW_M5A EQU $1C
+COL_M6A EQU 4
+ROW_M6A EQU $0E
+;
+COL_M1B EQU 3
+ROW_M1B EQU $3E
+COL_M2B EQU 3
+ROW_M2B EQU $36
+COL_M3B EQU 3
+ROW_M3B EQU $2C
+COL_M4B EQU 3
+ROW_M4B EQU $24
+COL_M5B EQU 3
+ROW_M5B EQU $1A
+COL_M6B EQU 3
+ROW_M6B EQU $0C
+;
+COL_M1C EQU 2
+ROW_M1C EQU $3E
+COL_M2C EQU 2
+ROW_M2C EQU $36
+COL_M3C EQU 2
+ROW_M3C EQU $2C
+COL_M4C EQU 2
+ROW_M4C EQU $24
+COL_M5C EQU 2
+ROW_M5C EQU $1A
+COL_M6C EQU 2
+ROW_M6C EQU $0C
+;
+COL_M1D EQU 2
+ROW_M1D EQU $44
+COL_M2D EQU 2
+ROW_M2D EQU $3C
+COL_M3D EQU 2
+ROW_M3D EQU $32
+COL_M4D EQU 2
+ROW_M4D EQU $2A
+COL_M5D EQU 2
+ROW_M5D EQU $20
+COL_M6D EQU 2
+ROW_M6D EQU $12
+;
+COL_M1E EQU 3
+ROW_M1E EQU $44
+COL_M2E EQU 3
+ROW_M2E EQU $3C
+COL_M3E EQU 3
+ROW_M3E EQU $32
+COL_M4E EQU 3
+ROW_M4E EQU $2A
+COL_M5E EQU 3
+ROW_M5E EQU $20
+COL_M6E EQU 3
+ROW_M6E EQU $12
+;
+COL_M1F EQU 4
+ROW_M1F EQU $44
+COL_M2F EQU 4
+ROW_M2F EQU $3C
+COL_M3F EQU 4
+ROW_M3F EQU $32
+COL_M4F EQU 4
+ROW_M4F EQU $2A
+COL_M5F EQU 4
+ROW_M5F EQU $20
+COL_M6F EQU 4
+ROW_M6F EQU $12
+;
+COL_M1G EQU 3
+ROW_M1G EQU $42
+COL_M2G EQU 3
+ROW_M2G EQU $3A
+COL_M3G EQU 3
+ROW_M3G EQU $30
+COL_M4G EQU 3
+ROW_M4G EQU $28
+COL_M5G EQU 3
+ROW_M5G EQU $1E
+COL_M6G EQU 3
+ROW_M6G EQU $10
+;
+COL_M1H EQU 4
+ROW_M1H EQU $42
+COL_M2H EQU 4
+ROW_M2H EQU $3A
+COL_M3H EQU 4
+ROW_M3H EQU $30
+COL_M4H EQU 4
+ROW_M4H EQU $28
+COL_M5H EQU 4
+ROW_M5H EQU $1E
+COL_M6H EQU 4
+ROW_M6H EQU $10
+;
+COL_M1I EQU 2
+ROW_M1I EQU $42
+COL_M2I EQU 2
+ROW_M2I EQU $3A
+COL_M3I EQU 2
+ROW_M3I EQU $30
+COL_M4I EQU 2
+ROW_M4I EQU $28
+COL_M5I EQU 2
+ROW_M5I EQU $1E
+COL_M6I EQU 2
+ROW_M6I EQU $10
+;
+;
+COL_MC23 EQU 3
+ROW_MC23 EQU $34
+;
+COL_MP23 EQU 2
+ROW_MP23 EQU $34
+;
+COL_MD45 EQU 3
+ROW_MD45 EQU $22
+;
+COL_MP45 EQU 2
+ROW_MP45 EQU $22
+;
+;
+COL_AM EQU 4
+ROW_AM EQU $46
+;
+COL_PM EQU 4
+ROW_PM EQU $3E
+;
+COL_REMIND EQU 4
+ROW_REMIND EQU $36
+;
+COL_NIGHT EQU 4
+ROW_NIGHT EQU $24
+;
+COL_ALARM EQU 4
+ROW_ALARM EQU $1A
+;
+COL_NOTE EQU 4
+ROW_NOTE EQU $0C
+;
+; S1A1=2:47 S1B1=3:47 S1C1=4:47 S1D1=0:47 S1E1=1:47
+; S1A2=2:45 S1B2=3:45 S1C2=4:45 S1D2=0:45 S1E2=1:45
+; S1A3=2:43 S1B3=3:43 S1C3=4:43 S1D3=0:43 S1E3=1:43
+; S1A4=2:41 S1B4=3:41 S1C4=4:41 S1D4=0:41 S1E4=1:41
+; S1A5=2:3F S1B5=3:3F S1C5=4:3F S1D5=0:3F S1E5=1:3F
+;
+; S2A1=2:3D S2B1=3:3D S2C1=4:3D S2D1=0:3D S2E1=1:3D
+; S2A2=2:3B S2B2=3:3B S2C2=4:3B S2D2=0:3B S2E2=1:3B
+; S2A3=2:39 S2B3=3:39 S2C3=4:39 S2D3=0:39 S2E3=1:39
+; S2A4=2:37 S2B4=3:37 S2C4=4:37 S2D4=0:37 S2E4=1:37
+; S2A5=2:35 S2B5=3:35 S2C5=4:35 S2D5=0:35 S2E5=1:35
+;
+; S3A1=2:33 S3B1=3:33 S3C1=4:33 S3D1=0:33 S3E1=1:33
+; S3A2=2:31 S3B2=3:31 S3C2=4:31 S3D2=0:31 S3E2=1:31
+; S3A3=2:2F S3B3=3:2F S3C3=4:2F S3D3=0:2F S3E3=1:2F
+; S3A4=2:2D S3B4=3:2D S3C4=4:2D S3D4=0:2D S3E4=1:2D
+; S3A5=2:2B S3B5=3:2B S3C5=4:2B S3D5=0:2B S3E5=1:2B
+;
+; S4A1=2:27 S4B1=3:27 S4C1=4:27 S4D1=0:27 S4E1=1:27
+; S4A2=2:25 S4B2=3:25 S4C2=4:25 S4D2=0:25 S4E2=1:25
+; S4A3=2:23 S4B3=3:23 S4C3=4:23 S4D3=0:23 S4E3=1:23
+; S4A4=2:21 S4B4=3:21 S4C4=4:21 S4D4=0:21 S4E4=1:21
+; S4A5=2:1F S4B5=3:1F S4C5=4:1F S4D5=0:1F S4E5=1:1F
+;
+; S5A1=2:1D S5B1=3:1D S5C1=4:1D S5D1=0:1D S5E1=1:1D
+; S5A2=2:1B S5B2=3:1B S5C2=4:1B S5D2=0:1B S5E2=1:1B
+; S5A3=2:19 S5B3=3:19 S5C3=4:19 S5D3=0:19 S5E3=1:19
+; S5A4=2:17 S5B4=3:17 S5C4=4:17 S5D4=0:17 S5E4=1:17
+; S5A5=2:15 S5B5=3:15 S5C5=4:15 S5D5=0:15 S5E5=1:15
+;
+; S6A1=2:13 S6B1=3:13 S6C1=4:13 S6D1=0:13 S6E1=1:13
+; S6A2=2:11 S6B2=3:11 S6C2=4:11 S6D2=0:11 S6E2=1:11
+; S6A3=2:0F S6B3=3:0F S6C3=4:0F S6D3=0:0F S6E3=1:0F
+; S6A4=2:0D S6B4=3:0D S6C4=4:0D S6D4=0:0D S6E4=1:0D
+; S6A5=2:0B S6B5=3:0B S6C5=4:0B S6D5=0:0B S6E5=1:0B
+;
+; S7A1=2:09 S7B1=3:09 S7C1=4:09 S7D1=0:09 S7E1=1:09
+; S7A2=2:07 S7B2=3:07 S7C2=4:07 S7D2=0:07 S7E2=1:07
+; S7A3=2:05 S7B3=3:05 S7C3=4:05 S7D3=0:05 S7E3=1:05
+; S7A4=2:03 S7B4=3:03 S7C4=4:03 S7D4=0:03 S7E4=1:03
+; S7A5=2:01 S7B5=3:01 S7C5=4:01 S7D5=0:01 S7E5=1:01
+;
+; S8A1=2:02 S8B1=3:02 S8C1=4:02 S8D1=1:02 S8E1=0:02
+; S8A2=2:04 S8B2=3:04 S8C2=4:04 S8D2=1:04 S8E2=0:04
+; S8A3=2:06 S8B3=3:06 S8C3=4:06 S8D3=1:06 S8E3=0:06
+; S8A4=2:08 S8B4=3:08 S8C4=4:08 S8D4=1:08 S8E4=0:08
+; S8A5=2:0a S8B5=3:0a S8C5=4:0a S8D5=1:0a S8E5=0:0a
+;
+;
+; Character set
+;
+C_0 EQU $00
+C_1 EQU $01
+C_2 EQU $02
+C_3 EQU $03
+C_4 EQU $04
+C_5 EQU $05
+C_6 EQU $06
+C_7 EQU $07
+C_8 EQU $08
+C_9 EQU $09
+C_A EQU $0A
+C_B EQU $0B
+C_C EQU $0C
+C_D EQU $0D
+C_E EQU $0E
+C_F EQU $0F
+C_G EQU $10
+C_H EQU $11
+C_I EQU $12
+C_J EQU $13
+C_K EQU $14
+C_L EQU $15
+C_M EQU $16
+C_N EQU $17
+C_O EQU $18
+C_P EQU $19
+C_Q EQU $1A
+C_R EQU $1B
+C_S EQU $1C
+C_T EQU $1D
+C_U EQU $1E
+C_V EQU $1F
+C_W EQU $20
+C_X EQU $21
+C_Y EQU $22
+C_Z EQU $23
+C_BLANK EQU $24
+C_SPACE EQU $24
+C_EXCLAIM EQU $25
+C_DQUOTE EQU $26
+C_POUND EQU $27
+C_DOLLAR EQU $28
+C_PERCENT EQU $29
+C_AMPERSAND EQU $2A
+C_QUOTE EQU $2B
+C_LPAREN EQU $2C
+C_RPAREN EQU $2D
+C_TIMES EQU $2E
+C_PLUS EQU $2F
+C_COMMA EQU $30
+C_MINUS EQU $31
+C_PERIOD EQU $32
+C_SLASH EQU $33
+C_COLON EQU $34
+C_BACKSLASH EQU $35
+C_DIVIDE EQU $36
+C_EQUAL EQU $37
+C_BELL EQU $38
+C_QUESTION EQU $39
+C_UNDER EQU $3A
+C_CHECK EQU $3B
+C_PREV EQU $3C
+C_LEFTARR EQU $3C ; Symbol for the previous key
+C_NEXT EQU $3D
+C_RIGHTARR EQU $3D ; Symbol for the next key
+C_BLOCK EQU $3E
+C_SEP EQU $3F
+C6_SPACE EQU $1d
+; The basic timex character set is:
+; 0 1 2 3 4 5 6 7 8 9 A B C D E F
+; G H I J K L M N O P Q R S T U V
+; W X Y Z ! " # $ % & ' ( ) * +
+; , - . / : ; < = > ? @ A B C D E
+;
+; We also have the timex6 character set as:
+; 0 1 2 3 4 5 6 7 8 9 A B C D E F
+; G H : L M N P R T U W Y r - +
+;
+
+EVT_NEXT EQU $00 ; Next button pressed (not interested in the up transition)
+EVT_MODE EQU $01 ; Mode button pressed (not interested in the up transition)
+EVT_SET EQU $02 ; Set/Delete button pressed (not interested in the up transition)
+EVT_PREV EQU $03 ; Prev button pressed (not interested in the up transition)
+EVT_GLOW EQU $04 ; Indiglo button pressed (not interested in the up transition)
+EVT_ANY EQU $05 ; Any button pressed (not interested in the up transition)
+EVT_ANY4 EQU $06 ; Any button pressed except indiglo (not interested in the up transition)
+EVT_RESUME EQU $1a ; Called when resuming from a nested app
+EVT_ENTER EQU $1b ; Initial state. The Time value is generally $01 or $84 for a well behaved app
+EVT_NEST EQU $1c ; The state table 1 entry called when a nested application is called. It is the equivalent of
+ ; EVT_ENTER for an interrupt. This only occurs for Wristapps, Timer, and appt apps.
+EVT_END EQU $1d ; End of event table indicator
+EVT_TIMER1 EQU $1e ; Timer event - This is fired for a $83 time request
+EVT_TIMER2 EQU $1f ; Timer event - This is fired for a $82,$84,$01 timer request
+; $20-$36 - UNUSED
+; (I bet that you can have user specified events for these too)
+EVT_USER0 EQU $37
+EVT_USER1 EQU $38
+EVT_USER2 EQU $39
+EVT_USER3 EQU $3a ; User specified events. Queued by calling POSTEVENT ($4E78)
+; $3b-$7f - UNUSED
+EVT_DNNEXT EQU $80 ; Next button pressed
+EVT_DNMODE EQU $81 ; Mode button pressed
+EVT_DNSET EQU $82 ; Set/Delete button pressed
+EVT_DNPREV EQU $83 ; Prev button pressed
+EVT_DNGLOW EQU $84 ; Indiglo button pressed
+EVT_DNANY EQU $85 ; Any of the four buttons Pressed
+EVT_DNANY4 EQU $86 ; Any button pressed except indiglo
+
+; $87-$9F - UNUSED
+EVT_UPNEXT EQU $A0 ; Next button released
+EVT_UPMODE EQU $A1 ; Mode button released
+EVT_UPSET EQU $A2 ; Set/Delete button released
+EVT_UPPREV EQU $A3 ; Prev button released
+EVT_UPGLOW EQU $A4 ; Indiglo button released
+EVT_UPANY EQU $A5 ; Any of the four buttons Released
+EVT_UPANY4 EQU $A6 ; Any button Released except indiglo
+
+ALARM_STATUS EQU $69 ; This is the status flags for the alarms. The low order bit indicates that it is enabled
+ ; The next bit seems to indicate that the alarm is temporarily masked or disabled
+ ; Apparently the next bit can be set, but I haven't seen any use for it.
+; EQU $69 ; Alarm 1 Status
+; EQU $69 ; Alarm 1 Status
+; EQU $6a ; Alarm 2 Status
+; EQU $6b ; Alarm 3 Status
+; EQU $6c ; Alarm 4 Status
+; EQU $6d ; Alarm 5 Status
+
+SCAN_MONTH EQU $7a ; The current SCAN month
+SCAN_DAY EQU $7b ; The current SCAN day
+SCAN_YEAR EQU $7c ; The current SCAN year
+
+MONTH_JAN EQU 1
+MONTH_FEB EQU 2
+MONTH_MAR EQU 3
+MONTH_APR EQU 4
+MONTH_MAY EQU 5
+MONTH_JUN EQU 6
+MONTH_JUL EQU 7
+MONTH_AUG EQU 8
+MONTH_SEP EQU 9
+MONTH_OCT EQU 10
+MONTH_NOV EQU 11
+MONTH_DEC EQU 12
+
+SYSTEMP0 EQU $A0
+SYSTEMP1 EQU $A1
+
+TIM_ONCE EQU $ff ; No time interval. Operation is executed just once
+
+TIM1_TIC EQU $00
+TIM1_2TIC EQU $01
+TIM1_3TIC EQU $02
+TIM1_4TIC EQU $03
+TIM1_HALFSEC EQU $04
+TIM1_SECOND EQU $05
+TIM1_SECHALF EQU $06
+TIM1_TWOSEC EQU $07
+TIM1_TWOSEC1 EQU $08
+TIM1_12SEC EQU $09
+TIM1_18SEC EQU $0a
+;
+; Note that the second part of this table is happen-stance since it is really a rollover
+; of the second table on top of the first one. But it might be useful to someone...
+;
+TIM1_TICA EQU $0b ; This is the typical scroll interval
+TIM1_2TICA EQU $0c
+TIM1_4TICA EQU $0d
+TIM1_8TIC EQU $0e ; This is the normal blink interval
+TIM1_12TIC EQU $0f ; Just over a second
+TIM1_16TIC EQU $10 ; A second and a half
+TIM1_24TIC EQU $11 ; Two and a half seconds
+TIM1_32TIC EQU $12 ; Just over three seconds
+TIM1_40TIC EQU $13 ; Four seconds
+TIM1_48TIC EQU $14 ; Almost five seconds
+TIM1_96TIC EQU $15 ; Almost ten seconds
+
+TIM2_TIC EQU $80 ; This is the typical scroll interval
+TIM2_2TIC EQU $81
+TIM2_4TIC EQU $82
+TIM2_8TIC EQU $83 ; This is the normal blink interval
+TIM2_12TIC EQU $84 ; Just over a second
+TIM2_16TIC EQU $85 ; A second and a half
+TIM2_24TIC EQU $86 ; Two and a half seconds
+TIM2_32TIC EQU $87 ; Just over three seconds
+TIM2_40TIC EQU $88 ; Four seconds
+TIM2_48TIC EQU $89 ; Almost five seconds
+TIM2_96TIC EQU $8a ; Almost ten seconds
+
+TIM_LONG1 EQU $01 ; Long shot time interval - Fires a $1F when the the timer expires
+TIM_03 EQU $03 ; Unknown
+TIM_08 EQU $08 ; Unknown
+
+TIM_SHORT EQU $82 ; Short timer - Fires a $1F event when the timer expires
+TIM_MED EQU $83 ; Medium timer - Fires a $1E event when the timer expires
+TIM_LONG EQU $84 ; Long timer - Fires a $1F event when the timer expires
+TIM_86 EQU $86 ; ?Timer
+;-----------------------------------------------------------------------------------------
+TZ1_HOUR EQU $b0 ; Time zone 1 current hour (0-23)
+TZ1_MINUTE EQU $b1 ; Time zone 1 current minute (0-59)
+TZ1_MONTH EQU $b2 ; Time zone 1 current month of the year (1-12)
+TZ1_DAY EQU $b3 ; Time zone 1 current day of the month (1-31)
+TZ1_YEAR EQU $b4 ; Time zone 1 current year (mod 1900)
+TZ1_NAME EQU $b5 ; Time zone 1 name (3 TIMEX characters)
+; EQU $b6 ; " " " "
+; EQU $b7 ; " " " "
+TZ1_DOW EQU $b8 ; Time zone 1 day of week (0=Monday...6=Sunday)
+;-----------------------------------------------------------------------------------------
+TZ2_HOUR EQU $b9 ; Time zone 2 current hour (0-23) in Timezone 1
+TZ2_MINUTE EQU $ba ; Time zone 2 current minute (0-59)
+TZ2_MONTH EQU $bb ; Time zone 2 current month of the year (1-12)
+TZ2_DAY EQU $bc ; Time zone 2 current day of the month (1-31)
+TZ2_YEAR EQU $bd ; Time zone 2 current year (mod 1900)
+TZ2_NAME EQU $be ; Time zone 2 name (3 TIMEX characters)
+; EQU $bf ; " " " "
+; EQU $c0 ; " " " "
+TZ2_DOW EQU $c1 ; Time zone 2 day of the week (0=Monday..6=Sunday)
+;-----------------------------------------------------------------------------------------
+; Sound Support Values
+TONE_END EQU $00 ; END
+TONE_LOW_C EQU $10 ; Low C
+TONE_HI_C EQU $20 ; High C
+TONE_MID_C EQU $30 ; Middle C
+TONE_VHI_C EQU $40 ; Very high C
+TONE_HI_F EQU $50 ; High F (little bit lower than F)
+TONE_MID_F EQU $60 ; Middle F
+TONE_LO_F EQU $70 ; Low F
+TONE_VHI_GSHARP EQU $80 ; Very High G# (G Sharp)
+TONE_HI_GSHARP EQU $90 ; High G#
+TONE_MID_GSHARP EQU $A0 ; Middle G#
+TONE_LO_GSHARP EQU $B0 ; Low G#
+TONE_HI_D EQU $C0 ; High D
+TONE_MID_D EQU $D0 ; Middle D
+TONE_LO_D EQU $E0 ; Low D
+TONE_PAUSE EQU $F0 ; Pause
+SND_END EQU $80
+;-----------------------------------------------------------------------------------------
+SNDSTART EQU $4E39 ; Start playing the current sound in SYSSOUND
+;--------------------------------------------------------------------------------
+PLAYCONF EQU $4E69 ; Play a confirmation sound
+PLAYBUTTON EQU $4E6F ; Play the button beep sound if no other sound is currently playing
+;--------------------------------------------------------------------------------
+POSTEVENT EQU $4E78 ; Post a event to the internal processing queue
+; Parameters:
+; A - Event to be posted.
+; This posts an event to run through the processing loop for the current applet.
+; Typical user events are in the $30-$3F range.
+;
+;--------------------------------------------------------------------------------
+INDIGLO_OFF EQU $4E7D ; This routine turns off the indiglo light
+;--------------------------------------------------------------------------------
+SNDSTOP EQU $4F29 ; This stops whatever sound is currently playing
+;--------------------------------------------------------------------------------
+CALL_NESTEDAPP EQU $4F3C
+; Purpose:
+; This sets up to call a nested application while the current one is running.
+; Up to 5 apps may be nested (although there are only 3 potential ones defined).
+; If more than 5 have been called the oldest one will be forgotten.
+; When the nested app is called, NESTED_APP will be set to the application number
+; passed in and NESTED_PARM will contain the X parameter passed in
+;
+; Parameters:
+; A - Nested application number. This is one of the three defined apps:
+; 9 = APP2_ALARM - Alarm (while another app is running)
+; 10 = APP2_APPT - Appointment (while another app is running)
+; 11 = APP2_WRIST - Wristapp (while another app is running)
+; X - Parameter to pass to the nested application
+;--------------------------------------------------------------------------------
+SET_INDIGLO EQU $54f3 ; This routine turns on/off the indiglo light
+; Parameters:
+; 0,Sys_9e - Bit indicates request for on or off
+;--------------------------------------------------------------------------------
+PUTSCROLLMSG EQU $5511 ; Make the buffer at MSGBUF visible
+;--------------------------------------------------------------------------------
+SCROLLMSG EQU $5534 ; Start the scrolling cycle for the current message
+; Parameters:
+; MSGBUF - Message to be scroll terminated by a SEPARATOR character
+;--------------------------------------------------------------------------------
+SCROLLMSG_CONT EQU $5538 ; Start the scrolling cycle for the current message, but don't reset the
+ ; scrolling cycle wait count.
+; Parameters:
+; MSGBUF - Message to be scroll terminated by a SEPARATOR character
+; SCROLL_TICS - The current tic count in the cycle
+;--------------------------------------------------------------------------------
+START_BLINKX EQU $55aa ; Establish and call the specified blinking rountine
+; Parameters:
+; X - single byte parameter to the particular blinking function
+; A - Blinking function to be selected
+;--------------------------------------------------------------------------------
+START_BLINKP EQU $55ae ; Establish and call the specified blinking rountine
+; Parameters:
+; X - Address of parameter to the particular blinking function
+; A - Blinking function to be selected
+BLINK_YEAR EQU 0 ; Blink the year in the right place according to the current time format
+BLINK_SECONDS EQU 1 ; Blink two characters point to by UPDATE_PARM on the right two digits of the middle line - Used for the seconds
+BLINK_AMPM EQU 2 ; Blink AM/PM on the right most digits of the middle line (A or P pointed to by UPDATE_PARM)
+BLINK_MONTH EQU 3 ; Blink the month in the right place according to the current time format
+BLINK_HMONTH EQU 4 ; Blink the month in the right place according to the current time format for a half date (no year)
+BLINK_DAY EQU 5 ; Blink the day in the right place according to the current time format
+BLINK_HDAY EQU 6 ; Blink the day in the right place according to the current time format for half dates
+BLINK_MID12 EQU 7 ; Blink the left two blank padded digits on the middle line (value pointed to by UPDATE_PARM)
+BLINK_HOUR EQU 8 ; Blink the Hour (left two segments on the middle line) and AM/PM indicator (hour point to by UPDATE_PARM)
+BLINK_MID34 EQU 9 ; Blink the middle two zero padded digits on the middle line (value pointed to by UPDATE_PARM)
+BLINK_SEGMENT EQU 10 ; Blink a single segment indicated by UPDATE_POS and mask in UPDATE_VAL
+BLINK_DIGIT EQU 11 ; Blink solid black cursor for the digit (UPDATE_POS is the location on the bottom line)
+BLINK_TZONE EQU 12 ; Blink the timezone information (Pointed to by UPDATE_PARM)
+BLINK_TOP34 EQU 13 ; Blink the middle zero padded two digits on the top line (value pointed to by UPDATE_PARM)
+;--------------------------------------------------------------------------------
+PUTLINE3 EQU $59e7 ; Put a single character on the bottom line of the display
+POSL3_1 EQU $50
+POSL3_2 EQU $4f
+POSL3_3 EQU $45
+POSL3_4 EQU $3b
+POSL3_5 EQU $31
+POSL3_6 EQU $1f
+POSL3_7 EQU $15
+POSL3_8 EQU $0b
+; Parameters:
+; A = Position S1 S2 S3 S4 S5 S6 S7 S8
+; [$50] [$4f] [$45] [$3b] [$31] [$1f] [$15] [$0b]
+; [ 80] [ 79] [ 69] [ 59] [ 49] [ 31] [ 21] [ 11]
+; X = Character in Timex Ascii to display
+; Notes:
+; This appears to be an XOR operation. Calling the same function twice in a row would
+; erase the character. Writing on top of an existing character seems to let you generate
+; a non Ascii character.
+
+PUTLINE1 EQU $5a33 ; Put a single character on the top line of the display
+POSL1_1 EQU $44
+POSL1_2 EQU $3c
+POSL1_3 EQU $32
+POSL1_4 EQU $2a
+POSL1_5 EQU $20
+POSL1_6 EQU $12
+; Parameters:
+; A = Position [$44] [$3c] - [$32] [$2a] - [$20] [$12]
+; [ 68] [ 60] [ 50] [ 42] [ 32] [18]
+; X = Character in Timex Ascii to display
+
+PUTLINE2 EQU $5a6b ; Put a single character on the second line of the display
+POSL1_1 EQU $44
+POSL1_2 EQU $3c
+POSL1_3 EQU $32
+POSL1_4 EQU $2a
+POSL1_5 EQU $20
+POSL1_6 EQU $12
+; Parameters:
+; A = Position [$44] [$3c] - [$32] [$2a] - [$20] [$12]
+; [ 68] [ 60] [ 50] [ 42] [ 32] [18]
+; X = Character in Timex Ascii to display
+
+CLEARALL EQU $5aa0 ; Clear the display
+CLEARBOT EQU $5aad ; Clear the bottom line of the display
+CLEARSYM EQU $5acb ; Turns off all the non digit symbols segments (including dots, dashes and colons)
+;-------------------------------------------------------------------------
+START_UPDATEX equ $56c4 ; Establish and call the specified update function (See START_UPDATEP)
+; Parameters:
+; X - single byte parameter to the particular update function
+; A - Update function to be selected
+;-------------------------------------------------------------------------
+START_UPDATEP EQU $56C8 ; This establishes an update function. Update functions are called every 8/10th
+ ; of a second. This function will update a number in an upward or downward
+ ; direction based on the setting of 0,SYSFLAGS
+; Parameters:
+; A - Update function to be selected
+; X - Pointer to parameters for the update function
+UPD_YEAR EQU 0 ; Update the year
+UPD_MONTH EQU 1 ; Update the Month
+UPD_HMONTH EQU 2 ; Update the Month in Half date format
+UPD_DAY EQU 3 ; Update the day
+UPD_HDAY EQU 4 ; Update the day in half date format
+UPD_MID12 EQU 5 ; Update MID12
+UPD_HOUR EQU 6 ; Update the hour
+UPD_MID34 EQU 7 ; Update MID34
+UPD_DIGIT EQU 8 ; Update the digit at UPDATE_POS
+;-------------------------------------------------------------------------
+BANNER8 EQU $5746 ; Display an 8 character string
+; Parameters
+; A = Offset from 0110 for the start of an 8 character timex string
+;
+;-------------------------------------------------------------------------
+PUTMSGXBOT EQU $574a ; Puts a message on the bottom of the screen.
+; Parameters
+; A = Message selector number. Valid values from 0 to 27. They correspond to
+; the same strings passed into PUTMSGBOT scaled down by 8
+;-------------------------------------------------------------------------
+PUTMSGBOT EQU $574d ; Puts a message on the bottom of the screen.
+; Parameters
+; A = Offset into message selector string. Valid values from from $00 to $d8 at
+; 8 Byte offsets. $E0 is the start of the 6 byte top/mid message strings.
+SYS8_MON EQU $00 ; $00 = "MON "
+SYS8_TUE EQU $08 ; $08 = "TUE "
+SYS8_WED EQU $10 ; $10 = "WED "
+SYS8_THU EQU $18 ; $18 = "THU "
+SYS8_FRI EQU $20 ; $20 = "FRI "
+SYS8_SAT EQU $28 ; $28 = "SAT "
+SYS8_SUN EQU $30 ; $30 = "SUN "
+SYS8_VERDATE EQU $38 ; $38 = " 802104 "
+SYS8_VERSION EQU $40 ; $40 = " V2.1 "
+SYS8_MODE EQU $48 ; $48 = " MODE "
+SYS8_SET_MODE EQU $50 ; $50 = "SET MODE"
+SYS8_SET EQU $58 ; $58 = "SET "
+SYS8_TO EQU $60 ; $60 = "TO "
+SYS8_FOR EQU $68 ; $68 = "FOR "
+SYS8_ENTRIES EQU $70 ; $70 = "ENTRIES "
+SYS8_UPCOMING EQU $78 ; $78 = "UPCOMING"
+SYS8_ENTRY EQU $80 ; $80 = " ENTRY "
+SYS8_SCAN EQU $88 ; $88 = " SCAN "
+SYS8_SCAN_RIGHT EQU $90 ; $90 = " SCAN"
+SYS8_SYNCING EQU $98 ; $98 = " SYNCING"
+SYS8_PROGRESS EQU $a0 ; $a0 = "PROGRESS"
+SYS8_DATA_OK EQU $a8 ; $a8 = " DATA OK"
+SYS8_RESEND EQU $b0 ; $b0 = "-RESEND-"
+SYS8_ABORTED EQU $b8 ; $b8 = " ABORTED"
+SYS8_MISMATCH EQU $c0 ; $c0 = "MISMATCH"
+SYS8_SPLIT EQU $c8 ; $c8 = " SPLIT "
+SYS8_START EQU $d0 ; $d0 = ">=START "
+SYS8_STOP EQU $d8 ; $d8 = ">=STOP "
+; $e0 is the start of the message table SYS6_SET
+;
+PUT6TOP EQU $577f
+; Parameters:
+; A = Offset from 0110 for the start of a 6 byte data item to be put on the top
+; line of the screen. This uses a different encoding for characters where:
+; we have 32 different values which correspond to:
+; "0123456789ABCDEFGH:LMNPRTUWYr -+"
+; 0123456789abcdef0123456789abcdef
+; e.g. $12=':', $13='L'.
+; It appears that things wrap when you get to $20
+;
+PUTMSG1 EQU $5783 ; Put up a message on the top line
+; Parameters - Offset into message selector string.
+; Typically you want a multiple of 6 to choose from these below
+;
+SYS6_SET EQU $00 ; 00 = " SET " (This is stored at $5F5F in the roms)
+SYS6_HOLDTO EQU $06 ; 06 = "HOLDTO"
+SYS6_ALARM EQU $0C ; 0C = "ALARM "
+SYS6_ENTER EQU $12 ; 12 = "ENTER "
+SYS6_HR EQU $18 ; 18 = " HR"
+SYS6_SWITCH EQU $1E ; 1E = "SWITCH"
+SYS6_TIME EQU $24 ; 24 = " TIME "
+SYS6_FORMAT EQU $2A ; 2A = "FORMAT"
+SYS6_DAILY EQU $30 ; 30 = "DAILY "
+SYS6_APPT EQU $36 ; 36 = " APPT "
+SYS6_NO EQU $3c ; 3c = " NO "
+SYS6_APPTS EQU $42 ; 42 = "APPTS "
+SYS6_END_OF EQU $48 ; 48 = "END OF"
+SYS6_LIST EQU $4e ; 4e = " LIST "
+SYS6_DELETE EQU $54 ; 54 = "DELETE"
+SYS6_ANN EQU $5a ; 5a = " ANN "
+SYS6_PHONE EQU $60 ; 60 = "PHONE "
+SYS6_DONE EQU $66 ; 66 = " DONE "
+SYS6_PRI EQU $6c ; 6c = "PRI "
+SYS6_COMM EQU $72 ; 72 = " COMM "
+SYS6_READY EQU $78 ; 78 = "READY "
+SYS6_IN EQU $7e ; 7e = " IN "
+SYS6_ERROR EQU $84 ; 84 = "ERROR "
+SYS6_CEASED EQU $8a ; 8a = "CEASED"
+SYS6_PC EQU $90 ; 90 = "PC- "
+SYS6_WATCH EQU $96 ; 96 = "WATCH "
+SYS6_CHRONO EQU $9c ; 9c = "CHRONO"
+SYS6_TIMER EQU $A2 ; A2 = "TIMER "
+SYS6_000000 EQU $a8 ; a8 = "000000"
+; ae = "MTWTFS"
+; B4 = "SOUEHR"
+; BA = "AUG+74"
+; C0 = "P16174"
+; C6 = "P1OY40"
+; CC = "W+0++0"
+; D2 = "251332"
+; D8 = "0321++"
+; DE = "R++ 0+"
+; E4 = "+12+1T"
+; EA = "+0 0+1"
+; F0 = "26+2U+"
+; F6 = "0 C100"
+; FC = "C0GW"
+;
+PUT6MID EQU $57a9
+; Parameters:
+; A = Offset from 0110 for the start of a 6 byte data item to be put on the top
+; line of the screen. This uses a different encoding for characters where:
+; we have 32 different values which correspond to:
+; "0123456789ABCDEFGH:LMNPRTUWYr -+"
+; e.g. $12=':', $13='L'.
+; It appears that things wrap when you get to $20
+;
+; PUT6MIDA was identified wrong...
+PUTMSG2 EQU $57AD ; This functions just the same as PUTMSG1 except it puts things on the middle line
+CLEARTOP EQU $57d3 ; Puts blanks into all 6 top digits (Blanks out the top line)
+; Parameters:
+; None
+CLEARMID EQU $57d9 ; Puts blanks into all 6 Middle digits (Blanks out the middle line)
+; Parameters:
+; None
+;-------------------------------------------------------------------------
+; These next 6 routines take the two bytes in DATDIGIT1 ($A2) and DATDIGIT2($A3) and put them
+; on the display in the appropriate locations. The digits are represented using the TIMEX6
+; character set.
+;
+PUTTOP12 EQU $57e1 ; Puts DATDIGIT1/2 into TOP Digits 1 and 2
+PUTTOP34 EQU $57f1 ; Puts DATDIGIT1/2 into TOP Digits 3 and 4
+PUTTOP56 EQU $5801 ; Puts DATDIGIT1/2 into TOP Digits 5 and 6
+PUTMID12 EQU $5811 ; Puts DATDIGIT1/2 into Middle Digits 1 and 2
+PUTMID34 EQU $5821 ; Puts DATDIGIT1/2 into Middle Digits 3 and 4
+PUTMID56 EQU $5831 ; Puts DATDIGIT1/2 into Middle Digits 5 and 6
+; These 6 routines blank out parts of the display
+CLRTOP12 EQU $57df ; Puts Blanks into TOP Digits 1 and 2
+CLRTOP34 EQU $57ef ; Puts Blanks into TOP Digits 3 and 4
+CLRTOP56 EQU $57ff ; Puts Blanks into TOP Digits 5 and 6
+CLRMID12 EQU $580f ; Puts Blanks into Middle Digits 1 and 2
+CLRMID34 EQU $581f ; Puts Blanks into Middle Digits 3 and 4
+CLRMID56 EQU $582f ; Puts Blanks into Middle Digits 5 and 6
+;
+FMTXLEAD0 EQU $583f ; Formats into DATDIGIT1/2 with leading zeros
+; Parameters:
+; X - value to be formatted. 0-9 results in 0 followed by the digit
+; 10-99 results in number for both digits
+FMTBLANK0 EQU $584e ; Format into DATDIGIT1/2
+; Parameters:
+; X - value to be formatted. 0 results in all blanks.
+; 1-9 results in blank followed by the digit
+; 10-99 results in number for both digits
+FMTX EQU $5852 ; Format into DATDIGIT1/2
+; Parameters:
+; X - value to be formatted. 0-9 results in blank followed by the digit
+; 10-99 results in number for both digits
+
+FMTSPACE EQU $585d ; Format blankes into DATDIGIT1/2
+; Parameters: NONE
+; This routine simply puts spaces into DATDIGIT1 DATDIGIT2
+;
+SAYEOLMSG EQU $587a ; Puts 'END OF LIST' on the display
+PUTBOT678 EQU $5987 ; Puts three digits into the lower corner of the display.
+; Typically this is the time zone information.
+; Parameters:
+; X - Pointer to 3 byte location containing bytes to put on the display
+; (pointed to by x) 3 bytes in TIMEX ascii. Because the X register iss
+; used to index to them, they must be located in the first 256 bytes of
+; memory.
+PUTDATESEP EQU $59ac ; Put either Dashes or periods on the top line
+
+DIGLOCTOP EQU $5e2f ; Locations of digits on the top line
+DIGLOCMID EQU $5e35 ; Locations of digits on the middle line
+DIGLOCBOT EQU $5e3b ; Locations of digits on the bottom line
+
+;-------------------------------------------------------------------------
+PUT_YEARX EQU $67D5 ; Put the leading zero 2 digit year in the appropriate spot on the display based
+ ; on the current time zone date format
+; Parameters:
+; X - Year to be displayed
+;-------------------------------------------------------------------------
+PUT_MONTHX EQU $67D9 ; Put the leading space 2 digit month in the appropriate spot on the display based
+ ; on the current time zone date format
+; Parameters:
+; X - Month to be displayed
+;-------------------------------------------------------------------------
+PUT_DAYX EQU $67DD ; Put the leading zero 2 digit day in the appropriate spot on the display based
+ ; on the current time zone date format
+; Parameters:
+; X - Day to be displayed
+;-------------------------------------------------------------------------
+SAY_HOURX EQU $67E1 ; Puts up the hour on the display along with an AM/PM indicator and a Colon.
+ ; This code respects the current 12/24 hour format.
+; Parameters:
+; X - Hour to be displayed
+;-------------------------------------------------------------------------
+PUT_MINUTEX EQU $682C ; This puts the minute in the middle two digits on the middle line followed by a period
+; Parameters:
+; X - minute (0-59) to be displayed
+;-------------------------------------------------------------------------
+SHOWSEC_TENS EQU $6839 ; Puts the character at SECOND_TENS onto the next to the last digit on the middle line
+; Parameters:
+; SECOND_TENS - Value to be put on the display
+;-------------------------------------------------------------------------
+SHOWSEC_ONES EQU $6841 ; Puts the character at SECOND_ONES onto the last digit on the middle line
+; Parameters:
+; SECOND_ONES - Value to be put on the display
+;-------------------------------------------------------------------------
+CALC_DOW_X EQU $68DE ; Computes the Day of the Week from the Month, Day, Year information
+; Parameters:
+; X - Pointer to Month, Day, Year block
+;-------------------------------------------------------------------------
+ACQUIRE EQU $68F1 ; Disable interrupts for a short piece of code
+RELEASE EQU $68FB ; Reenable interrupts
+;-------------------------------------------------------------------------
+GET_MONTHLEN EQU $6902 ; Computes the number of days in a given month
+; Parameters:
+; PARM_MONTH, PARM_YEAR contain the month and year to look for
+; Returns:
+; A - Number of days in the month
+;-------------------------------------------------------------------------
+SETALL EQU $5a9c ; Turn on all segments on the display
+INCA_WRAPX EQU $6B16 ; Advance to the next value wrapped within a range
+; Parameters:
+; A - Number to be incremented
+; X - Range to hold number within
+;-------------------------------------------------------------------------
+GETBCDHI EQU $6B5b
+; Parameters:
+; X - Hex value to be converted (Range 0-99)
+; Returns:
+; A - High byte of number in timex ascii
+;-------------------------------------------------------------------------
+GETBCDLOW EQU $6B63
+; Parameters:
+; X - Hex value to be converted (Range 0-99)
+; Returns:
+; A - Low byte of number in timex ascii
+;-------------------------------------------------------------------------
+TABHEX2BCD EQU $6b69 ; 100 bytes from 6b69-6bcc
+; This is a 100 byte table of HEX to BCD conversion values. You can take the value you want
+; to convert, load it into the X register and then load TABHEX2BCX,X. To get the high order byte,
+; just shift it right by 4. The low order is just an and with $0f.
+
+SYS_26 EQU $26
+MODE_FLAGS EQU $68 ; FLAGS
+ ; Bit0 = Indicates that we are in alarm set mode (SET=IN SET MODE)
+ ; Bit1 = Indicates that we have a backup mode pending alarm (SET=PENDING)
+ ; Bit2 = Indicates that hourly chimes are to be played (SET=ENABLED)
+ ; Bit3 = Indicates that hourly chimes are temporarily disabled (SET=DISABLED)
+ ; Bit4 = Enables beep for any button pressed (SET=BEEP)
+ ; Bit5 = Indicates that we are in COMM Mode (SET=IN COMM Mode)
+ ; Bit6 = Indicates that ALARM SET MODE is on the display (SET=On Display)
+ ; Bit7 = <UNUSED>
+APP_FLAGS EQU $8f ; System Flags
+ ; Bit0 = Event has been posted (SET=TRUE)
+ ; Bit1 = We want to allow the app to be suspended (SET=ALLOW)
+ ; Bit2 = Run a nested application (SET=TRUE) - only for ALARM,APPT, WRISTAPP
+ ; Bit3 = A button beep has already been played (SET=PLAYED)
+ ; Bit4 = <UNUSED>
+ ; Bit5 = <UNUSED>
+ ; Bit6 = <UNUSED>
+ ; Bit7 = <UNUSED>
+BTNFLAGS EQU $90 ; Flags for the timer. Note that bits 5 and 7 are exclusive because they happen to
+ ; use the same variables to hold their information.
+ ; Bit0 = <UNUSED>
+ ; Bit1 = wristapp wants a 1/10 second timer function called (WRIST_DOTIC) (SET=CALL)
+ ; Bit2 = Indicates a blink routine is pending (SET=PENDING)
+ ; Bit3 = Indicates a scrolling message is pending (SET=PENDING)
+ ; Bit4 = Indicates an update routine is pending (SET=PENDING)
+ ; Bit5 = Indicates a blink routine has been established (SET=ACTIVE)
+ ; Bit6 = Indicates a scrolling message is in progress (SET=ACTIVE)
+ ; Bit7 = Indicates an update routine has been established (SET=ACTIVE)
+BTNSTATE EQU $91 ; Current event/button press
+TIMER_FLAGS EQU $94 ; System Flags
+ ; Bit0 = Indicates that the timer2 timer has been enabled (SET=ENABLED)
+ ; Bit1 = Indicates that the TIC timer has been enabled (SET=ENABLED)
+ ; Bit2 = Indicates that we want to turn off the indiglo automatically (SET=TURN OFF)
+ ; Bit3 = Indicates that they have done something in this applet (SET=done something)
+ ; Bit4 = Request to reset the watch (SET=Reset Watch)
+ ; Bit5 = Request to turn off the INDIGLO at some future time
+ ; Bit6 = <UNUSED>
+ ; Bit7 = ????Related to indicating that sound is currently playing
+MAIN_FLAGS EQU $95 ; Flags to set queue requests to do something in the main loop
+ ; Bit0 = Indicates that a button has changed state (SET=CHANGED)
+ ; Bit1 = Indicates that the current app should be suspended and TIME activated (SET=Suspend)
+ ; Bit2 = Indicates that the TIMER_TICS has been updated (SET=Updated)
+ ; Bit3 = Indicates that the hourly chimes need to be played (SET=Please Play)
+ ; Bit4 = Indicates that the appointments should be checked (SET=Please Check)
+ ; Bit5 = Indicates that the anniversaries need to be checked (SET=Please Check)
+ ; Bit6 = <UNUSED>
+ ; Bit7 = <UNUSED>
+WRISTAPP_FLAGS EQU $96 ; System Flags
+ ; Bit0 = wristapp wants a second timer function called at start of interrupt (WRIST_DOTIC) (SET=CALL)
+ ; Bit1 = wristapp wants a call once a minute when it changes (WRIST_DOTIC) (SET=CALL)
+ ; Bit2 = wristapp wants a call once an hour when it changes (WRIST_DOTIC) (SET=CALL)
+ ; Bit3 = wristapp wants a call once a day when it changes (WRIST_DOTIC) (SET=CALL)
+ ; Bit4 = Play button beep sound on wristapp for any button (SET=ENABLE)
+ ; Bit5 = Play button beep sound on wristapp for mode button (SET=ENABLE)
+ ; Bit6 = Uses system rules for button beep decisions (SET=SYSTEM RULES)
+ ; Bit7 = Wristapp has been loaded (SET=LOADED)
+NEST_PARM EQU $99 ; Holds the parameter passed to the current nested app
+SYSSOUND EQU $9B ; Current sound to be played
+HW_FLAGS EQU $9e ; System Variable
+ ; Bit0 = Request state for Indiglo light (SET=ON)
+ ; Bit1 = Indicates the the SYS_07 hardware has been reset
+ ; Bit2 = <UNUSED>
+ ; Bit3 = Indicates that we want to load some code from the serial port at reset (SET=ON)
+ ; Bit4 = Set but never used. Mimics the state of 0,PORT_C_DATA & 0,PORT_C_DDR
+ ; Bit5 = Set but never used. Mimics the state of 1,PORT_C_DATA & 1,PORT_C_DDR
+ ; Bit6 = Indicates that INST_ADDR is a pointer into the EEPROM (SET=EEPROM Address)
+ ; Bit7 = Interrupts have been disabled (SET=DISABLED)
+SYSFLAGS EQU $9F ; System flags
+ ; Bit0 = Indicates the update direction. (SET=UP)
+ ; Bit1 = Indicates that the screen needs to be cleared (SET=no need to clear)
+ ; Also used as part of a the digit blinking code (SET=Show digits)
+ ; Bit2 = Indicates that the end of a scrolling message has been reached (SET=END)
+ ; Bit3 = User vs system string (SET=User String)
+ ; Bit4 = <UNUSED>
+ ; Bit5 = <UNUSED>
+ ; Bit6 = <UNUSED>
+ ; Bit7 = <UNUSED>
+DATDIGIT1 EQU $A2 ; First digit parameter for PUTMIDnn/PUTTOPnn routines
+DATDIGIT2 EQU $A3 ; Second digit parameter for PUTMIDnn/PUTTOPnn routines
+UPDATE_VAL EQU $a6 ; Temporary value passed to the update/blink routines
+UPDATE_PARM EQU $a7 ; Pointer to the data passed to the update/blink routines
+;
+; The sound in SYSSOUND can be set to one of the following values:
+;
+SND_HOURLY EQU $83 ; HOURLY CHIME
+SND_APPT EQU $85 ; APPOINTMENT BEEP
+SND_ALARM EQU $86 ; ALARM BEEP
+SND_DLOAD EQU $87 ; PROGRAM DOWNLOAD
+SND_EXTRA EQU $88 ; EXTRA
+SND_COMERR EQU $89 ; COMM ERROR
+SND_DONE EQU $8A ; COMM DONE
+SND_BUTTON EQU $c1 ; BUTTON BEEP
+SND_RETURN EQU $c2 ; RETURN TO TIME
+SND_CONF EQU $c4 ; CONFIRMATION
+
+APPT_PROMBASE EQU $0100 ; Address of the first entry for Appointments in the EEPROM
+LIST_PROMBASE EQU $0102 ; Address of the first entry for LISTs in the EEPROM
+PHONE_PROMBASE EQU $0104 ; Address of the first entry for PHONE numbers in the EEPROM
+ANNIV_PROMBASE EQU $0106 ; Address of the first entry for Anniversaries in the EEPROM
+APPT_ENTRIES EQU $0108 ; Number of currently loaded Appointment entries
+LIST_ENTRIES EQU $0109 ; Number of currently loaded LIST entries
+PHONE_ENTRIES EQU $010a ; Number of currently loaded Phone number entries
+ANNIV_ENTRIES EQU $010b ; Number of currently loaded Anniversary entries
+APPT_BASEYEAR EQU $010c ; The year for the first loaded appointment
+APPT_PRETIME EQU $010d ; How many minutes ahead of time to announce an appointment
+COMM_010e EQU $010e ; ????
+; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+SND_BASEOFF EQU $010f ; Sound base pointer - All sounds are this base relative to SND_BASE (0336)
+WRIST_MAIN EQU $0110 ; This is the primary initialization entry point for a Wristapp
+WRIST_SUSPEND EQU $0113 ; This is the entry point called immediately before suspending the wristapp
+WRIST_DOTIC EQU $0116 ; This is the entry point called for a timer tic in a wristapp
+WRIST_INCOMM EQU $0119 ; This is called when the COMM app is suspending the wristapp which has requests to process timer events
+WRIST_NEWDATA EQU $011c ; This is the wristapp entry point called when new data has been downloaded to the watch
+WRIST_GETSTATE EQU $011f ; Entry to get a wristapp state table entry
+WRIST_JMP_STATE0 EQU $0123 ; Wristapp entry point to call state 0
+
+INST_ADDRHI EQU $0437
+INST_ADDRLO EQU $0438
+USER04a1 EQU $04a1
+NESTED_APP EQU $04a2 ; Nested application (Only to run an application while a different one is running)
+ ; This is used to handle alarms and appointments that go off while you are running something else
+APP2_ALARM EQU 9 ; 9 = Alarm (while another app is running)
+APP2_APPT EQU 10 ; 10 = Appointment (while another app is running)
+APP2_WRIST EQU 11 ; 11 = Wristapp (while another app is running)
+NESTED_PARM EQU $04a4 ; Parameter passed to the nested app call
+USER04c3 EQU $04c3
+BUF_PHONENUM EQU $043a ; 12 byte buffer to hold a decompressed phone number
+EXTRACTBUF EQU $0446 ; 32 byte buffer to hold extracted data from the EEPROM
+UPDATE_POS EQU $04f3 ; Position to update a segment or digit in the blink/refresh routines
+;
+; These two constants appear to be associated with the PUTSCROLLMSG and SCROLLMSG routines
+;
+SEPARATOR EQU $3F ; Indicates the end of a scrolling string
+MSGBUF EQU $04d2 ; Location of the system buffer for a scrolling string
+CURRENT_APP EQU $04c1 ; The current application number (1-8)
+APP_TIME EQU 1 ; 1 = Time of Day
+APP_ALARM EQU 2 ; 2 = Alarm
+APP_APPT EQU 3 ; 3 = Appointment
+APP_ANNIV EQU 4 ; 4 = Anniversary
+APP_PHONE EQU 5 ; 5 = Phone number
+APP_LIST EQU 6 ; 6 = List
+APP_COMM EQU 7 ; 7 = Communication
+APP_WRIST EQU 8 ; 8 = Wristapp (if downloaded)
+BTN_PRESSED EQU $04c3 ; The button currently pressed (For EVT_ANY or EVT_ANY4 events) 0=NEXT 1=MODE 2=SET 3=PREV 4=GLOW
+EFFECTIVE_APP EQU $04c4 ; The efective application
+APP_13 EQU 13 ; Some submode of the TIME application
+APP_TIME_SET EQU 14 ; Submode of the TIME application
+UPDATE_MIN EQU $04f4 ; Minimum value for the update function to generate. At this, it wraps to UPDATE_MAX
+UPDATE_MAX EQU $04f5 ; Maximum value for the update function to generate. At this, it wraps to UPDATE_MIN
+PARM_MONTH EQU $04f9 ; Month parameter
+PARM_YEAR EQU $04fa ; Current year also...
+
+WATCHTIMER EQU $7ff0
+;
+; Other random routines which you might call....
+;
+ALARM_BLINKSEL EQU $40a5
+ALARM_UPDATESEL EQU $40a9
+ALARM_SELMIN EQU $40aD
+ALARM_SELMAX EQU $40b1
+FIND_ANNIV_TODAY EQU $40bc
+FIND_ANNIV_SCAN EQU $40c2
+ANNIV_NEXT_ENTRY EQU $40d0
+ANNIV_PREV_ENTRY EQU $4106
+FIND_ANNIV_ENTRY EQU $414E
+CHECK_ANNIVERSARIES EQU $41EB
+SET_ANNIVTEST_TODAY EQU $4229
+ANNIV_GETMONTHLEN EQU $4259
+TEST_ANNIVERSARY EQU $4277
+ANNIV_COPY_INFO EQU $42F7
+READ_ANNIV_CURRENT EQU $4306
+READ_ANNIV_FIRST EQU $4315
+READ_ANNIV_NEXT EQU $4324
+TEST_SCAN_START EQU $4335
+FIX_SCAN_YEAR EQU $4360
+TEST_SCAN_END EQU $436D
+RESTORE_SCAN_YEAR EQU $439D
+INCREMENT_SCAN_DATE EQU $43A8
+GET_SCAN_MONTHLEN EQU $43CF
+DECREMENT_SCAN_DATE EQU $43E3
+FIND_APPT_NOW EQU $4404
+FIND_APPT_SCAN EQU $440A
+SET_APPTFIND_SCAN EQU $4411
+READ_APPT_NEXT EQU $441B
+APPT_LATCH_ENTRYDATA EQU $4457
+APPT_LATCH_ENTRYONLY EQU $445B
+READ_APPT_PREV EQU $446B
+FIND_APPT_ENTRY EQU $44B5
+APPT_LATCH_ENTDYDATA EQU $4594
+CHECK_APPOINTMENTS EQU $45A8
+SET_APPTFIND_NOW EQU $4619
+READ_APPT_FIRST EQU $4675
+READ_APPT_LAST EQU $468C
+CHECK_APPT_TIME EQU $46A6
+READ_APPT_PACKET1 EQU $4729
+READ_NEXT_APPT_PACKET EQU $4738
+READ_APPT_CURRENT EQU $4749
+PROCESS_EVENTS EQU $4862
+DO_ANYAPP_EVENT EQU $49ae
+DO_NESTAPP_EVENT EQU $49b1
+DO_APP_EVENT EQU $49ed
+DO_NORMAL_STATE EQU $4a24
+TRANSITION_RBUTTON EQU $4b5d
+TRANSITION_LBUTTON EQU $4bac
+QUEUE_INDIGLO_OFF EQU $4bf1
+QUEUE_INDIGLO_OFF EQU $4c38
+NIGHTMODE_INDIGLO_ON EQU $4c45
+INDIGLO_ON EQU $4c4b
+PROCESS_REQUESTS EQU $4C55
+TIMER1_INTERVALS EQU $4c93
+TIMER2_INTERVALS EQU $4c9e
+DO_EVENT EQU $4Cb8
+GETSTATE EQU $4d12
+GETSTATE_TAB EQU $4D22
+CHECK_COMPATIBLE_EVENT EQU $4Daa
+STOP_ALL_SOUND EQU $4E57
+PREPARE_TIMER2_TIMER EQU $4E85
+PLAY_HOURLY EQU $4EA0
+PAUSE_WATCH EQU $4EB6
+RESUME_WATCH EQU $4ECD
+RESUME_UPDATE EQU $4EE5
+ACQUIRE_TIME EQU $4F11
+RELEASE_TIME EQU $4F1D
+PLAY_BUTTON_SAFE EQU $4F35
+PREPARE_NEST_CALL EQU $4F8F
+UNPACK_PHONENUM EQU $4FAE
+PHONE_UNPACK_VAL EQU $4FCF
+UNPACK_STRING EQU $4FDF
+READ_PACKET EQU $502D
+FIND_PACKET EQU $5033
+DO_TRANSFER EQU $504E
+TOGGLE_ENTRYFLAG EQU $5066
+MAKE_INST_LDA EQU $50A3
+MAKE_INST_LDA_X EQU $50A7
+MAKE_INST_STA EQU $50AB
+ADD_INSTADDR EQU $50B6
+SET_INSTADDR_0110 EQU $50C6
+GET_INST_BYTE EQU $50DA
+WRITE_FLAG_BYTE EQU $50F9
+FILL_EXTRACTBUF EQU $512D
+SAVE_EXTRACTBUF EQU $514C
+SYSTEM_RESET EQU $518A
+SND_OFF EQU $5213
+DO_SOUND EQU $5225
+SET_SYS_0f_4d EQU $52c0
+SET_SYS_0f_41 EQU $52C5
+ENABLE_EYE EQU $5367
+SERIAL_DELAY EQU $5375
+DISABLE_EYE EQU $537E
+SET_SYS_07 EQU $5389
+CLEAR_SYS_07 EQU $5390
+RESET_SYS_07 EQU $5396
+INITHW_SYS_07 EQU $539D
+SETHW_07_08_C1 EQU $53B5
+WRITE_ACQUIRE EQU $542b
+WRITE_RELEASE EQU $5437
+MAKE_INST2_LDA_X EQU $5442
+MAKE_INST2_STA_X EQU $5446
+PROM_READ EQU $5451
+PROM_WRITE EQU $5477
+READ_EEPROM_PORT EQU $54BB
+PROM_STARTIO EQU $54C5
+PROM_ACQUIRE EQU $54D1
+PROM_RELEASE EQU $54DB
+PROM_SHOW EQU $54E2
+PROM_HIDE EQU $54E7
+DO_SCROLL EQU $5555
+DO_BLINK EQU $55b7
+PUTDOWTOP EQU $5773
+FMTBLANK0B EQU $5864
+SAYHOLDTODELETE EQU $588b
+PUT_PHONENUM EQU $58a3
+PUTYEARMID EQU $58da
+CLEAR_HMONTH EQU $58f9
+PUT_HMONTHX EQU $58Fe
+CLEAR_HDAY EQU $5912
+PUT_HDAYX EQU $5917
+FIXLEAD0 EQU $592b
+CLEAR_MONTH EQU $5937
+IPUT_MONTHX EQU $593c
+CLEAR_DAY EQU $5950
+IPUT_DAYX EQU $5955
+CLEAR_YEAR EQU $5970
+IPUT_YEARX EQU $5975
+PUTHALFDATESEP EQU $59a1
+PUT_LETTERX EQU $59cf
+PUT_HOURX EQU $59da
+CLEAR_RANGE EQU $5abf
+SYSSYMVALS EQU $5adc
+PHONE_NEXT_ENTRY EQU $6176
+PHONE_PREV_ENTRY EQU $6195
+PHONE_READ_CURRENT EQU $61B0
+PHONE_SHOW_CURRENT EQU $61B9
+PHONE_FIND_SCAN_ENTRY EQU $61FA
+PHONE_READ_ENTRY EQU $6235
+PHONE_READ_NEXT_ENTRY EQU $6246
+PHONE_READ_FIRST_NEXT EQU $625A
+UPDATE_SECONDS EQU $6267
+ADJUST_TZ1TIME EQU $62E0
+ADJUST_TZ2TIME EQU $634C
+UPDATE_TZ1DISP EQU $63B8
+UPDATE_TZ2DISP EQU $63EF
+TIME_SET_BLINKON EQU $6669
+TIME_SET_BLINKOFF EQU $666d
+TIME_SET_GET_TIMEPTR EQU $6684
+TIME_SET_SHOWDISPLAY EQU $6693
+TIME_GET_BLINKPARM EQU $66ee
+SHOW_TIME_DISPLAY EQU $6773
+CLEAR_PM EQU $681E
+CLEAR_AM EQU $6825
+SHOWNIGHT_SYM EQU $6849
+SAY_HOLD_TO EQU $685E
+FIX_TMAPP_DAY EQU $686A
+TMAPP_COPYTZ1 EQU $688A
+TMAPP_COPYTZ2 EQU $6895
+GETTZNAME EQU $68A0
+GET_MONTHDAYX EQU $68A8
+GET_YEAR EQU $68BB
+GET_HOURFORMAT EQU $68C4
+GET_DATEFMT EQU $68D4
+COPY_MDY EQU $68E4
+CHECK_TZ EQU $6917
+CALC_DOW EQU $6925
+TIME_BLINKSEL EQU $69AD
+TIME_UPDATESEL EQU $69B8
+TIME_SELMIN EQU $69c3
+TIME_SELMAX EQU $69ce
+LIST_GO_NEXT EQU $6AA8
+LIST_GO_PREV EQU $6AB6
+LIST_DISPLAY_CURRENT EQU $6AC4
+CLEAR_WRISTAPPMEM EQU $6b28
+DELAY_X EQU $6b3a
+DELAY_X16 EQU $6b4c
+SHOWNOTE_SYM EQU $6C56
+SHOWALARM_SYM EQU $6C6a
+ALARM_CHECK EQU $6c9c
+ALARM_START_BLINK EQU $6Ea6
+ALARM_CALL_BLINK EQU $6EAd
+ALARM_GET_BLINKPARM EQU $6Ec0
+ALARM_DISPLAY_CURRENT EQU $6EFD
+ALARM_SHOW_HOURLYNOTE EQU $6F42
+ALARM_SHOW_ALARMSYM EQU $6F53
+ALARM_SHOW_AMPM EQU $6F64
+ALARM_SHOW_TEXTCHAR EQU $6F85
+ALARM_FIX_HOUR EQU $6F91
+ALARM_GET_DISPLAYHOUR EQU $6FA9
+ALARM_SET_CURRENT EQU $6FC7
+ALARM_SAVE_STATUS EQU $6FDE
+ALARM_GET_TEXTOFFSET EQU $6FE5
+ALARM_GET_DATAOFFSET EQU $6FEE
+MASK_ALARMS EQU $6FFC
+UNMASK_ALARMS EQU $7009
+ANNIV_SHOW_DATE EQU $718D
+ANNIV_SHOW_SCAN_DATE EQU $71A8
+ANNIV_SHOW_CURRENT EQU $71B5
+SHOWREMIND_SYM EQU $71DF
+OFFREMIND_SYM EQU $71F7
+SAY_NO_ANN_ENTRIES EQU $71FE
+APPT_SHOW_TIME EQU $73E0
+APPT_SHOW_DATE EQU $7442
+APPT_SHOW_SCAN EQU $745D
+APPT_SHOW_CURRENT EQU $746A
+APPT_SHOW_UPCOMING EQU $7497
+SAY_NO_APPT_ENTRIES EQU $74C6
diff --git a/flash/flash.asm b/flash/flash.asm
index 15281dc..3a97f77 100644
--- a/flash/flash.asm
+++ b/flash/flash.asm
@@ -46,7 +46,7 @@ S6_SAMPLE: timex6 "SAMPLE"
;
STATETAB:
db 0
- db EVT_ENTER,TIM_2_8TIC,0 ; Initial state
+ db EVT_ENTER,TIM2_8TIC,0 ; Initial state
db EVT_TIMER2,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
diff --git a/from_pkg/Inc150/Wristapp.i b/from_pkg/Inc150/Wristapp.i
new file mode 100644
index 0000000..c645c12
--- /dev/null
+++ b/from_pkg/Inc150/Wristapp.i
@@ -0,0 +1,1508 @@
+;
+; Wristapp.i - For the Datalink 150
+; Copyright (c) 1997 by John A. Toebes, VIII. All Rights Reserved.
+;
+DISP_ROW EQU $1d ; Hardware register to select which row of the display is to be written to. You need to
+ ; Combine this with setting DISP_COL to cause the segment to change
+DISP_COL EQU $1e ; Hardware register to select which col of the display is to be written to. You must set
+ ; DISP_ROW first to cause the segment to change
+; It turns out that the segments on the display are readily accessible. You can turn on/off any segment
+; pretty easily.
+;
+; The top and middle lines are a series of segments which can be individually turned on to
+; achieve the different letters. I assign the segments as follows:
+; A
+; _____
+; | |
+; F | |H | B
+; | | |
+; ---G-
+; | | |
+; E | |I | C
+; |_____|
+; D
+;
+; Numbering the digits on the line from left to right we would get
+;
+;
+; 1A 2A 3A 4A 5A 6A
+; _____ _____ _____ _____ _____ _____
+; 1| |1 2| |2 3| |3 4| |4 5| |5 6| |6
+; F| |1 |B F| |2 |B F| |3 |B F| |4 |B F| |5 |B F| |6 |B
+; | |H | | |H | D23 | |H | D34| |H | D45 | |H | | |H |
+; --1G- --2G- --- --3G- -- --4G- --- --5G- --6G-
+; 1| |1 |1 2| |2 |2 3| |3 |3 4| |4 |4 5| |5 |5 6| |6 |6
+; E| |I |C E| |I |C E| |I |C E| |I |C E| |I |C E| |I |C
+; |_____| |_____| . |_____| |_____| . |_____| |_____|
+; 1D 2D P23 3D 4D P45 5D 6D
+;
+; AM PM Remind Night Alarm Note
+;
+;
+; 1A 2A 3A 4A 5A 6A
+; _____ _____ C23 _____ _____ _____ _____
+; 1| |1 2| |2 o 3| |3 4| |4 5| |5 6| |6
+; F| |1 |B F| |2 |B F| |3 |B F| |4 |B F| |5 |B F| |6 |B
+; | |H | | |H | D23 | |H | | |H | D45 | |H | | |H |
+; --1G- --2G- --- --3G- --4G- --- --5G- --6G-
+; 1| |1 |1 2| |2 |2 3| |3 |3 4| |4 |4 5| |5 |5 6| |6 |6
+; E| |I |C E| |I |C o E| |I |C E| |I |C E| |I |C E| |I |C
+; |_____| |_____| . |_____| |_____| . |_____| |_____|
+; 1D 2D P23 3D 4D P45 5D 6D
+;
+; Note the two dashes between segments 2&3 and 4&5. For convenience, I refer to these
+; as D23 and D45 or DASH23 and DASH45 respectively.
+; I prefix all of the items on the first row with a T and those on the middle row with a M.
+;
+; Pixels on the bottom line are addressed a little differently. For these, we have 8 5x5 sets of
+; segments. We can reference them as follows:
+;
+; S1 S2 S3 S4 S5 S6 S7 S8
+; 12345 12345 12345 12345 12345 12345 12345 12345
+; *****A *****A *****A *****A *****A *****A *****A *****A
+; *****B *****B *****B *****B *****B *****B *****B *****B
+; *****C *****C *****C *****C *****C *****C *****C *****C
+; *****D *****D *****D *****D *****D *****D *****D *****D
+; *****E *****E *****E *****E *****E *****E *****E *****E
+;
+; Hence, the lower right pixel is referenced as S8E5
+;
+
+; Value Bit0 Bit1 Bit2 Bit3 Bit4
+; ------ ------ ------ ------ ------ ------
+; 00 <none> <none> <none> <none> <none>
+; 02 S8E1 S8D1 S8A1 S8B1 S8C1
+; 04 S8E2 S8D2 S8A2 S8B2 S8C2
+; 06 S8E3 S8D3 S8A3 S8B3 S8C3
+; 08 S8E4 S8D4 S8A4 S8B4 S8C4
+; 0A S8E5 S8D5 S8A5 S8B5 S8C5
+; 0C <none> <none> <none> <none> <none>
+; 0E T6C T6B M6C M6B Note
+; 10 T6D T6G T6A <none> M6A
+; 12 T6I T6H M6I M6G M6H
+; 14 T6E T6F M6D M6E M6F
+; 16 <none> <none> <none> <none> <none>
+; 18 <none> <none> <none> <none> <none>
+; 1A <none> <none> <none> <none> <none>
+; 1C T5C T5B M5C M5B Alarm
+; 1E T5D T5G T5A <none> M5A
+; 20 T5I T5H M5I M5G M5H
+; 22 T5E T5F M5D M5E M5F
+; 24 TP45 TD45 MP45 MD45 <none>
+; 26 T4C T4B M4C M4B Night
+; 28 T4D T4G T4A <none> M4A
+; 2A T4I T4H M4I M4G M4H
+; 2C T4E T4F M4D M4E M4F
+; 2E T3C T3B M3C M3B TD34
+; 30 T3D T3G T3A <none> M3A
+; 32 T3I T3H M3I M3G M3H
+; 34 T3E T3F M3D M3E M3F
+; 36 TP23 TD23 MP23 MC23 <none>
+; 38 T2C T2B M2C M2B Remind
+; 3A T2D T2G T2A <none> M2A
+; 3C T2I T2H M2I M2G M2H
+; 3E T2E T2F M2D M2E M2F
+; 40 T1C T1B M1C M1B PM
+; 42 T1D T1G T1A <none> M1A
+; 44 T1I T1H M1I M1G M1H
+; 46 T1E T1F M1D M1E M1F
+; 48 <none> <none> <none> <none> AM
+;
+; For the ODD Bits, we have:
+;
+; Value Bit0 Bit1 Bit2 Bit3 Bit4
+; ------ ------ ------ ------ ------ ------
+; 01 S7D5 S7E5 S7A5 S7B5 S7C5
+; 03 S7D4 S7E4 S7A4 S7B4 S7C4
+; 05 S7D3 S7E3 S7A3 S7B3 S7C3
+; 07 S7D2 S7E2 S7A2 S7B2 S7C2
+; 09 S7D1 S7E1 S7A1 S7B1 S7C1
+; 0B S6D5 S6E5 S6A5 S6B5 S6C5
+; 0D S6D4 S6E4 S6A4 S6B4 S6C4
+; 0F S6D3 S6E3 S6A3 S6B3 S6C3
+; 11 S6D2 S6E2 S6A2 S6B2 S6C2
+; 13 S6D1 S6E1 S6A1 S6B1 S6C1
+; 15 S5D5 S5E5 S5A5 S5B5 S5C5
+; 17 S5D4 S5E4 S5A4 S5B4 S5C4
+; 19 S5D3 S5E3 S5A3 S5B3 S5C3
+; 1B S5D2 S5E2 S5A2 S5B2 S5C2
+; 1D S5D1 S5E1 S5A1 S5B1 S5C1
+; 1F S4D5 S4E5 S4A5 S4B5 S4C5
+; 21 S4D4 S4E4 S4A4 S4B4 S4C4
+; 23 S4D3 S4E3 S4A3 S4B3 S4C3
+; 25 S4D2 S4E2 S4A2 S4B2 S4C2
+; 27 S4D1 S4E1 S4A1 S4B1 S4C1
+; 29 <none> <none> <none> <none> <none>
+; 2B S3D5 S3E5 S3A5 S3B5 S3C5
+; 2D S3D4 S3E4 S3A4 S3B4 S3C4
+; 2F S3D3 S3E3 S3A3 S3B3 S3C3
+; 31 S3D2 S3E2 S3A2 S3B2 S3C2
+; 33 S3D1 S3E1 S3A1 S3B1 S3C1
+; 35 S2D5 S2E5 S2A5 S2B5 S2C5
+; 37 S2D4 S2E4 S2A4 S2B4 S2C4
+; 39 S2D3 S2E3 S2A3 S2B3 S2C3
+; 3B S2D2 S2E2 S2A2 S2B2 S2C2
+; 3D S2D1 S2E1 S2A1 S2B1 S2C1
+; 3F S1D5 S1E5 S1A5 S1B5 S1C5
+; 41 S1D4 S1E4 S1A4 S1B4 S1C4
+; 43 S1D3 S1E3 S1A3 S1B3 S1C3
+; 45 S1D2 S1E2 S1A2 S1B2 S1C2
+; 47 S1D1 S1E1 S1A1 S1B1 S1C1
+;
+;
+; Of course if you want to look it from the orientation of the segments on the display,
+; you can use this information. To make it more compact, I used the notation
+; bit:Value
+; where value is what you store in $1D and Bit is which bit to set/clear in $1E to get the effect
+;
+; T1A=2:42 T2A=2:3A T3A=2:30 T4A=2:28 T5A=2:1E T6A=2:10
+; T1B=1:40 T2B=1:38 T3B=1:2E T4B=1:26 T5B=1:1c T6B=1:0e
+; T1C=0:40 T2C=0:38 T3C=0:2E T4C=0:26 T5C=0:1c T6C=0:0e
+; T1D=0:42 T2D=0:3A T3D=0:30 T4D=0:28 T5D=0:1e T6D=0:10
+; T1E=0:46 T2E=0:3E T3E=0:34 T4E=0:2C T5E=0:22 T6E=0:14
+; T1F=1:46 T2F=1:3E T3F=1:34 T4F=1:2C T5F=1:22 T6F=1:14
+; T1G=1:42 T2G=1:3A T3G=1:30 T4G=1:28 T5G=1:1E T6G=1:10
+; T1H=1:44 T2H=1:3C T3H=1:32 T4H=1:2A T5H=1:20 T6H=1:12
+; T1I=0:44 T2I=0:3C T3I=0:32 T4I=0:2A T5I=0:20 T6I=0:12
+;
+; TP23=0:36
+; TD23=1:36
+; TD34=4:2E
+; TD45=1:24
+; TP45=0:24
+;
+; M1A=4:42 M2A=4:3A M3A=4:30 M4A=4:28 M5A=4:1E M6A=4:10
+; M1B=3:40 M2B=3:38 M3B=3:2E M4B=3:26 M5B=3:1C M6B=3:0E
+; M1C=2:40 M2C=2:38 M3C=2:2E M4C=2:26 M5C=2:1C M6C=2:0E
+; M1D=2:46 M2D=2:3E M3D=2:34 M4D=2:2C M5D=2:22 M6D=2:14
+; M1E=3:46 M2E=3:3E M3E=3:34 M4E=3:2C M5E=3:22 M6E=3:14
+; M1F=4:46 M2F=4:3E M3F=4:34 M4F=4:2C M5F=4:22 M6F=4:14
+; M1G=3:44 M2G=3:3C M3G=3:32 M4G=3:2A M5G=3:20 M6G=3:12
+; M1H=4:44 M2H=4:3C M3H=4:32 M4H=4:2A M5H=4:20 M6H=4:12
+; M1I=2:44 M2I=2:3C M3I=2:32 M4I=2:2A M5I=2:20 M6I=2:12
+;
+; MC23=3:36
+; MP23=2:36
+; MD45=3:24
+; MP45=2:24
+;
+; AM=4:48
+; PM=4:40
+; Remind=4:38
+; Night=4:26
+; Alarm=4:1C
+; Note=4:0e
+
+COL_T1A EQU 2
+ROW_T1A EQU $42
+COL_T2A EQU 2
+ROW_T2A EQU $3A
+COL_T3A EQU 2
+ROW_T3A EQU $30
+COL_T4A EQU 2
+ROW_T4A EQU $28
+COL_T5A EQU 2
+ROW_T5A EQU $1E
+COL_T6A EQU 2
+ROW_T6A EQU $10
+;
+COL_T1B EQU 1
+ROW_T1B EQU $40
+COL_T2B EQU 1
+ROW_T2B EQU $38
+COL_T3B EQU 1
+ROW_T3B EQU $2E
+COL_T4B EQU 1
+ROW_T4B EQU $26
+COL_T5B EQU 1
+ROW_T5B EQU $1c
+COL_T6B EQU 1
+ROW_T6B EQU $0e
+;
+COL_T1C EQU 0
+ROW_T1C EQU $40
+COL_T2C EQU 0
+ROW_T2C EQU $38
+COL_T3C EQU 0
+ROW_T3C EQU $2E
+COL_T4C EQU 0
+ROW_T4C EQU $26
+COL_T5C EQU 0
+ROW_T5C EQU $1c
+COL_T6C EQU 0
+ROW_T6C EQU $0e
+;
+COL_T1D EQU 0
+ROW_T1D EQU $42
+COL_T2D EQU 0
+ROW_T2D EQU $3A
+COL_T3D EQU 0
+ROW_T3D EQU $30
+COL_T4D EQU 0
+ROW_T4D EQU $28
+COL_T5D EQU 0
+ROW_T5D EQU $1e
+COL_T6D EQU 0
+ROW_T6D EQU $10
+;
+COL_T1E EQU 0
+ROW_T1E EQU $46
+COL_T2E EQU 0
+ROW_T2E EQU $3E
+COL_T3E EQU 0
+ROW_T3E EQU $34
+COL_T4E EQU 0
+ROW_T4E EQU $2C
+COL_T5E EQU 0
+ROW_T5E EQU $22
+COL_T6E EQU 0
+ROW_T6E EQU $14
+;
+COL_T1F EQU 1
+ROW_T1F EQU $46
+COL_T2F EQU 1
+ROW_T2F EQU $3E
+COL_T3F EQU 1
+ROW_T3F EQU $34
+COL_T4F EQU 1
+ROW_T4F EQU $2C
+COL_T5F EQU 1
+ROW_T5F EQU $22
+COL_T6F EQU 1
+ROW_T6F EQU $14
+;
+COL_T1G EQU 1
+ROW_T1G EQU $42
+COL_T2G EQU 1
+ROW_T2G EQU $3A
+COL_T3G EQU 1
+ROW_T3G EQU $30
+COL_T4G EQU 1
+ROW_T4G EQU $28
+COL_T5G EQU 1
+ROW_T5G EQU $1E
+COL_T6G EQU 1
+ROW_T6G EQU $10
+;
+COL_T1H EQU 1
+ROW_T1H EQU $44
+COL_T2H EQU 1
+ROW_T2H EQU $3C
+COL_T3H EQU 1
+ROW_T3H EQU $32
+COL_T4H EQU 1
+ROW_T4H EQU $2A
+COL_T5H EQU 1
+ROW_T5H EQU $20
+COL_T6H EQU 1
+ROW_T6H EQU $12
+;
+COL_T1I EQU 0
+ROW_T1I EQU $44
+COL_T2I EQU 0
+ROW_T2I EQU $3C
+COL_T3I EQU 0
+ROW_T3I EQU $32
+COL_T4I EQU 0
+ROW_T4I EQU $2A
+COL_T5I EQU 0
+ROW_T5I EQU $20
+COL_T6I EQU 0
+ROW_T6I EQU $12
+;
+;
+COL_TP23 EQU 0
+ROW_TP23 EQU $36
+;
+COL_TD23 EQU 1
+ROW_TD23 EQU $36
+;
+COL_TD34 EQU 4
+ROW_TD34 EQU $2E
+;
+COL_TD45 EQU 1
+ROW_TD45 EQU $24
+;
+COL_TP45 EQU 0
+ROW_TP45 EQU $24
+;
+;
+COL_M1A EQU 4
+ROW_M1A EQU $42
+COL_M2A EQU 4
+ROW_M2A EQU $3A
+COL_M3A EQU 4
+ROW_M3A EQU $30
+COL_M4A EQU 4
+ROW_M4A EQU $28
+COL_M5A EQU 4
+ROW_M5A EQU $1E
+COL_M6A EQU 4
+ROW_M6A EQU $10
+;
+COL_M1B EQU 3
+ROW_M1B EQU $40
+COL_M2B EQU 3
+ROW_M2B EQU $38
+COL_M3B EQU 3
+ROW_M3B EQU $2E
+COL_M4B EQU 3
+ROW_M4B EQU $26
+COL_M5B EQU 3
+ROW_M5B EQU $1C
+COL_M6B EQU 3
+ROW_M6B EQU $0E
+;
+COL_M1C EQU 2
+ROW_M1C EQU $40
+COL_M2C EQU 2
+ROW_M2C EQU $38
+COL_M3C EQU 2
+ROW_M3C EQU $2E
+COL_M4C EQU 2
+ROW_M4C EQU $26
+COL_M5C EQU 2
+ROW_M5C EQU $1C
+COL_M6C EQU 2
+ROW_M6C EQU $0E
+;
+COL_M1D EQU 2
+ROW_M1D EQU $46
+COL_M2D EQU 2
+ROW_M2D EQU $3E
+COL_M3D EQU 2
+ROW_M3D EQU $34
+COL_M4D EQU 2
+ROW_M4D EQU $2C
+COL_M5D EQU 2
+ROW_M5D EQU $22
+COL_M6D EQU 2
+ROW_M6D EQU $14
+;
+COL_M1E EQU 3
+ROW_M1E EQU $46
+COL_M2E EQU 3
+ROW_M2E EQU $3E
+COL_M3E EQU 3
+ROW_M3E EQU $34
+COL_M4E EQU 3
+ROW_M4E EQU $2C
+COL_M5E EQU 3
+ROW_M5E EQU $22
+COL_M6E EQU 3
+ROW_M6E EQU $14
+;
+COL_M1F EQU 4
+ROW_M1F EQU $46
+COL_M2F EQU 4
+ROW_M2F EQU $3E
+COL_M3F EQU 4
+ROW_M3F EQU $34
+COL_M4F EQU 4
+ROW_M4F EQU $2C
+COL_M5F EQU 4
+ROW_M5F EQU $22
+COL_M6F EQU 4
+ROW_M6F EQU $14
+;
+COL_M1G EQU 3
+ROW_M1G EQU $44
+COL_M2G EQU 3
+ROW_M2G EQU $3C
+COL_M3G EQU 3
+ROW_M3G EQU $32
+COL_M4G EQU 3
+ROW_M4G EQU $2A
+COL_M5G EQU 3
+ROW_M5G EQU $20
+COL_M6G EQU 3
+ROW_M6G EQU $12
+;
+COL_M1H EQU 4
+ROW_M1H EQU $44
+COL_M2H EQU 4
+ROW_M2H EQU $3C
+COL_M3H EQU 4
+ROW_M3H EQU $32
+COL_M4H EQU 4
+ROW_M4H EQU $2A
+COL_M5H EQU 4
+ROW_M5H EQU $20
+COL_M6H EQU 4
+ROW_M6H EQU $12
+;
+COL_M1I EQU 2
+ROW_M1I EQU $44
+COL_M2I EQU 2
+ROW_M2I EQU $3C
+COL_M3I EQU 2
+ROW_M3I EQU $32
+COL_M4I EQU 2
+ROW_M4I EQU $2A
+COL_M5I EQU 2
+ROW_M5I EQU $20
+COL_M6I EQU 2
+ROW_M6I EQU $12
+;
+;
+COL_MC23 EQU 3
+ROW_MC23 EQU $36
+;
+COL_MP23 EQU 2
+ROW_MP23 EQU $36
+;
+COL_MD45 EQU 3
+ROW_MD45 EQU $24
+;
+COL_MP45 EQU 2
+ROW_MP45 EQU $24
+;
+;
+COL_AM EQU 4
+ROW_AM EQU $48
+;
+COL_PM EQU 4
+ROW_PM EQU $40
+;
+COL_REMIND EQU 4
+ROW_REMIND EQU $38
+;
+COL_NIGHT EQU 4
+ROW_NIGHT EQU $26
+;
+COL_ALARM EQU 4
+ROW_ALARM EQU $1C
+;
+COL_NOTE EQU 4
+ROW_NOTE EQU $0E
+;
+; S1A1=2:47 S1B1=3:47 S1C1=4:47 S1D1=0:47 S1E1=1:47
+; S1A2=2:45 S1B2=3:45 S1C2=4:45 S1D2=0:45 S1E2=1:45
+; S1A3=2:43 S1B3=3:43 S1C3=4:43 S1D3=0:43 S1E3=1:43
+; S1A4=2:41 S1B4=3:41 S1C4=4:41 S1D4=0:41 S1E4=1:41
+; S1A5=2:3F S1B5=3:3F S1C5=4:3F S1D5=0:3F S1E5=1:3F
+;
+; S2A1=2:3D S2B1=3:3D S2C1=4:3D S2D1=0:3D S2E1=1:3D
+; S2A2=2:3B S2B2=3:3B S2C2=4:3B S2D2=0:3B S2E2=1:3B
+; S2A3=2:39 S2B3=3:39 S2C3=4:39 S2D3=0:39 S2E3=1:39
+; S2A4=2:37 S2B4=3:37 S2C4=4:37 S2D4=0:37 S2E4=1:37
+; S2A5=2:35 S2B5=3:35 S2C5=4:35 S2D5=0:35 S2E5=1:35
+;
+; S3A1=2:33 S3B1=3:33 S3C1=4:33 S3D1=0:33 S3E1=1:33
+; S3A2=2:31 S3B2=3:31 S3C2=4:31 S3D2=0:31 S3E2=1:31
+; S3A3=2:2F S3B3=3:2F S3C3=4:2F S3D3=0:2F S3E3=1:2F
+; S3A4=2:2D S3B4=3:2D S3C4=4:2D S3D4=0:2D S3E4=1:2D
+; S3A5=2:2B S3B5=3:2B S3C5=4:2B S3D5=0:2B S3E5=1:2B
+;
+; S4A1=2:27 S4B1=3:27 S4C1=4:27 S4D1=0:27 S4E1=1:27
+; S4A2=2:25 S4B2=3:25 S4C2=4:25 S4D2=0:25 S4E2=1:25
+; S4A3=2:23 S4B3=3:23 S4C3=4:23 S4D3=0:23 S4E3=1:23
+; S4A4=2:21 S4B4=3:21 S4C4=4:21 S4D4=0:21 S4E4=1:21
+; S4A5=2:1F S4B5=3:1F S4C5=4:1F S4D5=0:1F S4E5=1:1F
+;
+; S5A1=2:1D S5B1=3:1D S5C1=4:1D S5D1=0:1D S5E1=1:1D
+; S5A2=2:1B S5B2=3:1B S5C2=4:1B S5D2=0:1B S5E2=1:1B
+; S5A3=2:19 S5B3=3:19 S5C3=4:19 S5D3=0:19 S5E3=1:19
+; S5A4=2:17 S5B4=3:17 S5C4=4:17 S5D4=0:17 S5E4=1:17
+; S5A5=2:15 S5B5=3:15 S5C5=4:15 S5D5=0:15 S5E5=1:15
+;
+; S6A1=2:13 S6B1=3:13 S6C1=4:13 S6D1=0:13 S6E1=1:13
+; S6A2=2:11 S6B2=3:11 S6C2=4:11 S6D2=0:11 S6E2=1:11
+; S6A3=2:0F S6B3=3:0F S6C3=4:0F S6D3=0:0F S6E3=1:0F
+; S6A4=2:0D S6B4=3:0D S6C4=4:0D S6D4=0:0D S6E4=1:0D
+; S6A5=2:0B S6B5=3:0B S6C5=4:0B S6D5=0:0B S6E5=1:0B
+;
+; S7A1=2:09 S7B1=3:09 S7C1=4:09 S7D1=0:09 S7E1=1:09
+; S7A2=2:07 S7B2=3:07 S7C2=4:07 S7D2=0:07 S7E2=1:07
+; S7A3=2:05 S7B3=3:05 S7C3=4:05 S7D3=0:05 S7E3=1:05
+; S7A4=2:03 S7B4=3:03 S7C4=4:03 S7D4=0:03 S7E4=1:03
+; S7A5=2:01 S7B5=3:01 S7C5=4:01 S7D5=0:01 S7E5=1:01
+;
+; S8A1=2:02 S8B1=3:02 S8C1=4:02 S8D1=1:02 S8E1=0:02
+; S8A2=2:04 S8B2=3:04 S8C2=4:04 S8D2=1:04 S8E2=0:04
+; S8A3=2:06 S8B3=3:06 S8C3=4:06 S8D3=1:06 S8E3=0:06
+; S8A4=2:08 S8B4=3:08 S8C4=4:08 S8D4=1:08 S8E4=0:08
+; S8A5=2:0a S8B5=3:0a S8C5=4:0a S8D5=1:0a S8E5=0:0a
+;
+;
+; Character set
+;
+C_0 EQU $00
+C_1 EQU $01
+C_2 EQU $02
+C_3 EQU $03
+C_4 EQU $04
+C_5 EQU $05
+C_6 EQU $06
+C_7 EQU $07
+C_8 EQU $08
+C_9 EQU $09
+C_A EQU $0A
+C_B EQU $0B
+C_C EQU $0C
+C_D EQU $0D
+C_E EQU $0E
+C_F EQU $0F
+C_G EQU $10
+C_H EQU $11
+C_I EQU $12
+C_J EQU $13
+C_K EQU $14
+C_L EQU $15
+C_M EQU $16
+C_N EQU $17
+C_O EQU $18
+C_P EQU $19
+C_Q EQU $1A
+C_R EQU $1B
+C_S EQU $1C
+C_T EQU $1D
+C_U EQU $1E
+C_V EQU $1F
+C_W EQU $20
+C_X EQU $21
+C_Y EQU $22
+C_Z EQU $23
+C_BLANK EQU $24
+C_SPACE EQU $24
+C_EXCLAIM EQU $25
+C_DQUOTE EQU $26
+C_POUND EQU $27
+C_DOLLAR EQU $28
+C_PERCENT EQU $29
+C_AMPERSAND EQU $2A
+C_QUOTE EQU $2B
+C_LPAREN EQU $2C
+C_RPAREN EQU $2D
+C_TIMES EQU $2E
+C_PLUS EQU $2F
+C_COMMA EQU $30
+C_MINUS EQU $31
+C_PERIOD EQU $32
+C_SLASH EQU $33
+C_COLON EQU $34
+C_BACKSLASH EQU $35
+C_DIVIDE EQU $36
+C_EQUAL EQU $37
+C_BELL EQU $38
+C_QUESTION EQU $39
+C_UNDER EQU $3A
+C_CHECK EQU $3B
+C_PREV EQU $3C
+C_LEFTARR EQU $3C ; Symbol for the previous key
+C_NEXT EQU $3D
+C_RIGHTARR EQU $3D ; Symbol for the next key
+C_BLOCK EQU $3E
+C_SEP EQU $3F
+C6_SPACE EQU $1d
+; The basic timex character set is:
+; 0 1 2 3 4 5 6 7 8 9 A B C D E F
+; G H I J K L M N O P Q R S T U V
+; W X Y Z ! " # $ % & ' ( ) * +
+; , - . / : ; < = > ? @ A B C D E
+;
+; We also have the timex6 character set as:
+; 0 1 2 3 4 5 6 7 8 9 A B C D E F
+; G H : L M N P R T U W Y r - +
+;
+
+EVT_NEXT EQU $00 ; Next button pressed (not interested in the up transition)
+EVT_MODE EQU $01 ; Mode button pressed (not interested in the up transition)
+EVT_SET EQU $02 ; Set/Delete button pressed (not interested in the up transition)
+EVT_PREV EQU $03 ; Prev button pressed (not interested in the up transition)
+EVT_GLOW EQU $04 ; Indiglo button pressed (not interested in the up transition)
+EVT_ANY EQU $05 ; Any button pressed (not interested in the up transition)
+EVT_ANY4 EQU $06 ; Any button pressed except indiglo (not interested in the up transition)
+EVT_RESUME EQU $1a ; Called when resuming from a nested app
+EVT_ENTER EQU $1b ; Initial state. The Time value is generally $01 or $84 for a well behaved app
+EVT_NEST EQU $1c ; The state table 1 entry called when a nested application is called. It is the equivalent of
+ ; EVT_ENTER for an interrupt. This only occurs for Wristapps, Timer, and appt apps.
+EVT_END EQU $1d ; End of event table indicator
+EVT_TIMER1 EQU $1e ; Timer event - This is fired for a $83 time request
+EVT_TIMER2 EQU $1f ; Timer event - This is fired for a $82,$84,$01 timer request
+; $20-$36 - UNUSED
+; (I bet that you can have user specified events for these too)
+EVT_USER0 EQU $37
+EVT_USER1 EQU $38
+EVT_USER2 EQU $39
+EVT_USER3 EQU $3a ; User specified events. Queued by calling POSTEVENT ($4E89)
+; $3b-$7f - UNUSED
+EVT_DNNEXT EQU $80 ; Next button pressed
+EVT_DNMODE EQU $81 ; Mode button pressed
+EVT_DNSET EQU $82 ; Set/Delete button pressed
+EVT_DNPREV EQU $83 ; Prev button pressed
+EVT_DNGLOW EQU $84 ; Indiglo button pressed
+EVT_DNANY EQU $85 ; Any of the four buttons Pressed
+EVT_DNANY4 EQU $86 ; Any button pressed except indiglo
+
+; $87-$9F - UNUSED
+EVT_UPNEXT EQU $A0 ; Next button released
+EVT_UPMODE EQU $A1 ; Mode button released
+EVT_UPSET EQU $A2 ; Set/Delete button released
+EVT_UPPREV EQU $A3 ; Prev button released
+EVT_UPGLOW EQU $A4 ; Indiglo button released
+EVT_UPANY EQU $A5 ; Any of the four buttons Released
+EVT_UPANY4 EQU $A6 ; Any button Released except indiglo
+
+ALARM_STATUS EQU $69 ; This is the status flags for the alarms. The low order bit indicates that it is enabled
+ ; The next bit seems to indicate that the alarm is temporarily masked or disabled
+ ; Apparently the next bit can be set, but I haven't seen any use for it.
+; EQU $69 ; Alarm 1 Status
+; EQU $69 ; Alarm 1 Status
+; EQU $6a ; Alarm 2 Status
+; EQU $6b ; Alarm 3 Status
+; EQU $6c ; Alarm 4 Status
+; EQU $6d ; Alarm 5 Status
+
+SCAN_MONTH EQU $7a ; The current SCAN month
+SCAN_DAY EQU $7b ; The current SCAN day
+SCAN_YEAR EQU $7c ; The current SCAN year
+
+MONTH_JAN EQU 1
+MONTH_FEB EQU 2
+MONTH_MAR EQU 3
+MONTH_APR EQU 4
+MONTH_MAY EQU 5
+MONTH_JUN EQU 6
+MONTH_JUL EQU 7
+MONTH_AUG EQU 8
+MONTH_SEP EQU 9
+MONTH_OCT EQU 10
+MONTH_NOV EQU 11
+MONTH_DEC EQU 12
+
+SYSTEMP0 EQU $A0
+SYSTEMP1 EQU $A1
+
+TIM_ONCE EQU $ff ; No time interval. Operation is executed just once
+
+TIM1_TIC EQU $00
+TIM1_2TIC EQU $01
+TIM1_3TIC EQU $02
+TIM1_4TIC EQU $03
+TIM1_HALFSEC EQU $04
+TIM1_SECOND EQU $05
+TIM1_SECHALF EQU $06
+TIM1_TWOSEC EQU $07
+TIM1_TWOSEC1 EQU $08
+TIM1_12SEC EQU $09
+TIM1_18SEC EQU $0a
+;
+; Note that the second part of this table is happen-stance since it is really a rollover
+; of the second table on top of the first one. But it might be useful to someone...
+;
+TIM1_TICA EQU $0b ; This is the typical scroll interval
+TIM1_2TICA EQU $0c
+TIM1_4TICA EQU $0d
+TIM1_8TIC EQU $0e ; This is the normal blink interval
+TIM1_12TIC EQU $0f ; Just over a second
+TIM1_16TIC EQU $10 ; A second and a half
+TIM1_24TIC EQU $11 ; Two and a half seconds
+TIM1_32TIC EQU $12 ; Just over three seconds
+TIM1_40TIC EQU $13 ; Four seconds
+TIM1_48TIC EQU $14 ; Almost five seconds
+TIM1_96TIC EQU $15 ; Almost ten seconds
+
+TIM2_TIC EQU $80 ; This is the typical scroll interval
+TIM2_2TIC EQU $81
+TIM2_4TIC EQU $82
+TIM2_8TIC EQU $83 ; This is the normal blink interval
+TIM2_12TIC EQU $84 ; Just over a second
+TIM2_16TIC EQU $85 ; A second and a half
+TIM2_24TIC EQU $86 ; Two and a half seconds
+TIM2_32TIC EQU $87 ; Just over three seconds
+TIM2_40TIC EQU $88 ; Four seconds
+TIM2_48TIC EQU $89 ; Almost five seconds
+TIM2_96TIC EQU $8a ; Almost ten seconds
+
+TIM_LONG1 EQU $01 ; Long shot time interval - Fires a $1F when the the timer expires
+TIM_03 EQU $03 ; Unknown
+TIM_08 EQU $08 ; Unknown
+
+TIM_SHORT EQU $82 ; Short timer - Fires a $1F event when the timer expires
+TIM_MED EQU $83 ; Medium timer - Fires a $1E event when the timer expires
+TIM_LONG EQU $84 ; Long timer - Fires a $1F event when the timer expires
+TIM_86 EQU $86 ; ?Timer
+;-----------------------------------------------------------------------------------------
+TZ1_HOUR EQU $b0 ; Time zone 1 current hour (0-23)
+TZ1_MINUTE EQU $b1 ; Time zone 1 current minute (0-59)
+TZ1_MONTH EQU $b2 ; Time zone 1 current month of the year (1-12)
+TZ1_DAY EQU $b3 ; Time zone 1 current day of the month (1-31)
+TZ1_YEAR EQU $b4 ; Time zone 1 current year (mod 1900)
+TZ1_NAME EQU $b5 ; Time zone 1 name (3 TIMEX characters)
+; EQU $b6 ; " " " "
+; EQU $b7 ; " " " "
+TZ1_DOW EQU $b8 ; Time zone 1 day of week (0=Monday...6=Sunday)
+;-----------------------------------------------------------------------------------------
+TZ2_HOUR EQU $b9 ; Time zone 2 current hour (0-23) in Timezone 1
+TZ2_MINUTE EQU $ba ; Time zone 2 current minute (0-59)
+TZ2_MONTH EQU $bb ; Time zone 2 current month of the year (1-12)
+TZ2_DAY EQU $bc ; Time zone 2 current day of the month (1-31)
+TZ2_YEAR EQU $bd ; Time zone 2 current year (mod 1900)
+TZ2_NAME EQU $be ; Time zone 2 name (3 TIMEX characters)
+; EQU $bf ; " " " "
+; EQU $c0 ; " " " "
+TZ2_DOW EQU $c1 ; Time zone 2 day of the week (0=Monday..6=Sunday)
+;-----------------------------------------------------------------------------------------
+; Sound Support Values
+TONE_END EQU $00 ; END
+TONE_LOW_C EQU $10 ; Low C
+TONE_HI_C EQU $20 ; High C
+TONE_MID_C EQU $30 ; Middle C
+TONE_VHI_C EQU $40 ; Very high C
+TONE_HI_F EQU $50 ; High F (little bit lower than F)
+TONE_MID_F EQU $60 ; Middle F
+TONE_LO_F EQU $70 ; Low F
+TONE_VHI_GSHARP EQU $80 ; Very High G# (G Sharp)
+TONE_HI_GSHARP EQU $90 ; High G#
+TONE_MID_GSHARP EQU $A0 ; Middle G#
+TONE_LO_GSHARP EQU $B0 ; Low G#
+TONE_HI_D EQU $C0 ; High D
+TONE_MID_D EQU $D0 ; Middle D
+TONE_LO_D EQU $E0 ; Low D
+TONE_PAUSE EQU $F0 ; Pause
+SND_END EQU $80
+;--------------------------------------------------------------------------------
+SNDSTART EQU $4e4a ; Start playing the current sound in SYSSOUND
+;--------------------------------------------------------------------------------
+PLAYCONF EQU $4e7a ; Play a confirmation sound
+PLAYBUTTON EQU $4e80 ; Play the button beep sound if no other sound is currently playing
+;--------------------------------------------------------------------------------
+POSTEVENT EQU $4e89 ; Post a event to the internal processing queue
+; Parameters:
+; A - Event to be posted.
+; This posts an event to run through the processing loop for the current applet.
+; Typical user events are in the $30-$3F range.
+;
+;--------------------------------------------------------------------------------
+INDIGLO_OFF EQU $4e8e ; This routine turns off the indiglo light
+;--------------------------------------------------------------------------------
+SNDSTOP EQU $4f3a ; This stops whatever sound is currently playing
+;--------------------------------------------------------------------------------
+CALL_NESTEDAPP EQU $4f4d
+; Purpose:
+; This sets up to call a nested application while the current one is running.
+; Up to 5 apps may be nested (although there are only 3 potential ones defined).
+; If more than 5 have been called the oldest one will be forgotten.
+; When the nested app is called, NESTED_APP will be set to the application number
+; passed in and NESTED_PARM will contain the X parameter passed in
+;
+; Parameters:
+; A - Nested application number. This is one of the three defined apps:
+; 9 = APP2_ALARM - Alarm (while another app is running)
+; 10 = APP2_APPT - Appointment (while another app is running)
+; 11 = APP2_WRIST - Wristapp (while another app is running)
+; X - Parameter to pass to the nested application
+;--------------------------------------------------------------------------------
+SET_INDIGLO EQU $5504 ; This routine turns on/off the indiglo light
+; Parameters:
+; 0,Sys_9e - Bit indicates request for on or off
+;--------------------------------------------------------------------------------
+PUTSCROLLMSG EQU $5522 ; Make the buffer at MSGBUF visible
+;--------------------------------------------------------------------------------
+SCROLLMSG EQU $5545 ; Start the scrolling cycle for the current message
+; Parameters:
+; MSGBUF - Message to be scroll terminated by a SEPARATOR character
+;--------------------------------------------------------------------------------
+SCROLLMSG_CONT EQU $5549 ; Start the scrolling cycle for the current message, but don't reset the
+ ; scrolling cycle wait count.
+; Parameters:
+; MSGBUF - Message to be scroll terminated by a SEPARATOR character
+; SCROLL_TICS - The current tic count in the cycle
+;--------------------------------------------------------------------------------
+START_BLINKX EQU $55bb ; Establish and call the specified blinking rountine
+; Parameters:
+; X - single byte parameter to the particular blinking function
+; A - Blinking function to be selected
+;--------------------------------------------------------------------------------
+START_BLINKP EQU $55BF ; Establish and call the specified blinking rountine
+; Parameters:
+; X - Address of parameter to the particular blinking function
+; A - Blinking function to be selected
+BLINK_YEAR EQU 0 ; Blink the year in the right place according to the current time format
+BLINK_SECONDS EQU 1 ; Blink two characters point to by UPDATE_PARM on the right two digits of the middle line - Used for the seconds
+BLINK_AMPM EQU 2 ; Blink AM/PM on the right most digits of the middle line (A or P pointed to by UPDATE_PARM)
+BLINK_MONTH EQU 3 ; Blink the month in the right place according to the current time format
+BLINK_HMONTH EQU 4 ; Blink the month in the right place according to the current time format for a half date (no year)
+BLINK_DAY EQU 5 ; Blink the day in the right place according to the current time format
+BLINK_HDAY EQU 6 ; Blink the day in the right place according to the current time format for half dates
+BLINK_MID12 EQU 7 ; Blink the left two blank padded digits on the middle line (value pointed to by UPDATE_PARM)
+BLINK_HOUR EQU 8 ; Blink the Hour (left two segments on the middle line) and AM/PM indicator (hour point to by UPDATE_PARM)
+BLINK_MID34 EQU 9 ; Blink the middle two zero padded digits on the middle line (value pointed to by UPDATE_PARM)
+BLINK_SEGMENT EQU 10 ; Blink a single segment indicated by UPDATE_POS and mask in UPDATE_VAL
+BLINK_DIGIT EQU 11 ; Blink solid black cursor for the digit (UPDATE_POS is the location on the bottom line)
+BLINK_TZONE EQU 12 ; Blink the timezone information (Pointed to by UPDATE_PARM)
+BLINK_TOP34 EQU 13 ; Blink the middle zero padded two digits on the top line (value pointed to by UPDATE_PARM)
+;--------------------------------------------------------------------------------
+PUTLINE3 EQU $56d5 ; Put a single character on the bottom line of the display
+POSL3_1 EQU $47
+POSL3_2 EQU $3d
+POSL3_3 EQU $33
+POSL3_4 EQU $27
+POSL3_5 EQU $1d
+POSL3_6 EQU $13
+POSL3_7 EQU $09
+POSL3_8 EQU $0a
+; Parameters:
+; A = Position S1 S2 S3 S4 S5 S6 S7 S8
+; [$47] [$3D] [$33] [$27] [$1D] [$13] [$09] [$0A]
+; [ 71] [ 61] [ 51] [ 39] [ 29] [ 19] [ 9] [ 10]
+; X = Character in Timex Ascii to display
+; Notes:
+; This appears to be an XOR operation. Calling the same function twice in a row would
+; erase the character. Writing on top of an existing character seems to let you generate
+; a non Ascii character.
+
+PUTLINE1 EQU $570D ; Put a single character on the top line of the display
+POSL1_1 EQU $46
+POSL1_2 EQU $3e
+POSL1_3 EQU $34
+POSL1_4 EQU $2c
+POSL1_5 EQU $22
+POSL1_6 EQU $14
+; Parameters:
+; A = Position [$46] [$3E] - [$34] [$2C] - [$22] [$14]
+; [ 70] [ 62] [ 52] [ 44] [ 34] [20]
+; X = Character in Timex Ascii to display
+
+PUTLINE2 EQU $5745 ; Put a single character on the second line of the display
+POSL2_1 EQU $46
+POSL2_2 EQU $3e
+POSL2_3 EQU $34
+POSL2_4 EQU $2c
+POSL2_5 EQU $22
+POSL2_6 EQU $14
+; Parameters:
+; A = Position [$46] [$3E] - [$34] [$2C] - [$22] [$14]
+; [ 70] [ 62] [ 52] [ 44] [ 34] [20]
+; X = Character in Timex Ascii to display
+
+CLEARALL EQU $577A ; Clear the display
+CLEARBOT EQU $5787 ; Clear the bottom line of the display
+CLEARSYM EQU $579f ; Turns off all the non digit symbols segments (including dots, dashes and colons)
+;-------------------------------------------------------------------------
+START_UPDATEX equ $57c3 ; Establish and call the specified update function (See START_UPDATEP)
+; Parameters:
+; X - single byte parameter to the particular update function
+; A - Update function to be selected
+;-------------------------------------------------------------------------
+START_UPDATEP EQU $57C7 ; This establishes an update function. Update functions are called every 8/10th
+ ; of a second. This function will update a number in an upward or downward
+ ; direction based on the setting of 0,SYSFLAGS
+; Parameters:
+; A - Update function to be selected
+; X - Pointer to parameters for the update function
+UPD_YEAR EQU 0 ; Update the year
+UPD_MONTH EQU 1 ; Update the Month
+UPD_HMONTH EQU 2 ; Update the Month in Half date format
+UPD_DAY EQU 3 ; Update the day
+UPD_HDAY EQU 4 ; Update the day in half date format
+UPD_MID12 EQU 5 ; Update MID12
+UPD_HOUR EQU 6 ; Update the hour
+UPD_MID34 EQU 7 ; Update MID34
+UPD_DIGIT EQU 8 ; Update the digit at UPDATE_POS
+;-------------------------------------------------------------------------
+BANNER8 EQU $5845 ; Display an 8 character string
+; Parameters
+; A = Offset from 0110 for the start of an 8 character timex string
+;
+;-------------------------------------------------------------------------
+PUTMSGXBOT EQU $5849 ; Puts a message on the bottom of the screen.
+; Parameters
+; A = Message selector number. Valid values from 0 to 27. They correspond to
+; the same strings passed into PUTMSGBOT scaled down by 8
+;-------------------------------------------------------------------------
+PUTMSGBOT EQU $584c ; Puts a message on the bottom of the screen.
+; Parameters
+; A = Offset into message selector string. Valid values from from $00 to $d8 at
+; 8 Byte offsets. $E0 is the start of the 6 byte top/mid message strings.
+SYS8_MON EQU $00 ; $00 = "MON "
+SYS8_TUE EQU $08 ; $08 = "TUE "
+SYS8_WED EQU $10 ; $10 = "WED "
+SYS8_THU EQU $18 ; $18 = "THU "
+SYS8_FRI EQU $20 ; $20 = "FRI "
+SYS8_SAT EQU $28 ; $28 = "SAT "
+SYS8_SUN EQU $30 ; $30 = "SUN "
+SYS8_VERDATE EQU $38 ; $38 = " 802003 "
+SYS8_VERSION EQU $40 ; $40 = " V2.0 "
+SYS8_MODE EQU $48 ; $48 = " MODE "
+SYS8_SET_MODE EQU $50 ; $50 = "SET MODE"
+SYS8_SET EQU $58 ; $58 = "SET "
+SYS8_TO EQU $60 ; $60 = "TO "
+SYS8_FOR EQU $68 ; $68 = "FOR "
+SYS8_ENTRIES EQU $70 ; $70 = "ENTRIES "
+SYS8_UPCOMING EQU $78 ; $78 = "UPCOMING"
+SYS8_ENTRY EQU $80 ; $80 = " ENTRY "
+SYS8_SCAN EQU $88 ; $88 = " SCAN "
+SYS8_SCAN_RIGHT EQU $90 ; $90 = " SCAN"
+SYS8_SYNCING EQU $98 ; $98 = " SYNCING"
+SYS8_PROGRESS EQU $a0 ; $a0 = "PROGRESS"
+SYS8_DATA_OK EQU $a8 ; $a8 = " DATA OK"
+SYS8_RESEND EQU $b0 ; $b0 = "-RESEND-"
+SYS8_ABORTED EQU $b8 ; $b8 = " ABORTED"
+SYS8_MISMATCH EQU $c0 ; $c0 = "MISMATCH"
+SYS8_SPLIT EQU $c8 ; $c8 = " SPLIT "
+SYS8_START EQU $d0 ; $d0 = ">=START "
+SYS8_STOP EQU $d8 ; $d8 = ">=STOP "
+; $e0 is the start of the message table SYS6_SET
+;
+PUT6TOP EQU $587e
+; Parameters:
+; A = Offset from 0110 for the start of a 6 byte data item to be put on the top
+; line of the screen. This uses a different encoding for characters where:
+; we have 32 different values which correspond to:
+; "0123456789ABCDEFGH:LMNPRTUWYr -+"
+; 0123456789abcdef0123456789abcdef
+; e.g. $12=':', $13='L'.
+; It appears that things wrap when you get to $20
+;
+PUTMSG1 EQU $5882 ; Put up a message on the top line
+; Parameters - Offset into message selector string.
+; Typically you want a multiple of 6 to choose from these below
+;
+SYS6_SET EQU $00 ; 00 = " SET " (This is stored at $5F5F in the roms)
+SYS6_HOLDTO EQU $06 ; 06 = "HOLDTO"
+SYS6_ALARM EQU $0C ; 0C = "ALARM "
+SYS6_ENTER EQU $12 ; 12 = "ENTER "
+SYS6_HR EQU $18 ; 18 = " HR"
+SYS6_SWITCH EQU $1E ; 1E = "SWITCH"
+SYS6_TIME EQU $24 ; 24 = " TIME "
+SYS6_FORMAT EQU $2A ; 2A = "FORMAT"
+SYS6_DAILY EQU $30 ; 30 = "DAILY "
+SYS6_APPT EQU $36 ; 36 = " APPT "
+SYS6_NO EQU $3c ; 3c = " NO "
+SYS6_APPTS EQU $42 ; 42 = "APPTS "
+SYS6_END_OF EQU $48 ; 48 = "END OF"
+SYS6_LIST EQU $4e ; 4e = " LIST "
+SYS6_DELETE EQU $54 ; 54 = "DELETE"
+SYS6_ANN EQU $5a ; 5a = " ANN "
+SYS6_PHONE EQU $60 ; 60 = "PHONE "
+SYS6_DONE EQU $66 ; 66 = " DONE "
+SYS6_PRI EQU $6c ; 6c = "PRI "
+SYS6_COMM EQU $72 ; 72 = " COMM "
+SYS6_READY EQU $78 ; 78 = "READY "
+SYS6_IN EQU $7e ; 7e = " IN "
+SYS6_ERROR EQU $84 ; 84 = "ERROR "
+SYS6_CEASED EQU $8a ; 8a = "CEASED"
+SYS6_PC EQU $90 ; 90 = "PC- "
+SYS6_WATCH EQU $96 ; 96 = "WATCH "
+SYS6_CHRONO EQU $9c ; 9c = "CHRONO"
+SYS6_TIMER EQU $A2 ; A2 = "TIMER "
+SYS6_000000 EQU $a8 ; a8 = "000000"
+; ae = "MTWTFS"
+; B4 = "SOUEHR"
+; BA = "AUG+74"
+; C0 = "P16174"
+; C6 = "P1OY40"
+; CC = "W+0++0"
+; D2 = "251332"
+; D8 = "0321++"
+; DE = "R++ 0+"
+; E4 = "+12+1T"
+; EA = "+0 0+1"
+; F0 = "26+2U+"
+; F6 = "0 C100"
+; FC = "C0GW"
+;
+PUT6MID EQU $58a8
+; Parameters:
+; A = Offset from 0110 for the start of a 6 byte data item to be put on the top
+; line of the screen. This uses a different encoding for characters where:
+; we have 32 different values which correspond to:
+; "0123456789ABCDEFGH:LMNPRTUWYr -+"
+; e.g. $12=':', $13='L'.
+; It appears that things wrap when you get to $20
+;
+; PUT6MIDA was identified wrong...
+PUTMSG2 EQU $58AC ; This functions just the same as PUTMSG1 except it puts things on the middle line
+CLEARTOP EQU $58d2 ; Puts blanks into all 6 top digits (Blanks out the top line)
+; Parameters:
+; None
+CLEARMID EQU $58d8 ; Puts blanks into all 6 Middle digits (Blanks out the middle line)
+; Parameters:
+; None
+;-------------------------------------------------------------------------
+; These next 6 routines take the two bytes in DATDIGIT1 ($A2) and DATDIGIT2($A3) and put them
+; on the display in the appropriate locations. The digits are represented using the TIMEX6
+; character set.
+;
+PUTTOP12 EQU $58e0 ; Puts DATDIGIT1/2 into TOP Digits 1 and 2
+PUTTOP34 EQU $58f0 ; Puts DATDIGIT1/2 into TOP Digits 3 and 4
+PUTTOP56 EQU $5900 ; Puts DATDIGIT1/2 into TOP Digits 5 and 6
+PUTMID12 EQU $5910 ; Puts DATDIGIT1/2 into Middle Digits 1 and 2
+PUTMID34 EQU $5920 ; Puts DATDIGIT1/2 into Middle Digits 3 and 4
+PUTMID56 EQU $5930 ; Puts DATDIGIT1/2 into Middle Digits 5 and 6
+; These 6 routines blank out parts of the display
+CLRTOP12 EQU $58de ; Puts Blanks into TOP Digits 1 and 2
+CLRTOP34 EQU $58ee ; Puts Blanks into TOP Digits 3 and 4
+CLRTOP56 EQU $59fe ; Puts Blanks into TOP Digits 5 and 6
+CLRMID12 EQU $590e ; Puts Blanks into Middle Digits 1 and 2
+CLRMID34 EQU $591e ; Puts Blanks into Middle Digits 3 and 4
+CLRMID56 EQU $592e ; Puts Blanks into Middle Digits 5 and 6
+;
+FMTXLEAD0 EQU $593E ; Formats into DATDIGIT1/2 with leading zeros
+; Parameters:
+; X - value to be formatted. 0-9 results in 0 followed by the digit
+; 10-99 results in number for both digits
+FMTBLANK0 EQU $594d ; Format into DATDIGIT1/2
+; Parameters:
+; X - value to be formatted. 0 results in all blanks.
+; 1-9 results in blank followed by the digit
+; 10-99 results in number for both digits
+FMTX EQU $5951 ; Format into DATDIGIT1/2
+; Parameters:
+; X - value to be formatted. 0-9 results in blank followed by the digit
+; 10-99 results in number for both digits
+
+FMTSPACE EQU $595C ; Format blankes into DATDIGIT1/2
+; Parameters: NONE
+; This routine simply puts spaces into DATDIGIT1 DATDIGIT2
+;
+SAYEOLMSG EQU $5979 ; Puts 'END OF LIST' on the display
+PUTBOT678 EQU $5a86 ; Puts three digits into the lower corner of the display.
+; Typically this is the time zone information.
+; Parameters:
+; X - Pointer to 3 byte location containing bytes to put on the display
+; (pointed to by x) 3 bytes in TIMEX ascii. Because the X register iss
+; used to index to them, they must be located in the first 256 bytes of
+; memory.
+PUTDATESEP EQU $5aab ; Put either Dashes or periods on the top line
+
+DIGLOCTOP EQU $5e26 ; Locations of digits on the top line
+DIGLOCMID EQU $5e2c ; Locations of digits on the middle line
+DIGLOCBOT EQU $5e32 ; Locations of digits on the bottom line
+
+;-------------------------------------------------------------------------
+PUT_YEARX EQU $67cc ; Put the leading zero 2 digit year in the appropriate spot on the display based
+ ; on the current time zone date format
+; Parameters:
+; X - Year to be displayed
+;-------------------------------------------------------------------------
+PUT_MONTHX EQU $67d0 ; Put the leading space 2 digit month in the appropriate spot on the display based
+ ; on the current time zone date format
+; Parameters:
+; X - Month to be displayed
+;-------------------------------------------------------------------------
+PUT_DAYX EQU $67d4 ; Put the leading zero 2 digit day in the appropriate spot on the display based
+ ; on the current time zone date format
+; Parameters:
+; X - Day to be displayed
+;-------------------------------------------------------------------------
+SAY_HOURX EQU $67d8 ; Puts up the hour on the display along with an AM/PM indicator and a Colon.
+ ; This code respects the current 12/24 hour format.
+; Parameters:
+; X - Hour to be displayed
+;-------------------------------------------------------------------------
+PUT_MINUTEX EQU $6823 ; This puts the minute in the middle two digits on the middle line followed by a period
+; Parameters:
+; X - minute (0-59) to be displayed
+;-------------------------------------------------------------------------
+SHOWSEC_TENS EQU $6830 ; Puts the character at SECOND_TENS onto the next to the last digit on the middle line
+; Parameters:
+; SECOND_TENS - Value to be put on the display
+;-------------------------------------------------------------------------
+SHOWSEC_ONES EQU $6838 ; Puts the character at SECOND_ONES onto the last digit on the middle line
+; Parameters:
+; SECOND_ONES - Value to be put on the display
+;-------------------------------------------------------------------------
+CALC_DOW_X EQU $68d5 ; Computes the Day of the Week from the Month, Day, Year information
+; Parameters:
+; X - Pointer to Month, Day, Year block
+;-------------------------------------------------------------------------
+ACQUIRE EQU $68e8 ; Disable interrupts for a short piece of code
+RELEASE EQU $68f2 ; Reenable interrupts
+;-------------------------------------------------------------------------
+GET_MONTHLEN EQU $68f9 ; Computes the number of days in a given month
+; Parameters:
+; PARM_MONTH, PARM_YEAR contain the month and year to look for
+; Returns:
+; A - Number of days in the month
+;-------------------------------------------------------------------------
+SETALL EQU $5776 ; Turn on all segments on the display
+INCA_WRAPX EQU $6b0d ; Advance to the next value wrapped within a range
+; Parameters:
+; A - Number to be incremented
+; X - Range to hold number within
+;-------------------------------------------------------------------------
+GETBCDHI EQU $6B52
+; Parameters:
+; X - Hex value to be converted (Range 0-99)
+; Returns:
+; A - High byte of number in timex ascii
+;-------------------------------------------------------------------------
+GETBCDLOW EQU $6B5A
+; Parameters:
+; X - Hex value to be converted (Range 0-99)
+; Returns:
+; A - Low byte of number in timex ascii
+;-------------------------------------------------------------------------
+TABHEX2BCD EQU $6b60 ; 100 bytes from 6b60-6bc3
+; This is a 100 byte table of HEX to BCD conversion values. You can take the value you want
+; to convert, load it into the X register and then load TABHEX2BCX,X. To get the high order byte,
+; just shift it right by 4. The low order is just an and with $0f.
+
+SYS_26 EQU $26
+MODE_FLAGS EQU $68 ; FLAGS
+ ; Bit0 = Indicates that we are in alarm set mode (SET=IN SET MODE)
+ ; Bit1 = Indicates that we have a backup mode pending alarm (SET=PENDING)
+ ; Bit2 = Indicates that hourly chimes are to be played (SET=ENABLED)
+ ; Bit3 = Indicates that hourly chimes are temporarily disabled (SET=DISABLED)
+ ; Bit4 = Enables beep for any button pressed (SET=BEEP)
+ ; Bit5 = Indicates that we are in COMM Mode (SET=IN COMM Mode)
+ ; Bit6 = Indicates that ALARM SET MODE is on the display (SET=On Display)
+ ; Bit7 = <UNUSED>
+APP_FLAGS EQU $8f ; System Flags
+ ; Bit0 = Event has been posted (SET=TRUE)
+ ; Bit1 = We want to allow the app to be suspended (SET=ALLOW)
+ ; Bit2 = Run a nested application (SET=TRUE) - only for ALARM,APPT, WRISTAPP
+ ; Bit3 = A button beep has already been played (SET=PLAYED)
+ ; Bit4 = <UNUSED>
+ ; Bit5 = <UNUSED>
+ ; Bit6 = <UNUSED>
+ ; Bit7 = <UNUSED>
+BTNFLAGS EQU $90 ; Flags for the timer. Note that bits 5 and 7 are exclusive because they happen to
+ ; use the same variables to hold their information.
+ ; Bit0 = <UNUSED>
+ ; Bit1 = wristapp wants a 1/10 second timer function called (WRIST_DOTIC) (SET=CALL)
+ ; Bit2 = Indicates a blink routine is pending (SET=PENDING)
+ ; Bit3 = Indicates a scrolling message is pending (SET=PENDING)
+ ; Bit4 = Indicates an update routine is pending (SET=PENDING)
+ ; Bit5 = Indicates a blink routine has been established (SET=ACTIVE)
+ ; Bit6 = Indicates a scrolling message is in progress (SET=ACTIVE)
+ ; Bit7 = Indicates an update routine has been established (SET=ACTIVE)
+BTNSTATE EQU $91 ; Current event/button press
+TIMER_FLAGS EQU $94 ; System Flags
+ ; Bit0 = Indicates that the timer2 timer has been enabled (SET=ENABLED)
+ ; Bit1 = Indicates that the TIC timer has been enabled (SET=ENABLED)
+ ; Bit2 = Indicates that we want to turn off the indiglo automatically (SET=TURN OFF)
+ ; Bit3 = Indicates that they have done something in this applet (SET=done something)
+ ; Bit4 = Request to reset the watch (SET=Reset Watch)
+ ; Bit5 = Request to turn off the INDIGLO at some future time
+ ; Bit6 = <UNUSED>
+ ; Bit7 = ????Related to indicating that sound is currently playing
+MAIN_FLAGS EQU $95 ; Flags to set queue requests to do something in the main loop
+ ; Bit0 = Indicates that a button has changed state (SET=CHANGED)
+ ; Bit1 = Indicates that the current app should be suspended and TIME activated (SET=Suspend)
+ ; Bit2 = Indicates that the TIMER_TICS has been updated (SET=Updated)
+ ; Bit3 = Indicates that the hourly chimes need to be played (SET=Please Play)
+ ; Bit4 = Indicates that the appointments should be checked (SET=Please Check)
+ ; Bit5 = Indicates that the anniversaries need to be checked (SET=Please Check)
+ ; Bit6 = <UNUSED>
+ ; Bit7 = <UNUSED>
+WRISTAPP_FLAGS EQU $96 ; System Flags
+ ; Bit0 = wristapp wants a second timer function called at start of interrupt (WRIST_DOTIC) (SET=CALL)
+ ; Bit1 = wristapp wants a call once a minute when it changes (WRIST_DOTIC) (SET=CALL)
+ ; Bit2 = wristapp wants a call once an hour when it changes (WRIST_DOTIC) (SET=CALL)
+ ; Bit3 = wristapp wants a call once a day when it changes (WRIST_DOTIC) (SET=CALL)
+ ; Bit4 = Play button beep sound on wristapp for any button (SET=ENABLE)
+ ; Bit5 = Play button beep sound on wristapp for mode button (SET=ENABLE)
+ ; Bit6 = Uses system rules for button beep decisions (SET=SYSTEM RULES)
+ ; Bit7 = Wristapp has been loaded (SET=LOADED)
+NEST_PARM EQU $99 ; Holds the parameter passed to the current nested app
+SYSSOUND EQU $9B ; Current sound to be played
+HW_FLAGS EQU $9e ; System Variable
+ ; Bit0 = Request state for Indiglo light (SET=ON)
+ ; Bit1 = Indicates the the SYS_07 hardware has been reset
+ ; Bit2 = <UNUSED>
+ ; Bit3 = Indicates that we want to load some code from the serial port at reset (SET=ON)
+ ; Bit4 = Set but never used. Mimics the state of 0,PORT_C_DATA & 0,PORT_C_DDR
+ ; Bit5 = Set but never used. Mimics the state of 1,PORT_C_DATA & 1,PORT_C_DDR
+ ; Bit6 = Indicates that INST_ADDR is a pointer into the EEPROM (SET=EEPROM Address)
+ ; Bit7 = Interrupts have been disabled (SET=DISABLED)
+SYSFLAGS EQU $9F ; System flags
+ ; Bit0 = Indicates the update direction. (SET=UP)
+ ; Bit1 = Indicates that the screen needs to be cleared (SET=no need to clear)
+ ; Also used as part of a the digit blinking code (SET=Show digits)
+ ; Bit2 = Indicates that the end of a scrolling message has been reached (SET=END)
+ ; Bit3 = User vs system string (SET=User String)
+ ; Bit4 = <UNUSED>
+ ; Bit5 = <UNUSED>
+ ; Bit6 = <UNUSED>
+ ; Bit7 = <UNUSED>
+DATDIGIT1 EQU $A2 ; First digit parameter for PUTMIDnn/PUTTOPnn routines
+DATDIGIT2 EQU $A3 ; Second digit parameter for PUTMIDnn/PUTTOPnn routines
+UPDATE_VAL EQU $a6 ; Temporary value passed to the update/blink routines
+UPDATE_PARM EQU $a7 ; Pointer to the data passed to the update/blink routines
+;
+; The sound in SYSSOUND can be set to one of the following values:
+;
+SND_HOURLY EQU $83 ; HOURLY CHIME
+SND_APPT EQU $85 ; APPOINTMENT BEEP
+SND_ALARM EQU $86 ; ALARM BEEP
+SND_DLOAD EQU $87 ; PROGRAM DOWNLOAD
+SND_EXTRA EQU $88 ; EXTRA
+SND_COMERR EQU $89 ; COMM ERROR
+SND_DONE EQU $8A ; COMM DONE
+SND_BUTTON EQU $c1 ; BUTTON BEEP
+SND_RETURN EQU $c2 ; RETURN TO TIME
+SND_CONF EQU $c4 ; CONFIRMATION
+
+APPT_PROMBASE EQU $0100 ; Address of the first entry for Appointments in the EEPROM
+LIST_PROMBASE EQU $0102 ; Address of the first entry for LISTs in the EEPROM
+PHONE_PROMBASE EQU $0104 ; Address of the first entry for PHONE numbers in the EEPROM
+ANNIV_PROMBASE EQU $0106 ; Address of the first entry for Anniversaries in the EEPROM
+APPT_ENTRIES EQU $0108 ; Number of currently loaded Appointment entries
+LIST_ENTRIES EQU $0109 ; Number of currently loaded LIST entries
+PHONE_ENTRIES EQU $010a ; Number of currently loaded Phone number entries
+ANNIV_ENTRIES EQU $010b ; Number of currently loaded Anniversary entries
+APPT_BASEYEAR EQU $010c ; The year for the first loaded appointment
+APPT_PRETIME EQU $010d ; How many minutes ahead of time to announce an appointment
+COMM_010e EQU $010e ; ????
+; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+SND_BASEOFF EQU $010f ; Sound base pointer - All sounds are this base relative to SND_BASE (0336)
+WRIST_MAIN EQU $0110 ; This is the primary initialization entry point for a Wristapp
+WRIST_SUSPEND EQU $0113 ; This is the entry point called immediately before suspending the wristapp
+WRIST_DOTIC EQU $0116 ; This is the entry point called for a timer tic in a wristapp
+WRIST_INCOMM EQU $0119 ; This is called when the COMM app is suspending the wristapp which has requests to process timer events
+WRIST_NEWDATA EQU $011c ; This is the wristapp entry point called when new data has been downloaded to the watch
+WRIST_GETSTATE EQU $011f ; Entry to get a wristapp state table entry
+WRIST_JMP_STATE0 EQU $0123 ; Wristapp entry point to call state 0
+
+INST_ADDRHI EQU $0437
+INST_ADDRLO EQU $0438
+USER04a1 EQU $04a1
+NESTED_APP EQU $04a2 ; Nested application (Only to run an application while a different one is running)
+ ; This is used to handle alarms and appointments that go off while you are running something else
+APP2_ALARM EQU 9 ; 9 = Alarm (while another app is running)
+APP2_APPT EQU 10 ; 10 = Appointment (while another app is running)
+APP2_WRIST EQU 11 ; 11 = Wristapp (while another app is running)
+NESTED_PARM EQU $04a4 ; Parameter passed to the nested app call
+USER04c3 EQU $04c3
+BUF_PHONENUM EQU $043a ; 12 byte buffer to hold a decompressed phone number
+EXTRACTBUF EQU $0446 ; 32 byte buffer to hold extracted data from the EEPROM
+UPDATE_POS EQU $04f3 ; Position to update a segment or digit in the blink/refresh routines
+;
+; These two constants appear to be associated with the PUTSCROLLMSG and SCROLLMSG routines
+;
+SEPARATOR EQU $3F ; Indicates the end of a scrolling string
+MSGBUF EQU $04d2 ; Location of the system buffer for a scrolling string
+CURRENT_APP EQU $04c1 ; The current application number (1-8)
+APP_TIME EQU 1 ; 1 = Time of Day
+APP_ALARM EQU 2 ; 2 = Alarm
+APP_APPT EQU 3 ; 3 = Appointment
+APP_ANNIV EQU 4 ; 4 = Anniversary
+APP_PHONE EQU 5 ; 5 = Phone number
+APP_LIST EQU 6 ; 6 = List
+APP_COMM EQU 7 ; 7 = Communication
+APP_WRIST EQU 8 ; 8 = Wristapp (if downloaded)
+BTN_PRESSED EQU $04c3 ; The button currently pressed (For EVT_ANY or EVT_ANY4 events) 0=NEXT 1=MODE 2=SET 3=PREV 4=GLOW
+EFFECTIVE_APP EQU $04c4 ; The efective application
+APP_13 EQU 13 ; Some submode of the TIME application
+APP_TIME_SET EQU 14 ; Submode of the TIME application
+UPDATE_MIN EQU $04f4 ; Minimum value for the update function to generate. At this, it wraps to UPDATE_MAX
+UPDATE_MAX EQU $04f5 ; Maximum value for the update function to generate. At this, it wraps to UPDATE_MIN
+PARM_MONTH EQU $04f9 ; Month parameter
+PARM_YEAR EQU $04fa ; Current year also...
+
+WATCHTIMER EQU $7ff0
+;
+; Other random routines which you might call....
+;
+ALARM_BLINKSEL EQU $4095
+ALARM_UPDATESEL EQU $4099
+ALARM_SELMIN EQU $409D
+ALARM_SELMAX EQU $40A1
+FIND_ANNIV_TODAY EQU $40CD
+FIND_ANNIV_SCAN EQU $40D3
+ANNIV_NEXT_ENTRY EQU $40E1
+ANNIV_PREV_ENTRY EQU $4117
+FIND_ANNIV_ENTRY EQU $415F
+CHECK_ANNIVERSARIES EQU $41FC
+SET_ANNIVTEST_TODAY EQU $423A
+ANNIV_GETMONTHLEN EQU $426A
+TEST_ANNIVERSARY EQU $4288
+ANNIV_COPY_INFO EQU $4308
+READ_ANNIV_CURRENT EQU $4317
+READ_ANNIV_FIRST EQU $4326
+READ_ANNIV_NEXT EQU $4335
+TEST_SCAN_START EQU $4346
+FIX_SCAN_YEAR EQU $4371
+TEST_SCAN_END EQU $437E
+RESTORE_SCAN_YEAR EQU $43AE
+INCREMENT_SCAN_DATE EQU $43B9
+GET_SCAN_MONTHLEN EQU $43E0
+DECREMENT_SCAN_DATE EQU $43F4
+FIND_APPT_NOW EQU $4415
+FIND_APPT_SCAN EQU $441B
+SET_APPTFIND_SCAN EQU $4422
+READ_APPT_NEXT EQU $442C
+APPT_LATCH_ENTRYDATA EQU $4468
+APPT_LATCH_ENTRYONLY EQU $446C
+READ_APPT_PREV EQU $447C
+FIND_APPT_ENTRY EQU $44C6
+APPT_LATCH_ENTDYDATA EQU $45A5
+CHECK_APPOINTMENTS EQU $45B9
+SET_APPTFIND_NOW EQU $462A
+READ_APPT_FIRST EQU $4686
+READ_APPT_LAST EQU $469D
+CHECK_APPT_TIME EQU $46B7
+READ_APPT_PACKET1 EQU $473A
+READ_NEXT_APPT_PACKET EQU $4749
+READ_APPT_CURRENT EQU $475A
+PROCESS_EVENTS EQU $49F6
+DO_ANYAPP_EVENT EQU $4B42
+DO_NESTAPP_EVENT EQU $4B45
+DO_APP_EVENT EQU $4B81
+DO_NORMAL_STATE EQU $4BB8
+TRANSITION_RBUTTON EQU $48fe
+TRANSITION_LBUTTON EQU $494d
+QUEUE_INDIGLO_OFF EQU $4992
+QUEUE_INDIGLO_OFF EQU $49D9
+NIGHTMODE_INDIGLO_ON EQU $49E6
+INDIGLO_ON EQU $49EC
+PROCESS_REQUESTS EQU $4C66
+TIMER1_INTERVALS EQU $4de1
+TIMER2_INTERVALS EQU $4dec
+DO_EVENT EQU $4CA4
+GETSTATE EQU $4CFE
+GETSTATE_TAB EQU $4D0e
+CHECK_COMPATIBLE_EVENT EQU $4D96
+STOP_ALL_SOUND EQU $4E68
+PREPARE_TIMER2_TIMER EQU $4E96
+PLAY_HOURLY EQU $4EB1
+PAUSE_WATCH EQU $4EC7
+RESUME_WATCH EQU $4EDE
+RESUME_UPDATE EQU $4EF6
+ACQUIRE_TIME EQU $4F22
+RELEASE_TIME EQU $4F2E
+PLAY_BUTTON_SAFE EQU $4F46
+PREPARE_NEST_CALL EQU $4FA0
+UNPACK_PHONENUM EQU $4FBF
+PHONE_UNPACK_VAL EQU $4FE0
+UNPACK_STRING EQU $4FF0
+READ_PACKET EQU $503E
+FIND_PACKET EQU $5044
+DO_TRANSFER EQU $505F
+TOGGLE_ENTRYFLAG EQU $5077
+MAKE_INST_LDA EQU $50B4
+MAKE_INST_LDA_X EQU $50B8
+MAKE_INST_STA EQU $50BC
+ADD_INSTADDR EQU $50C7
+SET_INSTADDR_0110 EQU $50D7
+GET_INST_BYTE EQU $50EB
+WRITE_FLAG_BYTE EQU $510A
+FILL_EXTRACTBUF EQU $513E
+SAVE_EXTRACTBUF EQU $515D
+SYSTEM_RESET EQU $519B
+SND_OFF EQU $5286
+DO_SOUND EQU $5298
+SET_SYS_0f_4d EQU $5203
+SET_SYS_0f_41 EQU $5208
+ENABLE_EYE EQU $53A6
+SERIAL_DELAY EQU $53B4
+DISABLE_EYE EQU $53BD
+SET_SYS_07 EQU $53C8
+CLEAR_SYS_07 EQU $53CF
+RESET_SYS_07 EQU $53D5
+INITHW_SYS_07 EQU $53DC
+SETHW_07_08_C1 EQU $53F4
+WRITE_ACQUIRE EQU $543C
+WRITE_RELEASE EQU $5448
+MAKE_INST2_LDA_X EQU $5453
+MAKE_INST2_STA_X EQU $5457
+PROM_READ EQU $5462
+PROM_WRITE EQU $5488
+READ_EEPROM_PORT EQU $54CC
+PROM_STARTIO EQU $54D6
+PROM_ACQUIRE EQU $54E2
+PROM_RELEASE EQU $54EC
+PROM_SHOW EQU $54F3
+PROM_HIDE EQU $54F8
+DO_SCROLL EQU $5566
+DO_BLINK EQU $55c8
+PUTDOWTOP EQU $5872
+FMTBLANK0B EQU $5963
+SAYHOLDTODELETE EQU $598a
+PUT_PHONENUM EQU $59a2
+PUTYEARMID EQU $59d9
+CLEAR_HMONTH EQU $59f8
+PUT_HMONTHX EQU $59FD
+CLEAR_HDAY EQU $5a11
+PUT_HDAYX EQU $5a16
+FIXLEAD0 EQU $5A2A
+CLEAR_MONTH EQU $5a36
+IPUT_MONTHX EQU $5a3b
+CLEAR_DAY EQU $5a4f
+IPUT_DAYX EQU $5a54
+CLEAR_YEAR EQU $5a6f
+IPUT_YEARX EQU $5a74
+PUTHALFDATESEP EQU $5aa0
+PUT_LETTERX EQU $5ace
+PUT_HOURX EQU $5ad9
+CLEAR_RANGE EQU $5793
+SYSSYMVALS EQU $57b0
+PHONE_NEXT_ENTRY EQU $616D
+PHONE_PREV_ENTRY EQU $618C
+PHONE_READ_CURRENT EQU $61A7
+PHONE_SHOW_CURRENT EQU $61B0
+PHONE_FIND_SCAN_ENTRY EQU $61F1
+PHONE_READ_ENTRY EQU $622C
+PHONE_READ_NEXT_ENTRY EQU $623D
+PHONE_READ_FIRST_NEXT EQU $6251
+UPDATE_SECONDS EQU $625E
+ADJUST_TZ1TIME EQU $62d7
+ADJUST_TZ2TIME EQU $6343
+UPDATE_TZ1DISP EQU $63af
+UPDATE_TZ2DISP EQU $63e6
+TIME_SET_BLINKON EQU $6660
+TIME_SET_BLINKOFF EQU $6664
+TIME_SET_GET_TIMEPTR EQU $667b
+TIME_SET_SHOWDISPLAY EQU $668a
+TIME_GET_BLINKPARM EQU $66e5
+SHOW_TIME_DISPLAY EQU $676A
+CLEAR_PM EQU $6815
+CLEAR_AM EQU $681c
+SHOWNIGHT_SYM EQU $6840
+SAY_HOLD_TO EQU $6855
+FIX_TMAPP_DAY EQU $6861
+TMAPP_COPYTZ1 EQU $6881
+TMAPP_COPYTZ2 EQU $688c
+GETTZNAME EQU $6897
+GET_MONTHDAYX EQU $689F
+GET_YEAR EQU $68b2
+GET_HOURFORMAT EQU $68bb
+GET_DATEFMT EQU $68cb
+COPY_MDY EQU $68db
+CHECK_TZ EQU $690e
+CALC_DOW EQU $691c
+TIME_BLINKSEL EQU $69A4
+TIME_UPDATESEL EQU $69AF
+TIME_SELMIN EQU $69ba
+TIME_SELMAX EQU $69c5
+LIST_GO_NEXT EQU $6A9F
+LIST_GO_PREV EQU $6AAD
+LIST_DISPLAY_CURRENT EQU $6ABB
+CLEAR_WRISTAPPMEM EQU $6b1f
+DELAY_X EQU $6b31
+DELAY_X16 EQU $6b43
+SHOWNOTE_SYM EQU $6C62
+SHOWALARM_SYM EQU $6C76
+ALARM_CHECK EQU $6BC4
+ALARM_START_BLINK EQU $6E9D
+ALARM_CALL_BLINK EQU $6EA4
+ALARM_GET_BLINKPARM EQU $6EB7
+ALARM_DISPLAY_CURRENT EQU $6EF4
+ALARM_SHOW_HOURLYNOTE EQU $6F39
+ALARM_SHOW_ALARMSYM EQU $6F4A
+ALARM_SHOW_AMPM EQU $6F5B
+ALARM_SHOW_TEXTCHAR EQU $6F7C
+ALARM_FIX_HOUR EQU $6F88
+ALARM_GET_DISPLAYHOUR EQU $6FA0
+ALARM_SET_CURRENT EQU $6FBE
+ALARM_SAVE_STATUS EQU $6FD5
+ALARM_GET_TEXTOFFSET EQU $6FDC
+ALARM_GET_DATAOFFSET EQU $6FE5
+MASK_ALARMS EQU $6FF3
+UNMASK_ALARMS EQU $7000
+ANNIV_SHOW_DATE EQU $7184
+ANNIV_SHOW_SCAN_DATE EQU $719F
+ANNIV_SHOW_CURRENT EQU $71AC
+SHOWREMIND_SYM EQU $71D6
+OFFREMIND_SYM EQU $71EE
+SAY_NO_ANN_ENTRIES EQU $71F5
+APPT_SHOW_TIME EQU $73D7
+APPT_SHOW_DATE EQU $7439
+APPT_SHOW_SCAN EQU $7454
+APPT_SHOW_CURRENT EQU $7461
+APPT_SHOW_UPCOMING EQU $748E
+SAY_NO_APPT_ENTRIES EQU $74BD
diff --git a/from_pkg/Inc150S/Wristapp.i b/from_pkg/Inc150S/Wristapp.i
new file mode 100644
index 0000000..13cac0b
--- /dev/null
+++ b/from_pkg/Inc150S/Wristapp.i
@@ -0,0 +1,1508 @@
+;
+; Wristapp.i - For the Datalink 150s
+; Copyright (c) 1997 by John A. Toebes, VIII. All Rights Reserved.
+;
+DISP_ROW EQU $1d ; Hardware register to select which row of the display is to be written to. You need to
+ ; Combine this with setting DISP_COL to cause the segment to change
+DISP_COL EQU $1e ; Hardware register to select which col of the display is to be written to. You must set
+ ; DISP_ROW first to cause the segment to change
+; It turns out that the segments on the display are readily accessible. You can turn on/off any segment
+; pretty easily.
+;
+; The top and middle lines are a series of segments which can be individually turned on to
+; achieve the different letters. I assign the segments as follows:
+; A
+; _____
+; | |
+; F | |H | B
+; | | |
+; ---G-
+; | | |
+; E | |I | C
+; |_____|
+; D
+;
+; Numbering the digits on the line from left to right we would get
+;
+;
+; 1A 2A 3A 4A 5A 6A
+; _____ _____ _____ _____ _____ _____
+; 1| |1 2| |2 3| |3 4| |4 5| |5 6| |6
+; F| |1 |B F| |2 |B F| |3 |B F| |4 |B F| |5 |B F| |6 |B
+; | |H | | |H | D23 | |H | D34| |H | D45 | |H | | |H |
+; --1G- --2G- --- --3G- -- --4G- --- --5G- --6G-
+; 1| |1 |1 2| |2 |2 3| |3 |3 4| |4 |4 5| |5 |5 6| |6 |6
+; E| |I |C E| |I |C E| |I |C E| |I |C E| |I |C E| |I |C
+; |_____| |_____| . |_____| |_____| . |_____| |_____|
+; 1D 2D P23 3D 4D P45 5D 6D
+;
+; AM PM Remind Night Alarm Note
+;
+;
+; 1A 2A 3A 4A 5A 6A
+; _____ _____ C23 _____ _____ _____ _____
+; 1| |1 2| |2 o 3| |3 4| |4 5| |5 6| |6
+; F| |1 |B F| |2 |B F| |3 |B F| |4 |B F| |5 |B F| |6 |B
+; | |H | | |H | D23 | |H | | |H | D45 | |H | | |H |
+; --1G- --2G- --- --3G- --4G- --- --5G- --6G-
+; 1| |1 |1 2| |2 |2 3| |3 |3 4| |4 |4 5| |5 |5 6| |6 |6
+; E| |I |C E| |I |C o E| |I |C E| |I |C E| |I |C E| |I |C
+; |_____| |_____| . |_____| |_____| . |_____| |_____|
+; 1D 2D P23 3D 4D P45 5D 6D
+;
+; Note the two dashes between segments 2&3 and 4&5. For convenience, I refer to these
+; as D23 and D45 or DASH23 and DASH45 respectively.
+; I prefix all of the items on the first row with a T and those on the middle row with a M.
+;
+; Pixels on the bottom line are addressed a little differently. For these, we have 8 5x5 sets of
+; segments. We can reference them as follows:
+;
+; S1 S2 S3 S4 S5 S6 S7 S8
+; 12345 12345 12345 12345 12345 12345 12345 12345
+; *****A *****A *****A *****A *****A *****A *****A *****A
+; *****B *****B *****B *****B *****B *****B *****B *****B
+; *****C *****C *****C *****C *****C *****C *****C *****C
+; *****D *****D *****D *****D *****D *****D *****D *****D
+; *****E *****E *****E *****E *****E *****E *****E *****E
+;
+; Hence, the lower right pixel is referenced as S8E5
+;
+
+; Value Bit0 Bit1 Bit2 Bit3 Bit4
+; ------ ------ ------ ------ ------ ------
+; 00 <none> <none> <none> <none> <none>
+; 02 S8E1 S8D1 S8A1 S8B1 S8C1
+; 04 S8E2 S8D2 S8A2 S8B2 S8C2
+; 06 S8E3 S8D3 S8A3 S8B3 S8C3
+; 08 S8E4 S8D4 S8A4 S8B4 S8C4
+; 0A S8E5 S8D5 S8A5 S8B5 S8C5
+; 0C <none> <none> <none> <none> <none>
+; 0E T6C T6B M6C M6B Note
+; 10 T6D T6G T6A <none> M6A
+; 12 T6I T6H M6I M6G M6H
+; 14 T6E T6F M6D M6E M6F
+; 16 <none> <none> <none> <none> <none>
+; 18 <none> <none> <none> <none> <none>
+; 1A <none> <none> <none> <none> <none>
+; 1C T5C T5B M5C M5B Alarm
+; 1E T5D T5G T5A <none> M5A
+; 20 T5I T5H M5I M5G M5H
+; 22 T5E T5F M5D M5E M5F
+; 24 TP45 TD45 MP45 MD45 <none>
+; 26 T4C T4B M4C M4B Night
+; 28 T4D T4G T4A <none> M4A
+; 2A T4I T4H M4I M4G M4H
+; 2C T4E T4F M4D M4E M4F
+; 2E T3C T3B M3C M3B TD34
+; 30 T3D T3G T3A <none> M3A
+; 32 T3I T3H M3I M3G M3H
+; 34 T3E T3F M3D M3E M3F
+; 36 TP23 TD23 MP23 MC23 <none>
+; 38 T2C T2B M2C M2B Remind
+; 3A T2D T2G T2A <none> M2A
+; 3C T2I T2H M2I M2G M2H
+; 3E T2E T2F M2D M2E M2F
+; 40 T1C T1B M1C M1B PM
+; 42 T1D T1G T1A <none> M1A
+; 44 T1I T1H M1I M1G M1H
+; 46 T1E T1F M1D M1E M1F
+; 48 <none> <none> <none> <none> AM
+;
+; For the ODD Bits, we have:
+;
+; Value Bit0 Bit1 Bit2 Bit3 Bit4
+; ------ ------ ------ ------ ------ ------
+; 01 S7D5 S7E5 S7A5 S7B5 S7C5
+; 03 S7D4 S7E4 S7A4 S7B4 S7C4
+; 05 S7D3 S7E3 S7A3 S7B3 S7C3
+; 07 S7D2 S7E2 S7A2 S7B2 S7C2
+; 09 S7D1 S7E1 S7A1 S7B1 S7C1
+; 0B S6D5 S6E5 S6A5 S6B5 S6C5
+; 0D S6D4 S6E4 S6A4 S6B4 S6C4
+; 0F S6D3 S6E3 S6A3 S6B3 S6C3
+; 11 S6D2 S6E2 S6A2 S6B2 S6C2
+; 13 S6D1 S6E1 S6A1 S6B1 S6C1
+; 15 S5D5 S5E5 S5A5 S5B5 S5C5
+; 17 S5D4 S5E4 S5A4 S5B4 S5C4
+; 19 S5D3 S5E3 S5A3 S5B3 S5C3
+; 1B S5D2 S5E2 S5A2 S5B2 S5C2
+; 1D S5D1 S5E1 S5A1 S5B1 S5C1
+; 1F S4D5 S4E5 S4A5 S4B5 S4C5
+; 21 S4D4 S4E4 S4A4 S4B4 S4C4
+; 23 S4D3 S4E3 S4A3 S4B3 S4C3
+; 25 S4D2 S4E2 S4A2 S4B2 S4C2
+; 27 S4D1 S4E1 S4A1 S4B1 S4C1
+; 29 <none> <none> <none> <none> <none>
+; 2B S3D5 S3E5 S3A5 S3B5 S3C5
+; 2D S3D4 S3E4 S3A4 S3B4 S3C4
+; 2F S3D3 S3E3 S3A3 S3B3 S3C3
+; 31 S3D2 S3E2 S3A2 S3B2 S3C2
+; 33 S3D1 S3E1 S3A1 S3B1 S3C1
+; 35 S2D5 S2E5 S2A5 S2B5 S2C5
+; 37 S2D4 S2E4 S2A4 S2B4 S2C4
+; 39 S2D3 S2E3 S2A3 S2B3 S2C3
+; 3B S2D2 S2E2 S2A2 S2B2 S2C2
+; 3D S2D1 S2E1 S2A1 S2B1 S2C1
+; 3F S1D5 S1E5 S1A5 S1B5 S1C5
+; 41 S1D4 S1E4 S1A4 S1B4 S1C4
+; 43 S1D3 S1E3 S1A3 S1B3 S1C3
+; 45 S1D2 S1E2 S1A2 S1B2 S1C2
+; 47 S1D1 S1E1 S1A1 S1B1 S1C1
+;
+;
+; Of course if you want to look it from the orientation of the segments on the display,
+; you can use this information. To make it more compact, I used the notation
+; bit:Value
+; where value is what you store in $1D and Bit is which bit to set/clear in $1E to get the effect
+;
+; T1A=2:40 T2A=2:38 T3A=2:2E T4A=2:26 T5A=2:1C T6A=2:0E
+; T1B=1:3E T2B=1:36 T3B=1:2C T4B=1:24 T5B=1:1A T6B=1:0C
+; T1C=0:3E T2C=0:36 T3C=0:2C T4C=0:24 T5C=0:1A T6C=0:0C
+; T1D=0:40 T2D=0:38 T3D=0:2E T4D=0:26 T5D=0:1C T6D=0:0E
+; T1E=0:44 T2E=0:3C T3E=0:32 T4E=0:2A T5E=0:20 T6E=0:12
+; T1F=1:44 T2F=1:3C T3F=1:32 T4F=1:2A T5F=1:20 T6F=1:12
+; T1G=1:40 T2G=1:38 T3G=1:2E T4G=1:26 T5G=1:1C T6G=1:0E
+; T1H=1:42 T2H=1:3A T3H=1:30 T4H=1:28 T5H=1:1E T6H=1:10
+; T1I=0:42 T2I=0:3A T3I=0:30 T4I=0:28 T5I=0:1E T6I=0:10
+;
+; TP23=0:34
+; TD23=1:34
+; TD34=4:2C
+; TD45=1:22
+; TP45=0:22
+;
+; M1A=4:40 M2A=4:38 M3A=4:2E M4A=4:26 M5A=4:1C M6A=4:0E
+; M1B=3:3E M2B=3:36 M3B=3:2C M4B=3:24 M5B=3:1A M6B=3:0C
+; M1C=2:3E M2C=2:36 M3C=2:2C M4C=2:24 M5C=2:1A M6C=2:0C
+; M1D=2:44 M2D=2:3C M3D=2:32 M4D=2:2A M5D=2:20 M6D=2:12
+; M1E=3:44 M2E=3:3C M3E=3:32 M4E=3:2A M5E=3:20 M6E=3:12
+; M1F=4:44 M2F=4:3C M3F=4:32 M4F=4:2A M5F=4:20 M6F=4:12
+; M1G=3:42 M2G=3:3A M3G=3:30 M4G=3:28 M5G=3:1E M6G=3:10
+; M1H=4:42 M2H=4:3A M3H=4:30 M4H=4:28 M5H=4:1E M6H=4:10
+; M1I=2:42 M2I=2:3A M3I=2:30 M4I=2:28 M5I=2:1E M6I=2:10
+;
+; MC23=3:34
+; MP23=2:34
+; MD45=3:22
+; MP45=2:22
+;
+; AM=4:46
+; PM=4:3E
+; Remind=4:36
+; Night=4:24
+; Alarm=4:1A
+; Note=4:0C
+
+COL_T1A EQU 2
+ROW_T1A EQU $40
+COL_T2A EQU 2
+ROW_T2A EQU $38
+COL_T3A EQU 2
+ROW_T3A EQU $2E
+COL_T4A EQU 2
+ROW_T4A EQU $26
+COL_T5A EQU 2
+ROW_T5A EQU $1C
+COL_T6A EQU 2
+ROW_T6A EQU $0E
+;
+COL_T1B EQU 1
+ROW_T1B EQU $3E
+COL_T2B EQU 1
+ROW_T2B EQU $36
+COL_T3B EQU 1
+ROW_T3B EQU $2C
+COL_T4B EQU 1
+ROW_T4B EQU $24
+COL_T5B EQU 1
+ROW_T5B EQU $1A
+COL_T6B EQU 1
+ROW_T6B EQU $0C
+;
+COL_T1C EQU 0
+ROW_T1C EQU $3E
+COL_T2C EQU 0
+ROW_T2C EQU $36
+COL_T3C EQU 0
+ROW_T3C EQU $2C
+COL_T4C EQU 0
+ROW_T4C EQU $24
+COL_T5C EQU 0
+ROW_T5C EQU $1A
+COL_T6C EQU 0
+ROW_T6C EQU $0C
+;
+COL_T1D EQU 0
+ROW_T1D EQU $40
+COL_T2D EQU 0
+ROW_T2D EQU $38
+COL_T3D EQU 0
+ROW_T3D EQU $2E
+COL_T4D EQU 0
+ROW_T4D EQU $26
+COL_T5D EQU 0
+ROW_T5D EQU $1C
+COL_T6D EQU 0
+ROW_T6D EQU $0E
+;
+COL_T1E EQU 0
+ROW_T1E EQU $44
+COL_T2E EQU 0
+ROW_T2E EQU $3C
+COL_T3E EQU 0
+ROW_T3E EQU $32
+COL_T4E EQU 0
+ROW_T4E EQU $2A
+COL_T5E EQU 0
+ROW_T5E EQU $20
+COL_T6E EQU 0
+ROW_T6E EQU $12
+;
+COL_T1F EQU 1
+ROW_T1F EQU $44
+COL_T2F EQU 1
+ROW_T2F EQU $3C
+COL_T3F EQU 1
+ROW_T3F EQU $32
+COL_T4F EQU 1
+ROW_T4F EQU $2A
+COL_T5F EQU 1
+ROW_T5F EQU $20
+COL_T6F EQU 1
+ROW_T6F EQU $12
+;
+COL_T1G EQU 1
+ROW_T1G EQU $40
+COL_T2G EQU 1
+ROW_T2G EQU $38
+COL_T3G EQU 1
+ROW_T3G EQU $2E
+COL_T4G EQU 1
+ROW_T4G EQU $26
+COL_T5G EQU 1
+ROW_T5G EQU $1C
+COL_T6G EQU 1
+ROW_T6G EQU $0E
+;
+COL_T1H EQU 1
+ROW_T1H EQU $42
+COL_T2H EQU 1
+ROW_T2H EQU $3A
+COL_T3H EQU 1
+ROW_T3H EQU $30
+COL_T4H EQU 1
+ROW_T4H EQU $28
+COL_T5H EQU 1
+ROW_T5H EQU $1E
+COL_T6H EQU 1
+ROW_T6H EQU $10
+;
+COL_T1I EQU 0
+ROW_T1I EQU $42
+COL_T2I EQU 0
+ROW_T2I EQU $3A
+COL_T3I EQU 0
+ROW_T3I EQU $30
+COL_T4I EQU 0
+ROW_T4I EQU $28
+COL_T5I EQU 0
+ROW_T5I EQU $1E
+COL_T6I EQU 0
+ROW_T6I EQU $10
+;
+;
+COL_TP23 EQU 0
+ROW_TP23 EQU $34
+;
+COL_TD23 EQU 1
+ROW_TD23 EQU $34
+;
+COL_TD34 EQU 4
+ROW_TD34 EQU $2C
+;
+COL_TD45 EQU 1
+ROW_TD45 EQU $22
+;
+COL_TP45 EQU 0
+ROW_TP45 EQU $22
+;
+;
+COL_M1A EQU 4
+ROW_M1A EQU $40
+COL_M2A EQU 4
+ROW_M2A EQU $38
+COL_M3A EQU 4
+ROW_M3A EQU $2E
+COL_M4A EQU 4
+ROW_M4A EQU $26
+COL_M5A EQU 4
+ROW_M5A EQU $1C
+COL_M6A EQU 4
+ROW_M6A EQU $0E
+;
+COL_M1B EQU 3
+ROW_M1B EQU $3E
+COL_M2B EQU 3
+ROW_M2B EQU $36
+COL_M3B EQU 3
+ROW_M3B EQU $2C
+COL_M4B EQU 3
+ROW_M4B EQU $24
+COL_M5B EQU 3
+ROW_M5B EQU $1A
+COL_M6B EQU 3
+ROW_M6B EQU $0C
+;
+COL_M1C EQU 2
+ROW_M1C EQU $3E
+COL_M2C EQU 2
+ROW_M2C EQU $36
+COL_M3C EQU 2
+ROW_M3C EQU $2C
+COL_M4C EQU 2
+ROW_M4C EQU $24
+COL_M5C EQU 2
+ROW_M5C EQU $1A
+COL_M6C EQU 2
+ROW_M6C EQU $0C
+;
+COL_M1D EQU 2
+ROW_M1D EQU $44
+COL_M2D EQU 2
+ROW_M2D EQU $3C
+COL_M3D EQU 2
+ROW_M3D EQU $32
+COL_M4D EQU 2
+ROW_M4D EQU $2A
+COL_M5D EQU 2
+ROW_M5D EQU $20
+COL_M6D EQU 2
+ROW_M6D EQU $12
+;
+COL_M1E EQU 3
+ROW_M1E EQU $44
+COL_M2E EQU 3
+ROW_M2E EQU $3C
+COL_M3E EQU 3
+ROW_M3E EQU $32
+COL_M4E EQU 3
+ROW_M4E EQU $2A
+COL_M5E EQU 3
+ROW_M5E EQU $20
+COL_M6E EQU 3
+ROW_M6E EQU $12
+;
+COL_M1F EQU 4
+ROW_M1F EQU $44
+COL_M2F EQU 4
+ROW_M2F EQU $3C
+COL_M3F EQU 4
+ROW_M3F EQU $32
+COL_M4F EQU 4
+ROW_M4F EQU $2A
+COL_M5F EQU 4
+ROW_M5F EQU $20
+COL_M6F EQU 4
+ROW_M6F EQU $12
+;
+COL_M1G EQU 3
+ROW_M1G EQU $42
+COL_M2G EQU 3
+ROW_M2G EQU $3A
+COL_M3G EQU 3
+ROW_M3G EQU $30
+COL_M4G EQU 3
+ROW_M4G EQU $28
+COL_M5G EQU 3
+ROW_M5G EQU $1E
+COL_M6G EQU 3
+ROW_M6G EQU $10
+;
+COL_M1H EQU 4
+ROW_M1H EQU $42
+COL_M2H EQU 4
+ROW_M2H EQU $3A
+COL_M3H EQU 4
+ROW_M3H EQU $30
+COL_M4H EQU 4
+ROW_M4H EQU $28
+COL_M5H EQU 4
+ROW_M5H EQU $1E
+COL_M6H EQU 4
+ROW_M6H EQU $10
+;
+COL_M1I EQU 2
+ROW_M1I EQU $42
+COL_M2I EQU 2
+ROW_M2I EQU $3A
+COL_M3I EQU 2
+ROW_M3I EQU $30
+COL_M4I EQU 2
+ROW_M4I EQU $28
+COL_M5I EQU 2
+ROW_M5I EQU $1E
+COL_M6I EQU 2
+ROW_M6I EQU $10
+;
+;
+COL_MC23 EQU 3
+ROW_MC23 EQU $34
+;
+COL_MP23 EQU 2
+ROW_MP23 EQU $34
+;
+COL_MD45 EQU 3
+ROW_MD45 EQU $22
+;
+COL_MP45 EQU 2
+ROW_MP45 EQU $22
+;
+;
+COL_AM EQU 4
+ROW_AM EQU $46
+;
+COL_PM EQU 4
+ROW_PM EQU $3E
+;
+COL_REMIND EQU 4
+ROW_REMIND EQU $36
+;
+COL_NIGHT EQU 4
+ROW_NIGHT EQU $24
+;
+COL_ALARM EQU 4
+ROW_ALARM EQU $1A
+;
+COL_NOTE EQU 4
+ROW_NOTE EQU $0C
+;
+; S1A1=2:47 S1B1=3:47 S1C1=4:47 S1D1=0:47 S1E1=1:47
+; S1A2=2:45 S1B2=3:45 S1C2=4:45 S1D2=0:45 S1E2=1:45
+; S1A3=2:43 S1B3=3:43 S1C3=4:43 S1D3=0:43 S1E3=1:43
+; S1A4=2:41 S1B4=3:41 S1C4=4:41 S1D4=0:41 S1E4=1:41
+; S1A5=2:3F S1B5=3:3F S1C5=4:3F S1D5=0:3F S1E5=1:3F
+;
+; S2A1=2:3D S2B1=3:3D S2C1=4:3D S2D1=0:3D S2E1=1:3D
+; S2A2=2:3B S2B2=3:3B S2C2=4:3B S2D2=0:3B S2E2=1:3B
+; S2A3=2:39 S2B3=3:39 S2C3=4:39 S2D3=0:39 S2E3=1:39
+; S2A4=2:37 S2B4=3:37 S2C4=4:37 S2D4=0:37 S2E4=1:37
+; S2A5=2:35 S2B5=3:35 S2C5=4:35 S2D5=0:35 S2E5=1:35
+;
+; S3A1=2:33 S3B1=3:33 S3C1=4:33 S3D1=0:33 S3E1=1:33
+; S3A2=2:31 S3B2=3:31 S3C2=4:31 S3D2=0:31 S3E2=1:31
+; S3A3=2:2F S3B3=3:2F S3C3=4:2F S3D3=0:2F S3E3=1:2F
+; S3A4=2:2D S3B4=3:2D S3C4=4:2D S3D4=0:2D S3E4=1:2D
+; S3A5=2:2B S3B5=3:2B S3C5=4:2B S3D5=0:2B S3E5=1:2B
+;
+; S4A1=2:27 S4B1=3:27 S4C1=4:27 S4D1=0:27 S4E1=1:27
+; S4A2=2:25 S4B2=3:25 S4C2=4:25 S4D2=0:25 S4E2=1:25
+; S4A3=2:23 S4B3=3:23 S4C3=4:23 S4D3=0:23 S4E3=1:23
+; S4A4=2:21 S4B4=3:21 S4C4=4:21 S4D4=0:21 S4E4=1:21
+; S4A5=2:1F S4B5=3:1F S4C5=4:1F S4D5=0:1F S4E5=1:1F
+;
+; S5A1=2:1D S5B1=3:1D S5C1=4:1D S5D1=0:1D S5E1=1:1D
+; S5A2=2:1B S5B2=3:1B S5C2=4:1B S5D2=0:1B S5E2=1:1B
+; S5A3=2:19 S5B3=3:19 S5C3=4:19 S5D3=0:19 S5E3=1:19
+; S5A4=2:17 S5B4=3:17 S5C4=4:17 S5D4=0:17 S5E4=1:17
+; S5A5=2:15 S5B5=3:15 S5C5=4:15 S5D5=0:15 S5E5=1:15
+;
+; S6A1=2:13 S6B1=3:13 S6C1=4:13 S6D1=0:13 S6E1=1:13
+; S6A2=2:11 S6B2=3:11 S6C2=4:11 S6D2=0:11 S6E2=1:11
+; S6A3=2:0F S6B3=3:0F S6C3=4:0F S6D3=0:0F S6E3=1:0F
+; S6A4=2:0D S6B4=3:0D S6C4=4:0D S6D4=0:0D S6E4=1:0D
+; S6A5=2:0B S6B5=3:0B S6C5=4:0B S6D5=0:0B S6E5=1:0B
+;
+; S7A1=2:09 S7B1=3:09 S7C1=4:09 S7D1=0:09 S7E1=1:09
+; S7A2=2:07 S7B2=3:07 S7C2=4:07 S7D2=0:07 S7E2=1:07
+; S7A3=2:05 S7B3=3:05 S7C3=4:05 S7D3=0:05 S7E3=1:05
+; S7A4=2:03 S7B4=3:03 S7C4=4:03 S7D4=0:03 S7E4=1:03
+; S7A5=2:01 S7B5=3:01 S7C5=4:01 S7D5=0:01 S7E5=1:01
+;
+; S8A1=2:02 S8B1=3:02 S8C1=4:02 S8D1=1:02 S8E1=0:02
+; S8A2=2:04 S8B2=3:04 S8C2=4:04 S8D2=1:04 S8E2=0:04
+; S8A3=2:06 S8B3=3:06 S8C3=4:06 S8D3=1:06 S8E3=0:06
+; S8A4=2:08 S8B4=3:08 S8C4=4:08 S8D4=1:08 S8E4=0:08
+; S8A5=2:0a S8B5=3:0a S8C5=4:0a S8D5=1:0a S8E5=0:0a
+;
+;
+; Character set
+;
+C_0 EQU $00
+C_1 EQU $01
+C_2 EQU $02
+C_3 EQU $03
+C_4 EQU $04
+C_5 EQU $05
+C_6 EQU $06
+C_7 EQU $07
+C_8 EQU $08
+C_9 EQU $09
+C_A EQU $0A
+C_B EQU $0B
+C_C EQU $0C
+C_D EQU $0D
+C_E EQU $0E
+C_F EQU $0F
+C_G EQU $10
+C_H EQU $11
+C_I EQU $12
+C_J EQU $13
+C_K EQU $14
+C_L EQU $15
+C_M EQU $16
+C_N EQU $17
+C_O EQU $18
+C_P EQU $19
+C_Q EQU $1A
+C_R EQU $1B
+C_S EQU $1C
+C_T EQU $1D
+C_U EQU $1E
+C_V EQU $1F
+C_W EQU $20
+C_X EQU $21
+C_Y EQU $22
+C_Z EQU $23
+C_BLANK EQU $24
+C_SPACE EQU $24
+C_EXCLAIM EQU $25
+C_DQUOTE EQU $26
+C_POUND EQU $27
+C_DOLLAR EQU $28
+C_PERCENT EQU $29
+C_AMPERSAND EQU $2A
+C_QUOTE EQU $2B
+C_LPAREN EQU $2C
+C_RPAREN EQU $2D
+C_TIMES EQU $2E
+C_PLUS EQU $2F
+C_COMMA EQU $30
+C_MINUS EQU $31
+C_PERIOD EQU $32
+C_SLASH EQU $33
+C_COLON EQU $34
+C_BACKSLASH EQU $35
+C_DIVIDE EQU $36
+C_EQUAL EQU $37
+C_BELL EQU $38
+C_QUESTION EQU $39
+C_UNDER EQU $3A
+C_CHECK EQU $3B
+C_PREV EQU $3C
+C_LEFTARR EQU $3C ; Symbol for the previous key
+C_NEXT EQU $3D
+C_RIGHTARR EQU $3D ; Symbol for the next key
+C_BLOCK EQU $3E
+C_SEP EQU $3F
+C6_SPACE EQU $1d
+; The basic timex character set is:
+; 0 1 2 3 4 5 6 7 8 9 A B C D E F
+; G H I J K L M N O P Q R S T U V
+; W X Y Z ! " # $ % & ' ( ) * +
+; , - . / : ; < = > ? @ A B C D E
+;
+; We also have the timex6 character set as:
+; 0 1 2 3 4 5 6 7 8 9 A B C D E F
+; G H : L M N P R T U W Y r - +
+;
+
+EVT_NEXT EQU $00 ; Next button pressed (not interested in the up transition)
+EVT_MODE EQU $01 ; Mode button pressed (not interested in the up transition)
+EVT_SET EQU $02 ; Set/Delete button pressed (not interested in the up transition)
+EVT_PREV EQU $03 ; Prev button pressed (not interested in the up transition)
+EVT_GLOW EQU $04 ; Indiglo button pressed (not interested in the up transition)
+EVT_ANY EQU $05 ; Any button pressed (not interested in the up transition)
+EVT_ANY4 EQU $06 ; Any button pressed except indiglo (not interested in the up transition)
+EVT_RESUME EQU $1a ; Called when resuming from a nested app
+EVT_ENTER EQU $1b ; Initial state. The Time value is generally $01 or $84 for a well behaved app
+EVT_NEST EQU $1c ; The state table 1 entry called when a nested application is called. It is the equivalent of
+ ; EVT_ENTER for an interrupt. This only occurs for Wristapps, Timer, and appt apps.
+EVT_END EQU $1d ; End of event table indicator
+EVT_TIMER1 EQU $1e ; Timer event - This is fired for a $83 time request
+EVT_TIMER2 EQU $1f ; Timer event - This is fired for a $82,$84,$01 timer request
+; $20-$36 - UNUSED
+; (I bet that you can have user specified events for these too)
+EVT_USER0 EQU $37
+EVT_USER1 EQU $38
+EVT_USER2 EQU $39
+EVT_USER3 EQU $3a ; User specified events. Queued by calling POSTEVENT ($4E78)
+; $3b-$7f - UNUSED
+EVT_DNNEXT EQU $80 ; Next button pressed
+EVT_DNMODE EQU $81 ; Mode button pressed
+EVT_DNSET EQU $82 ; Set/Delete button pressed
+EVT_DNPREV EQU $83 ; Prev button pressed
+EVT_DNGLOW EQU $84 ; Indiglo button pressed
+EVT_DNANY EQU $85 ; Any of the four buttons Pressed
+EVT_DNANY4 EQU $86 ; Any button pressed except indiglo
+
+; $87-$9F - UNUSED
+EVT_UPNEXT EQU $A0 ; Next button released
+EVT_UPMODE EQU $A1 ; Mode button released
+EVT_UPSET EQU $A2 ; Set/Delete button released
+EVT_UPPREV EQU $A3 ; Prev button released
+EVT_UPGLOW EQU $A4 ; Indiglo button released
+EVT_UPANY EQU $A5 ; Any of the four buttons Released
+EVT_UPANY4 EQU $A6 ; Any button Released except indiglo
+
+ALARM_STATUS EQU $69 ; This is the status flags for the alarms. The low order bit indicates that it is enabled
+ ; The next bit seems to indicate that the alarm is temporarily masked or disabled
+ ; Apparently the next bit can be set, but I haven't seen any use for it.
+; EQU $69 ; Alarm 1 Status
+; EQU $69 ; Alarm 1 Status
+; EQU $6a ; Alarm 2 Status
+; EQU $6b ; Alarm 3 Status
+; EQU $6c ; Alarm 4 Status
+; EQU $6d ; Alarm 5 Status
+
+SCAN_MONTH EQU $7a ; The current SCAN month
+SCAN_DAY EQU $7b ; The current SCAN day
+SCAN_YEAR EQU $7c ; The current SCAN year
+
+MONTH_JAN EQU 1
+MONTH_FEB EQU 2
+MONTH_MAR EQU 3
+MONTH_APR EQU 4
+MONTH_MAY EQU 5
+MONTH_JUN EQU 6
+MONTH_JUL EQU 7
+MONTH_AUG EQU 8
+MONTH_SEP EQU 9
+MONTH_OCT EQU 10
+MONTH_NOV EQU 11
+MONTH_DEC EQU 12
+
+SYSTEMP0 EQU $A0
+SYSTEMP1 EQU $A1
+
+TIM_ONCE EQU $ff ; No time interval. Operation is executed just once
+
+TIM1_TIC EQU $00
+TIM1_2TIC EQU $01
+TIM1_3TIC EQU $02
+TIM1_4TIC EQU $03
+TIM1_HALFSEC EQU $04
+TIM1_SECOND EQU $05
+TIM1_SECHALF EQU $06
+TIM1_TWOSEC EQU $07
+TIM1_TWOSEC1 EQU $08
+TIM1_12SEC EQU $09
+TIM1_18SEC EQU $0a
+;
+; Note that the second part of this table is happen-stance since it is really a rollover
+; of the second table on top of the first one. But it might be useful to someone...
+;
+TIM1_TICA EQU $0b ; This is the typical scroll interval
+TIM1_2TICA EQU $0c
+TIM1_4TICA EQU $0d
+TIM1_8TIC EQU $0e ; This is the normal blink interval
+TIM1_12TIC EQU $0f ; Just over a second
+TIM1_16TIC EQU $10 ; A second and a half
+TIM1_24TIC EQU $11 ; Two and a half seconds
+TIM1_32TIC EQU $12 ; Just over three seconds
+TIM1_40TIC EQU $13 ; Four seconds
+TIM1_48TIC EQU $14 ; Almost five seconds
+TIM1_96TIC EQU $15 ; Almost ten seconds
+
+TIM2_TIC EQU $80 ; This is the typical scroll interval
+TIM2_2TIC EQU $81
+TIM2_4TIC EQU $82
+TIM2_8TIC EQU $83 ; This is the normal blink interval
+TIM2_12TIC EQU $84 ; Just over a second
+TIM2_16TIC EQU $85 ; A second and a half
+TIM2_24TIC EQU $86 ; Two and a half seconds
+TIM2_32TIC EQU $87 ; Just over three seconds
+TIM2_40TIC EQU $88 ; Four seconds
+TIM2_48TIC EQU $89 ; Almost five seconds
+TIM2_96TIC EQU $8a ; Almost ten seconds
+
+TIM_LONG1 EQU $01 ; Long shot time interval - Fires a $1F when the the timer expires
+TIM_03 EQU $03 ; Unknown
+TIM_08 EQU $08 ; Unknown
+
+TIM_SHORT EQU $82 ; Short timer - Fires a $1F event when the timer expires
+TIM_MED EQU $83 ; Medium timer - Fires a $1E event when the timer expires
+TIM_LONG EQU $84 ; Long timer - Fires a $1F event when the timer expires
+TIM_86 EQU $86 ; ?Timer
+;-----------------------------------------------------------------------------------------
+TZ1_HOUR EQU $b0 ; Time zone 1 current hour (0-23)
+TZ1_MINUTE EQU $b1 ; Time zone 1 current minute (0-59)
+TZ1_MONTH EQU $b2 ; Time zone 1 current month of the year (1-12)
+TZ1_DAY EQU $b3 ; Time zone 1 current day of the month (1-31)
+TZ1_YEAR EQU $b4 ; Time zone 1 current year (mod 1900)
+TZ1_NAME EQU $b5 ; Time zone 1 name (3 TIMEX characters)
+; EQU $b6 ; " " " "
+; EQU $b7 ; " " " "
+TZ1_DOW EQU $b8 ; Time zone 1 day of week (0=Monday...6=Sunday)
+;-----------------------------------------------------------------------------------------
+TZ2_HOUR EQU $b9 ; Time zone 2 current hour (0-23) in Timezone 1
+TZ2_MINUTE EQU $ba ; Time zone 2 current minute (0-59)
+TZ2_MONTH EQU $bb ; Time zone 2 current month of the year (1-12)
+TZ2_DAY EQU $bc ; Time zone 2 current day of the month (1-31)
+TZ2_YEAR EQU $bd ; Time zone 2 current year (mod 1900)
+TZ2_NAME EQU $be ; Time zone 2 name (3 TIMEX characters)
+; EQU $bf ; " " " "
+; EQU $c0 ; " " " "
+TZ2_DOW EQU $c1 ; Time zone 2 day of the week (0=Monday..6=Sunday)
+;-----------------------------------------------------------------------------------------
+; Sound Support Values
+TONE_END EQU $00 ; END
+TONE_LOW_C EQU $10 ; Low C
+TONE_HI_C EQU $20 ; High C
+TONE_MID_C EQU $30 ; Middle C
+TONE_VHI_C EQU $40 ; Very high C
+TONE_HI_F EQU $50 ; High F (little bit lower than F)
+TONE_MID_F EQU $60 ; Middle F
+TONE_LO_F EQU $70 ; Low F
+TONE_VHI_GSHARP EQU $80 ; Very High G# (G Sharp)
+TONE_HI_GSHARP EQU $90 ; High G#
+TONE_MID_GSHARP EQU $A0 ; Middle G#
+TONE_LO_GSHARP EQU $B0 ; Low G#
+TONE_HI_D EQU $C0 ; High D
+TONE_MID_D EQU $D0 ; Middle D
+TONE_LO_D EQU $E0 ; Low D
+TONE_PAUSE EQU $F0 ; Pause
+SND_END EQU $80
+;-----------------------------------------------------------------------------------------
+SNDSTART EQU $4E39 ; Start playing the current sound in SYSSOUND
+;--------------------------------------------------------------------------------
+PLAYCONF EQU $4E69 ; Play a confirmation sound
+PLAYBUTTON EQU $4E6F ; Play the button beep sound if no other sound is currently playing
+;--------------------------------------------------------------------------------
+POSTEVENT EQU $4E78 ; Post a event to the internal processing queue
+; Parameters:
+; A - Event to be posted.
+; This posts an event to run through the processing loop for the current applet.
+; Typical user events are in the $30-$3F range.
+;
+;--------------------------------------------------------------------------------
+INDIGLO_OFF EQU $4E7D ; This routine turns off the indiglo light
+;--------------------------------------------------------------------------------
+SNDSTOP EQU $4F29 ; This stops whatever sound is currently playing
+;--------------------------------------------------------------------------------
+CALL_NESTEDAPP EQU $4F3C
+; Purpose:
+; This sets up to call a nested application while the current one is running.
+; Up to 5 apps may be nested (although there are only 3 potential ones defined).
+; If more than 5 have been called the oldest one will be forgotten.
+; When the nested app is called, NESTED_APP will be set to the application number
+; passed in and NESTED_PARM will contain the X parameter passed in
+;
+; Parameters:
+; A - Nested application number. This is one of the three defined apps:
+; 9 = APP2_ALARM - Alarm (while another app is running)
+; 10 = APP2_APPT - Appointment (while another app is running)
+; 11 = APP2_WRIST - Wristapp (while another app is running)
+; X - Parameter to pass to the nested application
+;--------------------------------------------------------------------------------
+SET_INDIGLO EQU $54f3 ; This routine turns on/off the indiglo light
+; Parameters:
+; 0,Sys_9e - Bit indicates request for on or off
+;--------------------------------------------------------------------------------
+PUTSCROLLMSG EQU $5511 ; Make the buffer at MSGBUF visible
+;--------------------------------------------------------------------------------
+SCROLLMSG EQU $5534 ; Start the scrolling cycle for the current message
+; Parameters:
+; MSGBUF - Message to be scroll terminated by a SEPARATOR character
+;--------------------------------------------------------------------------------
+SCROLLMSG_CONT EQU $5538 ; Start the scrolling cycle for the current message, but don't reset the
+ ; scrolling cycle wait count.
+; Parameters:
+; MSGBUF - Message to be scroll terminated by a SEPARATOR character
+; SCROLL_TICS - The current tic count in the cycle
+;--------------------------------------------------------------------------------
+START_BLINKX EQU $55aa ; Establish and call the specified blinking rountine
+; Parameters:
+; X - single byte parameter to the particular blinking function
+; A - Blinking function to be selected
+;--------------------------------------------------------------------------------
+START_BLINKP EQU $55ae ; Establish and call the specified blinking rountine
+; Parameters:
+; X - Address of parameter to the particular blinking function
+; A - Blinking function to be selected
+BLINK_YEAR EQU 0 ; Blink the year in the right place according to the current time format
+BLINK_SECONDS EQU 1 ; Blink two characters point to by UPDATE_PARM on the right two digits of the middle line - Used for the seconds
+BLINK_AMPM EQU 2 ; Blink AM/PM on the right most digits of the middle line (A or P pointed to by UPDATE_PARM)
+BLINK_MONTH EQU 3 ; Blink the month in the right place according to the current time format
+BLINK_HMONTH EQU 4 ; Blink the month in the right place according to the current time format for a half date (no year)
+BLINK_DAY EQU 5 ; Blink the day in the right place according to the current time format
+BLINK_HDAY EQU 6 ; Blink the day in the right place according to the current time format for half dates
+BLINK_MID12 EQU 7 ; Blink the left two blank padded digits on the middle line (value pointed to by UPDATE_PARM)
+BLINK_HOUR EQU 8 ; Blink the Hour (left two segments on the middle line) and AM/PM indicator (hour point to by UPDATE_PARM)
+BLINK_MID34 EQU 9 ; Blink the middle two zero padded digits on the middle line (value pointed to by UPDATE_PARM)
+BLINK_SEGMENT EQU 10 ; Blink a single segment indicated by UPDATE_POS and mask in UPDATE_VAL
+BLINK_DIGIT EQU 11 ; Blink solid black cursor for the digit (UPDATE_POS is the location on the bottom line)
+BLINK_TZONE EQU 12 ; Blink the timezone information (Pointed to by UPDATE_PARM)
+BLINK_TOP34 EQU 13 ; Blink the middle zero padded two digits on the top line (value pointed to by UPDATE_PARM)
+;--------------------------------------------------------------------------------
+PUTLINE3 EQU $59e7 ; Put a single character on the bottom line of the display
+POSL3_1 EQU $50
+POSL3_2 EQU $4f
+POSL3_3 EQU $45
+POSL3_4 EQU $3b
+POSL3_5 EQU $31
+POSL3_6 EQU $1f
+POSL3_7 EQU $15
+POSL3_8 EQU $0b
+; Parameters:
+; A = Position S1 S2 S3 S4 S5 S6 S7 S8
+; [$50] [$4f] [$45] [$3b] [$31] [$1f] [$15] [$0b]
+; [ 80] [ 79] [ 69] [ 59] [ 49] [ 31] [ 21] [ 11]
+; X = Character in Timex Ascii to display
+; Notes:
+; This appears to be an XOR operation. Calling the same function twice in a row would
+; erase the character. Writing on top of an existing character seems to let you generate
+; a non Ascii character.
+
+PUTLINE1 EQU $5a33 ; Put a single character on the top line of the display
+POSL1_1 EQU $44
+POSL1_2 EQU $3c
+POSL1_3 EQU $32
+POSL1_4 EQU $2a
+POSL1_5 EQU $20
+POSL1_6 EQU $12
+; Parameters:
+; A = Position [$44] [$3c] - [$32] [$2a] - [$20] [$12]
+; [ 68] [ 60] [ 50] [ 42] [ 32] [18]
+; X = Character in Timex Ascii to display
+
+PUTLINE2 EQU $5a6b ; Put a single character on the second line of the display
+POSL1_1 EQU $44
+POSL1_2 EQU $3c
+POSL1_3 EQU $32
+POSL1_4 EQU $2a
+POSL1_5 EQU $20
+POSL1_6 EQU $12
+; Parameters:
+; A = Position [$44] [$3c] - [$32] [$2a] - [$20] [$12]
+; [ 68] [ 60] [ 50] [ 42] [ 32] [18]
+; X = Character in Timex Ascii to display
+
+CLEARALL EQU $5aa0 ; Clear the display
+CLEARBOT EQU $5aad ; Clear the bottom line of the display
+CLEARSYM EQU $5acb ; Turns off all the non digit symbols segments (including dots, dashes and colons)
+;-------------------------------------------------------------------------
+START_UPDATEX equ $56c4 ; Establish and call the specified update function (See START_UPDATEP)
+; Parameters:
+; X - single byte parameter to the particular update function
+; A - Update function to be selected
+;-------------------------------------------------------------------------
+START_UPDATEP EQU $56C8 ; This establishes an update function. Update functions are called every 8/10th
+ ; of a second. This function will update a number in an upward or downward
+ ; direction based on the setting of 0,SYSFLAGS
+; Parameters:
+; A - Update function to be selected
+; X - Pointer to parameters for the update function
+UPD_YEAR EQU 0 ; Update the year
+UPD_MONTH EQU 1 ; Update the Month
+UPD_HMONTH EQU 2 ; Update the Month in Half date format
+UPD_DAY EQU 3 ; Update the day
+UPD_HDAY EQU 4 ; Update the day in half date format
+UPD_MID12 EQU 5 ; Update MID12
+UPD_HOUR EQU 6 ; Update the hour
+UPD_MID34 EQU 7 ; Update MID34
+UPD_DIGIT EQU 8 ; Update the digit at UPDATE_POS
+;-------------------------------------------------------------------------
+BANNER8 EQU $5746 ; Display an 8 character string
+; Parameters
+; A = Offset from 0110 for the start of an 8 character timex string
+;
+;-------------------------------------------------------------------------
+PUTMSGXBOT EQU $574a ; Puts a message on the bottom of the screen.
+; Parameters
+; A = Message selector number. Valid values from 0 to 27. They correspond to
+; the same strings passed into PUTMSGBOT scaled down by 8
+;-------------------------------------------------------------------------
+PUTMSGBOT EQU $574d ; Puts a message on the bottom of the screen.
+; Parameters
+; A = Offset into message selector string. Valid values from from $00 to $d8 at
+; 8 Byte offsets. $E0 is the start of the 6 byte top/mid message strings.
+SYS8_MON EQU $00 ; $00 = "MON "
+SYS8_TUE EQU $08 ; $08 = "TUE "
+SYS8_WED EQU $10 ; $10 = "WED "
+SYS8_THU EQU $18 ; $18 = "THU "
+SYS8_FRI EQU $20 ; $20 = "FRI "
+SYS8_SAT EQU $28 ; $28 = "SAT "
+SYS8_SUN EQU $30 ; $30 = "SUN "
+SYS8_VERDATE EQU $38 ; $38 = " 802104 "
+SYS8_VERSION EQU $40 ; $40 = " V2.1 "
+SYS8_MODE EQU $48 ; $48 = " MODE "
+SYS8_SET_MODE EQU $50 ; $50 = "SET MODE"
+SYS8_SET EQU $58 ; $58 = "SET "
+SYS8_TO EQU $60 ; $60 = "TO "
+SYS8_FOR EQU $68 ; $68 = "FOR "
+SYS8_ENTRIES EQU $70 ; $70 = "ENTRIES "
+SYS8_UPCOMING EQU $78 ; $78 = "UPCOMING"
+SYS8_ENTRY EQU $80 ; $80 = " ENTRY "
+SYS8_SCAN EQU $88 ; $88 = " SCAN "
+SYS8_SCAN_RIGHT EQU $90 ; $90 = " SCAN"
+SYS8_SYNCING EQU $98 ; $98 = " SYNCING"
+SYS8_PROGRESS EQU $a0 ; $a0 = "PROGRESS"
+SYS8_DATA_OK EQU $a8 ; $a8 = " DATA OK"
+SYS8_RESEND EQU $b0 ; $b0 = "-RESEND-"
+SYS8_ABORTED EQU $b8 ; $b8 = " ABORTED"
+SYS8_MISMATCH EQU $c0 ; $c0 = "MISMATCH"
+SYS8_SPLIT EQU $c8 ; $c8 = " SPLIT "
+SYS8_START EQU $d0 ; $d0 = ">=START "
+SYS8_STOP EQU $d8 ; $d8 = ">=STOP "
+; $e0 is the start of the message table SYS6_SET
+;
+PUT6TOP EQU $577f
+; Parameters:
+; A = Offset from 0110 for the start of a 6 byte data item to be put on the top
+; line of the screen. This uses a different encoding for characters where:
+; we have 32 different values which correspond to:
+; "0123456789ABCDEFGH:LMNPRTUWYr -+"
+; 0123456789abcdef0123456789abcdef
+; e.g. $12=':', $13='L'.
+; It appears that things wrap when you get to $20
+;
+PUTMSG1 EQU $5783 ; Put up a message on the top line
+; Parameters - Offset into message selector string.
+; Typically you want a multiple of 6 to choose from these below
+;
+SYS6_SET EQU $00 ; 00 = " SET " (This is stored at $5F5F in the roms)
+SYS6_HOLDTO EQU $06 ; 06 = "HOLDTO"
+SYS6_ALARM EQU $0C ; 0C = "ALARM "
+SYS6_ENTER EQU $12 ; 12 = "ENTER "
+SYS6_HR EQU $18 ; 18 = " HR"
+SYS6_SWITCH EQU $1E ; 1E = "SWITCH"
+SYS6_TIME EQU $24 ; 24 = " TIME "
+SYS6_FORMAT EQU $2A ; 2A = "FORMAT"
+SYS6_DAILY EQU $30 ; 30 = "DAILY "
+SYS6_APPT EQU $36 ; 36 = " APPT "
+SYS6_NO EQU $3c ; 3c = " NO "
+SYS6_APPTS EQU $42 ; 42 = "APPTS "
+SYS6_END_OF EQU $48 ; 48 = "END OF"
+SYS6_LIST EQU $4e ; 4e = " LIST "
+SYS6_DELETE EQU $54 ; 54 = "DELETE"
+SYS6_ANN EQU $5a ; 5a = " ANN "
+SYS6_PHONE EQU $60 ; 60 = "PHONE "
+SYS6_DONE EQU $66 ; 66 = " DONE "
+SYS6_PRI EQU $6c ; 6c = "PRI "
+SYS6_COMM EQU $72 ; 72 = " COMM "
+SYS6_READY EQU $78 ; 78 = "READY "
+SYS6_IN EQU $7e ; 7e = " IN "
+SYS6_ERROR EQU $84 ; 84 = "ERROR "
+SYS6_CEASED EQU $8a ; 8a = "CEASED"
+SYS6_PC EQU $90 ; 90 = "PC- "
+SYS6_WATCH EQU $96 ; 96 = "WATCH "
+SYS6_CHRONO EQU $9c ; 9c = "CHRONO"
+SYS6_TIMER EQU $A2 ; A2 = "TIMER "
+SYS6_000000 EQU $a8 ; a8 = "000000"
+; ae = "MTWTFS"
+; B4 = "SOUEHR"
+; BA = "AUG+74"
+; C0 = "P16174"
+; C6 = "P1OY40"
+; CC = "W+0++0"
+; D2 = "251332"
+; D8 = "0321++"
+; DE = "R++ 0+"
+; E4 = "+12+1T"
+; EA = "+0 0+1"
+; F0 = "26+2U+"
+; F6 = "0 C100"
+; FC = "C0GW"
+;
+PUT6MID EQU $57a9
+; Parameters:
+; A = Offset from 0110 for the start of a 6 byte data item to be put on the top
+; line of the screen. This uses a different encoding for characters where:
+; we have 32 different values which correspond to:
+; "0123456789ABCDEFGH:LMNPRTUWYr -+"
+; e.g. $12=':', $13='L'.
+; It appears that things wrap when you get to $20
+;
+; PUT6MIDA was identified wrong...
+PUTMSG2 EQU $57AD ; This functions just the same as PUTMSG1 except it puts things on the middle line
+CLEARTOP EQU $57d3 ; Puts blanks into all 6 top digits (Blanks out the top line)
+; Parameters:
+; None
+CLEARMID EQU $57d9 ; Puts blanks into all 6 Middle digits (Blanks out the middle line)
+; Parameters:
+; None
+;-------------------------------------------------------------------------
+; These next 6 routines take the two bytes in DATDIGIT1 ($A2) and DATDIGIT2($A3) and put them
+; on the display in the appropriate locations. The digits are represented using the TIMEX6
+; character set.
+;
+PUTTOP12 EQU $57e1 ; Puts DATDIGIT1/2 into TOP Digits 1 and 2
+PUTTOP34 EQU $57f1 ; Puts DATDIGIT1/2 into TOP Digits 3 and 4
+PUTTOP56 EQU $5801 ; Puts DATDIGIT1/2 into TOP Digits 5 and 6
+PUTMID12 EQU $5811 ; Puts DATDIGIT1/2 into Middle Digits 1 and 2
+PUTMID34 EQU $5821 ; Puts DATDIGIT1/2 into Middle Digits 3 and 4
+PUTMID56 EQU $5831 ; Puts DATDIGIT1/2 into Middle Digits 5 and 6
+; These 6 routines blank out parts of the display
+CLRTOP12 EQU $57df ; Puts Blanks into TOP Digits 1 and 2
+CLRTOP34 EQU $57ef ; Puts Blanks into TOP Digits 3 and 4
+CLRTOP56 EQU $57ff ; Puts Blanks into TOP Digits 5 and 6
+CLRMID12 EQU $580f ; Puts Blanks into Middle Digits 1 and 2
+CLRMID34 EQU $581f ; Puts Blanks into Middle Digits 3 and 4
+CLRMID56 EQU $582f ; Puts Blanks into Middle Digits 5 and 6
+;
+FMTXLEAD0 EQU $583f ; Formats into DATDIGIT1/2 with leading zeros
+; Parameters:
+; X - value to be formatted. 0-9 results in 0 followed by the digit
+; 10-99 results in number for both digits
+FMTBLANK0 EQU $584e ; Format into DATDIGIT1/2
+; Parameters:
+; X - value to be formatted. 0 results in all blanks.
+; 1-9 results in blank followed by the digit
+; 10-99 results in number for both digits
+FMTX EQU $5852 ; Format into DATDIGIT1/2
+; Parameters:
+; X - value to be formatted. 0-9 results in blank followed by the digit
+; 10-99 results in number for both digits
+
+FMTSPACE EQU $585d ; Format blankes into DATDIGIT1/2
+; Parameters: NONE
+; This routine simply puts spaces into DATDIGIT1 DATDIGIT2
+;
+SAYEOLMSG EQU $587a ; Puts 'END OF LIST' on the display
+PUTBOT678 EQU $5987 ; Puts three digits into the lower corner of the display.
+; Typically this is the time zone information.
+; Parameters:
+; X - Pointer to 3 byte location containing bytes to put on the display
+; (pointed to by x) 3 bytes in TIMEX ascii. Because the X register iss
+; used to index to them, they must be located in the first 256 bytes of
+; memory.
+PUTDATESEP EQU $59ac ; Put either Dashes or periods on the top line
+
+DIGLOCTOP EQU $5e2f ; Locations of digits on the top line
+DIGLOCMID EQU $5e35 ; Locations of digits on the middle line
+DIGLOCBOT EQU $5e3b ; Locations of digits on the bottom line
+
+;-------------------------------------------------------------------------
+PUT_YEARX EQU $67D5 ; Put the leading zero 2 digit year in the appropriate spot on the display based
+ ; on the current time zone date format
+; Parameters:
+; X - Year to be displayed
+;-------------------------------------------------------------------------
+PUT_MONTHX EQU $67D9 ; Put the leading space 2 digit month in the appropriate spot on the display based
+ ; on the current time zone date format
+; Parameters:
+; X - Month to be displayed
+;-------------------------------------------------------------------------
+PUT_DAYX EQU $67DD ; Put the leading zero 2 digit day in the appropriate spot on the display based
+ ; on the current time zone date format
+; Parameters:
+; X - Day to be displayed
+;-------------------------------------------------------------------------
+SAY_HOURX EQU $67E1 ; Puts up the hour on the display along with an AM/PM indicator and a Colon.
+ ; This code respects the current 12/24 hour format.
+; Parameters:
+; X - Hour to be displayed
+;-------------------------------------------------------------------------
+PUT_MINUTEX EQU $682C ; This puts the minute in the middle two digits on the middle line followed by a period
+; Parameters:
+; X - minute (0-59) to be displayed
+;-------------------------------------------------------------------------
+SHOWSEC_TENS EQU $6839 ; Puts the character at SECOND_TENS onto the next to the last digit on the middle line
+; Parameters:
+; SECOND_TENS - Value to be put on the display
+;-------------------------------------------------------------------------
+SHOWSEC_ONES EQU $6841 ; Puts the character at SECOND_ONES onto the last digit on the middle line
+; Parameters:
+; SECOND_ONES - Value to be put on the display
+;-------------------------------------------------------------------------
+CALC_DOW_X EQU $68DE ; Computes the Day of the Week from the Month, Day, Year information
+; Parameters:
+; X - Pointer to Month, Day, Year block
+;-------------------------------------------------------------------------
+ACQUIRE EQU $68F1 ; Disable interrupts for a short piece of code
+RELEASE EQU $68FB ; Reenable interrupts
+;-------------------------------------------------------------------------
+GET_MONTHLEN EQU $6902 ; Computes the number of days in a given month
+; Parameters:
+; PARM_MONTH, PARM_YEAR contain the month and year to look for
+; Returns:
+; A - Number of days in the month
+;-------------------------------------------------------------------------
+SETALL EQU $5a9c ; Turn on all segments on the display
+INCA_WRAPX EQU $6B16 ; Advance to the next value wrapped within a range
+; Parameters:
+; A - Number to be incremented
+; X - Range to hold number within
+;-------------------------------------------------------------------------
+GETBCDHI EQU $6B5b
+; Parameters:
+; X - Hex value to be converted (Range 0-99)
+; Returns:
+; A - High byte of number in timex ascii
+;-------------------------------------------------------------------------
+GETBCDLOW EQU $6B63
+; Parameters:
+; X - Hex value to be converted (Range 0-99)
+; Returns:
+; A - Low byte of number in timex ascii
+;-------------------------------------------------------------------------
+TABHEX2BCD EQU $6b69 ; 100 bytes from 6b69-6bcc
+; This is a 100 byte table of HEX to BCD conversion values. You can take the value you want
+; to convert, load it into the X register and then load TABHEX2BCX,X. To get the high order byte,
+; just shift it right by 4. The low order is just an and with $0f.
+
+SYS_26 EQU $26
+MODE_FLAGS EQU $68 ; FLAGS
+ ; Bit0 = Indicates that we are in alarm set mode (SET=IN SET MODE)
+ ; Bit1 = Indicates that we have a backup mode pending alarm (SET=PENDING)
+ ; Bit2 = Indicates that hourly chimes are to be played (SET=ENABLED)
+ ; Bit3 = Indicates that hourly chimes are temporarily disabled (SET=DISABLED)
+ ; Bit4 = Enables beep for any button pressed (SET=BEEP)
+ ; Bit5 = Indicates that we are in COMM Mode (SET=IN COMM Mode)
+ ; Bit6 = Indicates that ALARM SET MODE is on the display (SET=On Display)
+ ; Bit7 = <UNUSED>
+APP_FLAGS EQU $8f ; System Flags
+ ; Bit0 = Event has been posted (SET=TRUE)
+ ; Bit1 = We want to allow the app to be suspended (SET=ALLOW)
+ ; Bit2 = Run a nested application (SET=TRUE) - only for ALARM,APPT, WRISTAPP
+ ; Bit3 = A button beep has already been played (SET=PLAYED)
+ ; Bit4 = <UNUSED>
+ ; Bit5 = <UNUSED>
+ ; Bit6 = <UNUSED>
+ ; Bit7 = <UNUSED>
+BTNFLAGS EQU $90 ; Flags for the timer. Note that bits 5 and 7 are exclusive because they happen to
+ ; use the same variables to hold their information.
+ ; Bit0 = <UNUSED>
+ ; Bit1 = wristapp wants a 1/10 second timer function called (WRIST_DOTIC) (SET=CALL)
+ ; Bit2 = Indicates a blink routine is pending (SET=PENDING)
+ ; Bit3 = Indicates a scrolling message is pending (SET=PENDING)
+ ; Bit4 = Indicates an update routine is pending (SET=PENDING)
+ ; Bit5 = Indicates a blink routine has been established (SET=ACTIVE)
+ ; Bit6 = Indicates a scrolling message is in progress (SET=ACTIVE)
+ ; Bit7 = Indicates an update routine has been established (SET=ACTIVE)
+BTNSTATE EQU $91 ; Current event/button press
+TIMER_FLAGS EQU $94 ; System Flags
+ ; Bit0 = Indicates that the timer2 timer has been enabled (SET=ENABLED)
+ ; Bit1 = Indicates that the TIC timer has been enabled (SET=ENABLED)
+ ; Bit2 = Indicates that we want to turn off the indiglo automatically (SET=TURN OFF)
+ ; Bit3 = Indicates that they have done something in this applet (SET=done something)
+ ; Bit4 = Request to reset the watch (SET=Reset Watch)
+ ; Bit5 = Request to turn off the INDIGLO at some future time
+ ; Bit6 = <UNUSED>
+ ; Bit7 = ????Related to indicating that sound is currently playing
+MAIN_FLAGS EQU $95 ; Flags to set queue requests to do something in the main loop
+ ; Bit0 = Indicates that a button has changed state (SET=CHANGED)
+ ; Bit1 = Indicates that the current app should be suspended and TIME activated (SET=Suspend)
+ ; Bit2 = Indicates that the TIMER_TICS has been updated (SET=Updated)
+ ; Bit3 = Indicates that the hourly chimes need to be played (SET=Please Play)
+ ; Bit4 = Indicates that the appointments should be checked (SET=Please Check)
+ ; Bit5 = Indicates that the anniversaries need to be checked (SET=Please Check)
+ ; Bit6 = <UNUSED>
+ ; Bit7 = <UNUSED>
+WRISTAPP_FLAGS EQU $96 ; System Flags
+ ; Bit0 = wristapp wants a second timer function called at start of interrupt (WRIST_DOTIC) (SET=CALL)
+ ; Bit1 = wristapp wants a call once a minute when it changes (WRIST_DOTIC) (SET=CALL)
+ ; Bit2 = wristapp wants a call once an hour when it changes (WRIST_DOTIC) (SET=CALL)
+ ; Bit3 = wristapp wants a call once a day when it changes (WRIST_DOTIC) (SET=CALL)
+ ; Bit4 = Play button beep sound on wristapp for any button (SET=ENABLE)
+ ; Bit5 = Play button beep sound on wristapp for mode button (SET=ENABLE)
+ ; Bit6 = Uses system rules for button beep decisions (SET=SYSTEM RULES)
+ ; Bit7 = Wristapp has been loaded (SET=LOADED)
+NEST_PARM EQU $99 ; Holds the parameter passed to the current nested app
+SYSSOUND EQU $9B ; Current sound to be played
+HW_FLAGS EQU $9e ; System Variable
+ ; Bit0 = Request state for Indiglo light (SET=ON)
+ ; Bit1 = Indicates the the SYS_07 hardware has been reset
+ ; Bit2 = <UNUSED>
+ ; Bit3 = Indicates that we want to load some code from the serial port at reset (SET=ON)
+ ; Bit4 = Set but never used. Mimics the state of 0,PORT_C_DATA & 0,PORT_C_DDR
+ ; Bit5 = Set but never used. Mimics the state of 1,PORT_C_DATA & 1,PORT_C_DDR
+ ; Bit6 = Indicates that INST_ADDR is a pointer into the EEPROM (SET=EEPROM Address)
+ ; Bit7 = Interrupts have been disabled (SET=DISABLED)
+SYSFLAGS EQU $9F ; System flags
+ ; Bit0 = Indicates the update direction. (SET=UP)
+ ; Bit1 = Indicates that the screen needs to be cleared (SET=no need to clear)
+ ; Also used as part of a the digit blinking code (SET=Show digits)
+ ; Bit2 = Indicates that the end of a scrolling message has been reached (SET=END)
+ ; Bit3 = User vs system string (SET=User String)
+ ; Bit4 = <UNUSED>
+ ; Bit5 = <UNUSED>
+ ; Bit6 = <UNUSED>
+ ; Bit7 = <UNUSED>
+DATDIGIT1 EQU $A2 ; First digit parameter for PUTMIDnn/PUTTOPnn routines
+DATDIGIT2 EQU $A3 ; Second digit parameter for PUTMIDnn/PUTTOPnn routines
+UPDATE_VAL EQU $a6 ; Temporary value passed to the update/blink routines
+UPDATE_PARM EQU $a7 ; Pointer to the data passed to the update/blink routines
+;
+; The sound in SYSSOUND can be set to one of the following values:
+;
+SND_HOURLY EQU $83 ; HOURLY CHIME
+SND_APPT EQU $85 ; APPOINTMENT BEEP
+SND_ALARM EQU $86 ; ALARM BEEP
+SND_DLOAD EQU $87 ; PROGRAM DOWNLOAD
+SND_EXTRA EQU $88 ; EXTRA
+SND_COMERR EQU $89 ; COMM ERROR
+SND_DONE EQU $8A ; COMM DONE
+SND_BUTTON EQU $c1 ; BUTTON BEEP
+SND_RETURN EQU $c2 ; RETURN TO TIME
+SND_CONF EQU $c4 ; CONFIRMATION
+
+APPT_PROMBASE EQU $0100 ; Address of the first entry for Appointments in the EEPROM
+LIST_PROMBASE EQU $0102 ; Address of the first entry for LISTs in the EEPROM
+PHONE_PROMBASE EQU $0104 ; Address of the first entry for PHONE numbers in the EEPROM
+ANNIV_PROMBASE EQU $0106 ; Address of the first entry for Anniversaries in the EEPROM
+APPT_ENTRIES EQU $0108 ; Number of currently loaded Appointment entries
+LIST_ENTRIES EQU $0109 ; Number of currently loaded LIST entries
+PHONE_ENTRIES EQU $010a ; Number of currently loaded Phone number entries
+ANNIV_ENTRIES EQU $010b ; Number of currently loaded Anniversary entries
+APPT_BASEYEAR EQU $010c ; The year for the first loaded appointment
+APPT_PRETIME EQU $010d ; How many minutes ahead of time to announce an appointment
+COMM_010e EQU $010e ; ????
+; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+SND_BASEOFF EQU $010f ; Sound base pointer - All sounds are this base relative to SND_BASE (0336)
+WRIST_MAIN EQU $0110 ; This is the primary initialization entry point for a Wristapp
+WRIST_SUSPEND EQU $0113 ; This is the entry point called immediately before suspending the wristapp
+WRIST_DOTIC EQU $0116 ; This is the entry point called for a timer tic in a wristapp
+WRIST_INCOMM EQU $0119 ; This is called when the COMM app is suspending the wristapp which has requests to process timer events
+WRIST_NEWDATA EQU $011c ; This is the wristapp entry point called when new data has been downloaded to the watch
+WRIST_GETSTATE EQU $011f ; Entry to get a wristapp state table entry
+WRIST_JMP_STATE0 EQU $0123 ; Wristapp entry point to call state 0
+
+INST_ADDRHI EQU $0437
+INST_ADDRLO EQU $0438
+USER04a1 EQU $04a1
+NESTED_APP EQU $04a2 ; Nested application (Only to run an application while a different one is running)
+ ; This is used to handle alarms and appointments that go off while you are running something else
+APP2_ALARM EQU 9 ; 9 = Alarm (while another app is running)
+APP2_APPT EQU 10 ; 10 = Appointment (while another app is running)
+APP2_WRIST EQU 11 ; 11 = Wristapp (while another app is running)
+NESTED_PARM EQU $04a4 ; Parameter passed to the nested app call
+USER04c3 EQU $04c3
+BUF_PHONENUM EQU $043a ; 12 byte buffer to hold a decompressed phone number
+EXTRACTBUF EQU $0446 ; 32 byte buffer to hold extracted data from the EEPROM
+UPDATE_POS EQU $04f3 ; Position to update a segment or digit in the blink/refresh routines
+;
+; These two constants appear to be associated with the PUTSCROLLMSG and SCROLLMSG routines
+;
+SEPARATOR EQU $3F ; Indicates the end of a scrolling string
+MSGBUF EQU $04d2 ; Location of the system buffer for a scrolling string
+CURRENT_APP EQU $04c1 ; The current application number (1-8)
+APP_TIME EQU 1 ; 1 = Time of Day
+APP_ALARM EQU 2 ; 2 = Alarm
+APP_APPT EQU 3 ; 3 = Appointment
+APP_ANNIV EQU 4 ; 4 = Anniversary
+APP_PHONE EQU 5 ; 5 = Phone number
+APP_LIST EQU 6 ; 6 = List
+APP_COMM EQU 7 ; 7 = Communication
+APP_WRIST EQU 8 ; 8 = Wristapp (if downloaded)
+BTN_PRESSED EQU $04c3 ; The button currently pressed (For EVT_ANY or EVT_ANY4 events) 0=NEXT 1=MODE 2=SET 3=PREV 4=GLOW
+EFFECTIVE_APP EQU $04c4 ; The efective application
+APP_13 EQU 13 ; Some submode of the TIME application
+APP_TIME_SET EQU 14 ; Submode of the TIME application
+UPDATE_MIN EQU $04f4 ; Minimum value for the update function to generate. At this, it wraps to UPDATE_MAX
+UPDATE_MAX EQU $04f5 ; Maximum value for the update function to generate. At this, it wraps to UPDATE_MIN
+PARM_MONTH EQU $04f9 ; Month parameter
+PARM_YEAR EQU $04fa ; Current year also...
+
+WATCHTIMER EQU $7ff0
+;
+; Other random routines which you might call....
+;
+ALARM_BLINKSEL EQU $40a5
+ALARM_UPDATESEL EQU $40a9
+ALARM_SELMIN EQU $40aD
+ALARM_SELMAX EQU $40b1
+FIND_ANNIV_TODAY EQU $40bc
+FIND_ANNIV_SCAN EQU $40c2
+ANNIV_NEXT_ENTRY EQU $40d0
+ANNIV_PREV_ENTRY EQU $4106
+FIND_ANNIV_ENTRY EQU $414E
+CHECK_ANNIVERSARIES EQU $41EB
+SET_ANNIVTEST_TODAY EQU $4229
+ANNIV_GETMONTHLEN EQU $4259
+TEST_ANNIVERSARY EQU $4277
+ANNIV_COPY_INFO EQU $42F7
+READ_ANNIV_CURRENT EQU $4306
+READ_ANNIV_FIRST EQU $4315
+READ_ANNIV_NEXT EQU $4324
+TEST_SCAN_START EQU $4335
+FIX_SCAN_YEAR EQU $4360
+TEST_SCAN_END EQU $436D
+RESTORE_SCAN_YEAR EQU $439D
+INCREMENT_SCAN_DATE EQU $43A8
+GET_SCAN_MONTHLEN EQU $43CF
+DECREMENT_SCAN_DATE EQU $43E3
+FIND_APPT_NOW EQU $4404
+FIND_APPT_SCAN EQU $440A
+SET_APPTFIND_SCAN EQU $4411
+READ_APPT_NEXT EQU $441B
+APPT_LATCH_ENTRYDATA EQU $4457
+APPT_LATCH_ENTRYONLY EQU $445B
+READ_APPT_PREV EQU $446B
+FIND_APPT_ENTRY EQU $44B5
+APPT_LATCH_ENTDYDATA EQU $4594
+CHECK_APPOINTMENTS EQU $45A8
+SET_APPTFIND_NOW EQU $4619
+READ_APPT_FIRST EQU $4675
+READ_APPT_LAST EQU $468C
+CHECK_APPT_TIME EQU $46A6
+READ_APPT_PACKET1 EQU $4729
+READ_NEXT_APPT_PACKET EQU $4738
+READ_APPT_CURRENT EQU $4749
+PROCESS_EVENTS EQU $4862
+DO_ANYAPP_EVENT EQU $49ae
+DO_NESTAPP_EVENT EQU $49b1
+DO_APP_EVENT EQU $49ed
+DO_NORMAL_STATE EQU $4a24
+TRANSITION_RBUTTON EQU $4b5d
+TRANSITION_LBUTTON EQU $4bac
+QUEUE_INDIGLO_OFF EQU $4bf1
+QUEUE_INDIGLO_OFF EQU $4c38
+NIGHTMODE_INDIGLO_ON EQU $4c45
+INDIGLO_ON EQU $4c4b
+PROCESS_REQUESTS EQU $4C55
+TIMER1_INTERVALS EQU $4c93
+TIMER2_INTERVALS EQU $4c9e
+DO_EVENT EQU $4Cb8
+GETSTATE EQU $4d12
+GETSTATE_TAB EQU $4D22
+CHECK_COMPATIBLE_EVENT EQU $4Daa
+STOP_ALL_SOUND EQU $4E57
+PREPARE_TIMER2_TIMER EQU $4E85
+PLAY_HOURLY EQU $4EA0
+PAUSE_WATCH EQU $4EB6
+RESUME_WATCH EQU $4ECD
+RESUME_UPDATE EQU $4EE5
+ACQUIRE_TIME EQU $4F11
+RELEASE_TIME EQU $4F1D
+PLAY_BUTTON_SAFE EQU $4F35
+PREPARE_NEST_CALL EQU $4F8F
+UNPACK_PHONENUM EQU $4FAE
+PHONE_UNPACK_VAL EQU $4FCF
+UNPACK_STRING EQU $4FDF
+READ_PACKET EQU $502D
+FIND_PACKET EQU $5033
+DO_TRANSFER EQU $504E
+TOGGLE_ENTRYFLAG EQU $5066
+MAKE_INST_LDA EQU $50A3
+MAKE_INST_LDA_X EQU $50A7
+MAKE_INST_STA EQU $50AB
+ADD_INSTADDR EQU $50B6
+SET_INSTADDR_0110 EQU $50C6
+GET_INST_BYTE EQU $50DA
+WRITE_FLAG_BYTE EQU $50F9
+FILL_EXTRACTBUF EQU $512D
+SAVE_EXTRACTBUF EQU $514C
+SYSTEM_RESET EQU $518A
+SND_OFF EQU $5213
+DO_SOUND EQU $5225
+SET_SYS_0f_4d EQU $52c0
+SET_SYS_0f_41 EQU $52C5
+ENABLE_EYE EQU $5367
+SERIAL_DELAY EQU $5375
+DISABLE_EYE EQU $537E
+SET_SYS_07 EQU $5389
+CLEAR_SYS_07 EQU $5390
+RESET_SYS_07 EQU $5396
+INITHW_SYS_07 EQU $539D
+SETHW_07_08_C1 EQU $53B5
+WRITE_ACQUIRE EQU $542b
+WRITE_RELEASE EQU $5437
+MAKE_INST2_LDA_X EQU $5442
+MAKE_INST2_STA_X EQU $5446
+PROM_READ EQU $5451
+PROM_WRITE EQU $5477
+READ_EEPROM_PORT EQU $54BB
+PROM_STARTIO EQU $54C5
+PROM_ACQUIRE EQU $54D1
+PROM_RELEASE EQU $54DB
+PROM_SHOW EQU $54E2
+PROM_HIDE EQU $54E7
+DO_SCROLL EQU $5555
+DO_BLINK EQU $55b7
+PUTDOWTOP EQU $5773
+FMTBLANK0B EQU $5864
+SAYHOLDTODELETE EQU $588b
+PUT_PHONENUM EQU $58a3
+PUTYEARMID EQU $58da
+CLEAR_HMONTH EQU $58f9
+PUT_HMONTHX EQU $58Fe
+CLEAR_HDAY EQU $5912
+PUT_HDAYX EQU $5917
+FIXLEAD0 EQU $592b
+CLEAR_MONTH EQU $5937
+IPUT_MONTHX EQU $593c
+CLEAR_DAY EQU $5950
+IPUT_DAYX EQU $5955
+CLEAR_YEAR EQU $5970
+IPUT_YEARX EQU $5975
+PUTHALFDATESEP EQU $59a1
+PUT_LETTERX EQU $59cf
+PUT_HOURX EQU $59da
+CLEAR_RANGE EQU $5abf
+SYSSYMVALS EQU $5adc
+PHONE_NEXT_ENTRY EQU $6176
+PHONE_PREV_ENTRY EQU $6195
+PHONE_READ_CURRENT EQU $61B0
+PHONE_SHOW_CURRENT EQU $61B9
+PHONE_FIND_SCAN_ENTRY EQU $61FA
+PHONE_READ_ENTRY EQU $6235
+PHONE_READ_NEXT_ENTRY EQU $6246
+PHONE_READ_FIRST_NEXT EQU $625A
+UPDATE_SECONDS EQU $6267
+ADJUST_TZ1TIME EQU $62E0
+ADJUST_TZ2TIME EQU $634C
+UPDATE_TZ1DISP EQU $63B8
+UPDATE_TZ2DISP EQU $63EF
+TIME_SET_BLINKON EQU $6669
+TIME_SET_BLINKOFF EQU $666d
+TIME_SET_GET_TIMEPTR EQU $6684
+TIME_SET_SHOWDISPLAY EQU $6693
+TIME_GET_BLINKPARM EQU $66ee
+SHOW_TIME_DISPLAY EQU $6773
+CLEAR_PM EQU $681E
+CLEAR_AM EQU $6825
+SHOWNIGHT_SYM EQU $6849
+SAY_HOLD_TO EQU $685E
+FIX_TMAPP_DAY EQU $686A
+TMAPP_COPYTZ1 EQU $688A
+TMAPP_COPYTZ2 EQU $6895
+GETTZNAME EQU $68A0
+GET_MONTHDAYX EQU $68A8
+GET_YEAR EQU $68BB
+GET_HOURFORMAT EQU $68C4
+GET_DATEFMT EQU $68D4
+COPY_MDY EQU $68E4
+CHECK_TZ EQU $6917
+CALC_DOW EQU $6925
+TIME_BLINKSEL EQU $69AD
+TIME_UPDATESEL EQU $69B8
+TIME_SELMIN EQU $69c3
+TIME_SELMAX EQU $69ce
+LIST_GO_NEXT EQU $6AA8
+LIST_GO_PREV EQU $6AB6
+LIST_DISPLAY_CURRENT EQU $6AC4
+CLEAR_WRISTAPPMEM EQU $6b28
+DELAY_X EQU $6b3a
+DELAY_X16 EQU $6b4c
+SHOWNOTE_SYM EQU $6C56
+SHOWALARM_SYM EQU $6C6a
+ALARM_CHECK EQU $6c9c
+ALARM_START_BLINK EQU $6Ea6
+ALARM_CALL_BLINK EQU $6EAd
+ALARM_GET_BLINKPARM EQU $6Ec0
+ALARM_DISPLAY_CURRENT EQU $6EFD
+ALARM_SHOW_HOURLYNOTE EQU $6F42
+ALARM_SHOW_ALARMSYM EQU $6F53
+ALARM_SHOW_AMPM EQU $6F64
+ALARM_SHOW_TEXTCHAR EQU $6F85
+ALARM_FIX_HOUR EQU $6F91
+ALARM_GET_DISPLAYHOUR EQU $6FA9
+ALARM_SET_CURRENT EQU $6FC7
+ALARM_SAVE_STATUS EQU $6FDE
+ALARM_GET_TEXTOFFSET EQU $6FE5
+ALARM_GET_DATAOFFSET EQU $6FEE
+MASK_ALARMS EQU $6FFC
+UNMASK_ALARMS EQU $7009
+ANNIV_SHOW_DATE EQU $718D
+ANNIV_SHOW_SCAN_DATE EQU $71A8
+ANNIV_SHOW_CURRENT EQU $71B5
+SHOWREMIND_SYM EQU $71DF
+OFFREMIND_SYM EQU $71F7
+SAY_NO_ANN_ENTRIES EQU $71FE
+APPT_SHOW_TIME EQU $73E0
+APPT_SHOW_DATE EQU $7442
+APPT_SHOW_SCAN EQU $745D
+APPT_SHOW_CURRENT EQU $746A
+APPT_SHOW_UPCOMING EQU $7497
+SAY_NO_APPT_ENTRIES EQU $74C6
diff --git a/from_pkg/datahid.zsm b/from_pkg/datahid.zsm
new file mode 100644
index 0000000..da381fd
--- /dev/null
+++ b/from_pkg/datahid.zsm
@@ -0,0 +1,239 @@
+;Name: Data Hider
+;Version: DATAHID1
+;Description: 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!
+;HelpFile: watchapp.hlp
+;HelpTopic: 102
+ INCLUDE "WRISTAPP.I"
+;
+; <A NAME="datahid_1">(1) Program specific constants</A>
+;
+FLAGBYTE EQU $61
+B_CHOOSE EQU 0 ; Which digit we are working on (SET=SECOND DIGIT)
+B_CLEARIT EQU 1 ; Indicates that we need to clear the display first
+B_LOCKED EQU 2
+B_VALID EQU 3
+; Bit 0 indicates which digit we are working on (SET=SECOND DIGIT)
+; Bit 1 indicates that we need to clear the display first
+;
+DIGIT0 EQU $62 ; The first digit to enter
+DIGIT1 EQU $63 ; The second digit to enter
+SYSTEMP0 EQU $A0
+SYSTEMP1 EQU $A1
+;
+; <A NAME="datahid_2">(2) System entry point vectors</A>
+;
+START EQU *
+L0110: jmp MAIN ; The main entry point - <A HREF="wristappformat.html#WRIST_MAIN">WRIST_MAIN</A>
+L0113: rts ; Called when we are suspended for any reason - <A HREF="wristappformat.html#WRIST_SUSPEND">WRIST_SUSPEND</A>
+ nop
+ nop
+L0116: rts ; Called to handle any timers or time events - <A HREF="wristappformat.html#WRIST_DOTIC">WRIST_DOTIC</A>
+ nop
+ nop
+L0119: rts ; Called when the COMM app starts and we have timers pending - <A HREF="wristappformat.html#WRIST_INCOMM">WRIST_INCOMM</A>
+ nop
+ nop
+L011c: rts ; Called when the COMM app loads new data - <A HREF="wristappformat.html#WRIST_NEWDATA">WRIST_NEWDATA</A>
+ nop
+ nop
+
+L011f: lda STATETAB0,X ; The state table get routine - <A HREF="wristappformat.html#WRIST_GETSTATE">WRIST_GETSTATE</A>
+ rts
+
+L0123: jmp HANDLE_STATE0
+ db STATETAB0-STATETAB0
+L0127: jmp HANDLE_STATE1
+ db STATETAB1-STATETAB0
+;
+; <A NAME="datahid_3">(3) Program strings</A>
+S6_TOEBES: timex6 "TOEBES"
+S6_SAMPLE: timex6 "SAMPLE"
+S6_PRESS: timex6 "PRESS "
+S8_PASSWORD: timex "PASSWORD"
+SX_MESSAGE timex "BY JOHN A. TOEBES, VIII"
+ db SEPARATOR
+;
+; <A NAME="datahid_4">(4) State Table</A>
+;
+STATETAB0:
+ db 0
+ db EVT_ENTER,TIM2_8TIC,0 ; Initial state
+ db EVT_TIMER2,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_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_END
+;
+; <A NAME="datahid_5">(5) State Table 0 Handler</A>
+; 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_ENTER ; Is this our initial entry?
+ bne REFRESH0
+;
+; This is the initial event for starting us
+;
+DO_ENTER
+ bclr 1,FLAGBYTE ; Indicate that we need to clear the display
+ jsr CLEARSYM ; Clear the display
+ lda #S6_TOEBES-START
+ jsr PUT6TOP
+ lda #S6_SAMPLE-START
+ jsr PUT6MID
+ lda #S8_PASSWORD-START
+ jmp BANNER8
+;
+; We come here for a RESUME or TIMER2 event. For this we want to reset the display
+;
+REFRESH0
+ brset 1,FLAGBYTE,NOCLEAR0 ; Do we need to clear the display first?
+ bset 1,FLAGBYTE
+ jsr CLEARSYM
+NOCLEAR0
+ lda #S6_PRESS-START
+ jsr PUT6TOP
+ lda #SYS6_SET
+ jsr PUTMSG2
+ lda #SX_MESSAGE-START
+ jmp SETUP_SCROLL
+;
+; <A NAME="datahid_6">(6) State Table 1 Handler</A>
+; This is called to process the state events.
+; We see SET, RESUME, DNANY4, and UPANY4 events
+;
+HANDLE_STATE1:
+ bset 1,APP_FLAGS ; Indicate that we can be suspended
+ lda BTNSTATE ; Get the event
+ cmp #EVT_UPANY4
+ beq REFRESH
+ cmp #EVT_DNANY4 ; Is this our initial entry?
+ bne FORCEFRESH
+ 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
+;
+; <A NAME="datahid_7">(7) Our real working code...</A>
+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
+ clra
+ sta UPDATE_MIN ; Our low end is 0
+ lda #99
+ sta UPDATE_MAX ; and the high end is 99 (the max since this is a 2 digit value)
+ brset 0,FLAGBYTE,UPD1
+ ldx DIGIT1
+ jsr FMTXLEAD0
+ jsr PUTMID34
+ ldx #DIGIT0 ; Point to our value to be updated
+ lda #UPD_MID12 ; Request updating in the middle of the display
+ bra UPD2
+UPD1
+ ldx DIGIT0
+ jsr FMTXLEAD0
+ jsr PUTMID12
+ ldx #DIGIT1
+ lda #UPD_MID34
+UPD2
+ jsr START_UPDATEP ; And prepare the update routine
+ bset 4,BTNFLAGS ; Mark that the update is now pending
+ bclr 1,FLAGBYTE
+ lda #SYS8_SET_MODE
+ jmp PUTMSGBOT
+
+DO_MODE
+ lda FLAGBYTE
+ eor #1
+ sta FLAGBYTE
+
+REFRESH
+ brset 1,FLAGBYTE,NOCLEAR ; Do we need to clear the display first?
+FORCEFRESH
+ jsr CLEARALL ; Yes, clear everything before we start
+ bset 1,FLAGBYTE ; And remember that we have already done that
+NOCLEAR
+ bclr 7,BTNFLAGS ; Turn off any update routine that might be pending
+ brset 0,FLAGBYTE,SET1
+ ldx DIGIT1
+ jsr FMTXLEAD0
+ jsr PUTMID34
+ ldx #DIGIT0
+ lda #BLINK_MID12
+ bra SET2
+SET1
+ ldx DIGIT0
+ jsr FMTXLEAD0
+ jsr PUTMID12
+ ldx #DIGIT1
+ lda #BLINK_MID34
+SET2
+ jsr START_BLINKP
+ bset 2,BTNFLAGS ; Mark a blink routine as pending
+ rts
+;
+; <A NAME="datahid_8">(8) This is the main initialization routine which is called when we first get the app into memory</A>
+;
+MAIN:
+ lda #$c0 ; We want button beeps and to indicate that we have been loaded
+ sta WRISTAPP_FLAGS
+ clr FLAGBYTE ; start with a clean slate
+ clr DIGIT0
+ clr DIGIT1
+ rts
+;
+; <A NAME="datahid_9">(9) This subroutine is useful for getting a scrolling string on the screen</A>
+;
+;----------------------------------------------------------------------
+; Routine:
+; SETUP_SCROLL
+; Parameters:
+; X - Offset from Start to the string
+; Returns:
+; MSGBUF - contains copied string
+; Purpose
+; This copies the current string into MSGBUF and calls the appropriate routines
+; to start it scrolling on the bottom line.
+;----------------------------------------------------------------------
+SETUP_SCROLL:
+ clr SYSTEMP0
+ sta SYSTEMP1
+DO_COPY:
+ ldx SYSTEMP1 ; Get the pointer to the source character
+ lda START,X ; Get the character that we are copying
+ ldx SYSTEMP0 ; Get the pointer to the output buffer
+ sta MSGBUF,X ; and store the character away
+ inc SYSTEMP0 ; Increment our count
+ inc SYSTEMP1 ; As well as the pointer to the character
+ cmp #SEPARATOR ; Did we get a terminator character
+ bne DO_COPY ; No, go back for more
+ ;
+ ; The string is now in a buffer terminated by a separator character
+ ;
+ jsr PUTSCROLLMSG ; Initialize the scrolling support
+ jmp SCROLLMSG ; And tell it to actually start scrolling
diff --git a/from_pkg/dayfind.zsm b/from_pkg/dayfind.zsm
new file mode 100644
index 0000000..0455853
--- /dev/null
+++ b/from_pkg/dayfind.zsm
@@ -0,0 +1,374 @@
+;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"
+;
+; <A NAME="dayfind_1">(1) Program specific constants</A>
+;
+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
+;
+;
+; <A NAME="dayfind_2">(2) System entry point vectors</A>
+;
+START EQU *
+L0110: jmp MAIN ; The main entry point - <A HREF="wristappformat.html#WRIST_MAIN">WRIST_MAIN</A>
+L0113: rts ; Called when we are suspended for any reason - <A HREF="wristappformat.html#WRIST_SUSPEND">WRIST_SUSPEND</A>
+ nop
+ nop
+L0116: rts ; Called to handle any timers or time events - <A HREF="wristappformat.html#WRIST_DOTIC">WRIST_DOTIC</A>
+ nop
+ nop
+L0119: rts ; Called when the COMM app starts and we have timers pending - <A HREF="wristappformat.html#WRIST_INCOMM">WRIST_INCOMM</A>
+ nop
+ nop
+L011c: rts ; Called when the COMM app loads new data - <A HREF="wristappformat.html#WRIST_NEWDATA">WRIST_NEWDATA</A>
+ nop
+ nop
+
+L011f: lda STATETAB0,X ; The state table get routine - <A HREF="wristappformat.html#WRIST_GETSTATE">WRIST_GETSTATE</A>
+ rts
+
+L0123: jmp HANDLE_STATE0
+ db STATETAB0-STATETAB0
+L0127: jmp HANDLE_STATE1
+ db STATETAB1-STATETAB0
+;
+; <A NAME="dayfind_3">(3) Program strings</A>
+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
+;
+; <A NAME="dayfind_4">(4) State Table</A>
+;
+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
+;
+; <A NAME="dayfind_5">(5) State Table 0 Handler</A>
+; 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
+;
+; <A NAME="dayfind_6">(6) This code gets the current date from the system</A>
+ 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
+;--------------------------------------------------------------------------------
+; <A NAME="dayfind_7">(7) State Table 1 Handler</A>
+; 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
+;
+; <A NAME="dayfind_8">(8) Our real working code...</A>
+; 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
+; <A NAME="dayfind_9">(9) Fake repeater</A>
+; 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
+; <A NAME="dayfind_10">(10) Update routine usage</A>
+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
+; <A NAME="dayfind_11">(11) Making the mode button work</A>
+; 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
+; <A NAME="dayfind_12">(12) Establishing a blink routine</A>
+; 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
+; <A NAME="dayfind_13">(13) Calling BLINK_SECOND</A>
+; 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:
+; <A NAME="dayfind_14">(14) Calling BLINK_SEGMENT</A>
+; 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<<COL_TD23)
+ lda #ROW_TD23 ; We want to blink the DASH after the day of week
+ sta UPDATE_POS ; Store the ROW for it in UPDATE_POS
+ lda #(1<<COL_TD23) ; Get the mask for the column
+ sta UPDATE_VAL ; And store that in UPDATE_VAL
+ lda #BLINK_SEGMENT ; We want a BLINK_SEGMENT function
+ bra SETUP_BLINK ; and get to it.
+
+DO_BLINK_MONTH ; 1: Month
+; <A NAME="dayfind_15">(15) Calling BLINK_HMONTH, BLINK_HDAY</A>
+; These are the normal boring cases of calling the blink routine. They simply need the
+; address of the byte holding the value to blink and the function to blink them with.
+; UPDATE_PARM - Points to the month
+ lda #BLINK_HMONTH ; We want a BLINK HALF-MONTH function
+ ldx #SCAN_MONTH ; to blink our month
+ bra SETUP_BLINK ; and do it
+
+DO_BLINK_DAY ; 2: Day
+; UPDATE_PARM - Points to the day
+ lda #BLINK_HDAY ; We want a BLINK HALF-DAY function
+ ldx #SCAN_DAY ; to blink our day
+
+SETUP_BLINK
+ jsr START_BLINKP ; Request the blink function
+ lda digsel ; Figure out which one we are blinking
+ lsla ; *2
+ lsla ; *4
+ lsla ; *8
+ add #S8_WEEK-START ; And use that to index the banner to put on the bottom
+ jsr BANNER8
+ bset 2,BTNFLAGS ; Mark a blink routine as pending
+ rts
+;
+; <A NAME="dayfind_16">(16) This is the main initialization routine which is called when we first get the app into memory</A>
+;
+MAIN:
+ lda #$c0 ; We want button beeps and to indicate that we have been loaded
+ sta WRISTAPP_FLAGS
+ clr FLAGBYTE ; start with a clean slate
+ rts
diff --git a/from_pkg/endoff.zsm b/from_pkg/endoff.zsm
new file mode 100644
index 0000000..1f903ba
--- /dev/null
+++ b/from_pkg/endoff.zsm
@@ -0,0 +1,145 @@
+;Name: Week End Off
+;Version: ENDOFF
+;Description: Week End Off - by John A. Toebes, VIII
+;This application turns off all alarms on the weekend.
+;
+;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"
+;
+; <A NAME="endoff_1">(1) Program specific constants</A>
+;
+START EQU *
+;
+; <A NAME="endoff_2">(2) System entry point vectors</A>
+;
+L0110: jmp MAIN ; The main entry point - <A HREF="wristappformat.html#WRIST_MAIN">WRIST_MAIN</A>
+L0113: rts ; Called when we are suspended for any reason - <A HREF="wristappformat.html#WRIST_SUSPEND">WRIST_SUSPEND</A>
+ nop
+ nop
+L0116: jmp CHECKSTATE ; Called to handle any timers or time events - <A HREF="wristappformat.html#WRIST_DOTIC">WRIST_DOTIC</A>
+L0119: jmp ENABLE_ALL ; Called when the COMM app starts and we have timers pending - <A HREF="wristappformat.html#WRIST_INCOMM">WRIST_INCOMM</A>
+L011c: jmp CHECKSTATE ; Called when the COMM app loads new data - <A HREF="wristappformat.html#WRIST_NEWDATA">WRIST_NEWDATA</A>
+
+L011f: lda STATETAB,X ; The state table get routine - <A HREF="wristappformat.html#WRIST_GETSTATE">WRIST_GETSTATE</A>
+ rts
+
+L0123: jmp HANDLE_STATE0
+ db STATETAB-STATETAB
+;
+; <A NAME="endoff_3">(3) Program strings</A>
+;
+S6_WEEK: timex6 " WEEH "
+S6_ENDOFF: timex6 "ENDOFF"
+S8_TOEBES: timex "J.TOEBES"
+;
+; <A NAME="endoff_4">(4) State Table</A>
+;
+STATETAB:
+ db 0
+ db EVT_ENTER,TIM_LONG,0 ; Initial state
+ db EVT_RESUME,TIM_ONCE,0 ; Resume from a nested app
+ db EVT_MODE,TIM_ONCE,$FF ; Mode button
+ db EVT_END
+;
+; <A NAME="endoff_5">(5) State Table 0 Handler</A>
+; This is called to process the state events.
+; We see ENTER and RESUME events
+;
+HANDLE_STATE0:
+ bset 1,APP_FLAGS ; Allow us to be suspended
+ jsr CLEARALL ; Clear the display
+ lda #S6_WEEK-START ; Put ' WEEK ' on the top line
+ jsr PUT6TOP
+ lda #S6_ENDOFF-START ; Put 'ENDOFF' on the second line
+ jsr PUT6MID
+;
+; <A NAME="endoff_6">(6) Faking a letter K</A>
+;
+;
+; We have We want it to look like:
+; | | |
+; | | | |
+; | | | |
+; |=====| |=====
+; | | | |
+; | | | |
+; | | | |
+; This means turning off T5B and turning on T5H
+ lda #ROW_T5B
+ sta DISP_ROW
+ bclr COL_T5B,DISP_COL
+ lda #ROW_T5H
+ sta DISP_ROW
+ bset COL_T5H,DISP_COL
+ bsr CHECKSTATE ; Just for fun, check the alarm state
+ lda #S8_TOEBES-START
+ jmp BANNER8
+;
+; <A NAME="endoff_7">(7) This is the main initialization routine which is called when we first get the app into memory</A>
+;
+MAIN:
+ bset 7,WRISTAPP_FLAGS ; Tell them that we are a live application
+ lda #$C8 ; Bit3 = wristapp wants a call once a day when it changes (WRIST_DOTIC) (SET=CALL)
+ ; Bit6 = Uses system rules for button beep decisions (SET=SYSTEM RULES)
+ ; Bit7 = Wristapp has been loaded (SET=LOADED)
+ sta WRISTAPP_FLAGS
+ ; Fall into CHECKSTATE
+;
+; <A NAME="endoff_8">(8) Determining the day of the week</A>
+;
+CHECKSTATE
+ jsr ACQUIRE ; Lock so that it doesn't change under us
+ lda TZ1_DOW ; Assume that we are using the first timezone
+ jsr CHECK_TZ ; See which one we are really using
+ bcc GOT_TZ1 ; If we were right, just skip on to do the work
+ lda TZ2_DOW ; Wrong guess, just load up the second time zone
+GOT_TZ1
+ jsr RELEASE ; Unlock so the rest of the system is happy
+ cmp #5 ; Time zone day of week is 0=Monday...6=Sunday
+ bhs DISABLE_ALL ; Saturday, Sunday - disable them all
+ ; Fall into ENABLE_ALL
+;---------------------------------------------------------------
+; Routine:
+; <A NAME="endoff_9">(9) ENABLE_ALL/DISABLE_ALL</A>
+; Parameters:
+; NONE
+; Purpose:
+; These routines enable/disable all of the alarms. It hides the disabled status of
+; the alarm by storing it in bit 3 of the alarm flags.
+; Bit0 = Alarm is enabled (SET=ENABLED)
+; Bit1 = Alarm is masked (SET=MASKED)
+; Bit2 = Current alarm is in 12 hour mode and is in the afternoon (SET=AFTERNOON)
+; Bit3 = Alarm was enabled, but we are hiding it (SET=HIDDEN)
+; It is safe to call these routine multiple times.
+;---------------------------------------------------------------
+ENABLE_ALL
+ ldx #4 ; We have 5 alarms to go through
+ENABLE_NEXT
+ lda ALARM_STATUS,X ; Get the flags for this alarm
+ lsra ; Shift right 3 to get our hidden bit into place
+ lsra
+ lsra
+ and #1 ; Mask out everything except the hidden bit (now in the enabled position
+ ora ALARM_STATUS,X ; Or it back into the flags
+ and #7 ; and clear out our hidden bit
+ sta ALARM_STATUS,X ; then save it out again.
+ decx ; Count down the number of alarms
+ bpl ENABLE_NEXT ; And go back for the next one
+ rts
+
+DISABLE_ALL
+ ldx #4 ; We have 5 alarms to go through
+DISABLE_NEXT
+ lda ALARM_STATUS,X ; Get the flags for this alarm
+ and #1 ; And extract our enabled bit
+ lsla ; Shift left 3 to save as our hidden bit
+ lsla
+ lsla
+ ora ALARM_STATUS,X ; Or it back into the flags
+ and #$0e ; and clear out the enabled bit
+ sta ALARM_STATUS,X ; then save it out again.
+ decx ; Count down the number of alarms
+ bpl DISABLE_NEXT ; And go back for the next one
+ rts
diff --git a/from_pkg/flash.zsm b/from_pkg/flash.zsm
new file mode 100644
index 0000000..e1dc14a
--- /dev/null
+++ b/from_pkg/flash.zsm
@@ -0,0 +1,135 @@
+;Name: Flash
+;Version: FLASH
+;Description: by John A. Toebes, VIII
+;This is a simple number update/flash program
+;
+;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"
+;
+; <A NAME="flash_1">(1) Program specific constants</A>
+;
+FLAGBYTE EQU $61
+; Bit 1 indicates that we need to clear the display first
+;
+CURVAL EQU $62 ; The current value we are displaying
+;
+; <A NAME="flash_2">(2) System entry point vectors</A>
+;
+START EQU *
+L0110: jmp MAIN ; The main entry point - <A HREF="wristappformat.html#WRIST_MAIN">WRIST_MAIN</A>
+L0113: rts ; Called when we are suspended for any reason - <A HREF="wristappformat.html#WRIST_SUSPEND">WRIST_SUSPEND</A>
+ nop
+ nop
+L0116: rts ; Called to handle any timers or time events - <A HREF="wristappformat.html#WRIST_DOTIC">WRIST_DOTIC</A>
+ nop
+ nop
+L0119: rts ; Called when the COMM app starts and we have timers pending - <A HREF="wristappformat.html#WRIST_INCOMM">WRIST_INCOMM</A>
+ nop
+ nop
+L011c: rts ; Called when the COMM app loads new data - <A HREF="wristappformat.html#WRIST_NEWDATA">WRIST_NEWDATA</A>
+ nop
+ nop
+
+L011f: lda STATETAB,X ; The state table get routine - <A HREF="wristappformat.html#WRIST_GETSTATE">WRIST_GETSTATE</A>
+ rts
+
+L0123: jmp HANDLE_STATE0
+ db STATETAB-STATETAB
+;
+; <A NAME="flash_3">(3) Program strings</A>
+S6_FLASH: timex6 "FLASH "
+S6_SAMPLE: timex6 "SAMPLE"
+;
+; <A NAME="flash_4">(4) State Table</A>
+;
+STATETAB:
+ db 0
+ db EVT_ENTER,TIM2_8TIC,0 ; Initial state
+ db EVT_TIMER2,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_DNANY4,TIM_ONCE,0 ; NEXT, PREV, SET, MODE button pressed
+ db EVT_UPANY4,TIM_ONCE,0 ; NEXT, PREV, SET, MODE button released
+ db EVT_END
+;
+; <A NAME="flash_5">(5) State Table 0 Handler</A>
+; This is called to process the state events.
+; We see ENTER, TIMER2, RESUME, DNANY4 and UPANY4 events
+;
+HANDLE_STATE0:
+ bset 1,APP_FLAGS ; Indicate that we can be suspended
+ lda BTNSTATE ; Get the event
+ cmp #EVT_DNANY4 ; Did they press a button?
+ bne CHKENTER ; No, pass on to see what else there might be
+ 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_SET ; Perhaps the SET button
+ beq DO_SET ; If so, handle it
+ ; In reality, we can't reach here since we handled all three buttons
+ ; in the above code (the MODE button is handled before we get here and the
+ ; GLOW button doesn't send in an event for this). We can just fall through
+ ; and take whatever we get from it.
+CHKENTER
+ cmp #EVT_ENTER ; Is this our initial entry?
+ bne REFRESH
+;
+; This is the initial event for starting us
+;
+DO_ENTER
+ bclr 1,FLAGBYTE ; Indicate that we need to clear the display
+ jsr CLEARSYM ; Clear the display
+ lda #S6_FLASH-START
+ jsr PUT6TOP
+ lda #S6_SAMPLE-START
+ jsr PUT6MID
+ lda #SYS8_MODE
+ jmp PUTMSGBOT
+;
+; <A NAME="flash_6">(6) Our real working code...</A>
+
+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
+ clra
+ sta UPDATE_MIN ; Our low end is 0
+ lda #99
+ sta UPDATE_MAX ; and the high end is 99 (the max since this is a 2 digit value)
+ ldx #CURVAL ; Point to our value to be updated
+ lda #UPD_MID34 ; Request updating in the middle of the display
+ jsr START_UPDATEP ; And prepare the update routine
+ bset 4,BTNFLAGS ; Mark that the update is now pending
+ bclr 1,FLAGBYTE
+ lda #SYS8_SET_MODE
+ jmp PUTMSGBOT
+
+DO_SET
+ clr CURVAL ; When they hit the set button, we just clear to zero
+SHOWVAL
+ brset 1,FLAGBYTE,NOCLEAR ; Do we need to clear the display first?
+REFRESH
+ jsr CLEARALL ; Yes, clear everything before we start
+ bset 1,FLAGBYTE ; And remember that we have already done that
+NOCLEAR
+ bclr 7,BTNFLAGS ; Turn off any update routine that might be pending
+ ldx #CURVAL
+ lda #BLINK_MID34
+ jsr START_BLINKP
+ bset 2,BTNFLAGS ; Mark a blink routine as pending
+ rts
+;
+; <A NAME="flash_7">(7) This is the main initialization routine which is called when we first get the app into memory</A>
+;
+MAIN:
+ lda #$c0 ; We want button beeps and to indicate that we have been loaded
+ sta WRISTAPP_FLAGS
+ clr FLAGBYTE ; start with a clean slate
+ clr CURVAL
+ rts
diff --git a/from_pkg/hello.zsm b/from_pkg/hello.zsm
new file mode 100644
index 0000000..ad6f4c8
--- /dev/null
+++ b/from_pkg/hello.zsm
@@ -0,0 +1,77 @@
+;Name: Hello World
+;Version: HELLO
+;Description: This is a simple Hello Program
+;by John A. Toebes, VIII
+;
+;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"
+;
+; Program specific constants
+;
+FLAGBYTE EQU $61
+; Bit 0 indicates that we want to show the segments instead of the message
+;
+START EQU *
+L0110: jmp MAIN
+L0113: rts
+ nop
+ nop
+L0116: rts
+ nop
+ nop
+L0119: rts
+ nop
+ nop
+L011c: rts
+ nop
+ nop
+
+L011f: lda STATETAB,X
+ rts
+
+L0123: jmp HANDLE_STATE0
+ db STATETAB-STATETAB
+
+S6_HELLO: timex6 "HELLO "
+S6_WORLD: timex6 "WORLD "
+
+;
+;
+STATETAB:
+ db 0
+ db EVT_ENTER,TIM_ONCE,0 ; Initial state
+ db EVT_RESUME,TIM_ONCE,0 ; Resume from a nested app
+ db EVT_DNNEXT,TIM_ONCE,0 ; Next button
+ db EVT_MODE,TIM_ONCE,$FF ; Mode button
+ db EVT_END
+;
+; This
+HANDLE_STATE0:
+ bset 1,$8f ; Indicate that we can be suspended
+ lda BTNSTATE ; Get the event
+ cmp #EVT_DNNEXT ; Did they press the next button?
+ beq DOTOGGLE ; Yes, toggle what we are displaying
+CLEARIT bclr 0,FLAGBYTE ; Start us in the show display state
+REFRESH brclr 0,FLAGBYTE,SHOWDISP ; Do we want to see the main display?
+ jmp SETALL ; No, just turn on all segments
+SHOWDISP jsr CLEARALL ; Clear the display
+ lda #S6_HELLO-START
+ jsr PUT6TOP
+ lda #S6_WORLD-START
+ jsr PUT6MID
+ lda #SYS8_MODE
+ jmp PUTMSGBOT
+
+DOTOGGLE brset 0,FLAGBYTE,CLEARIT
+ bset 0,FLAGBYTE
+ bra REFRESH
+;
+; 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 $96
+ clr FLAGBYTE ; start with a clean slate
+ rts
diff --git a/from_pkg/hexdump.zsm b/from_pkg/hexdump.zsm
new file mode 100644
index 0000000..3924dc6
--- /dev/null
+++ b/from_pkg/hexdump.zsm
@@ -0,0 +1,322 @@
+;Name: Hex Dump
+;Version: HEXDUMP
+;Description: Hex Dumper - by John A. Toebes, VIII
+;This Hex dump routine is a simple thing to test out dumping hex bytes...
+;
+; Press the NEXT/PREV buttons to advance/backup by 6 bytes of memory at a time
+; Press the SET button to change the location in memory where you are dumping.
+;
+;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"
+;
+; <A NAME="hexdump_1">(1) Program specific constants</A>
+;
+FLAGBYTE EQU $61
+; Bit 0 indicates the direction of the last button
+; The other bits are not used
+CURRENT_DIGIT EQU $62
+DIGIT0 EQU $63
+DIGIT1 EQU $64
+DIGIT2 EQU $65
+DIGIT3 EQU $66
+;
+;
+; <A NAME="hexdump_2">(2) System entry point vectors</A>
+;
+START EQU *
+L0110: jmp MAIN ; The main entry point - <A HREF="wristappformat.html#WRIST_MAIN">WRIST_MAIN</A>
+L0113: rts ; Called when we are suspended for any reason - <A HREF="wristappformat.html#WRIST_SUSPEND">WRIST_SUSPEND</A>
+ nop
+ nop
+L0116: rts ; Called to handle any timers or time events - <A HREF="wristappformat.html#WRIST_DOTIC">WRIST_DOTIC</A>
+ nop
+ nop
+L0119: rts ; Called when the COMM app starts and we have timers pending - <A HREF="wristappformat.html#WRIST_INCOMM">WRIST_INCOMM</A>
+ nop
+ nop
+L011c: rts ; Called when the COMM app loads new data - <A HREF="wristappformat.html#WRIST_NEWDATA">WRIST_NEWDATA</A>
+ nop
+ nop
+
+L011f: lda STATETAB0,X ; The state table get routine - <A HREF="wristappformat.html#WRIST_GETSTATE">WRIST_GETSTATE</A>
+ rts
+
+L0123: jmp HANDLE_STATE0
+ db STATETAB0-STATETAB0
+L0127: jmp HANDLE_STATE1
+ db STATETAB1-STATETAB0
+L012b: jmp HANDLE_STATE2
+ db STATETAB2-STATETAB0
+;
+; <A NAME="hexdump_3">(3) Program strings</A>
+;
+S6_BYTE: timex6 " BYTE "
+S6_DUMPER: timex6 "DUMPER"
+S8_LOCATION timex "aaaa "
+;
+; <A NAME="hexdump_4">(4) State Table</A>
+;
+STATETAB0:
+ db 0
+ db EVT_ENTER,TIM2_12TIC,0 ; Initial state
+ db EVT_RESUME,TIM_ONCE,0 ; Resume from a nested app
+ db EVT_TIMER2,TIM_ONCE,0 ; This is the timer
+ db EVT_DNNEXT,TIM2_8TIC,1 ; Next button
+ db EVT_DNPREV,TIM2_8TIC,1 ; Prev button
+ db EVT_MODE,TIM_ONCE,$FF ; Mode button
+ db EVT_SET,TIM_ONCE,2 ; Set button
+ db EVT_USER0,TIM_ONCE,$FF ; Return to system
+ db EVT_END
+
+STATETAB1:
+ db 0
+ db EVT_UPANY,TIM_ONCE,0 ; Releasing the prev or next button
+ db EVT_TIMER2,TIM2_TIC,1 ; Repeat operation with a timer
+ db EVT_END ; End of table
+
+STATETAB2:
+ db 2
+ db EVT_RESUME,TIM_ONCE,2 ; Resume from a nested app
+ db EVT_DNANY4,TIM_ONCE,2 ; NEXT, PREV, SET, MODE button pressed
+ db EVT_UPANY4,TIM_ONCE,2 ; NEXT, PREV, SET, MODE button released
+ db EVT_USER2,TIM_ONCE,0 ; Return to state 0
+ db EVT_END ; End of table
+
+;
+; <A NAME="hexdump_5">(5) State Table 0 Handler</A>
+; 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_ENTER ; Is this the initial state?
+ bne SHOWDATA ; no, just clean up the screen
+;
+; <A NAME="hexdump_6">(6) Put up the initial banner screen</A>
+;
+ jsr CLEARALL ; Clear the display
+ lda #S6_BYTE-START ; Put ' BYTE ' on the top line
+ jsr PUT6TOP
+ lda #S6_DUMPER-START ; Put 'DUMPER' on the second line
+ jsr PUT6MID
+ lda #SYS8_MODE ; Put MODE on the bottom line
+ jmp PUTMSGBOT
+; <A NAME="hexdump_7">(7) FMTHEX is a routine similar to FMTX, but it handles hex values instead</A>
+;=======================================================================
+; Routine: FMTHEX
+; Purpose:
+; Format a byte into the buffer
+; Parameters:
+; A - Byte to be formatted
+; X - Offset into Message buffer to put the byte
+;=======================================================================
+FMTHEX:
+ sta S8_LOCATION,X ; Save the byte
+ and #$0f ; Extract the bottom nibble
+ sta S8_LOCATION+1,X ; Save the hex value of the nibble
+ lda S8_LOCATION,X ; Get the value once again
+ lsra ; Shift right by 4 to get the high order nibble
+ lsra
+ lsra
+ lsra
+
+ sta S8_LOCATION,X ; And put it back into the buffer
+ rts
+;
+; <A NAME="hexdump_8">(8) This is called when we press the prev/next button or when the timer fires during that event</A>
+;
+HANDLE_STATE1:
+ lda BTNSTATE
+ cmp #EVT_TIMER2 ; Is this a repeat/timer event?
+ beq REPEATBTN ; yes, do as they asked
+
+ bclr 0,FLAGBYTE ; Assume that they hit the prev button
+ cmp #EVT_DNPREV ; Did they hit the prev button
+ bne REPEATBTN ; Yes, we guessed right
+ bset 0,FLAGBYTE ; No, they hit next. Mark the direction.
+REPEATBTN:
+ brclr 0,FLAGBYTE,NEXTLOC ; If they hit the next button, go do that operation
+;
+; They pressed the prev button, let's go to the previous location
+;
+PREVLOC:
+ lda CURRENT_LOC+1
+ sub #6
+ sta CURRENT_LOC+1
+ lda CURRENT_LOC
+ sbc #0
+ sta CURRENT_LOC
+ bra SHOWDATA
+NEXTLOC:
+ lda #6
+ add CURRENT_LOC+1
+ sta CURRENT_LOC+1
+ lda CURRENT_LOC
+ adc #0
+ sta CURRENT_LOC
+;
+; <A NAME="hexdump_9">(9) This is the main screen update routine.</A>
+; It dumps the current memory bytes based on the current address. Note that since it updates the entire
+; display, it doesn't have to clear anything
+;
+SHOWDATA:
+ jsr CLEARSYM
+
+ clrx
+ bsr GETBYTE
+ jsr PUTTOP12
+
+ ldx #1
+ bsr GETBYTE
+ jsr PUTTOP34
+
+ ldx #2
+ bsr GETBYTE
+ jsr PUTTOP56
+
+ ldx #3
+ bsr GETBYTE
+ jsr PUTMID12
+
+ ldx #4
+ bsr GETBYTE
+ jsr PUTMID34
+
+ ldx #5
+ bsr GETBYTE
+ jsr PUTMID56
+
+ lda CURRENT_LOC ; Get the high order byte of the address
+ clrx
+ bsr FMTHEX ; Put that at the start of the buffer
+ lda CURRENT_LOC+1 ; Get the low order byte of the address
+ ldx #2
+ bsr FMTHEX ; Put that next in the buffer
+
+ lda #S8_LOCATION-START
+ jmp BANNER8
+; <A NAME="hexdump_10">(10) GETBYTE gets a byte from memory and formats it as a hex value</A>
+;=======================================================================
+; Routine: GETBYTE
+; Purpose:
+; Read a byte from memory and put it into DATDIGIT1/DATDIGIT2 as hex values
+; Parameters:
+; X - Offset from location to read byte
+; CURRENT_LOC - Base location to read from
+;=======================================================================
+GETBYTE
+CURRENT_LOC EQU *+1 ; Self modifying code... Point to what we want to modify
+ lda $4000,X ; Get the current byte
+ sta DATDIGIT2 ; And save it away
+ lsra ; Extract the high nibble
+ lsra
+ lsra
+ lsra
+
+ sta DATDIGIT1 ; And save it
+ lda DATDIGIT2 ; Get the byte again
+ and #$0f ; Extract the low nibble
+ sta DATDIGIT2 ; And save it
+ rts
+;
+; <A NAME="hexdump_11">(11) State Table 2 Handler</A>
+; This is called to process the state events.
+; We see SET, RESUME, DNANY4, and UPANY4 events
+;
+HANDLE_STATE2:
+ bset 1,APP_FLAGS ; Indicate that we can be suspended
+ lda BTNSTATE ; Get the event
+ cmp #EVT_UPANY4
+ beq REFRESH2
+ cmp #EVT_DNANY4 ; Is this our initial entry?
+ bne FORCEFRESH
+ 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
+ bsr SHOWDATA
+ lda #EVT_USER2
+ jmp POSTEVENT
+;
+; <A NAME="hexdump_12">(12) This handles the update routine to change a digit...</A>
+;
+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
+ clra
+ sta UPDATE_MIN ; Our low end is 0
+ lda #$F
+ sta UPDATE_MAX ; and the high end is 15 (the hes digits 0-F)
+ bsr GET_DISP_PARM
+ lda #UPD_DIGIT
+ jsr START_UPDATEP ; And prepare the update routine
+ bset 4,BTNFLAGS ; Mark that the update is now pending
+ rts
+;
+; <A NAME="hexdump_13">(13) This is where we switch which digit we are changing...</A>
+;
+DO_MODE
+ lda CURRENT_DIGIT
+ inca
+ and #3
+ sta CURRENT_DIGIT
+;
+; <A NAME="hexdump_14">(14) Refresh the screen and start blinking the current digit...</A>
+;
+REFRESH2
+ lda DIGIT0 ; Get the first digit
+ lsla ; *16
+ lsla
+ lsla
+ lsla
+ add DIGIT1 ; Plus the second digit
+ sta CURRENT_LOC ; To make the high byte of the address
+ lda DIGIT2 ; Get the third digit
+ lsla ; *16
+ lsla
+ lsla
+ lsla
+ add DIGIT3 ; Plus the fourth digit
+ sta CURRENT_LOC+1 ; To make the low byte of the address
+FORCEFRESH
+ bclr 7,BTNFLAGS ; Turn off any update routine that might be pending
+ jsr SHOWDATA ; Format the screen
+ ldx #4 ; We need to copy over 4 bytes from the buffer
+COPYIT
+ decx ; This will be one down.
+ lda S8_LOCATION,X ; Get the formatted byte
+ sta DIGIT0,X ; And store it for the update routine
+ tstx ; Did we copy enough bytes?
+ bne COPYIT ; No, go back for more
+ bsr GET_DISP_PARM ; Get the parm for the blink routine
+ lda #BLINK_DIGIT ; Request to blink a digit
+ jsr START_BLINKP ; And do it
+ bset 2,BTNFLAGS ; Mark a blink routine as pending
+ rts
+;
+; <A NAME="hexdump_15">(15) This gets the parameters for an UPDATE/BLINK routine</A>
+;
+GET_DISP_PARM
+ lda CURRENT_DIGIT ; Figure out what digit we are dumping
+ sta UPDATE_POS ; Store it for the BLINK/UPDATE routine
+ add #DIGIT0 ; Point to the byte to be updated
+ tax ; And put it into X as needed for the parameter
+ rts
+;
+; <A NAME="hexdump_16">(16) This is the main initialization routine which is called when we first get the app into memory</A>
+;
+MAIN:
+ lda #$c0 ; We want button beeps and to indicate that we have been loaded
+ sta WRISTAPP_FLAGS
+ clr CURRENT_DIGIT ; Start out on the first digit
+ rts
diff --git a/from_pkg/number.zsm b/from_pkg/number.zsm
new file mode 100644
index 0000000..e2ecde0
--- /dev/null
+++ b/from_pkg/number.zsm
@@ -0,0 +1,110 @@
+;Name: Numbers
+;Version: NUMBER
+;Description: This is a simple number count program
+;by John A. Toebes, VIII
+;
+;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"
+;
+; Program specific constants
+;
+FLAGBYTE EQU $61
+; Bit 0 indicates that we want to show the segments instead of the message
+;
+CURVAL EQU $62 ; The current value we are displaying
+START EQU *
+L0110: jmp MAIN
+L0113: rts
+ nop
+ nop
+L0116: rts
+ nop
+ nop
+L0119: rts
+ nop
+ nop
+L011c: rts
+ nop
+ nop
+
+L011f: lda STATETAB,X
+ rts
+
+L0123: jmp HANDLE_STATE0
+ db STATETAB-STATETAB
+
+S6_NUMBER: timex6 "NUMBER"
+S6_COUNT: timex6 "COUNT "
+
+;
+;
+STATETAB:
+ db 0
+ db EVT_ENTER,TIM2_8TIC,0 ; Initial state
+ db EVT_TIMER2,TIM_ONCE,0 ; The timer from the enter event
+ db EVT_RESUME,TIM_ONCE,0 ; Resume from a nested app
+ db EVT_DNNEXT,TIM_ONCE,0 ; Next button
+ db EVT_DNPREV,TIM_ONCE,0 ; Prev button
+ db EVT_DNSET,TIM_ONCE,0 ; Set button
+ db EVT_MODE,TIM_ONCE,$FF ; Mode button
+ db EVT_END
+;
+; This
+HANDLE_STATE0:
+ bset 1,APP_FLAGS ; Indicate that we can be suspended
+ lda BTNSTATE ; Get the event
+ cmp #EVT_DNNEXT ; Did they press the next button?
+ beq DO_NEXT ; Yes, increment the counter
+ cmp #EVT_DNPREV ; How about the PREV button
+ beq DO_PREV ; handle it
+ cmp #EVT_DNSET ; Maybe the set button?
+ beq DO_SET ; Deal with it!
+ cmp #EVT_ENTER ; Is this our initial entry?
+ bne REFRESH
+;
+; This is the initial event for starting us
+;
+DO_ENTER
+ bclr 1,FLAGBYTE ; Indicate that we need to clear the display
+ jsr CLEARSYM ; Clear the display
+ lda #S6_NUMBER-START
+ jsr PUT6TOP
+ lda #S6_COUNT-START
+ jsr PUT6MID
+ lda #SYS8_MODE
+ jmp PUTMSGBOT
+
+DO_NEXT inc CURVAL
+ lda CURVAL
+ cmp #100
+ bne SHOWVAL
+DO_SET
+ clr CURVAL
+SHOWVAL
+ brset 1,FLAGBYTE,NOCLEAR
+REFRESH
+ jsr CLEARALL
+ bset 1,FLAGBYTE
+NOCLEAR
+ ldx CURVAL
+ jsr FMTXLEAD0
+ jmp PUTMID34
+DO_PREV
+ lda CURVAL
+ beq WRAPUP
+ dec CURVAL
+ bra SHOWVAL
+WRAPUP lda #99
+ sta CURVAL
+ bra SHOWVAL
+;
+; 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
+ clr FLAGBYTE ; start with a clean slate
+ clr CURVAL
+ rts
diff --git a/from_pkg/passwd.zsm b/from_pkg/passwd.zsm
new file mode 100644
index 0000000..b6a2f8a
--- /dev/null
+++ b/from_pkg/passwd.zsm
@@ -0,0 +1,232 @@
+;Name: Password
+;Version: PASSWD
+;Description: This is a simple number update/passwd program
+;by John A. Toebes, VIII
+;
+;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"
+;
+; <A NAME="passwd_1">(1) Program specific constants</A>
+;
+FLAGBYTE EQU $61
+; Bit 0 indicates which digit we are working on (SET=SECOND DIGIT)
+; Bit 1 indicates that we need to clear the display first
+;
+DIGIT0 EQU $62 ; The first digit to enter
+DIGIT1 EQU $63 ; The second digit to enter
+SYSTEMP0 EQU $A0
+SYSTEMP1 EQU $A1
+;
+; <A NAME="passwd_2">(2) System entry point vectors</A>
+;
+START EQU *
+L0110: jmp MAIN ; The main entry point - <A HREF="wristappformat.html#WRIST_MAIN">WRIST_MAIN</A>
+L0113: rts ; Called when we are suspended for any reason - <A HREF="wristappformat.html#WRIST_SUSPEND">WRIST_SUSPEND</A>
+ nop
+ nop
+L0116: rts ; Called to handle any timers or time events - <A HREF="wristappformat.html#WRIST_DOTIC">WRIST_DOTIC</A>
+ nop
+ nop
+L0119: rts ; Called when the COMM app starts and we have timers pending - <A HREF="wristappformat.html#WRIST_INCOMM">WRIST_INCOMM</A>
+ nop
+ nop
+L011c: rts ; Called when the COMM app loads new data - <A HREF="wristappformat.html#WRIST_NEWDATA">WRIST_NEWDATA</A>
+ nop
+ nop
+
+L011f: lda STATETAB0,X ; The state table get routine - <A HREF="wristappformat.html#WRIST_GETSTATE">WRIST_GETSTATE</A>
+ rts
+
+L0123: jmp HANDLE_STATE0
+ db STATETAB0-STATETAB0
+L0127: jmp HANDLE_STATE1
+ db STATETAB1-STATETAB0
+;
+; <A NAME="passwd_3">(3) Program strings</A>
+S6_TOEBES: timex6 "TOEBES"
+S6_SAMPLE: timex6 "SAMPLE"
+S6_PRESS: timex6 "PRESS "
+S8_PASSWORD: timex "PASSWORD"
+SX_MESSAGE timex "BY JOHN A. TOEBES, VIII"
+ db SEPARATOR
+;
+; <A NAME="passwd_4">(4) State Table</A>
+;
+STATETAB0:
+ db 0
+ db EVT_ENTER,TIM2_8TIC,0 ; Initial state
+ db EVT_TIMER2,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_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_END
+;
+; <A NAME="passwd_5">(5) State Table 0 Handler</A>
+; 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_ENTER ; Is this our initial entry?
+ bne REFRESH0
+;
+; This is the initial event for starting us
+;
+DO_ENTER
+ bclr 1,FLAGBYTE ; Indicate that we need to clear the display
+ jsr CLEARSYM ; Clear the display
+ lda #S6_TOEBES-START
+ jsr PUT6TOP
+ lda #S6_SAMPLE-START
+ jsr PUT6MID
+ lda #S8_PASSWORD-START
+ jmp BANNER8
+;
+; We come here for a RESUME or TIMER2 event. For this we want to reset the display
+;
+REFRESH0
+ brset 1,FLAGBYTE,NOCLEAR0 ; Do we need to clear the display first?
+ bset 1,FLAGBYTE
+ jsr CLEARSYM
+NOCLEAR0
+ lda #S6_PRESS-START
+ jsr PUT6TOP
+ lda #SYS6_SET
+ jsr PUTMSG2
+ lda #SX_MESSAGE-START
+ jmp SETUP_SCROLL
+;
+; <A NAME="passwd_6">(6) State Table 1 Handler</A>
+; This is called to process the state events.
+; We see SET, RESUME, DNANY4, and UPANY4 events
+;
+HANDLE_STATE1:
+ bset 1,APP_FLAGS ; Indicate that we can be suspended
+ lda BTNSTATE ; Get the event
+ cmp #EVT_UPANY4
+ beq REFRESH
+ cmp #EVT_DNANY4 ; Is this our initial entry?
+ bne FORCEFRESH
+ 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
+;
+; <A NAME="passwd_7">(7) Our real working code...</A>
+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
+ clra
+ sta UPDATE_MIN ; Our low end is 0
+ lda #99
+ sta UPDATE_MAX ; and the high end is 99 (the max since this is a 2 digit value)
+ brset 0,FLAGBYTE,UPD1
+ ldx DIGIT1
+ jsr FMTXLEAD0
+ jsr PUTMID34
+ ldx #DIGIT0 ; Point to our value to be updated
+ lda #UPD_MID12 ; Request updating in the middle of the display
+ bra UPD2
+UPD1
+ ldx DIGIT0
+ jsr FMTXLEAD0
+ jsr PUTMID12
+ ldx #DIGIT1
+ lda #UPD_MID34
+UPD2
+ jsr START_UPDATEP ; And prepare the update routine
+ bset 4,BTNFLAGS ; Mark that the update is now pending
+ bclr 1,FLAGBYTE
+ lda #SYS8_SET_MODE
+ jmp PUTMSGBOT
+
+DO_MODE
+ lda FLAGBYTE
+ eor #1
+ sta FLAGBYTE
+
+REFRESH
+ brset 1,FLAGBYTE,NOCLEAR ; Do we need to clear the display first?
+FORCEFRESH
+ jsr CLEARALL ; Yes, clear everything before we start
+ bset 1,FLAGBYTE ; And remember that we have already done that
+NOCLEAR
+ bclr 7,BTNFLAGS ; Turn off any update routine that might be pending
+ brset 0,FLAGBYTE,SET1
+ ldx DIGIT1
+ jsr FMTXLEAD0
+ jsr PUTMID34
+ ldx #DIGIT0
+ lda #BLINK_MID12
+ bra SET2
+SET1
+ ldx DIGIT0
+ jsr FMTXLEAD0
+ jsr PUTMID12
+ ldx #DIGIT1
+ lda #BLINK_MID34
+SET2
+ jsr START_BLINKP
+ bset 2,BTNFLAGS ; Mark a blink routine as pending
+ rts
+;
+; <A NAME="passwd_8">(8) This is the main initialization routine which is called when we first get the app into memory</A>
+;
+MAIN:
+ lda #$c0 ; We want button beeps and to indicate that we have been loaded
+ sta WRISTAPP_FLAGS
+ clr FLAGBYTE ; start with a clean slate
+ clr DIGIT0
+ clr DIGIT1
+ rts
+;
+; <A NAME="passwd_9">(9) This subroutine is useful for getting a scrolling string on the screen</A>
+;
+;----------------------------------------------------------------------
+; Routine:
+; SETUP_SCROLL
+; Parameters:
+; X - Offset from Start to the string
+; Returns:
+; MSGBUF - contains copied string
+; Purpose
+; This copies the current string into MSGBUF and calls the appropriate routines
+; to start it scrolling on the bottom line.
+;----------------------------------------------------------------------
+SETUP_SCROLL:
+ clr SYSTEMP0
+ sta SYSTEMP1
+DO_COPY:
+ ldx SYSTEMP1 ; Get the pointer to the source character
+ lda START,X ; Get the character that we are copying
+ ldx SYSTEMP0 ; Get the pointer to the output buffer
+ sta MSGBUF,X ; and store the character away
+ inc SYSTEMP0 ; Increment our count
+ inc SYSTEMP1 ; As well as the pointer to the character
+ cmp #SEPARATOR ; Did we get a terminator character
+ bne DO_COPY ; No, go back for more
+ ;
+ ; The string is now in a buffer terminated by a separator character
+ ;
+ jsr PUTSCROLLMSG ; Initialize the scrolling support
+ jmp SCROLLMSG ; And tell it to actually start scrolling
diff --git a/from_pkg/promdump.zsm b/from_pkg/promdump.zsm
new file mode 100644
index 0000000..d2eafb3
--- /dev/null
+++ b/from_pkg/promdump.zsm
@@ -0,0 +1,336 @@
+;Name: Prom Dump
+;Version: promdump
+;Description: Prom Dumper - by John A. Toebes, VIII
+;This Prom Dump routine shows you what is in the EEProm
+;
+; Press the NEXT/PREV buttons to advance/backup by 6 bytes of memory at a time
+; Press the SET button to change the location in memory where you are dumping.
+;
+;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"
+;
+; <A NAME="promdump_1">(1) Program specific constants</A>
+;
+FLAGBYTE EQU $61
+; Bit 0 indicates the direction of the last button
+; The other bits are not used
+CURRENT_DIGIT EQU $62
+DIGIT0 EQU $63
+DIGIT1 EQU $64
+DIGIT2 EQU $65
+DIGIT3 EQU $66
+;
+; These should have been in the Wristapp.i files, but I forgot them...
+;
+INST_ADDRHI EQU $0437
+INST_ADDRLO EQU $0438
+HW_FLAGS EQU $9e
+;
+;
+; <A NAME="promdump_2">(2) System entry point vectors</A>
+;
+START EQU *
+L0110: jmp MAIN ; The main entry point - <A HREF="wristappformat.html#WRIST_MAIN">WRIST_MAIN</A>
+L0113: rts ; Called when we are suspended for any reason - <A HREF="wristappformat.html#WRIST_SUSPEND">WRIST_SUSPEND</A>
+ nop
+ nop
+L0116: rts ; Called to handle any timers or time events - <A HREF="wristappformat.html#WRIST_DOTIC">WRIST_DOTIC</A>
+ nop
+ nop
+L0119: rts ; Called when the COMM app starts and we have timers pending - <A HREF="wristappformat.html#WRIST_INCOMM">WRIST_INCOMM</A>
+ nop
+ nop
+L011c: rts ; Called when the COMM app loads new data - <A HREF="wristappformat.html#WRIST_NEWDATA">WRIST_NEWDATA</A>
+ nop
+ nop
+
+L011f: lda STATETAB0,X ; The state table get routine - <A HREF="wristappformat.html#WRIST_GETSTATE">WRIST_GETSTATE</A>
+ rts
+
+L0123: jmp HANDLE_STATE0
+ db STATETAB0-STATETAB0
+L0127: jmp HANDLE_STATE1
+ db STATETAB1-STATETAB0
+L012b: jmp HANDLE_STATE2
+ db STATETAB2-STATETAB0
+;
+; <A NAME="promdump_3">(3) Program strings</A>
+;
+S6_EEPROM: timex6 "EEPROM"
+S6_DUMPER: timex6 "DUMPER"
+S8_LOCATION timex "aaaa "
+;
+; <A NAME="promdump_4">(4) State Table</A>
+;
+STATETAB0:
+ db 0
+ db EVT_ENTER,TIM2_12TIC,0 ; Initial state
+ db EVT_RESUME,TIM_ONCE,0 ; Resume from a nested app
+ db EVT_TIMER2,TIM_ONCE,0 ; This is the timer
+ db EVT_DNNEXT,TIM2_8TIC,1 ; Next button
+ db EVT_DNPREV,TIM2_8TIC,1 ; Prev button
+ db EVT_MODE,TIM_ONCE,$FF ; Mode button
+ db EVT_SET,TIM_ONCE,2 ; Set button
+ db EVT_USER0,TIM_ONCE,$FF ; Return to system
+ db EVT_END
+
+STATETAB1:
+ db 0
+ db EVT_UPANY,TIM_ONCE,0 ; Releasing the prev or next button
+ db EVT_TIMER2,TIM2_TIC,1 ; Repeat operation with a timer
+ db EVT_END ; End of table
+
+STATETAB2:
+ db 2
+ db EVT_RESUME,TIM_ONCE,2 ; Resume from a nested app
+ db EVT_DNANY4,TIM_ONCE,2 ; NEXT, PREV, SET, MODE button pressed
+ db EVT_UPANY4,TIM_ONCE,2 ; NEXT, PREV, SET, MODE button released
+ db EVT_USER2,TIM_ONCE,0 ; Return to state 0
+ db EVT_END ; End of table
+
+CURRENT_LOC
+ dw $0000 ; This is where we start in memory
+;
+; <A NAME="promdump_5">(5) State Table 0 Handler</A>
+; 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_ENTER ; Is this the initial state?
+ bne SHOWDATA ; no, just clean up the screen
+;
+; <A NAME="promdump_6">(6) Put up the initial banner screen</A>
+;
+ jsr CLEARALL ; Clear the display
+ lda #S6_EEPROM-START ; Put 'EEPROM' on the top line
+ jsr PUT6TOP
+ lda #S6_DUMPER-START ; Put 'DUMPER' on the second line
+ jsr PUT6MID
+ lda #SYS8_MODE ; Put MODE on the bottom line
+ jmp PUTMSGBOT
+; <A NAME="promdump_7">(7) FMTHEX is a routine similar to FMTX, but it handles hex values instead</A>
+;=======================================================================
+; Routine: FMTHEX
+; Purpose:
+; Format a byte into the buffer
+; Parameters:
+; A - Byte to be formatted
+; X - Offset into Message buffer to put the byte
+;=======================================================================
+FMTHEX:
+ sta S8_LOCATION,X ; Save the byte
+ and #$0f ; Extract the bottom nibble
+ sta S8_LOCATION+1,X ; Save the hex value of the nibble
+ lda S8_LOCATION,X ; Get the value once again
+ lsra ; Shift right by 4 to get the high order nibble
+ lsra
+ lsra
+ lsra
+
+ sta S8_LOCATION,X ; And put it back into the buffer
+ rts
+;
+; <A NAME="promdump_8">(8) This is called when we press the prev/next button or when the timer fires during that event</A>
+;
+HANDLE_STATE1:
+ lda BTNSTATE
+ cmp #EVT_TIMER2 ; Is this a repeat/timer event?
+ beq REPEATBTN ; yes, do as they asked
+
+ bclr 0,FLAGBYTE ; Assume that they hit the prev button
+ cmp #EVT_DNPREV ; Did they hit the prev button
+ bne REPEATBTN ; Yes, we guessed right
+ bset 0,FLAGBYTE ; No, they hit next. Mark the direction.
+REPEATBTN:
+ brclr 0,FLAGBYTE,NEXTLOC ; If they hit the next button, go do that operation
+;
+; They pressed the prev button, let's go to the previous location
+;
+PREVLOC:
+ lda CURRENT_LOC+1
+ sub #6
+ sta CURRENT_LOC+1
+ lda CURRENT_LOC
+ sbc #0
+ sta CURRENT_LOC
+ bra SHOWDATA
+NEXTLOC:
+ lda #6
+ add CURRENT_LOC+1
+ sta CURRENT_LOC+1
+ lda CURRENT_LOC
+ adc #0
+ sta CURRENT_LOC
+;
+; <A NAME="promdump_9">(9) This is the main screen update routine.</A>
+; It dumps the current memory bytes based on the current address. Note that since it updates the entire
+; display, it doesn't have to clear anything
+;
+SHOWDATA:
+ jsr CLEARSYM
+
+ clrx
+ bsr GETBYTE
+ jsr PUTTOP12
+
+ ldx #1
+ bsr GETBYTE
+ jsr PUTTOP34
+
+ ldx #2
+ bsr GETBYTE
+ jsr PUTTOP56
+
+ ldx #3
+ bsr GETBYTE
+ jsr PUTMID12
+
+ ldx #4
+ bsr GETBYTE
+ jsr PUTMID34
+
+ ldx #5
+ bsr GETBYTE
+ jsr PUTMID56
+
+ lda CURRENT_LOC ; Get the high order byte of the address
+ clrx
+ bsr FMTHEX ; Put that at the start of the buffer
+ lda CURRENT_LOC+1 ; Get the low order byte of the address
+ ldx #2
+ bsr FMTHEX ; Put that next in the buffer
+
+ lda #S8_LOCATION-START
+ jmp BANNER8
+; <A NAME="promdump_10">(10) GETBYTE gets a byte from memory and formats it as a hex value</A>
+;=======================================================================
+; Routine: GETBYTE
+; Purpose:
+; Read a byte from memory and put it into DATDIGIT1/DATDIGIT2 as hex values
+; Parameters:
+; X - Offset from location to read byte
+; CURRENT_LOC - Base location to read from
+;=======================================================================
+GETBYTE
+ txa
+ add CURRENT_LOC+1
+ sta INST_ADDRLO
+ lda CURRENT_LOC
+ adc #0
+ sta INST_ADDRHI
+ bset 6,HW_FLAGS ; Tell them that it is an EEPROM address
+ jsr GET_INST_BYTE ; Get the current byte
+ sta DATDIGIT2 ; And save it away
+ lsra ; Extract the high nibble
+ lsra
+ lsra
+ lsra
+
+ sta DATDIGIT1 ; And save it
+ lda DATDIGIT2 ; Get the byte again
+ and #$0f ; Extract the low nibble
+ sta DATDIGIT2 ; And save it
+ rts
+;
+; <A NAME="promdump_11">(11) State Table 2 Handler</A>
+; This is called to process the state events.
+; We see SET, RESUME, DNANY4, and UPANY4 events
+;
+HANDLE_STATE2:
+ bset 1,APP_FLAGS ; Indicate that we can be suspended
+ lda BTNSTATE ; Get the event
+ cmp #EVT_UPANY4
+ beq REFRESH2
+ cmp #EVT_DNANY4 ; Is this our initial entry?
+ bne FORCEFRESH
+ 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
+ bsr SHOWDATA
+ lda #EVT_USER2
+ jmp POSTEVENT
+;
+; <A NAME="promdump_12">(12) This handles the update routine to change a digit...</A>
+;
+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
+ clra
+ sta UPDATE_MIN ; Our low end is 0
+ lda #$F
+ sta UPDATE_MAX ; and the high end is 15 (the hes digits 0-F)
+ bsr GET_DISP_PARM
+ lda #UPD_DIGIT
+ jsr START_UPDATEP ; And prepare the update routine
+ bset 4,BTNFLAGS ; Mark that the update is now pending
+ rts
+;
+; <A NAME="promdump_13">(13) This is where we switch which digit we are changing...</A>
+;
+DO_MODE
+ lda CURRENT_DIGIT
+ inca
+ and #3
+ sta CURRENT_DIGIT
+;
+; <A NAME="promdump_14">(14) Refresh the screen and start blinking the current digit...</A>
+;
+REFRESH2
+ lda DIGIT0 ; Get the first digit
+ lsla ; *16
+ lsla
+ lsla
+ lsla
+ add DIGIT1 ; Plus the second digit
+ sta CURRENT_LOC ; To make the high byte of the address
+ lda DIGIT2 ; Get the third digit
+ lsla ; *16
+ lsla
+ lsla
+ lsla
+ add DIGIT3 ; Plus the fourth digit
+ sta CURRENT_LOC+1 ; To make the low byte of the address
+FORCEFRESH
+ bclr 7,BTNFLAGS ; Turn off any update routine that might be pending
+ jsr SHOWDATA ; Format the screen
+ ldx #4 ; We need to copy over 4 bytes from the buffer
+COPYIT
+ decx ; This will be one down.
+ lda S8_LOCATION,X ; Get the formatted byte
+ sta DIGIT0,X ; And store it for the update routine
+ tstx ; Did we copy enough bytes?
+ bne COPYIT ; No, go back for more
+ bsr GET_DISP_PARM ; Get the parm for the blink routine
+ lda #BLINK_DIGIT ; Request to blink a digit
+ jsr START_BLINKP ; And do it
+ bset 2,BTNFLAGS ; Mark a blink routine as pending
+ rts
+;
+; <A NAME="promdump_15">(15) This gets the parameters for an UPDATE/BLINK routine</A>
+;
+GET_DISP_PARM
+ lda CURRENT_DIGIT ; Figure out what digit we are dumping
+ sta UPDATE_POS ; Store it for the BLINK/UPDATE routine
+ add #DIGIT0 ; Point to the byte to be updated
+ tax ; And put it into X as needed for the parameter
+ rts
+;
+; <A NAME="promdump_16">(16) This is the main initialization routine which is called when we first get the app into memory</A>
+;
+MAIN:
+ lda #$c0 ; We want button beeps and to indicate that we have been loaded
+ sta WRISTAPP_FLAGS
+ clr CURRENT_DIGIT ; Start out on the first digit
+ rts
diff --git a/from_pkg/sound.zsm b/from_pkg/sound.zsm
new file mode 100644
index 0000000..9e28066
--- /dev/null
+++ b/from_pkg/sound.zsm
@@ -0,0 +1,135 @@
+;Name: Sound Test
+;Version: SOUND0
+;Description: This is a sample program to just play a single tone
+;
+;TIP: Download your watch faster: Download a WristApp once, then do not send it again. It stays in the watch!
+;HelpFile: watchapp.hlp
+;HelpTopic: 102
+
+ INCLUDE "WRISTAPP.I"
+;
+; <A NAME="sound_1">(1) Program specific constants</A>
+;
+FLAGBYTE EQU $61
+; Bit 1 indicates that we need to clear the display first
+;
+CURVAL EQU $62 ; The current value we are displaying
+;
+; <A NAME="sound_2">(2) System entry point vectors</A>
+;
+START EQU *
+L0110: jmp MAIN ; The main entry point - <A HREF="wristappformat.html#WRIST_MAIN">WRIST_MAIN</A>
+L0113: rts ; Called when we are suspended for any reason - <A HREF="wristappformat.html#WRIST_SUSPEND">WRIST_SUSPEND</A>
+ nop
+ nop
+L0116: rts ; Called to handle any timers or time events - <A HREF="wristappformat.html#WRIST_DOTIC">WRIST_DOTIC</A>
+ nop
+ nop
+L0119: rts ; Called when the COMM app starts and we have timers pending - <A HREF="wristappformat.html#WRIST_INCOMM">WRIST_INCOMM</A>
+ nop
+ nop
+L011c: rts ; Called when the COMM app loads new data - <A HREF="wristappformat.html#WRIST_NEWDATA">WRIST_NEWDATA</A>
+ nop
+ nop
+
+L011f: lda STATETAB,X ; The state table get routine - <A HREF="wristappformat.html#WRIST_GETSTATE">WRIST_GETSTATE</A>
+ rts
+
+L0123: jmp HANDLE_STATE0
+ db STATETAB-STATETAB
+;
+; <A NAME="sound_3">(3) Program strings</A>
+S6_SOUND: timex6 "SOUND "
+S6_SAMPLE: timex6 "SAMPLE"
+;
+; <A NAME="sound_4">(4) State Table</A>
+;
+STATETAB:
+ db 0
+ db EVT_ENTER,TIM2_8TIC,0 ; Initial state
+ db EVT_TIMER2,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_DNANY4,TIM_ONCE,0 ; NEXT, PREV, SET, MODE button pressed
+ db EVT_UPANY4,TIM_ONCE,0 ; NEXT, PREV, SET, MODE button released
+ db EVT_END
+;
+; <A NAME="sound_5">(5) State Table 0 Handler</A>
+; This is called to process the state events.
+; We see ENTER, TIMER2, RESUME, DNANY4 and UPANY4 events
+;
+HANDLE_STATE0:
+ bset 1,APP_FLAGS ; Indicate that we can be suspended
+ lda BTNSTATE ; Get the event
+ cmp #EVT_DNANY4 ; Did they press a button?
+ bne CHKENTER ; No, pass on to see what else there might be
+ 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_SET ; Perhaps the SET button
+ beq DO_SET ; If so, handle it
+ ; In reality, we can't reach here since we handled all three buttons
+ ; in the above code (the MODE button is handled before we get here and the
+ ; GLOW button doesn't send in an event for this). We can just fall through
+ ; and take whatever we get from it.
+CHKENTER
+ cmp #EVT_ENTER ; Is this our initial entry?
+ bne REFRESH
+;
+; This is the initial event for starting us
+;
+DO_ENTER
+ bclr 1,FLAGBYTE ; Indicate that we need to clear the display
+ jsr CLEARSYM ; Clear the display
+ lda #S6_SOUND-START
+ jsr PUT6TOP
+ lda #S6_SAMPLE-START
+ jsr PUT6MID
+ lda #SYS8_MODE
+ jmp PUTMSGBOT
+;
+; <A NAME="sound_6">(6) Our real working code...</A>
+
+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
+ clra
+ sta UPDATE_MIN ; Our low end is 0
+ lda #15
+ sta UPDATE_MAX ; and the high end is 15
+ ldx #CURVAL ; Point to our value to be updated
+ lda #UPD_MID34 ; Request updating in the middle of the display
+ jsr START_UPDATEP ; And prepare the update routine
+ bset 4,BTNFLAGS ; Mark that the update is now pending
+ bclr 1,FLAGBYTE
+ lda #SYS8_SET_MODE
+ jmp PUTMSGBOT
+
+DO_SET
+ clr CURVAL ; When they hit the set button, we just clear to zero
+SHOWVAL
+ brset 1,FLAGBYTE,NOCLEAR ; Do we need to clear the display first?
+REFRESH
+ jsr CLEARALL ; Yes, clear everything before we start
+ bset 1,FLAGBYTE ; And remember that we have already done that
+NOCLEAR
+ bclr 7,BTNFLAGS ; Turn off any update routine that might be pending
+ ldx #CURVAL
+ lda #BLINK_MID34
+ jsr START_BLINKP
+ bset 2,BTNFLAGS ; Mark a blink routine as pending
+ rts
+;
+; <A NAME="sound_7">(7) This is the main initialization routine which is called when we first get the app into memory</A>
+;
+MAIN:
+ lda #$c0 ; We want button beeps and to indicate that we have been loaded
+ sta WRISTAPP_FLAGS
+ clr FLAGBYTE ; start with a clean slate
+ clr CURVAL
+ rts
diff --git a/from_pkg/sound1.zsm b/from_pkg/sound1.zsm
new file mode 100644
index 0000000..d798940
--- /dev/null
+++ b/from_pkg/sound1.zsm
@@ -0,0 +1,83 @@
+;Sound: Datalink Default
+;Version: Sound1
+;
+; This sample corresponds to the default sounds that you get when you reset a datalink
+; watch to its default state.
+;
+;****************************************************************************************
+;* Copyright (C) 1997 John A. Toebes, VIII *
+;* All Rights Reserved *
+;* This program may not be distributed in any form without the permission of the author *
+;* jtoebes@geocities.com *
+;****************************************************************************************
+;
+ INCLUDE "WRISTAPP.I"
+;
+; This is the default sound table
+;
+DEF_SOUNDS
+ db SP_1-SD_1 ; 0000: 08
+
+ db SD_1-DEF_SOUNDS ; 0001: 0b BUTTON BEEP
+ db SD_2-DEF_SOUNDS ; 0002: 0c RETURN TO TIME
+ db SD_3-DEF_SOUNDS ; 0003: 0d HOURLY CHIME
+ db SD_4-DEF_SOUNDS ; 0004: 0e CONFIRMATION
+ db SD_5-DEF_SOUNDS ; 0005: 0f APPOINTMENT BEEP
+ db SD_5-DEF_SOUNDS ; 0006: 0f ALARM BEEP
+ db SD_5-DEF_SOUNDS ; 0007: 0f PROGRAM DOWNLOAD
+ db SD_5-DEF_SOUNDS ; 0008: 0f EXTRA
+ db SD_6-DEF_SOUNDS ; 0009: 11 COMM ERROR
+ db SD_7-DEF_SOUNDS ; 000a: 12 COMM DONE
+;
+; This is the <A HREF="#Soundlet_count_table">soundlet count table</A> which contains the duration
+; counts for the individual soundlets
+;
+SD_1 db SND_END+1 ; 000b: 81
+SD_2 db SND_END+1 ; 000c: 81
+SD_3 db SND_END+2 ; 000d: 82
+SD_4 db SND_END+4 ; 000e: 84
+SD_5 db 10,SND_END+40 ; 000f: 0a a8
+SD_6 db SND_END+10 ; 0011: 8a
+SD_7 db SND_END+32 ; 0012: a0
+;
+; This is the <A HREF="#Soundlet_pointer_table">soundlet pointer table</A> which contains the pointers to the soundlets
+;
+SP_1 db SL_2-DEF_SOUNDS ; 0013: 1d
+SP_2 db SL_1-DEF_SOUNDS ; 0014: 1b
+SP_3 db SL_3-DEF_SOUNDS ; 0015: 1f
+SP_4 db SL_2-DEF_SOUNDS ; 0016: 1d
+SP_5 db SL_4-DEF_SOUNDS ; 0017: 22
+ db SL_5-DEF_SOUNDS ; 0018: 27
+SP_6 db SL_6-DEF_SOUNDS ; 0019: 2a
+SP_7 db SL_2-DEF_SOUNDS ; 001a: 1d
+;
+; These are the <A HREF="#soundlet">soundlets</A> themselves. The +1 or other number
+; indicates the duration for the sound.
+;
+SL_1 db TONE_HI_GSHARP+1 ; 001b: 91
+ db TONE_END ; 001c: 00
+
+SL_2 db TONE_MID_C+1 ; 001d: 31
+ db TONE_END ; 001e: 00
+
+SL_3 db TONE_MID_C+2 ; 001f: 32
+ db TONE_PAUSE+2 ; 0020: f2
+ db TONE_END ; 0021: 00
+
+SL_4 db TONE_HI_C+2 ; 0022: 22
+ db TONE_PAUSE+2 ; 0023: f2
+ db TONE_HI_C+2 ; 0024: 22
+ db TONE_PAUSE+10 ; 0025: fa
+ db TONE_END ; 0026: 00
+
+SL_5 db TONE_HI_C+2 ; 0027: 22
+ db TONE_PAUSE+2 ; 0028: f2
+ db TONE_END ; 0029: 00
+
+SL_6 db TONE_HI_C+3 ; 002a: 23
+ db TONE_MID_C+3 ; 002b: 33
+ db TONE_END ; 002c: 00
+;
+; This is the tone that the comm app plays for each record
+;
+ db TONE_MID_C/16 ; 002d: 03
diff --git a/from_pkg/spend0.zsm b/from_pkg/spend0.zsm
new file mode 100644
index 0000000..ada28a1
--- /dev/null
+++ b/from_pkg/spend0.zsm
@@ -0,0 +1,656 @@
+;Name: spend watch
+;Version: spend0
+;Description: spend watch - by John A. Toebes, VIII
+;This keeps track of how much is in one of 7 categories
+;
+; Press the NEXT/PREV buttons to advance/backup through the categories
+; Press the SET button to add/subtract/set/clear the amounts in the categories
+; If you press the set button while the action is blinking, it will be carried out, otherwise
+; you can cancel the operation.
+;
+;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
+;Parent: SpendSet
+;****************************************************************************************
+;* Copyright (C) 1997 John A. Toebes, VIII *
+;* All Rights Reserved *
+;* This program may not be distributed in any form without the permission of the author *
+;* jtoebes@geocities.com *
+;****************************************************************************************
+;
+; History:
+; 31 July 96 - Corrected problem with totals not being recalculated when you reenter
+; the wristapp.
+;
+ INCLUDE "WRISTAPP.I"
+;
+; <A NAME="spend_1">(1) Program specific constants</A>
+;
+; We use a few extra bytes here in low memory. Since we can't possibly
+; be running while the COMM app is running, we have no chance of
+; conflicting with it's use of this memory.
+;
+BLINK_BUF EQU $5C ; 3 Byte Buffer for the blink routine
+; EQU $5D
+; EQU $5E
+CAT_SAVE EQU $5F ; Temporary counter variable
+COUNTER EQU $60 ; Temporary variable to hold the
+FLAGBYTE EQU $61
+; Bit 0 indicates that the display does not need to be cleared
+; The other bits are not used
+
+CURRENT_MODE EQU $62 ; The current mode that we are in
+MODE_SELECT EQU 0 ; Set mode, selecting which category to modify
+MODE_HUNDREDS EQU 1 ; Set mode, changing the hundreds of dollars digits
+MODE_DOLLARS EQU 2 ; Set mode, changing the dollars digits
+MODE_CENTS EQU 3 ; Set mode, changing the cents
+MODE_ACTION EQU 4 ; Set mode, changing the action
+MODE_VIEW EQU 5 ; Normal display mode
+
+CATEGORY EQU $63 ; Current category
+;
+; These three bytes need to be contiguous. The represent the current
+; value that is being operated on
+;
+HUNDREDS EQU $64
+DOLLARS EQU $65
+CENTS EQU $66
+
+ACTION EQU $67 ; Selector for the current action
+ACT_ADD EQU 0
+ACT_SUB EQU 1
+ACT_SET EQU 2
+ACT_CLEAR EQU 3
+AMT_BASE EQU $F0
+;
+;
+; <A NAME="spend_2">(2) System entry point vectors</A>
+;
+START EQU *
+L0110: jmp MAIN ; The main entry point - <A HREF="wristappformat.html#WRIST_MAIN">WRIST_MAIN</A>
+L0113: rts ; Called when we are suspended for any reason - <A HREF="wristappformat.html#WRIST_SUSPEND">WRIST_SUSPEND</A>
+ nop
+ nop
+L0116: jmp DO_UPD ; Called to handle any timers or time events - <A HREF="wristappformat.html#WRIST_DOTIC">WRIST_DOTIC</A>
+L0119: rts ; Called when the COMM app starts and we have timers pending - <A HREF="wristappformat.html#WRIST_INCOMM">WRIST_INCOMM</A>
+ nop
+ nop
+L011c: rts ; Called when the COMM app loads new data - <A HREF="wristappformat.html#WRIST_NEWDATA">WRIST_NEWDATA</A>
+ nop
+ nop
+
+L011f: lda STATETAB0,X ; The state table get routine - <A HREF="wristappformat.html#WRIST_GETSTATE">WRIST_GETSTATE</A>
+ rts
+
+L0123: jmp HANDLE_STATE
+ db STATETAB0-STATETAB0
+L0127: jmp HANDLE_STATE
+ db STATETAB1-STATETAB0
+;
+; <A NAME="spend_3">(3) Program strings</A>
+;
+; These strings represent the 4 possible actions. They need to be early on in the data segment so that
+; then can be pointed to by using 8-bit offset addressing. They are exactly 3 bytes long and are
+; displayed by using the BLINK_TZONE routine
+;
+S3_MODE:
+S3_ADD timex "ADD"
+S3_SUB timex "SUB"
+S3_SET timex "SET"
+S3_CLR timex "CLR"
+;
+; These are the categories that the end user has configured. They are set by using the SPENDSET program
+; which searches for the first string "TOTAL ". These strings must be exactly 8 bytes each in order with
+; total being the first one.
+;
+S8_TOTAL: timex "TOTAL "
+S8_CAT1: timex "CAT1 "
+S8_CAT2: timex "CAT2 "
+S8_CAT3: timex "CAT3 "
+S8_CAT4: timex "CAT4 "
+S8_CAT5: timex "CAT5 "
+S8_CAT6: timex "CAT6 "
+S8_CAT7: timex "CAT7 "
+;
+; These are the running amounts for each category. Note that you can actually
+; initialize them with some default and the code will run properly
+;
+AMT_TOTAL: db 0,0,0
+AMT_CAT1: db 0,0,0
+AMT_CAT2: db 0,0,0
+AMT_CAT3: db 0,0,0
+AMT_CAT4: db 0,0,0
+AMT_CAT5: db 0,0,0
+AMT_CAT6: db 0,0,0
+AMT_CAT7: db 0,0,0
+;
+; These strings prompt for the current mode that we are in. They are displayed on the top line of
+; the display.
+;
+S6_SELECT timex6 "SELECT"
+S6_AMOUNT timex6 "AMOUNT"
+S6_ACTION timex6 "ACTION"
+S6_SPEND: timex6 "SPEND" ; save a byte by leaching off the space on the start of the next string
+S6_WATCH: timex6 " WATCH"
+;
+; This table selects which string is to be displayed. It is directly indexed by the current mode
+;
+MSG_TAB db S6_SELECT-START ; 0 - MODE_SELECT
+ db S6_AMOUNT-START ; 1 - MODE_HUNDREDS
+ db S6_AMOUNT-START ; 2 - MODE_DOLLARS
+ db S6_AMOUNT-START ; 3 - MODE_CENTS
+ db S6_ACTION-START ; 4 - MODE_ACTION
+ db S6_SPEND-START ; 5 - MODE_VIEW
+;
+; This is one of the magic tricks for providing the source for the blink routine.
+; These are base pointers (offset from HUNDREDS) that we use to copy three bytes into
+; BLINK_BUF. The interesting one here is the MODE_CENTS entry which points to DATDIGIT1
+; This works because the last number that we format happens to be the cents amount,
+; and the blink routine expects the two characters instead of the actual value.
+;
+DATASRC db HUNDREDS-HUNDREDS ; 1 - MODE_HUNDREDS
+ db DOLLARS-HUNDREDS ; 2 - MODE_DOLLARS
+ db DATDIGIT1-HUNDREDS ; 3 - MODE_CENTS
+ db S3_ADD-HUNDREDS ; 4 - MODE_ACTION 0 - ACT_ADD
+ db S3_SUB-HUNDREDS ; 4 - MODE_ACTION 1 - ACT_SUB
+ db S3_SET-HUNDREDS ; 4 - MODE_ACTION 2 - ACT_SET
+ db S3_CLR-HUNDREDS ; 4 - MODE_ACTION 3 - ACT_CLR
+;
+; This is the parameter to select which blink routine we want to use
+;
+BLINK_PARM db BLINK_MID12 ; 1 - MODE_HUNDREDS
+ db BLINK_MID34 ; 2 - MODE_DOLLARS
+ db BLINK_SECONDS ; 3 - MODE_CENTS
+ db BLINK_TZONE ; 4 - MODE_ACTION
+;
+; <A NAME="spend_4">(4) State Tables</A>
+;
+; This set of state tables is a little special since we actually use the
+; same state processing routine for both states. This saves us a lot of
+; memory but still allows us to let the state table make it easy to exit
+; the app with the MODE button
+;
+STATETAB0:
+ db 0
+ db EVT_ENTER,TIM2_12TIC,0 ; Initial state
+ db EVT_RESUME,TIM_ONCE,0 ; Resume from a nested app
+ db EVT_TIMER2,TIM_ONCE,0 ; This is the timer
+ db EVT_MODE,TIM_ONCE,$FF ; Mode button
+ db EVT_SET,TIM_ONCE,1 ; Set button
+ db EVT_DNANY4,TIM_ONCE,0 ; NEXT, PREV, SET, MODE 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 ; Return to state 0
+ db EVT_END ; End of table
+;
+; <A NAME="spend_5">(5) Put up the initial banner screen</A>
+;
+HANDLE_ENTER
+ clra
+ sta CATEGORY ; We start out displaying the totals
+ jsr FETCH_CATEGORY
+ jsr CLEARALL ; Clear the display
+ lda #S6_SPEND-START ; Put 'SPEND ' on the top line
+ jsr PUT6TOP
+ lda #S6_WATCH-START ; Put ' WATCH' on the second line
+ jsr PUT6MID
+ clr FLAGBYTE ; Force us to clear the display
+ lda #MODE_VIEW ; Start out in the VIEW mode
+ sta CURRENT_MODE
+ lda #SYS8_MODE ; Put MODE on the bottom line
+ jmp PUTMSGBOT
+;
+; <A NAME="spend_6">(6) This is the main screen update routine.</A>
+;---------------------------------------------------------------
+; Routine:
+; SHOWCURRENT
+; Parameters:
+; HUNDREDS,DOLLARS,CENTS - Current value to be displayed
+; 0,FLAGBYTE - Screen state (CLR=Must clear it first)
+; CATEGORY - the current category to be displayed
+; Returns:
+; DATDIGIT1,DATDIGIT2 - 2 digit characters for the cents value
+; Purpose:
+; This routine shows the current selected category and value for the category
+;---------------------------------------------------------------
+SHOWCURRENT
+ brset 0,FLAGBYTE,NOCLEAR ; If we don't need to clear the display, skip it
+ jsr CLEARALL ; Clear the display
+ bset 0,FLAGBYTE ; And remember that we did it
+NOCLEAR
+ lda #ROW_MP45 ; Turn on the decimal point
+ sta DISP_ROW
+ bset COL_MP45,DISP_COL
+ ldx HUNDREDS ; Get the Hundreds
+ jsr FMTBLANK0 ; Format it
+ jsr PUTMID12 ; and display it
+ ;
+ ; We want to output the dollars, but if there were no hundreds, we want to let the
+ ; first digit be a blank. To do this, we simply let it be a blank and set it to a zero
+ ; if there was actually anything in the hundreds field
+ ;
+ ldx DOLLARS ; Get the Dollars
+ jsr FMTX ; Format it
+ tst HUNDREDS ; Do we need to have a leading zero?
+ beq NOBLANKIT ; No, so it is fine
+ ldx DOLLARS ; Yes, Get the Dollars again
+ jsr FMTXLEAD0 ; And format it with a leading zero
+NOBLANKIT
+ jsr PUTMID34 ; Display the Dollars
+ ldx CENTS ; Get the Cents
+ jsr FMTXLEAD0 ; Format it (and leave it around for later)
+ jsr PUTMID56 ; and display it.
+ lda CATEGORY ; Get which category we want
+ lsla ; *2
+ lsla ; *4
+ lsla ; *8
+ add #S8_TOTAL-START ; *8+the start of the string
+ jmp BANNER8 ; and display the right string
+;
+; <A NAME="spend_7">(7) State Table 0 and 1 Handler</A>
+; This is called to process the state events.
+; We see SET, RESUME, DNANY4, and UPANY4 events
+;
+HANDLE_STATE:
+ bset 1,APP_FLAGS ; Indicate that we can be suspended
+ lda BTNSTATE ; Get the event
+ cmp #EVT_ENTER ; Is this the initial state?
+ beq HANDLE_ENTER
+ cmp #EVT_DNANY4 ; How about a button pressed?
+ beq HANDLE_DNANY
+ bclr 1,BTNFLAGS ; Turn off the repeat counter
+ cmp #EVT_SET ; Did they press the set button
+ bne SKIP2 ; No
+ clr CURRENT_MODE ; Yes, Go to MODE_SELECT
+SKIP2 bra GOREFRESH
+;
+; <A NAME="spend_8">(8) They pressed a button, so handle it</A>
+;
+HANDLE_DNANY
+ lda BTN_PRESSED ; Let's see what the button they pressed was
+ beq DO_NEXT ; MODE=1, and NEXT=0, so if it is less, it must be the next button
+ cmp #EVT_SET ; MODE=1 SET=2 PREV=3, test all at once
+ blo DO_MODE ; <2 = 1 so we have a EVT_MODE
+ bhi DO_PREV ; >2 = 3 so we have a EVT_PREV
+ ;
+ ; They pressed the set button, so we want to carry out the operation IF they have
+ ; one currently selected.
+ ;
+DO_SETOUT
+ lda CURRENT_MODE ; See what mode we were in
+ cmp #MODE_ACTION ; Is it the ACTION mode?
+ bne NO_ACTION ; No, so just cancel the operation
+ jsr DO_OPERATION ; Do what they requested
+ jsr DO_TOTAL ; And total up everything
+ jsr PLAYCONF ; Plus tell them that we did it
+NO_ACTION
+ bclr 0,FLAGBYTE ; We need to clear the display
+ lda #MODE_VIEW ; And switch back to VIEW mode
+ sta CURRENT_MODE
+ lda #EVT_USER2 ; And go back to state 0
+ jmp POSTEVENT
+;
+; <A NAME="spend_9">(9) This handles the update routine to change a digit...</A>
+;
+DO_NEXT
+ bset 0,SYSFLAGS ; Mark our update direction as up
+ BRSKIP2 ; and skip over the next instruction
+DO_PREV
+ bclr 0,SYSFLAGS ; Mark our update direction as down
+DO_UPD
+ lda CURRENT_MODE ; Which mode are we in?
+ beq CHANGE_CATEGORY ; 0=MODE_SELECT, so change the category
+ cmp #MODE_VIEW ; 5=MODE_VIEW, so we also change the category
+ bne TRYOTHERS
+CHANGE_CATEGORY
+; <A NAME="spend_10">(10) updating the category</A>
+ ldx #CATEGORY ; Point to the category variable
+ lda #7 ; get our range of values
+ bsr ADJUST_PX_ANDA ; And let the routine do the adjust for us
+ jsr FETCH_CATEGORY ; Update the current amount from the new category
+GOREFRESH
+ bra REFRESH
+;
+; <A NAME="spend_11">(11) ADJUST_PX_ANDA - a routine to adjust a value based on the direction</A>
+;---------------------------------------------------------------
+; Routine:
+; ADJUST_PX_ANDA
+; Parameters:
+; A - Binary range to limit value within ((2**x)-1)
+; 0,SYSFLAGS - Direction to adjust, SET=UP
+; X - Pointer to value to be adjusted
+; Returns:
+; Value pointed to by X is adjusted
+; Purpose:
+; This routine adjusts a value up or down based on the current direction, wrapping
+; it to the binary range indicated by the value in A. Note that this value must
+; be a power of 2-1 (e.g. 1, 3, 7, 15, 31, 63, or 127)
+;---------------------------------------------------------------
+ADJUST_PX_ANDA
+ inc ,X
+ brset 0,SYSFLAGS,NODEC
+ dec ,X
+ dec ,X
+NODEC and ,X
+ sta ,X
+ rts
+;
+; <A NAME="spend_12">(12) Try updating one of the other modes</A>
+; We have already handled MODE_SELECT and MODE_VIEW. This code handles
+; MODE_HUNDREDS, MODE_DOLLARS, MODE_CENTS, and MODE_ACTION
+;
+TRYOTHERS
+ cmp #MODE_CENTS ; 3=MODE_CENTS
+ bls TRYMORE ; If it is <=, then we leave only MODE_ACTION
+; <A NAME="spend_13">(13) updating the Action</A>
+ lda CATEGORY ; Which category is it?
+ beq REFRESH ; If we are displaying the total, you can't change the action
+ ldx #ACTION ; Point to the current action
+ lda #3 ; and the range of actions
+ bsr ADJUST_PX_ANDA ; and let our simple routine handle it for us
+ bra REFRESH
+TRYMORE
+ beq DOCENTS ; If it is MODE_CENTS, go handle it
+; <A NAME="spend_14">(14) Update MODE_HUNDREDS=1 and MODE_DOLLARS=2</A>
+ clrx ; Set the lower limit =0
+ stx UPDATE_MIN
+ ldx #99 ; And the upper limit= 99
+ stx UPDATE_MAX
+ add #HUNDREDS-1 ; Point to the right byte to update
+ tax ; And put it in X as the parameter
+ lda CURRENT_MODE ; MODE=1 MODE=2
+ deca ; 0 1
+ lsla ; 0 2
+ add #UPD_MID12 ; 5=UPD_MID12 7=UPD_MID34
+ jsr START_UPDATEP ; And prepare the update routine
+ bset 4,BTNFLAGS ; Mark that the update is now pending
+ rts
+;
+; <A NAME="spend_15">(15) This is where we switch which digit we are changing...</A>
+;
+DO_MODE
+ lda CURRENT_MODE ; Get the mode
+ ldx #MODE_ACTION ; Limit it to the first 5 modes
+ jsr INCA_WRAPX ; And let the system increment it for us
+ sta CURRENT_MODE ; Save it back
+ ; When we switch to the ACTION mode and we have the Totals category showing,
+ ; we need to limit them to the single action of CLEAR
+ ;
+ cmp #MODE_ACTION ; Did we go to action mode?
+ bne REFRESH ; No, nothing to do
+ clr ACTION ; Reset the action to be add
+ tst CATEGORY ; Are we displaying the totals
+ bne REFRESH ; No, nothing more to do
+ lda #ACT_CLEAR ; Yes, switch them to CLEAR
+ sta ACTION
+;
+; <A NAME="spend_16">(16) Refresh the screen and start blinking the current digit...</A>
+;
+REFRESH
+ ; 0 - SELECT <Category>
+ ; 1 - AMOUNT (Blink hundreds)
+ ; 2 - AMOUNT (Blink dollars)
+ ; 3 - AMOUNT (Blink cents)
+ ; 4 - ACTION
+ jsr SHOWCURRENT ; Format the screen
+ ldx CURRENT_MODE ; Get the mode
+ lda MSG_TAB,X ; So that we can get the message for it
+ jsr PUT6TOP ; And put that on the top of the display
+ ;
+ ; Now we need to make the right thing blink
+ ;
+ ldx CURRENT_MODE ; Are we in Select mode?
+ beq NOBLINK2 ; Yes, don't blink anything
+ cpx #MODE_ACTION ; How about ACTION MODE?
+ bhi NOBLINK2 ; >ACTION is VIEW mode, so if so, don't blink either
+ ; 1 -> BLINK_MID12 PARM=&HUNDREDS
+ ; 2 -> BLINK_MID34 PARM=&DOLLARS
+ ; 3 -> BLINK_SECONDS PARM=&2Characters
+ ; 4 -> BLINK_TZONE PARM=&3Characters
+ brset 1,BTNFLAGS,NOBLINK2 ; Also, we don't want to be blinking if we are in an update routine
+ bne SETUP_BLINK ; If we were not in action mode, we have the right data source
+ ; Put a > on the display
+ ldx #C_RIGHTARR ; Put a > sign right in front of the action
+ lda #POSL3_5
+ jsr PUTLINE3
+ lda CURRENT_MODE ; Get the mode
+ add ACTION ; And add in the action
+ tax ; To compute our data source pointer
+SETUP_BLINK
+;
+; <A NAME="spend_17">(17) Set up the parameters for and call the blink routine</A>
+;
+ ldx DATASRC-1,X ; Get the offsetted pointer to the right data
+ lda HUNDREDS,X ; And copy the 3 bytes to our blink buffer
+ sta BLINK_BUF
+ lda HUNDREDS+1,X
+ sta BLINK_BUF+1
+ lda HUNDREDS+2,X
+ sta BLINK_BUF+2
+ ldx CURRENT_MODE ; Get our mode again
+ lda BLINK_PARM-1,X ; and use it to pick up which parameter we are passing
+ ldx #BLINK_BUF ; Point to the common blink buffer
+ jsr START_BLINKP ; And do it
+ bset 2,BTNFLAGS ; Mark a blink routine as pending
+NOBLINK2
+ rts
+;
+; <A NAME="spend_18">(18) Update MODE_CENTS</A>
+; This is a special case since we don't have a system routine that allows updating
+; the right most digits on the middle line. Fortunately we can fake it by turning
+; on the tic timer and waiting until 8 tics have passed before going into a repeat
+; loop. The code has been carefully constructed so that the tic timer can just go
+; straight to the DO_UPD code to work.
+DOCENTS
+ ldx #COUNTER ; Point to the counter (saves code size)
+ brset 1,BTNFLAGS,NOSTART ; Are we already in an update loop?
+ lda #8 ; No, we need to wait 8 tics
+ sta ,X ; X->COUNTER ; Save the value
+ BSET 1,BTNFLAGS ; and start the timer
+ bra DOIT ; But still do it once right now
+;
+DEC_DELAY
+ dec ,X ; X->COUNTER ; We haven't hit the limit, decrement it and try again
+ rts
+NOSTART
+ tst ,X ; X->COUNTER ; We are in the loop, have we hit the limit?
+ bne DEC_DELAY ; no, go off and delay once more
+DOIT
+ lda #99 ; Our upper limit is 99
+ ldx #CENTS ; Point to the cents variable (saves code size)
+ brset 0,SYSFLAGS,UPCENTS ; Are we in an up mode?
+ dec ,X ; X->CENTS ; Down, decrement the value
+ bpl REFRESH ; If we didn't wrap, just go display it
+ sta ,X ; X->CENTS ; We wrapped, save the upper limit
+ bra REFRESH ; and go display it
+UPCENTS
+ inc ,X ; X->CENTS ; Up, increment the value
+ cmp ,X ; X->CENTS ; Did we hit the limit?
+ bpl REFRESH ; No, go display it
+ clr ,X ; X->CENTS ; Yes, wrap to the bottom
+ bra REFRESH ; and display it
+;
+; <A NAME="spend_19">(19) DO_OPERATION - Perform the requested operation</A>
+;---------------------------------------------------------------
+; Routine:
+; DO_OPERATION
+; Parameters:
+; HUNDREDS,DOLLARS,CENTS - Amount to be added/subtracted/set
+; CATEGORY - Item to be updated
+; ACTION - 0 = ACT_ADD
+; 1 = ACT_SUB
+; 2 = ACT_SET
+; 3 = ACT_CLEAR
+; Purpose:
+; Adjusts the corresponding category by the given amount
+;---------------------------------------------------------------
+DO_OPERATION
+ bsr COMPUTE_CATEGORY_BASE ; Point to the data for our category
+ lda ACTION ; Which action is it?
+ beq DO_ADD ; 0=ADD, go do it
+ cmp #ACT_SET ; 3 way compare here... (code trick)
+ beq DO_SET ; 2=SET, go do it
+ blo DO_SUB ; <2=1 (SUB), go do it
+DO_CLR ; >2 = 3 (CLEAR)
+ clr HUNDREDS ; Clear out the current values
+ clr DOLLARS
+ clr CENTS
+ tst CATEGORY ; Were we clearing the total?
+ bne DO_SET ; No, just handle it
+ ;
+ ; They want to clear everything
+ ;
+ ldx #(3*8)-1 ; Total number of categories
+CLEAR_TOTALS
+; Mini Routine here X=number of bytes to clear
+ clra
+CLR_MORE
+ sta AMT_TOTAL,X ; Clear out the next byte
+ decx ; Decrement the number to do
+ bpl CLR_MORE ; And go for more
+ rts
+;
+; <A NAME="spend_20">(20) Handle Subtracting a value</A>
+;
+DO_SUB
+ neg HUNDREDS ; Just negate the value to be added
+ neg DOLLARS
+ neg CENTS ; And fall into the add code
+;
+; <A NAME="spend_21">(21) Handle Adding a value</A>
+;
+DO_ADD
+ lda CENTS ; Add the cents
+ add AMT_BASE+2,X
+ sta CENTS
+ lda DOLLARS ; Add the dollars
+ add AMT_BASE+1,X
+ sta DOLLARS
+ lda HUNDREDS ; Add the hundreds
+ add AMT_BASE,X
+ sta HUNDREDS
+ ldx #CENTS ; Point to the cents as it will be the first one we fix up
+ tst ACTION ; See what type of operation we just did
+ beq FIXUP_ADD ; Was it an ADD? If so, do do it
+ bsr TRYDEC ; Decrement, fix up the Cents
+ bsr TRYDEC ; Then fix up the dollars
+ lda HUNDREDS ; Did the hundreds underflow as a result?
+ bmi DO_CLR ; Yes, so just set everything to zero
+ bra DO_SET ; No, so copy over the values to the current entry
+TRYDEC
+ lda ,X ; Get the current byte to check
+ bpl RETDEC ; If it didn't underflow, then skip to the next byte
+ add #100 ; Add back the 100 that it underflowed
+ sta ,X ; And save that away
+ decx ; Back up to the next most significant byte
+ dec ,X ; and borrow the one
+ rts
+RETDEC decx ; No need to do anything, so skip to the next byte
+ rts
+TRYADD
+ lda ,X ; Get the current byte to check
+ sub #100 ; See if it was less than 100
+ bmi RETDEC ; If so, then it was already normalized so skip out
+ sta ,X ; It was an overflow, so save the fixed value
+ decx ; Skip to the next byte
+ inc ,X ; And add in the overflow
+ rts
+
+FIXUP_ADD
+ bsr TRYADD ; Fix up the cents
+ bsr TRYADD ; and then fix up the dollars
+;
+; <A NAME="spend_22">(22) Handle setting a value</A>
+;
+DO_SET
+ bsr COMPUTE_CATEGORY_BASE ; Point to the data for our category
+ lda HUNDREDS ; Copy over the values to the current category
+ sta AMT_BASE,X
+ lda DOLLARS
+ sta AMT_BASE+1,X
+ lda CENTS
+ sta AMT_BASE+2,X
+ rts
+;
+; <A NAME="spend_23">(23) COMPUTE_BASE - Computes an offset pointer to get to the total amounts</A>
+; This is a trick to save us a few bytes in the instructions.
+;---------------------------------------------------------------
+; Routine:
+; COMPUTE_CATEGORY_BASE, COMPUTE_BASE
+; Parameters:
+; A - Offset into total
+; Returns:
+; X - Pointer relative to AMT_BASE to use
+; Purpose:
+; Computes an offset pointer to get to the total amounts
+;---------------------------------------------------------------
+COMPUTE_CATEGORY_BASE
+ lda CATEGORY ; Get our category
+COMPUTE_BASE
+ ldx #3
+ mul
+ add #AMT_TOTAL-AMT_BASE
+ tax
+ rts
+;
+; <A NAME="spend_24">(24) This is the main initialization routine which is called when we first get the app into memory</A>
+;
+MAIN:
+ lda #$c0 ; We want button beeps and to indicate that we have been loaded
+ sta WRISTAPP_FLAGS
+ ; Fall into DO_TOTAL
+;
+; <A NAME="spend_25">(25) DO_TOTAL - Recomputes the current total</A>
+;---------------------------------------------------------------
+; Routine:
+; DO_TOTAL
+; Parameters:
+; NONE
+; Purpose:
+; Recomputes the current total
+;---------------------------------------------------------------
+DO_TOTAL
+ lda CATEGORY ; Remember our category
+ sta CAT_SAVE
+ clr ACTION ; Say that we want to add 0=ACT_ADD
+ clr CATEGORY ; To the total category
+ ldx #2 ; But we need to clear it first
+ bsr CLEAR_TOTALS
+ lda #7 ; And iterate over the 7 categories
+ sta COUNTER
+TOT_LOOP
+ lda COUNTER ; Get our current category
+ bsr FETCH_CATEGORY ; And fetch the data
+ jsr DO_OPERATION ; Then add it to the total
+ dec COUNTER ; Go to the next category
+ bne TOT_LOOP ; Until we are done
+ lda CAT_SAVE ; Restore the category
+ sta CATEGORY
+ ; fall into FETCH_CATEGORY
+; <A NAME="spend_26">(26) FETCH_CATEGORY - Retrieves the value of the total amount for the selected category</A>
+;---------------------------------------------------------------
+; Routine:
+; FETCH_CATEGORY
+; Parameters:
+; A - Category to be fetched
+; Returns:
+; HUNDREDS,DOLLARS,CENTS - Current value of selected category
+; Purpose:
+; Retrieves the value of the total amount for the selected category
+;---------------------------------------------------------------
+FETCH_CATEGORY
+ bsr COMPUTE_BASE ; Get the pointer to the base
+ lda AMT_BASE,X ; And retrieve the data
+ sta HUNDREDS
+ lda AMT_BASE+1,X
+ sta DOLLARS
+ lda AMT_BASE+2,X
+ sta CENTS
+ rts
+;--------------------END OF CODE---------------------------------------------------
diff --git a/from_pkg/testsnd.zsm b/from_pkg/testsnd.zsm
new file mode 100644
index 0000000..ca8b2c7
--- /dev/null
+++ b/from_pkg/testsnd.zsm
@@ -0,0 +1,144 @@
+;Name: Test Sound
+;Version: TESTSND
+;Description: This routine tests the various sound capabilities of the datalink.
+;by John A. Toebes, VIII
+;
+;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"
+;
+; Program specific constants
+;
+CURRENT_VAL EQU $61
+
+START EQU *
+L0110: jmp MAIN
+L0113: rts
+ nop
+ nop
+L0116: rts
+ nop
+ nop
+L0119: rts
+ nop
+ nop
+L011c: rts
+ nop
+ nop
+
+L011f: lda TABLE0,X
+ rts
+
+L0123: jmp DOEVENT0
+ db TABLE0-TABLE0
+
+L0127: jmp DOEVENT1
+ db TABLE1-TABLE0
+
+S6_SOUND: timex6 "SOUND "
+S6_TEST: timex6 " TEST "
+S8_TOEBES: timex "J.TOEBES"
+;
+;
+TABLE0:
+ db 0
+ db EVT_ENTER,TIM_LONG,0 ; Initial state
+ db EVT_RESUME,TIM_ONCE,0 ; Resume from a nested app
+ db EVT_TIMER2,TIM_ONCE,0 ; This is the $84 timer
+ db EVT_DNNEXT,TIM_ONCE,1 ; Next button
+ db EVT_DNPREV,TIM_ONCE,1 ; Prev button
+ db EVT_MODE,TIM_ONCE,$FF ; Mode button
+ db EVT_DNSET,TIM_ONCE,0 ; Set button
+ db EVT_UPSET,TIM_ONCE,0 ;
+ db EVT_END
+
+TABLE1:
+ db 1
+ db EVT_UPNEXT,TIM_ONCE,1 ; Releasing the next button
+ db EVT_UPPREV,TIM_ONCE,1 ; Releasing the prev button
+ db EVT_USER0,TIM_ONCE,0 ; Return to the main state table
+ db EVT_END ; End of table
+
+DOEVENT0:
+ bset 1,APP_FLAGS ; Allow us to be suspended
+ lda BTNSTATE ; Get the event
+ cmp #EVT_RESUME ; Did another app get called in the meantime?
+ beq REFRESH ; We will refresh the display in this case
+ cmp #EVT_TIMER2 ; Did the initial timer expire?
+ beq REFRESH ; Yes, clean up the screen
+ cmp #EVT_ENTER ; Is this the initial state?
+ beq INITBANNER ; Yes, put up the banner
+ cmp #EVT_DNSET ; Did they hit the set button
+ beq PLAYIT
+ cmp #EVT_UPSET
+ beq SILENCE
+ rts
+
+PLAYIT:
+ lda #ROW_NOTE ; Turn on the little note symbol
+ sta DISP_ROW
+ bset COL_NOTE,DISP_COL
+ lda CURRENT_VAL
+ sta $28
+ rts
+
+SILENCE:
+ lda #ROW_NOTE ; Turn off the little note symbol
+ sta DISP_ROW
+ bclr COL_NOTE,DISP_COL
+ lda #15
+ sta $28
+ rts
+
+REFRESH:
+ jsr CLEARALL ; Clear the display
+ lda #S6_SOUND-START ; Put "SOUND" on the top of the display
+ jsr PUT6TOP
+ ldx CURRENT_VAL
+ jsr FMTX
+ jsr PUTMID34
+ bra JBANNER
+
+INITBANNER:
+ jsr CLEARALL ; Clear the display
+ lda #S6_SOUND-START ; Put 'SOUND ' on the top line
+ jsr PUT6TOP
+ lda #S6_TEST-START ; Put ' TEST ' on the second line
+ jsr PUT6MID
+JBANNER
+ lda #S8_TOEBES-START
+ jmp BANNER8
+;
+; This is the main initialization routine which is called when we first get the app into memory
+;
+MAIN:
+ bset 7,WRISTAPP_FLAGS ; Tell them that we are a live application
+ clr CURRENT_VAL
+ rts
+
+;
+; This is called when we press the prev/next button or when the timer fires during that event
+;
+DOEVENT1:
+ lda BTNSTATE
+ cmp #EVT_DNPREV
+ beq GO_DOWN
+ cmp #EVT_DNNEXT
+ beq GO_UP
+ lda #EVT_USER0
+ jmp POSTEVENT
+
+GO_DOWN bclr 0,SYSFLAGS ; Mark update direction as down
+ bra DOUPDN
+GO_UP bset 0,SYSFLAGS ; Mark update direction as up
+DOUPDN clra
+ jsr CLEARMID
+ sta UPDATE_MIN
+ lda #99
+ sta UPDATE_MAX
+ ldx #CURRENT_VAL
+ lda #UPD_MID34
+ jsr START_UPDATEP
+ bset 4,BTNFLAGS
+ rts
diff --git a/from_pkg/tipcalc.zsm b/from_pkg/tipcalc.zsm
new file mode 100644
index 0000000..c2683c8
--- /dev/null
+++ b/from_pkg/tipcalc.zsm
@@ -0,0 +1,358 @@
+;Name: Tip Calculator
+;Version: TIPCALC1
+;Description: The tip calculator - by John A. Toebes, VIII
+;
+;Press the set button to enter the amount. When in set mode, press the MODE button to switch between dollars and cents mode.
+;Press the set button to go back to the display mode. The tip amount will scroll across the bottom of the screen as 15%, 20% and then 10% in sequence.
+;
+;When in display mode, pressing the prev or next buttons will enter the set mode automatically on the dollars amount.
+;
+;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"
+ ;
+; TIPCALC
+;
+; Copyright (c) 1997 by John A. Toebes, VIII. 207 Livingstone Drive, Cary, NC 27513 USA. All Rights Reserved
+;
+; Permission is granted to use this program for personal use. It may not be sold or licenced for any reason
+; except with explicit permission of the Author.
+;
+;----------------------------------------------------------------------------------------------
+;
+; Local variables
+;
+CENTS_ONES EQU $60
+CENTS_TENS EQU $61
+DOLLAR_ONES EQU $62
+DOLLAR_TENS EQU $63
+WHICH_DIGIT EQU $64 ; Used to choose which digit we are setting
+AMT_CENTS EQU $65
+AMT_DOLLAR EQU $66
+BUF_POS EQU $67
+
+START EQU *
+ENT0110: jmp MAIN
+ENT0113: rts
+ nop
+ nop
+ENT0116: rts
+ nop
+ nop
+ENT0119: rts
+ nop
+ nop
+ENT011C: rts
+ nop
+ nop
+
+GETSTATE: LDA STATETAB,X
+ RTS
+
+ENTSTATE0: jmp HANDLE_STATE0
+ db STATETAB-STATETAB
+
+ENTSTATE1: jmp HANDLE_STATE1
+ db STATETAB1-STATETAB
+
+S6_TIP timex6 " TIP "
+S6_CALC timex6 " CALC "
+S6_AMOUNT timex6 "AMOUNT"
+S8_TIPCALC timex "TIP CALC"
+S8_TOEBES timex "J.TOEBES"
+
+SCALE_AMT db 0
+CALC_0: db 0
+CALC_1: db 0
+CALC_CENT_ONES: db 0
+CALC_CENT_TENS: db 0
+CALC_DOLLAR_ONES: db 0
+CALC_DOLLAR_TENS: db 0
+CALC_PADD db 0
+ db 0
+
+STATETAB:
+ db 0
+ db EVT_RESUME,TIM_ONCE,0
+ db EVT_ENTER,TIM_LONG,0
+ db EVT_TIMER2,TIM_ONCE,0
+ db EVT_MODE,TIM_ONCE,$ff
+ db EVT_DNANY4,TIM_ONCE,0
+ db EVT_USER0,TIM_ONCE,1
+ db EVT_USER1,TIM_ONCE,$ff
+ db EVT_END
+
+STATETAB1:
+ db 1 ; Enter state 2 if none of the items match
+ db EVT_USER0,TIM_ONCE,1
+ db EVT_DNANY4,TIM_ONCE,1
+ db EVT_UPANY4,TIM_ONCE,1
+ db EVT_USER2,TIM_ONCE,0
+ db EVT_END
+
+HANDLE_STATE0
+ lda BTNSTATE
+ cmp #EVT_ENTER
+ beq HANDLE_ENTER
+ cmp #EVT_DNANY4
+ beq FIRST_DOWN
+ bra REFRESH_BOTH
+
+FIRST_DOWN
+ lda #EVT_USER0
+ jmp POSTEVENT
+
+HANDLE_ENTER:
+ lda USER04a1
+ beq L01e6
+ clra
+ sta USER04a1
+ lda #EVT_USER1
+ jsr POSTEVENT
+ rts
+
+L01e6: jsr CLEARALL
+ lda #S6_TIP-START
+ jsr PUT6TOP
+ lda #S6_CALC-START
+ jsr PUT6MID
+ lda #S8_TOEBES-START
+ jmp BANNER8
+;
+; Refreshes the display
+;
+REFRESH_AMT
+ jsr FMTSPACE ; Blank the right side of the middle line
+ jsr PUTMID56
+ ldx AMT_DOLLAR ; Get the dollar amount
+ jsr FMTXLEAD0 ; Format it into digits
+ lda DATDIGIT1 ; Save away the tens digit
+ sta DOLLAR_TENS
+ bne NOFIXTENS ; Was it less than $10?
+ lda #C6_SPACE ; Yes, replace the 0 with a space
+ sta DATDIGIT1
+NOFIXTENS
+ lda DATDIGIT2 ; Store away the ones digit
+ sta DOLLAR_ONES
+ jsr PUTMID12
+ lda #$36 ; Turn on the decimal point
+ sta DISP_ROW
+ bset 2,DISP_COL
+ ldx AMT_CENTS ; Format the cents amount
+ jsr FMTXLEAD0
+ lda DATDIGIT1 ; Save away the tens digit
+ sta CENTS_TENS
+ lda DATDIGIT2
+ sta CENTS_ONES ; Save away the ones digit
+ jmp PUTMID34
+
+REFRESH_BOTH
+ jsr CLEARALL
+ lda #S6_TIP-START
+ jsr PUT6TOP
+ bsr REFRESH_AMT
+ clrx
+ lda #15
+ bsr APPEND_PCT
+ lda #20
+ bsr APPEND_PCT
+ lda #10
+ bsr APPEND_PCT
+ lda #SEPARATOR ; Wipe out the final space
+ sta MSGBUF-1,X
+ jsr PUTSCROLLMSG
+ jmp SCROLLMSG
+
+;
+; Parameters:
+; A - Amount to multiply by (0-25%)
+; X - buffer position
+;
+APPEND_PCT
+ sta SCALE_AMT ; Save the amount we will be scaling by
+ stx BUF_POS ; as well as where we are in the buffer
+ tax ; Get the amount to scale
+ jsr FMTXLEAD0 ; And convert to the decimal digits
+ ldx BUF_POS ; Get the current buffer position
+ lda DATDIGIT1 ; And put the two digits in it
+ bsr DO_APPEND
+ lda DATDIGIT2
+ bsr DO_APPEND
+ lda #$29 ; Followed by a %
+ bsr DO_APPEND
+ lda #$37 ; =
+ bsr DO_APPEND
+; lda #$28 ; $
+; bsr DO_APPEND
+ stx BUF_POS ; Remember where we are in the buffer
+;
+; This takes the four digits and does a BCD multiply by the scale amount
+;
+ lda CENTS_ONES
+ ldx SCALE_AMT
+ mul
+ sta CALC_0
+ lda CENTS_TENS
+ ldx SCALE_AMT
+ mul
+ add #5
+ sta CALC_1
+ lda DOLLAR_ONES
+ ldx SCALE_AMT
+ mul
+ sta CALC_CENT_ONES
+ lda DOLLAR_TENS
+ ldx SCALE_AMT
+ mul
+ sta CALC_CENT_TENS
+ clra
+ sta CALC_DOLLAR_ONES
+ sta CALC_DOLLAR_TENS
+ sta CALC_PADD
+;
+; We now have 4 bytes of the scaled values followed by three zeros
+; the largest value in any one should be 9*20 = 180 (although we support up to 28%)
+;
+; Now we need to propagate any values over. This is as simple as subtracting 10 from each
+; digit until we hit zero and adding 1 to the next digit.
+;
+ clrx
+AGAIN lda CALC_0,X ; Get the current digit
+DOFIX sub #10 ; See if we can take away 10 safely
+ blo NEXT_DIGIT ; Went under? Forget about doing this digit, it is already fine
+ sta CALC_0,X ; We had 10 to take away, save the changed value
+ lda CALC_0+1,X ; and increment the next digit. Note that we can't increment it straight
+ inca ; in memory because it is not in the first page of memory
+ sta CALC_0+1,X
+ bra AGAIN ;
+;
+; Parameters:
+; A - Byte to be stored in the buffer
+; X - Current position in the buffer
+; Notes:
+; We need to have a little locality... This is a convenient place to ensure that
+; it is reachable by lots of code. This routine take
+;
+DO_APPEND
+ sta MSGBUF,X
+ incx
+ rts
+
+
+NEXT_DIGIT
+ incx ; Finished with this digit, move to the next
+ cpx #6 ; Have we finished doing all 6?
+ blo AGAIN ; No, go back and do the next one
+;
+; We are done! Let's append the results
+;
+ ldx BUF_POS ; Remember where we are in the output buffer
+ lda CALC_DOLLAR_TENS; Get the tens digit
+ beq NOTENOUT ; If not more than ten, just skip it
+ bsr DO_APPEND ; Output the tens digit
+NOTENOUT
+ lda CALC_DOLLAR_ONES; Output the ones digit
+ bsr DO_APPEND
+ lda #$32 ; Put a decimal point after it
+ bsr DO_APPEND
+ lda CALC_CENT_TENS ; Output the tens digit
+ bsr DO_APPEND
+ lda CALC_CENT_ONES ; Output the ones digit
+ bsr DO_APPEND
+ lda #C_SPACE ; Put in a trailing space
+ bra DO_APPEND
+;--------------------------------------------------------------------
+MAIN: clra
+ sta AMT_CENTS
+ lda #15 ; Give them a default amount of $15.00
+ sta AMT_DOLLAR
+ bset 7,WRISTAPP_FLAGS ; Tell the system that we want to be active
+ rts
+;---------------------------------------------------------------------
+HANDLE_STATE1
+ bset 1,APP_FLAGS ; Allow our application to be suspended while idle.
+ lda BTNSTATE
+ cmp #EVT_USER0 ; Is this the initial entry?
+ beq INIT_UPDN
+ cmp #EVT_DNANY4 ; Did they press any of the buttons while in set mode?
+ beq BUTTON_DOWN
+;
+; They released the button, so start a blink
+;
+REPEAT_UP:
+ bset 1,SYSFLAGS ; Show the current digit
+ bra SET_DISPLAY
+
+;
+; They pressed a button, so start the update routine
+;
+BUTTON_DOWN
+ lda BTN_PRESSED
+ cmp #EVT_SET
+ bne TESTUPDN
+
+ lda #EVT_USER2 ; Get us back to state 0
+ jmp POSTEVENT
+
+INIT_UPDN
+ clr WHICH_DIGIT
+ lda #S6_AMOUNT-START
+ jsr PUT6TOP
+ lda #S8_TIPCALC-START
+ jsr BANNER8
+
+TESTUPDN
+ lda BTN_PRESSED
+ cmp #EVT_NEXT
+ beq GO_UP
+ cmp #EVT_PREV
+ beq GO_DOWN
+ cmp #EVT_MODE
+ beq SWITCH_DIGIT
+ rts
+
+; They must have hit the mode button
+SWITCH_DIGIT:
+ lda WHICH_DIGIT
+ inca
+ and #1
+ sta WHICH_DIGIT
+ bclr 1,SYSFLAGS ; Clear the current digit
+SET_DISPLAY
+ jsr REFRESH_AMT
+ lda #S6_AMOUNT-START
+ jsr PUT6TOP
+ lda #S8_TIPCALC-START
+ jsr BANNER8
+ bsr BEGIN_BLINKING ; Make the blink routine display it
+ bset 2,BTNFLAGS ; Mark a blink routine as pending
+ rts
+
+GO_DOWN bclr 0,SYSFLAGS ; Mark update direction as down
+ bra L0395
+GO_UP bset 0,SYSFLAGS ; Mark update direction as up
+L0395: clra
+ sta UPDATE_MIN
+ lda #99
+ sta UPDATE_MAX
+ lda WHICH_DIGIT
+ beq L03a8
+ ldx #AMT_CENTS
+ lda #UPD_MID34
+ bra L03b1
+L03a8: ldx #AMT_DOLLAR
+ lda #UPD_MID12
+L03b1: jsr START_UPDATEP
+ bset 4,BTNFLAGS
+ rts
+
+BEGIN_BLINKING:
+ lda WHICH_DIGIT
+ beq L03e3
+ ldx #AMT_CENTS
+ lda #BLINK_MID34
+ bra L03e7
+L03e3: ldx #AMT_DOLLAR
+ lda #BLINK_MID12
+L03e7: jmp START_BLINKP
diff --git a/from_pkg/update.zsm b/from_pkg/update.zsm
new file mode 100644
index 0000000..eb8b0a9
--- /dev/null
+++ b/from_pkg/update.zsm
@@ -0,0 +1,133 @@
+;Name: Update
+;Version: UPDATE
+;Description: This is a simple number update program
+;by John A. Toebes, VIII
+;
+;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"
+;
+; <A NAME="update_1">(1) Program specific constants</A>
+;
+FLAGBYTE EQU $61
+; Bit 1 indicates that we need to clear the display first
+;
+CURVAL EQU $62 ; The current value we are displaying
+;
+; <A NAME="update_2">(2) System entry point vectors</A>
+;
+START EQU *
+L0110: jmp MAIN ; The main entry point - <A HREF="wristappformat.html#WRIST_MAIN">WRIST_MAIN</A>
+L0113: rts ; Called when we are suspended for any reason - <A HREF="wristappformat.html#WRIST_SUSPEND">WRIST_SUSPEND</A>
+ nop
+ nop
+L0116: rts ; Called to handle any timers or time events - <A HREF="wristappformat.html#WRIST_DOTIC">WRIST_DOTIC</A>
+ nop
+ nop
+L0119: rts ; Called when the COMM app starts and we have timers pending - <A HREF="wristappformat.html#WRIST_INCOMM">WRIST_INCOMM</A>
+ nop
+ nop
+L011c: rts ; Called when the COMM app loads new data - <A HREF="wristappformat.html#WRIST_NEWDATA">WRIST_NEWDATA</A>
+ nop
+ nop
+
+L011f: lda STATETAB,X ; The state table get routine - <A HREF="wristappformat.html#WRIST_GETSTATE">WRIST_GETSTATE</A>
+ rts
+
+L0123: jmp HANDLE_STATE0
+ db STATETAB-STATETAB
+;
+; <A NAME="update_3">(3) Program strings</A>
+S6_UPDATE: timex6 "UPDATE"
+S6_SAMPLE: timex6 "SAMPLE"
+;
+; <A NAME="update_4">(4) State Table</A>
+;
+STATETAB:
+ db 0
+ db EVT_ENTER,TIM2_8TIC,0 ; Initial state
+ db EVT_TIMER2,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_DNANY4,TIM_ONCE,0 ; NEXT, PREV, SET, MODE button pressed
+ db EVT_UPANY4,TIM_ONCE,0 ; NEXT, PREV, SET, MODE button released
+ db EVT_END
+;
+; <A NAME="update_5">(5) State Table 0 Handler</A>
+; This is called to process the state events.
+; We see ENTER, TIMER2, RESUME, DNANY4 and UPANY4 events
+;
+HANDLE_STATE0:
+ bset 1,APP_FLAGS ; Indicate that we can be suspended
+ lda BTNSTATE ; Get the event
+ cmp #EVT_DNANY4 ; Did they press a button?
+ bne CHKENTER ; No, pass on to see what else there might be
+ 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_SET ; Perhaps the SET button
+ beq DO_SET ; If so, handle it
+ ; In reality, we can't reach here since we handled all three buttons
+ ; in the above code (the MODE button is handled before we get here and the
+ ; GLOW button doesn't send in an event for this). We can just fall through
+ ; and take whatever we get from it.
+CHKENTER
+ cmp #EVT_ENTER ; Is this our initial entry?
+ bne REFRESH
+;
+; This is the initial event for starting us
+;
+DO_ENTER
+ bclr 1,FLAGBYTE ; Indicate that we need to clear the display
+ jsr CLEARSYM ; Clear the display
+ lda #S6_UPDATE-START
+ jsr PUT6TOP
+ lda #S6_SAMPLE-START
+ jsr PUT6MID
+ lda #SYS8_MODE
+ jmp PUTMSGBOT
+;
+; <A NAME="update_6">(6) Our real working code...</A>
+
+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
+ clra
+ sta UPDATE_MIN ; Our low end is 0
+ lda #99
+ sta UPDATE_MAX ; and the high end is 99 (the max since this is a 2 digit value)
+ ldx #CURVAL ; Point to our value to be updated
+ lda #UPD_MID34 ; Request updating in the middle of the display
+ jsr START_UPDATEP ; And prepare the update routine
+ bset 4,BTNFLAGS ; Mark that the update is now pending
+ bclr 1,FLAGBYTE
+ lda #SYS8_SET_MODE
+ jmp PUTMSGBOT
+
+DO_SET
+ clr CURVAL ; When they hit the set button, we just clear to zero
+SHOWVAL
+ brset 1,FLAGBYTE,NOCLEAR ; Do we need to clear the display first?
+REFRESH
+ jsr CLEARALL ; Yes, clear everything before we start
+ bset 1,FLAGBYTE ; And remember that we have already done that
+NOCLEAR
+ bclr 7,BTNFLAGS ; Turn off any update routine that might be pending
+ ldx CURVAL ; Get the current value
+ jsr FMTXLEAD0 ; Convert it to the two ascii digits
+ jmp PUTMID34 ; And put it on the screen in the right place
+;
+; <A NAME="update_7">(7) This is the main initialization routine which is called when we first get the app into memory</A>
+;
+MAIN:
+ lda #$c0 ; We want button beeps and to indicate that we have been loaded
+ sta WRISTAPP_FLAGS
+ clr FLAGBYTE ; start with a clean slate
+ clr CURVAL
+ rts
diff --git a/number/number.asm b/number/number.asm
index 269a8f1..8a71702 100644
--- a/number/number.asm
+++ b/number/number.asm
@@ -44,7 +44,7 @@ S6_COUNT: timex6 "COUNT "
; (4) State Table
STATETAB:
db 0
- db EVT_ENTER,TIM_2_8TIC,0 ; Initial state
+ db EVT_ENTER,TIM2_8TIC,0 ; Initial state
db EVT_TIMER2,TIM_ONCE,0 ; The timer from the enter event
db EVT_RESUME,TIM_ONCE,0 ; Resume from a nested app
db EVT_DNNEXT,TIM_ONCE,0 ; Next button
diff --git a/password/password.asm b/password/password.asm
index f8c8122..d73c482 100644
--- a/password/password.asm
+++ b/password/password.asm
@@ -16,8 +16,8 @@ FLAGBYTE EQU $61
;
DIGIT0 EQU $62 ; The first digit to enter
DIGIT1 EQU $63 ; The second digit to enter
-SYSTEMP0 EQU $A0
-SYSTEMP1 EQU $A1
+;SYSTEMP0 EQU $A0
+;SYSTEMP1 EQU $A1
;
; (2) System entry point vectors
;
@@ -56,7 +56,7 @@ SX_MESSAGE timex "BY JOHN A. TOEBES, VIII"
;
STATETAB0:
db 0
- db EVT_ENTER,TIM_2_8TIC,0 ; Initial state
+ db EVT_ENTER,TIM2_8TIC,0 ; Initial state
db EVT_TIMER2,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
diff --git a/update/update.asm b/update/update.asm
index 930fcec..63eeadb 100644
--- a/update/update.asm
+++ b/update/update.asm
@@ -46,7 +46,7 @@ S6_SAMPLE: timex6 "SAMPLE"
;
STATETAB:
db 0
- db EVT_ENTER,TIM_2_8TIC,0 ; Initial state
+ db EVT_ENTER,TIM2_8TIC,0 ; Initial state
db EVT_TIMER2,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