;***********************************************************
;*        ROB NORTHERN UNPACK ROUTINE FOR RNC1             *
;***********************************************************
;*                                                         *
;*Assembler: MIPS R4300 / ASMN64 (PSY-Q)                   *
;*By : Icarus/TRSi&LFC                                     *
;*Version  : 1.00                                          *
;*Amiga Original Code by: Rob/Quartex                      *
;*                                                         *
;*Thanks to Wild Fire for some help/idea                   *
*                                                          *
;*Notes: The Include code is a little bit weird, so be     *
;*       warned!! =) its a mixture of Amiga converted      *
;*       assembler, ripped Turok stuff and my own code..   *
;*       I try to fix it up a little bit...                *
;***********************************************************

;***********************************************************
;*                                                         *
;* INPUT:                                                  *
;* a0 = source, pointer to the packed data!                *
;* a1 = destination, pointer to the dest. address in ram!  *
;*                                                         *
;* RETURN VALUE:                                           *
;* s0 = destination pointer... same as a1                  *
;*                                                         *
;***********************************************************

		opt at-

		opt h-

		opt ae+



START_ADD equ $80000400-$1000

		org  START_ADD                   ; position en RAM de l'intro-trainer
		dcb 4096,0                       ; Header Boot Block 4k

              ; remove the 2 line above if necessary!

start:
		la	a0,source
		la	a1,destination
		jal	rnc_decrunch
		nop
		move	t0,s0
		jr	t0                       ; jump in decrunched area ..
		nop

rnc_decrunch:
		include	"rnc.asm"		 ; Include RNC decruncher...

source:
		incbin	"test.rnc"               ; include the packed RNC data!
		db 1
destination:
		dcb	20000,0                  ; just a test buffer!
