*****************************************************************************
**                                                                         **
** Eagleripper: PSA                                                        **
**                                                                         **
** Project: Eagleplayer 2.04                                               **
** Authors: Promax                                                         **
** Start  : 1993/01/09                                                     **
** $Header$                                                                **
**                                                                         **
*****************************************************************************
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program (See the included file COPYING);
** if not, write to the Free Software Foundation, Inc.,
** 675 Mass Ave, Cambridge, MA 02139, USA.
**
***************************************************************************** 


 ***************************************************************************
 *                                                                         *
 * EaglePlayer PSA Ripper Engine V1.0 by Promax © 1998                     *
 *                                                                         *
 * done in 3 minutes :)                                                    *
 *                                                                         *
 ***************************************************************************

		opt	p-
		
	output	dh1:musik_tools/eagleplayer/engines/eaglerippers/PSA

	
		include	ep/eagleplayerripper.i
		include	exec/exec_lib.i

		Section	PSA_Ripper,Code

		RipperHeader	PSA_Tags

		dc.b	"Eagleripper-PSA Ripper V1.0",$a
		dc.b	"done by Promax 03.02.98",0
		even

PSA_Tags:	dc.l	RPT_Formatname,.Formatname
		dc.l	RPT_Ripp1,PSA_Ripp
		dc.l	RPT_RequestRipper,1
		dc.l	RPT_Version,1<<16!0
		dc.l	RPT_Creator,.Creator
		dc.l	RPT_GetModuleName,GetModuleName
		dc.l	RPT_Playername,.Playername
		dc.l	RPT_Prefix,.Prefix
		dc.l	0

.Creator:	dc.b	"Steve of PSA, adapted by Promax",0
.Formatname:	dc.b	"PSA",0
.Playername:	dc.b	"PSA",0
.Prefix:	dc.b	"PSA.",0
		even

PSA_RipLen	equ	36

PSA_Ripp:	cmp.l	#$50534100,d1			;PSA.
		beq.s	.ok
		rts

.OK:		bsr.s	PSARipStart
		rts

PSARipStart:	movem.l	d2-d7/a2-a6,-(sp)
		move.l  a1,a0
		moveq   #0,d0
		lea	Data(pc),a4
		move.l	a0,PSA_Module-Data(a4)
		cmp.l	#$50534100,(a0)
		bne.w	.error

		move.l	PSA_Module-Data(a4),d0
		beq.w	.error

		move.l	d0,a0
		lea	$4(a0),a2
		move.l	a2,PSA_ModuleName-Data(a4)
		move.l	PSA_RipLen(a0),PSA_RipSize-Data(a4)

		; fertig

		move.l	PSA_RipSize-Data(a4),d1	
		move.l  PSA_Module-Data(a4),a0
		moveq	#0,d0
.out		movem.l	(sp)+,d2-d7/a2-a6
		rts
.error		moveq	#-1,d0
		movem.l	(sp)+,d2-d7/a2-a6
		rts

GetModuleName:	lea	Data,a2
		moveq	#0,d0
		move.l	PSA_ModuleName-Data(a2),d0
		rts

Data:
PSA_Module	dc.l	0
PSA_ModuleName	dc.l	0
PSA_RipSize	dc.l	0
		even

