;******************************************************************************
;            (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.
;******************************************************************************
; Revision 1.1  04/25/94  15:30:35  jpe
; Moved CINEPAK_DATA from $30000 to $34000.
;
; Revision 1.0  04/08/94  13:56:20  jpe
; Initial revision.
;******************************************************************************
; Atari In-House Revisions:
; 200 16 Jun 95 JPE     Rearranged memory map to free up 1.5 MByte for CD
;                       buffering.
; 201 23 Aug 95 JPE     Reserved space for film index. Formalized locations
;                       of CD buffers.
; 202 25 Aug 95 JPE     Relocated index table and screen buffer (screen
;                       object size reduced from 240 to 216 lines).
; 203 08 Nov 95 JPE     Rearranged allocation of ROM emulator memory to make
;                       room for NVRAM simulator and data. Decreased CD data
;                       buffer by 16K to allow room for NVM BIOS scratch area.
;******************************************************************************

;-------------------------------------------------------------------------------
;   Memory map:
;
;    $4000 -  $15fff:   Code and data
;   $16000 -  $173ff:   Film index (~300 entries)
;   $17400 -  $7c7ff:   Display buffer (320x216x2x3)
;   $7c800 -  $7cfff:   Stack
;   $7d000 -  $7ffff:   Cinepak codebook data
;   $80000 -  $83fff:   NVM BIOS scratchpad
;   $84000 - $1fffff:   CD-ROM data buffer
;
;  $800000 - $801fff:   Stub
;  $802000 - $8105bf:   NVRAM simulator
;  $8105c0 - $81ffff:   Dead space
;  $820000 - $8fffff:   Sync debug history
;  $900000 - $91ffff:   NVRAM data
;  $920000 - $9effff:   Sample debug history
;  $9f0000 - $9fffff:   Event debug history
;-------------------------------------------------------------------------------

FILM_INDEX      .equ    $18000          ; Index of films
SCREEN_BASE     .equ    $19400          ; Display buffer
CINEPAK_DATA    .equ    $7f000          ; Codebooks (uses $3000)
INITSTACK       .equ    CINEPAK_DATA    ; Top of stack
NVM_SCRATCH     .equ    $82000          ; 16K NVM BIOS scratchpad
FILM_BASE       .equ    $86000          ; CD-ROM buffer area
RAM_END         .equ    $200000         ; End of DRAM

ROM_BASE        .equ    $800000         ; Base of ROM
STUB            .equ    ROM_BASE        ; Stub
NVRAM_SIM       .equ    $802000         ; NVRAM sumulator
DEAD_SPACE      .equ    $8105c0         ; Dead space
SYNC_HISTORY    .equ    $820000         ; Sync search history
NVRAM_DATA      .equ    $900000         ; NVRAM data
SAMP_HISTORY    .equ    $920000         ; Video/audio sample history
EVNT_HISTORY    .equ    $9f0000         ; Event records
ROM_END         .equ    $a00000         ; End of ROM

FULL_SIZE       .equ    (RAM_END-FILM_BASE)/2   ; ~3/4 MByte
HALF_SIZE       .equ    FULL_SIZE/2             ; ~3/8 MByte
WASTE           .equ    $100                    ; Waste after end of buffer

BUF0_BASE       .equ    FILM_BASE               ; Buffer 0 base
BUF1_BASE       .equ    BUF0_BASE+FULL_SIZE     ; Buffer 1 base
BUF2_BASE       .equ    BUF0_BASE               ; Buffer 2 base
BUF3_BASE       .equ    BUF2_BASE+HALF_SIZE     ; Buffer 3 base
BUF4_BASE       .equ    BUF1_BASE               ; Buffer 4 base
BUF5_BASE       .equ    BUF4_BASE+HALF_SIZE     ; Buffer 3 base
END_BUFFER      .equ    BUF1_BASE+FULL_SIZE     ; End of buffer area

BUF0_END        .equ    BUF1_BASE-WASTE         ; End of buffer 0
BUF1_END        .equ    END_BUFFER-WASTE        ; End of buffer 1
BUF2_END        .equ    BUF3_BASE-WASTE         ; End of buffer 2
BUF3_END        .equ    BUF0_END                ; End of buffer 3
BUF4_END        .equ    BUF5_BASE-WASTE         ; End of buffer 4
BUF5_END        .equ    BUF1_END                ; End of buffer 5
