;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Copyright (c) 2001-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:    occvars.h
;
; Purpose:      Occasions Mode Application Variable Offsets
;
; File Change History:
;
;               02/20/2002 RBR - Created occvars.h for M851
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; OCCASIONS MODE APPLICATION SYSTEM DATA
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

OCCSYSTEMDATASTARTOFFSET        equ     0

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


OCCNEXTRECURRINGRECNOOFFSET     equ 0               ; Offset for the recurring  
                                                    ;   next record to occur.

OCCNEXTNONRECURRINGRECNOOFFSET  equ 2               ; Offset for non-recurring  
                                                    ;   next record to occur.

OCCNEXTTOOCCURRECORDNOOFFSET    equ 4               ; Offset for next to occur 
                                                    ;   occasion record.

OCCCURRENTBANKRECNOOFFSET       equ 6               ; Offset for occasion record 
                                                    ;   and bank currently 
                                                    ;   viewed next to occur 
                                                    ;   occasion record.

OCCRECURRINGBANKRECNOOFFSET     equ 6




OCCOTHERBANKRECNOOFFSET         equ 8               ; Offset for occasion record 
                                                    ;   and bank other than the
                                                    ;   currently viewed record.

OCCNONRECURRINGBANKRECNOOFFSET  equ 8 



OCCBACKGROUNDDAYDELTAOFFSET     equ 10              ; Offset of the variable 
                                                    ;   used to store the day
                                                    ;   delta counter for timeline
                                                    ;   search

OCCTIMELINEFLAGINFOFFSET        equ 11              ; Timeline flag status



OCCNONRECURINGFIRSTRECNO        equ 12              ; First record number for the
                                                    ;   non recurring bank.

OCCNONRECURINGLASTRECNO         equ 14              ; Last record number for the 
                                                    ;   non recurring bank.



OCCRECURRINGLASTRECNO           equ 16              ; Last record number for the
                                                    ;   recurring bank.



OCCSYSTEMFLAGOFFSET             equ 18              ; Offset for the occasion 
                                                    ;   system flag.

OCCCURRENTBANKPOINTEROFFSET     equ 19


OCCOTHERBANKPOINTEROFFSET       equ 21

OCCRECURRINGYEARLO              equ 23

 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

OCCSYSTEMDATASIZE               equ  25
OCCDBALLOCATIONSIZE             equ  0 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;





  



;
; OCCASION'S MODE COMMON SYSTEM DATA (Used only during foreground execution)
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;-------------------------------------------------------------------------------
; Forground buffers for Recurring entry variables.
;-------------------------------------------------------------------------------

OCCRecurringBankTypeInfo        equ   (COREForegroundCommonBuffer+0)
OCCRecurringBankDay             equ   (COREForegroundCommonBuffer+1)
OCCRecurringBankMonth           equ   (COREForegroundCommonBuffer+2)
OCCRecurringBankYearLo          equ   (COREForegroundCommonBuffer+3)
OCCRecurringBankYearHi          equ   (COREForegroundCommonBuffer+4)
OCCRecurringBankMessLength      equ   (COREForegroundCommonBuffer+5)
OCCRecurringCurrentRecNo        equ   (COREForegroundCommonBuffer+6)
OCCRecurringLastEntryRecNum     equ   (COREForegroundCommonBuffer+8)

OCCOFFSETOFCURRENTRECFROMBASE   equ   (OCCRecurringCurrentRecNo -  OCCRecurringBankTypeInfo)


;-------------------------------------------------------------------------------
; Forground buffers for Non-recurring entry variables.
;-------------------------------------------------------------------------------

OCCNonRecurringBankTypeInfo     equ   (COREForegroundCommonBuffer+10)
OCCNonRecurringBankDay          equ   (COREForegroundCommonBuffer+11)
OCCNonRecurringBankMonth        equ   (COREForegroundCommonBuffer+12)
OCCNonRecurringBankYearLo       equ   (COREForegroundCommonBuffer+13)
OCCNonRecurringBankYearHi       equ   (COREForegroundCommonBuffer+14)
OCCNonRecurringBankMessLength   equ   (COREForegroundCommonBuffer+15)
OCCNonRecurringCurrentRecNo     equ   (COREForegroundCommonBuffer+16)
OCCNonRecurringLastEntryRecNum  equ   (COREForegroundCommonBuffer+18)
OCCNonRecurringFirstEntryRecNum equ   (COREForegroundCommonBuffer+20)

OCCRecurringYearInfoLowByte     equ   (COREForegroundCommonBuffer+22)
OCCRecurringYearInfoHighByte    equ   (COREForegroundCommonBuffer+23)



OCCMessageBuffStart             equ   COREWorkBuffer


