;******************************************************************************
;            (C) Copyright 1992-1995, Radius, Inc. and Atari Corp.
; Secret and confidential                                   All rights reserved
;******************************************************************************
; This source code and any compilation or derivative thereof is the joint
; property of Radius, Inc. and Atari Corp.  This code is provided pursuant
; to a Software License Agreement and/or Software Development Contract.  This
; code is the proprietary information of Radius, Inc. and Atari Corp. and is
; confidential in nature.  Its use and dissemination by any party other than
; Atari Corp. are strictly limited by the confidential information provisions
; of the Agreement or Contract referenced above.
;******************************************************************************
; 100 26 Jun 95 JPE     Initial revision.
; 101 17 Aug 95 JPE     Added support for voiceover. Offsets for film index
;                       parameters added.
; 102 14 Sep 95 JPE     Added data structures to support tree organization of
;                       playlist.
; 103 09 Oct 95 JPE     Added abort control and repeat flags for loader.
;                       Added branch table structure.
; 104 20 Oct 95 JPE     Removed buffCtrl element from LEAF structure.
; 105 08 Nov 95 JPE     Added auxStart element to buffer control block. Added
;                       structures for auxiliary atom.
; 106 01 Dec 95 JPE     Removed leaf structure, added component structure.
;                       Removed node table, branch table and voiceover table
;                       structures. Added txtSlide offset.
; 107 24 Jan 96 JPE     Added structure for NVM file control. Reduced film
;                       attribute size to 16 bits. Added playlist address to
;                       buffer control block. Reduced playlist attribute
;                       field to 8 bits. Removed CD index parameters from
;                       control block. Added offsets for film and control
;                       playlist elements. Load abort now local to buffer
;                       control block.
; 108 06 Feb 96 JPE     Added frame limits to HYPER structure.
;******************************************************************************

;------------------------------------------------------------------------------
;   BUFFER CONTROL BLOCK data structure.
;------------------------------------------------------------------------------

        .offset 0                   ; Dummy address

buffChunks:     ds.l    1           ; Number of chunks in buffer
dataStart:      ds.l    1           ; Start of data in buffer
bufEnd:         ds.l    1           ; End of buffer
bufStart:       ds.l    1           ; Start of buffer
playActive:     ds.w    1           ; Player active flag
bufReady:       ds.w    1           ; Buffer-ready flag
dataEnd:        ds.l    1           ; End of data in buffer
vCRYmovie:      ds.w    1           ; CRY/expanded-RGB flag
vVMODE:         ds.w    1           ; Video mode setting
movieWidth:     ds.l    1           ; Width of movie (pixels)
movieHeight:    ds.l    1           ; Height of movie (lines)
vADSC:          ds.l    1           ; Audio description
vSCLK:          ds.l    1           ; Serial clock rate
vDRIFT:         ds.l    1           ; Audio drift rate
vChunks:        ds.l    1           ; Chunks in movie
vTimeIncr:      ds.l    1           ; Movie time units per PIT tick
vMaxDelay:      ds.l    1           ; Maximum video/audio delay
cTabStart:      ds.l    1           ; Start of chunk table
bufLocked:      ds.w    1           ; Lock flag (read only)
auxStart:       ds.l    1           ; Start of auxiliary atom
txtSlide:       ds.w    1           ; Text slide flag
pListAddr:      ds.l    1           ; Playlist address
resolveCnt:     ds.w    1           ; Count of unresolved controls
resolveList:    ds.l    MAX_CTRL    ; Addresses of unresolved controls
censorMask:     ds.w    1           ; Mask for censored loop branches
loadAbort:      ds.w    1           ; Abort command to loader

BCTRL_SIZE:                         ; Size of structure

;------------------------------------------------------------------------------
;   LOADER CONTROL BLOCK data structure.
;------------------------------------------------------------------------------

        .offset 0               ; Dummy address

loadGo:         ds.w    1       ; Go command to loader
loadRepeat:     ds.w    1       ; Repeat command to loader
loadDone:       ds.w    1       ; Done status from loader
loadBCtrl:      ds.l    1       ; Pointer to buffer control block

