ow:	equ	160
oh:	equ	120

*****************************************************************
*	This code will read in the various parts of the big	*
*	file, modify their size top fuck off the right hand	*
*	crap and connect them all together.			*
*****************************************************************
start:
	move.w	#0,-(sp)
	move.l	#fname,-(sp)
	move.w	#$3c,-(sp)
	trap	#1
	addq.l	#8,sp
	move.w	d0,handle

	lea	flist,a6
cloop:
	tst.b	(a6)
	bmi	exit
	move.l	a6,d0
	bsr	openfile
	bsr	readframe
	bsr	writeframe
	bsr	closefile
	lea	12(a6),a6
	bra	cloop



exit:
	move.w	handle,-(sp)
	move.w	#$3e,-(sp)
	trap	#1
	addq.l	#4,sp
	clr.w	-(sp)
	trap	#1


readframe:
	pea	original
	move.l	#ow*oh*2,-(sp)
	move.w	handlein,-(sp)
	move.w	#$3f,-(sp)
	trap	#1
	add.l	#12,sp
	rts

openfile:
	move.w	#0,-(sp)
	move.l	d0,-(sp)
	move.w	#$3d,-(sp)
	trap	#1
	addq.l	#8,sp
	move.w	d0,handlein
	rts

closefile:
	move.w	handlein,-(sp)
	move.w	#$3e,-(sp)
	trap	#1
	addq.l	#4,sp
	rts

writeframe:
	pea	original
	move.l	#ow*oh*2,-(sp)
	move.w	handle,-(sp)
	move.w	#$40,-(sp)
	trap	#1
	add.l	#12,sp
	rts

flist:
	include	'fnames.s'
	dc.b	-1
fname:
	dc.b	'g:\smlmvie.dat',0
	even
handle:		dc.w	0
handlein:	dc.w	0
	even
	section bss
original:
	ds.b	ow*2*oh