;---------------------------------------------------
; Occasion sturcture offsets for Current bank and 
;   other bank.
;---------------------------------------------------


OCCBANKDAYOFFSET                equ   1
OCCYEARLOBYTEOFFSET             equ   3
OCCYEARHIOFFSET                 equ   4
OCCBANKMESSLENGTHOFFSET         equ   5
OCCBANKRECNOOFFSET              equ   6
OCCLASTENTRYRECNOOFFSET         equ   8
OCCFIRSTENTRYRECNOOFFSET        equ   10




















;*******************************************************************************
;
; OCCASION MODE CORE BACKGROUND BUFFER DATA REDEIFINTIONS
;
;*******************************************************************************

;----------------------------------------------------------------------
; Primary TZ Date reference buffer.
;----------------------------------------------------------------------

OCCTempPTZDay                   equ   (COREBackgroundCommonBuffer+0)   ; Holds the PTZ Ref. day info
OCCTempPTZMonth                 equ   (COREBackgroundCommonBuffer+1)   ; Holds the PTZ Ref. month info
OCCTempPTZYearLo                equ   (COREBackgroundCommonBuffer+2)   ; Holds the PTZ Ref. year low info
OCCTempPTZYearHigh              equ   (COREBackgroundCommonBuffer+3)   ; Holds the PTZ Ref. year high info


;----------------------------------------------------------------------
; Date Reference buffer.
;----------------------------------------------------------------------

OCCTempRefDateDay               equ   (COREBackgroundCommonBuffer+0)   ; Holds the Ref. day info
OCCTempRefDateMonth             equ   (COREBackgroundCommonBuffer+1)   ; Holds the Ref. month info
OCCTempRefDateYearLo            equ   (COREBackgroundCommonBuffer+2)   ; Holds the Ref. year low info
OCCTempRefDateYearHigh          equ   (COREBackgroundCommonBuffer+3)   ; Holds the Ref. year high info

;----------------------------------------------------------------------
; Temporary storage for the Next occurence recurring entry date buffer.
;----------------------------------------------------------------------

OCCTempNextRecOccDay            equ   (COREBackgroundCommonBuffer+4)   ; recurring entry's Day info
OCCTempNextRecOccMonth          equ   (COREBackgroundCommonBuffer+5)   ; recurring entry's Month info.
OCCTempNextRecOccYearLo         equ   (COREBackgroundCommonBuffer+6)   ; recurring entry's Year Low info.
OCCTempNextRecOccYearHi         equ   (COREBackgroundCommonBuffer+7)   ; recurring entry's Year High info.


;----------------------------------------------------------------------
; Temporary storage for the Next occurence non recurring entry date buffer.
;----------------------------------------------------------------------

OCCTempNextNonRecOccDay         equ   (COREBackgroundCommonBuffer+9)   ; non recurring entry's Day info
OCCTempNextNonRecOccMonth       equ   (COREBackgroundCommonBuffer+10)   ; non recurring entry's Month info.
OCCTempNextNonRecOccYearLo      equ   (COREBackgroundCommonBuffer+11)  ; non recurring entry's Year Low info.
OCCTempNextNonRecOccYearHi      equ   (COREBackgroundCommonBuffer+12)  ; non recurring entry's Year High info.


;----------------------------------------------------------------------
; Temporary storage for the Next occurence entry date buffer used
;   for the search routine. This redefinition has the same address
;   with the next non recurring entry information buffer above.
;----------------------------------------------------------------------

OCCTempType                     equ   (COREBackgroundCommonBuffer+8)
OCCTempDay                      equ   (COREBackgroundCommonBuffer+9)   ; hold the temp Day info.1-byte
OCCTempMonth                    equ   (COREBackgroundCommonBuffer+10)   ; hold the temp Month info.1-byte
OCCTempYearLo                   equ   (COREBackgroundCommonBuffer+11)  ; hold the temp Year Low info.1-byte
OCCTempYearHi                   equ   (COREBackgroundCommonBuffer+12)  ; hold the temp Year High info.1-byte

;----------------------------------------------------------------------
; Temporary storage for the Day Delta information.
;----------------------------------------------------------------------

OCCTempDayDelta                 equ   (COREBackgroundCommonBuffer+17)  

;----------------------------------------------------------------------
; Temporary storage for the year information of a recurring occasion
; used to comp




;----------------------------------------------------------------------
; Temporary storage used to reference record numbers for the 
;   search routine.
;----------------------------------------------------------------------

OCCTempNonRecurringRecNo        equ   (COREBackgroundCommonBuffer+19)  
OCCTempRecurringRecNo           equ   (COREBackgroundCommonBuffer+21)


;----------------------------------------------------------------------
; Temporary Storage used to hold and transfer Database specific header
;   information for use on Occasions mode.
;----------------------------------------------------------------------