LCTRL_SIZE:

;------------------------------------------------------------------------------
;   PLAYER CONTROL BLOCK data structure.
;------------------------------------------------------------------------------

        .offset 0               ; Dummy address

playGo:         ds.w    1       ; Go command to player
playPause:      ds.w    1       ; Pause command to player
playDone:       ds.w    1       ; Done status from player
playBCtrl:      ds.l    1       ; Pointer to buffer control block

PCTRL_SIZE:

;------------------------------------------------------------------------------
;   PLAYLIST data structures.
;------------------------------------------------------------------------------

        .offset 0               ; Dummy address

attrib:         ds.b    1       ; Attributes and flags
history:        ds.b    1       ; Film history
listCont:                       ; Continuation data (film or control)

;------ Extended data for film element ----------------------------------------

        .offset listCont

cdIndex:        ds.w    1       ; Film index on CD track
filmCont:                       ; Film continuation data

;------ Extended data for NORMAL film -----------------------------------------

        .offset filmCont

fwdLink:        ds.w    1       ; Film forward links
nlpDataEnd:                     ; End of data (not loop)
                ds.w    2       ; Loop has two extra links
lpDataEnd:                      ; End of data (loop)

;------ Extended data for SPECIAL film ----------------------------------------

        .offset filmCont

fRule:          ds.b    1       ; Film element RULE
fFanOut:        ds.b    1       ; Film element fan-outs
fExtData:                       ; Rule-specific data

;------ Extended data for SKIP film -------------------------------------------

        .offset fExtData

skPathRec:      ds.w    1       ; Path record
skFwdLink:      ds.w    1       ; Forward link
skFanIn:        ds.w    1       ; Number of fan-ins
skBackLink:                     ; Backward links

;------ Extended data for HYPER film ------------------------------------------

        .offset fExtData

hyClickThr:     ds.w    1       ; Joypad click threshold
hyClickCnt:     ds.w    1       ; Joypad click count
hyStartFrm:     ds.l    1       ; Starting frame number
hyEndFrm:       ds.l    1       ; Ending frame number
hyFwdLinkA:     ds.w    1       ; Forward link A
hyFwdLinkB:     ds.w    1       ; Forward link B
hyDataEnd:                      ; End of data

;------ Extended data for CONTROL element -------------------------------------

        .offset listCont

cType:          ds.b    1       ; Control element TYPE
cFanOut:        ds.b    1       ; Control element fan-outs
cExtData:                       ; Type-specific data

;------ Type-specific data for BURN element -----------------------------------

        .offset cExtData

buPathRec:      ds.w    1       ; Path record
buBurnMask:     ds.w    1       ; Burn mask
buVectors:                      ; Psychometric vectors

;------ Type-specific data for COUNT element ----------------------------------

        .offset cExtData

coCount:        ds.w    1       ; Count
coFwdLink:                      ; Forward links

;------ Type-specific data for SWITCH element ---------------------------------

        .offset cExtData

swVectors:                      ; Psychometric vectors

;------ Type-specific data for CENSOR element ---------------------------------

        .offset cExtData

ceFwdLink1:     ds.w    1       ; Forward link 1
ceFwdLink2:     ds.w    1       ; Forward link 2
ceFwdLink3:     ds.w    1       ; Forward link 3
ceFwdLink4:     ds.w    1       ; Forward link 4
ceDataEnd:

;------ Type-specific data for RELAY element ----------------------------------

        .offset cExtData

reCounter:      ds.w    1       ; Pointer to counter object
reFwdLink1:     ds.w    1       ; Forward link 1
reFwdLink2:     ds.w    1       ; Forward link 2
reDataEnd:

;------ Type-specific data for CHANGE element ---------------------------------

        .offset cExtData

chDiskNum:      ds.w    1       ; Disk number
chFwdLink:      ds.w    1       ; Forward link
chDataEnd:

;------------------------------------------------------------------------------
;   AUXILIARY ATOM data structure.
;------------------------------------------------------------------------------

        .offset 0               ; Dummy address

auxlTag:        ds.l    1       ; ASCII tag
auxlSize:       ds.l    1       ; Auxiliary atom size
auxlReserve:    ds.l    2       ; Reserved
trackTbl:                       ; Start of track table

;------------------------------------------------------------------------------
;   TRACK TABLE data structure.
;------------------------------------------------------------------------------

        .offset 0               ; Dummy address

trtbTag:        ds.l    1       ; ASCII tag
trtbSize:       ds.l    1       ; Track table size
trtbTracks:     ds.l    1       ; Number of tracks
trtbReserve:    ds.l    1       ; Reserved
trackRec:                       ; Start of track records

;------------------------------------------------------------------------------
;   TRACK RECORD data structure.
;------------------------------------------------------------------------------

        .offset 0               ; Dummy address

tkrcOff:        ds.l    1       ; Track offset
tkrcSize:       ds.l    1       ; Track size

;------------------------------------------------------------------------------
;   TRACK data structure.
;------------------------------------------------------------------------------

        .offset 0               ; Dummy address

trakTag:        ds.l    1       ; ASCII tag
trakSize:       ds.l    1       ; Track size
segmentTbl:                     ; Start of segment table

;------------------------------------------------------------------------------
;   SEGMENT TABLE data structure.
;------------------------------------------------------------------------------

        .offset 0               ; Dummy address

sgtbTag:        ds.l    1       ; ASCII tag
sgtbSize:       ds.l    1       ; Segment table size
sgtbSegs:       ds.l    1       ; Number of segments
segmentRec:                     ; Start of segment records

;------------------------------------------------------------------------------
;   SEGMENT RECORD data structure.
;------------------------------------------------------------------------------

        .offset 0               ; Dummy address

sgrcOffset:     ds.l    1       ; Segment offset
sgrcSize:       ds.l    1       ; Segment size
sgrcF0:         ds.l    1       ; Frame # keyed to start of segment
sgrcF1:         ds.l    1       ; Frame # keyed to end of segment

SGRC_SIZE:

;------------------------------------------------------------------------------
;   SEGMENT data structure.
;------------------------------------------------------------------------------

        .offset 0               ; Dummy address

sgmtTag:        ds.l    1       ; ASCII tag
sgmtSize:       ds.l    1       ; Voice track size
sgmtData:                       ; Segment data

;------------------------------------------------------------------------------
;   VOICE TRACK data structure.
;------------------------------------------------------------------------------

        .offset 0               ; Dummy address

vtrkTag:        ds.l    1       ; ASCII tag
vtrkSize:       ds.l    1       ; Voice track size
vtrkCount:      ds.l    1       ; Byte count
vtrkData:                       ; Voiceover data

;------------------------------------------------------------------------------
;   SUBTITLE data structure.
;------------------------------------------------------------------------------

        .offset 0               ; Dummy address

subtTag:        ds.l    1       ; ASCII tag
subtSize:       ds.l    1       ; Subtitle atom size
subtText:       ds.l    1       ; ASCII text string, null terminated

;------------------------------------------------------------------------------
;   SCORE data structure.
;------------------------------------------------------------------------------

        .offset 0               ; Dummy address

scorTag:        ds.l    1       ; ASCII tag
scorSize:       ds.l    1       ; Score atom size
dProfile:       ds.w    5       ; Increments to profile attributes
dScore:         ds.w    1       ; Increment to node-completion score

;------------------------------------------------------------------------------
;   NVM file control record structure.
;------------------------------------------------------------------------------

        .offset 0

name:           ds.l    1       ; Pointer to file name
exist:          ds.w    1       ; File-exists flag
mSex:           ds.w    1       ; Minimize-sex flag
mViol:          ds.w    1       ; Minimize-violence flag

FREC_SIZE:                      ; Size of record

;------------------------------------------------------------------------------

        .text                   ; Reset to text segment

