;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Copyright (c) 2000 - 2002 TIMEX Corporation.
; 
; This document is the property of, and contains information proprietary to
; TIMEX Corporation.  It is to be returned upon request.  Reproduction by any
; means, disclosure, or use of its contents for other than the expressed
; purpose for which it is loaned, without the written consent of TIMEX
; Corporation, is strictly prohibited.
;
; File Name :   ctmrvars.h
;
; Purpose   :   Countdown and Interval Timer common variables.
;
; File Change History:
;
;               08/03/2000 HSB - Created tmrvars.h for m841
;
;   m851 Development:
;
;               12/11/2001 FSU - Modified for M851.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;==============================================================================
;
; VARIABLE REDEFINITIONS 
;
;==============================================================================

;------------------------------------------------------------------------------
; Scroll Buffer (Used only during foreground execution)
;------------------------------------------------------------------------------

; Holds the type of timeout that has expired.
CTMRTimeoutArgument             equ     (COREWorkBuffer + 0)

; Holds the 10 seconds counter that indicates whether to display a large font
;   or small font timer data.
CTMR10SecondsCounter            equ     (COREWorkBuffer + 1)

; Holds the switch currently being held.  This will be used to check what key
;   is being held down while the automatic traversing of setting item is active.
CTMRKeyDepressed                equ     (COREWorkBuffer + 2)

; Holds the current setting item.
CTMRCurrentSetPosition          equ     (COREWorkBuffer + 3)

; Holds the number of records in the DB.
CTMRNumberOfRecords             equ     (COREWorkBuffer + 4)


;------------------------------------------------------------------------------
; REMEMBER: CTMRActiveResource, CTMRLastViewedEntry and CTMRFlags should be
;             arranged in this manner so that we can use a 16-bit transfer.
;------------------------------------------------------------------------------

; Timer resource index that is currently active / in display.
CTMRActiveResource              equ     (COREWorkBuffer + 5)

; Entry/record number of the currently displayed timer.
CTMRLastViewedEntry             equ     (COREWorkBuffer + 6)

; Contains the status, user set time and name of the current timer being 
;   displayed or edited.
CTMRFlags                       equ     (COREWorkBuffer + 7)
CTMRUserSetSecond               equ     (COREWorkBuffer + 8)
CTMRUserSetMinute               equ     (COREWorkBuffer + 9)
CTMRUserSetHour                 equ     (COREWorkBuffer + 10)
CTMRName0                       equ     (COREWorkBuffer + 11)   
CTMRName1                       equ     (COREWorkBuffer + 12)   
CTMRName2                       equ     (COREWorkBuffer + 13)   
CTMRName3                       equ     (COREWorkBuffer + 14)   
CTMRName4                       equ     (COREWorkBuffer + 15)   
CTMRName5                       equ     (COREWorkBuffer + 16)   
CTMRName6                       equ     (COREWorkBuffer + 17)   
CTMRName7                       equ     (COREWorkBuffer + 18)   
CTMRName8                       equ     (COREWorkBuffer + 19)   

; Temporary buffer used to store the working data and display it.
CTMRWorkSecond                  equ     (COREWorkBuffer + 20)
CTMRWorkMinute                  equ     (COREWorkBuffer + 21)
CTMRWorkHour                    equ     (COREWorkBuffer + 22)


;------------------------------------------------------------------------------
; Bit definitions for CTMRFlags
;------------------------------------------------------------------------------

bCTMRActionAtEnd0               equ     00000001B       ; b0 & b1: 00 - Stop At End.        
bCTMRActionAtEnd1               equ     00000010B       ;          01 - Repeat At End.
                                                        ;          10 - Chrono At End.

bCTMRHalfwayEnable              equ     00000100B       ; b2     : 0 - Disable halfway reminder
                                                        ;        : 1 - Enable halfway reminder

bCTMRDataIsZero                 equ     00001000B       ; b3     : 0 - Data is not zero.
                                                        ;        : 1 - Data is zero.

bCTMRLess15Sec                  equ     00010000B       ; b4     : 0 - Data is not less than 15 seconds.
                                                        ;        : 1 - Data is less than 15 seconds.

bCTMRLess1Min                   equ     00100000B       ; b5     : 0 - Data is not less than 1 minute.
                                                        ;        : 1 - Data is less than 1 minute.

;------------------------------------------------------------------------------
; Background Buffer (Used only during background execution)
;------------------------------------------------------------------------------

; This uses the last 4 bytes of the common background buffer.
; Temporary buffer used to compute for the halfway time.
; Although timer don't display hundredths data, this is needed to compute the 
;   halfway time using the existing utility.
CTMRBackgroundHalfHundredths    equ     ((COREBackgroundCommonBuffer + CORECOMMONBACKGROUNDVARIABLESMAXNUMBER) - 3)
CTMRBackgroundHalfSecond        equ     ((COREBackgroundCommonBuffer + CORECOMMONBACKGROUNDVARIABLESMAXNUMBER) - 2)
CTMRBackgroundHalfMinute        equ     ((COREBackgroundCommonBuffer + CORECOMMONBACKGROUNDVARIABLESMAXNUMBER) - 1)
CTMRBackgroundHalfHour          equ     ((COREBackgroundCommonBuffer + CORECOMMONBACKGROUNDVARIABLESMAXNUMBER) - 0)