OCCTempAppSpecificHdrInfoStart  equ   (COREBackgroundCommonBuffer+23)

OCCTempTotalNoOfREcords         equ   (COREBackgroundCommonBuffer+23)
OCCTempNoOfNonRecurringEntries  equ   (COREBackgroundCommonBuffer+25)
OCCTempNoOfRecurringEntries     equ   (COREBackgroundCommonBuffer+27)
OCCTempNonRecEntryFirstRecNo	equ   (COREBackgroundCommonBuffer+27)
OCCTempNonRecEntryLastRecNo     equ   (COREBackgroundCommonBuffer+29)
OCCTempRecurringEntryLastRecNo    equ   (COREBackgroundCommonBuffer+31)



;----------------------------------------------------------------------
; Temporary storage used to reference record numbers for the displaying
;   the next occurence occasion at peek.
;----------------------------------------------------------------------


OCCTempPeekType                 equ   (COREBackgroundCommonBuffer+7)   ; hold the temp type info.1-byte
OCCTempPeekDay                  equ   (COREBackgroundCommonBuffer+8)   ; hold the temp Day info.1-byte
OCCTempPeekMonth                equ   (COREBackgroundCommonBuffer+9)   ; hold the temp Month info.1-byte
OCCTempPeekYearLo               equ   (COREBackgroundCommonBuffer+10)  ; hold the temp Year Low info.1-byte
OCCTempPeekYearHi               equ   (COREBackgroundCommonBuffer+11)  ; hold the temp Year High info.1-byte
OCCTempPeekDOW                  equ   (COREBackgroundCommonBuffer+12)  ; hold the temp DOW info.1-byte
OCCTempPeekMessLength           equ   (COREBackgroundCommonBuffer+12)  ; hold the temp Year High info.1-byte
OCCTempPeekYearLoBuffer         equ   (COREBackgroundCommonBuffer+13)  ; hold the temp Year Low info.1-byte
OCCTempPeekYearHiBuffer         equ   (COREBackgroundCommonBuffer+14)  ; hold the temp Year High info.1-byte


OCCTempYearBufferLow			equ   (COREBackgroundCommonBuffer+16)
OCCTempYearBufferHigh           equ   (COREBackgroundCommonBuffer+17)


























;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;  Bit definitions for the Occasion Mode System Flag.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


bOCCDirectionForward            equ      00000001b  ; set previous direction is 
                                                    ;    forward.


bOCCRecurringEntriesAvailable   equ      00000010b  ; Set when there are recurring
                                                    ;   entries available.
                                                
bOCCRecurringEndBackward        equ      00000100b  ; set when recurring bank has reached                               
                                                    ;   to indicate that the record is pointing
                                                    ;   to the first record and there are nothing
                                                    ;   to view beyond this in the backward direction

bOCCRecurringEndForward         equ      00001000b  ; set when recurring bank has reached                               
                                                    ;   to indicate that the record is pointing
                                                    ;   to the last record and there are nothing
                                                    ;   to view beyond this in the forward direction

bOCCDoNotRefreshSystemRecords   equ      00010000b  ; Set if we should not retrive back the next
                                                    ;   occurence occasion records.

bOCCSystemFlagBit4              equ      00010000b  ; Unused system flag bit
                                
                                                        
bOCCNonRecurringEntriesAvailable equ     00100000b  ; Set when there are non-recurring
                                                    ;   entries available.



bOCCNonRecurringEndBackward     equ      01000000b  ; set when the non-recurring bank has reached                               
                                                    ;   to indicate that the record is pointing
                                                    ;   to the first record and there are nothing
                                                    ;   to view beyond this in the backward direction

bOCCNonRecurringEndForward      equ      10000000b  ; set when the non-recurring bank has reached                               
                                                    ;   to indicate that the record is pointing
                                                    ;   to the last record and there are nothing
                                                    ;   to view beyond this in the forward direction




OCCCLEARALLFORWANDBACKWBITS     equ      00110011b  ; Value used to clear all forward and backward
                                                    ;   bits 









                                                 

;-------------------------------------------------------------------------------
; Bit definitions for Occasion type.
;-------------------------------------------------------------------------------

bOCCRecurring                   equ      00010000b  ; set when the occasion is recurring
bOCCRecurringDispAnnv           equ      00100000b  ; set when the occasion's anniversary
                                                    ;   year is to be displayed.

bOCCRecEndBackward              equ      01000000b  ; set when record's backward end has 
                                                    ;   been reached to indicate that
                                                    ;   there are no more entries beyond
                                                    ;   this record number.

bOCCRecEndForward               equ      10000000b  ; set when record's forward end has 
                                                    ;   been reached to indicate that
                                                    ;   there are no more entries beyond
                                                    ;   this record number.
