;		Section "KeyFile Maker For DasMod Player",CODE

;Inputs Are A Null Terminated Name String
;		A Serial Number!

;		__a1 char *  <- Pointer To The Name 39 Chars MAX
;		__d0 LONG    <- The serial Number

		xdef	_Make_Key

_Make_Key:
		movem.l	d0-d7/a0-a6,-(sp)
		move.l	#$F423F,d1
		sub.l	d0,d1
		move.l	#KeyFile,a4		;KeyFile In 	a4
		move.l	d1,130(a4)		;Serial Number
		move.l	d0,140(a4)		;Serial Number
		move.l	#39,d0			
		move.l	#Offset_Table,a2	;Offsets In     a2
here		move.l	(a2)+,d1		
		move.b	(a1)+,(a4,d1)		;Fill In Key
		dbra	d0,here

		move.B	#$62,$130(a4)		;An Absoulte Compare
		move.b	#$48,$690(A4)		;A Simple Absolute Compare
		move.b	#$72,$101(a4)		;Another Absolute Dual Compare
		move.l	#$29A,$54(a4)		;Hidden CMP
		movem.l	(sp)+,d0-d7/a0-a6
		move.l	#KeyFile,a0		;Return Pointer To Buffer
		rts


Offset_Table:
		dc.l      23
		dc.l      1400
		dc.l      552
		dc.l      988
		dc.l      256
		dc.l      863
		dc.l      1300
		dc.l      233
		dc.l      884
		dc.l      246
		dc.l      982
		dc.l      477
		dc.l      971
		dc.l      445
		dc.l      422
		dc.l      345
		dc.l      543
		dc.l      1204
		dc.l      244
		dc.l      532
		dc.l      876
		dc.l      654
		dc.l      869
		dc.l      432
		dc.l      321
		dc.l      210
		dc.l      912
		dc.l      823
		dc.l      833
		dc.l      545
		dc.l      87
		dc.l      36
		dc.l      1476
		dc.l      1503
		dc.l      482
		dc.l      537
		dc.l      356
		dc.l      457
		dc.l      236
		dc.l      867
		dcb.l     $4,0
		dc.l      25
		dc.l      56
		dc.l      77
		dc.l      99
		dc.l      1601
		dc.l      947

KeyFile		ds.b	1687

