;*=====================================================================*
;*                TITLE:                  RAM68K.S                     *
;*                Function:               68000 ram and buffers        *
;*                                                                     *
;*                Project #:              JAGUAR                       *
;*                Programmer:             Andrew J Burgess             *
;*                                                                     *
;*                COPYRIGHT 1992 Atari Computer Corporation            *
;*          UNATHORIZED REPRODUCTION, ADAPTATION, DISTRIBUTION,        *
;*          PERFORMANCE OR DISPLAY OF THIS COMPUTER PROGRAM OR         *
;*        THE ASSOCIATED AUDIOVISUAL WORK IS STRICTLY PROHIBITED.      *
;*                            ALL RIGHTS RESERVED.                     *
;*                                                                     *
;*=====================================================================*

	.title	"RAM68K - 68000 ram and buffers"

BASE	EQU	$00D00000		; 68000 register base address

TOTAL_OBJS	EQU	1

	include	"jaguar.inc"
	include	"blit.inc"


;*======================================================================*
;*		EXTERNAL DECLARATION
;*======================================================================*

	.globl	olist_ptr	; Pointer to Active Object List
	.globl	olist_ram	; Storage for Active Object List
	.globl	olist_end	; End of Storage for Active Object List
	.globl	olist		; Storage for Master Object List
	.globl	olist_data	; Prepackeged Object List
	.globl	obj_display	; Display bitmap object

	.globl	param_ptr	; Pointer to shared parameter buffer
	.globl	param2_ptr	; Pointer to shared parameter buffer
	.globl	argbuffer	; Shared parameter buffer
	.globl	matbuffer	; matrix multiply buffer space
	.globl	imatbuffer	; matrix multiply buffer space
	.globl	vmatbuffer	; matrix multiply buffer space
	.globl	clipbuffer	; clipper codes buffer

	.globl	lastcolor	; DEBUG timebar last color

	.globl	curDisplay	; current display buffer flag
	.globl	disp_ptr	; Pointer to Display buffer
	.globl	draw_ptr	; Pointer to Build buffer

;*======================================================================*
;*	RAM DATA AREA
;*======================================================================*

	.bss

 	;*==============================================================*
lastcolor:
	.ds.l	1		; DEBUG timebar last color

param_ptr:			; Shared Param Buffer Pointer
	.ds.l	1

param2_ptr:			; Shared Param Buffer Pointer
	.ds.l	1

disp_ptr:			; Display Buffer Pointer
	.ds.l	1

draw_ptr:			; Build Buffer Pointer
	.ds.l	1

argbuffer:
	.ds.l	1000		; Parameter buffer

matbuffer:
	ds.l	1		;* buffer for long-alignment
	ds.l	3		;* three long pointers
	ds.l	12		;* left-hand matrix
	ds.l	12		;* right-hand matrix
	ds.l	12		;* answer matrix

imatbuffer:
	ds.l	1		;* buffer for long-alignment
	ds.l	12		;* model instance matrix

vmatbuffer:
	ds.l	1		;* buffer for long-alignment
	ds.l	12		;* viewer matrix

clipbuffer:
	.ds.l	2000		; Clip Code Buffer (8K)

 	;*==============================================================*
	;* the address of olist should be (a multiple of 32) - 8
	;* so the first scaled bit mapped object starts at a multiple of 32
	;* each object is 1 phrase (8 bytes) for a branch object
	;* and 3 phrases (24 bytes) for the scaled bit mapped object
	;* so every scaled bit mapped object is on a 32 byte boundary
 	;*==============================================================*

olist_ptr:			; Ptr to Active Mungable ObjList
	.ds.l	1

olist_ram:				; Storage for Mungable ObjList
	.ds.l	(2*((8*TOTAL_OBJS)+2))	; packed version of objects in obj_data
						; need 8 longs for each object
						; and 2 longs for a stop object

olist_end:				; end of olist_ram
	.ds.l	1

olist:					; Storage for Master ObjList
	.ds.l	((8*TOTAL_OBJS)+2)	; storage for master object list
						; need 8 longs for each object
						; and 2 longs for a stop object


 	;*==============================================================*
	;* FLAGS
 	;*==============================================================*

curDisplay:			;* current displayed buffer flag
	.ds.b	1

;*======================================================================*
;	CONSTANT DATA
;*======================================================================*

	.data

	.even

olist_data:			; Prepackaged Object List
obj_branch:
	.dc.l	$00000000 	; Branch Object		d63-d32
	.dc.l	$00008E73	; 			d31-d00
obj_display:
	.dc.l	$00000000	; Scaled BitMap Object	d63-d32
	.dc.l	$00320211	;			d31-d00
	.dc.l	$00000005	;	phrase 2	d63-d32
	.dc.l	$0140c000	;			d31-d00
	.dc.l	$00000000	;	phrase 3	d63-d32
	.dc.l	$00002020	;			d31-d00
obj_stop:
	.dc.l	$00000000	; Stop Object		d63-d32
	.dc.l	$00000004	;			d31-d00

;*=====================================================================*

	.end

;*=====================================================================*
;*                                 EOF
;*=====================================================================*

