;******************************************************************************
;            (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.0  04/08/94  14:01:05  jpe
; Initial revision.
; -----------------------------------------------------------------------------
; Revision 1.5.0 - Atari Corp. (SDS)
; Removed time calculation and Object List Update from 68k Handler. Both
; are now handled by the GPU.
;******************************************************************************
; 100 30 Mar 95 SDS     Initial revision.
; 101 08 Nov 95 JPE     Official legal banner added (no other changes).
;******************************************************************************

		.include	'memory.inc'
		.include	'player.inc'
		.include	'jaguar.inc'

		.globl		IntInit
		.globl		runframes

		.extern		semaphore
		.extern		scrbuf
IntInit:
		move.l	#(SCREEN_BASE+$8),scrbuf

		clr.l	runframes
		move.l	#IntSvce,USER0 		; Set up the vector
		move.w	#$1F02,INT1    		; Enable GPU (Clear any others)	

		rts

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Procedure: IntSvce
;            Service 68k Video/GPU Interrupts
;

IntSvce:
		move.l	a0,-(sp)

; GPU interrupt: Set semaphore to wake up main program.

		lea	semaphore,a0
		move.w	#$ffff,(a0)    		; Set semaphore

		move.w	#$202,INT1
		move.w	#$0,INT2

		move.l	(sp)+,a0
		rte

		.bss
		.long

runframes:	.ds.l	1			; # of frames since start

	        .end
