
	opt	o-,p+
	output	dh1:Assembler/L2Ed/|L2Patch.bin

	incdir	"dh1:Assembler/includes"
	include	"AmigaLVOs.s"

MAP_SIZE	equ	7884
LEANMAP_SIZE	equ	7332
CUST_OFFSET	equ	LEANMAP_SIZE
CMAP_OFFSET	equ	CUST_OFFSET+256

	rsreset
ST_vsleep	rs.w	1
ST_newbank	rs.w	1
ST_lastupdbank	rs.w	1
ST_lastbank	rs.w	1
ST_mapadr	rs.l	1
ST_custdat	rs.l	1
ST_iffwx	rs.w	1
ST_iffwy	rs.w	1
ST_iffpl	rs.w	1
ST_iffpk	rs.w	1
ST_iffbpr	rs.w	1
ST_iffplanes	rs.l	4
ST_mstyle	rs.b	10
ST_gotpal	rs.b	12
ST_catbuf	rs.b	32*8
ST_vfargs	rs.l	10
ST_vfbuffer	rs.b	128
ST_palbuffer	rs.w	16*12
ST_SIZEOF	rs.b	0

start

**************************************************************************
	ds.b	$0bc6
start4	cmp.b	#'Q',d0			;keyboard patch
	beq	start+$27d6
endpatch4

**************************************************************************
	ds.b	$1328-$0bc6-(endpatch4-start4)
start3	move.l	start+$001a58(pc),a0	;check for custom gfx
	cmp.l	#'CUST',CUST_OFFSET(a0)
	bne.s	.skip
	move.w	#7,$15c(a5)
	bsr	start+$602
	move.l	zackit+2(pc),a1
	move.l	(a1),a1
	addq.l	#2,a1
	move.l	a1,-(sp)
	move.l	start+$1f2E(pc),a1
.skip	rts
endpatch3

**************************************************************************
	ds.b	$1a6e-$1328-(endpatch3-start3)
start1	movem.l	d0/d1/a0/a1,-(sp)	;call world selection menu
	move.w	$014c(a5),d1
	opt	p-
zackit	lea	start+$0380f2,a0
	opt	p+
	dc.w	$43F9,$0001,$9040
	move.l	a0,d0
	move.l	(a0),a0
	jsr	(a0)
	tst.w	d0
	beq.s	lb1a94
	nop
	lsl.w	#2,d1
	move.l	(a0,d1.w),a0
	opt	p-
	jsr	start+$012bb8
	opt	p+
lb1a94	movem.l	(sp)+,d0/d1/a0/a1
	rts
endpatch1

**************************************************************************
	ds.b	$1fae-$1a6e-(endpatch1-start1)
start2	move.l	(a1)+,d2		;call check for custom gfx
	move.w	d2,d0
	and.w	#$03FF,d0
	lsl.l	#6,d0
	lea	(a2,d0.l),a4
	bsr.s	start+$1FD0
	addq.l	#2,a0
	dbra	d6,start+$1fae
	add.w	d5,a0
	dbra	d7,start+$1fa8
	bra	start3
endpatch2

**************************************************************************
	ds.b	$01c66a-$1fae-(endpatch2-start2)
	bra.s	.menu			;main patch
	bra.s	.customgfx
.menu	move.l	d0,a0
	cmp.l	#'FORM',(a1)
	beq.s	.quit
	movem.l	a0-a6/d0-d7,-(sp)
	bsr.s	menu
	movem.l	(sp)+,a0-a6/d0-d7
	bsr.s	loadfil
.quit	moveq.l	#0,d0
	rts

.customgfx
	movem.l	a0-a6/d0-d7,-(sp)
	bsr	customgfx
	movem.l	(sp)+,a0-a6/d0-d7
	rts

loadfil	movem.l	a0-a6/d0-d7,-(sp)
	lea	fnbuf(pc),a0
	lea	start+$011858+$4000(pc),a2
	jsr	-$4000(a2)
	cmp.l	#'IMP!',(a1)
	bne.s	.nodec
	movem.l	a0/a1/d0/d1,-(sp)
	move.l	a1,a0
	bsr	fimpdecrunch
	movem.l	(sp)+,a0/a1/d0/d1
.nodec	movem.l	(sp)+,a0-a6/d0-d7
	rts

menu	lea	locvars(pc),a3
	movem.l	d0-d1,-(sp)
	moveq.l	#0,d0
	move.w	$14C(a5),d0
	lea	start+$0106a0+$7000(pc),a0
	move.l	-$7000(a0),a0			;4d034
	move.l	a0,a2
	lea	ST_gotpal(a3),a1
	tst.b	(a1,d0.w)
	bne.s	.gotpal
	st	(a1,d0.w)
	lsl.w	#5,d0
	lea	ST_palbuffer(a3),a1
	moveq.w	#15,d1
	add.l	d0,a1
.cpycmp	move.w	(a0)+,(a1)+
	dbra	d1,.cpycmp
.gotpal	move.w	$14C(a5),d0
	lea	ST_palbuffer(a3),a1
	lsl.w	#5,d0
	add.l	d0,a1
	move.w	(a1),$4d076-$4d034(a2)
	move.w	(a1),$4d07a-$4d034(a2)
	move.w	(a1),$4d07e-$4d034(a2)
	move.w	(a1),$4d080-$4d034(a2)
	moveq.w	#15,d1
.respal	move.w	(a1)+,(a2)+
	dbra	d1,.respal
	movem.l	(sp)+,d0-d1
	lea	ST_mstyle(a3),a1
	lea	start+$01c444+4(pc),a0
	cmp.w	#12,d1
	bne.s	.cpylop
	lea	.mpract(pc),a0
.cpylop	move.b	(a0)+,d0
	beq.s	.eon
	cmp.b	#'/',d0
	beq.s	.eon
	move.b	d0,(a1)+
	bra.s	.cpylop
.eon	clr.b	(a1)
	lea	ST_mstyle(a3),a0
	move.l	a0,ST_vfargs(a3)

	lea	.cat(pc),a0
	lea	fnbuf(pc),a1
	bsr	rawdof

	lea	ST_catbuf(a3),a1
	bsr	loadfil

	move.w	#2,d0
	bsr	playsound
	move.w	ST_lastbank(a3),d0
	lsl.w	#5,d0
	tst.b	ST_catbuf(a3,d0.w)
	bne.s	.godcat
	clr.w	ST_lastbank(a3)
.godcat	move.w	ST_vsleep(a3),d0
	beq.s	.cont
	btst	#2,$016(a6)
	bne	.quit
.cont	bsr	.createoptscr
.loop	btst	#6,$BFE001
	bne.s	.loop
;	btst	#2,$016(a6)
;	beq.s	.endmen
	move.w	$106(a5),d0
	move.w	$108(a5),d1
	cmp.w	#168,d1
	blt.s	.nobut
	cmp.w	#192,d1
	bge.s	.nobut
	cmp.w	#8,d0
	blt.s	.nobut
	cmp.w	#312,d0
	bge.s	.nobut
	cmp.w	#88,d0
	blt.s	.but1
	cmp.w	#120,d0
	blt.s	.nobut
	cmp.w	#200,d0
	blt.s	.but2
	cmp.w	#232,d0
	blt.s	.nobut
	move.w	#14,d0
	bsr	playsound
	bra.s	.endmen
.nobut	sub.w	#$4c,d1
	bmi.s	.loop
	cmp.w	#8*10,d1
	bge.s	.loop
	ext.l	d1
	divu	#10,d1
	move.w	d1,d2
	lsl.w	#5,d2
	tst.b	ST_catbuf(a3,d2.w)
	beq.s	.loop
	move.w	d1,ST_newbank(a3)
	bsr	.updateitem
	bra.s	.loop
.but1	move.w	ST_newbank(a3),ST_lastbank(a3)
	move.w	#-1,ST_vsleep(a3)
	move.w	#3,d0
	bsr	playsound
	bra.s	.endmen
.but2	move.w	ST_newbank(a3),ST_lastbank(a3)
	clr.w	ST_vsleep(a3)
	move.w	#3,d0
	bsr	playsound
.endmen	bsr	.restoreoldscr
.quit
	lea	ST_mstyle(a3),a0
	move.l	a0,ST_vfargs(a3)
	lea	ST_catbuf(a3),a0
	move.w	ST_lastbank(a3),d0
	lsl.w	#5,d0
	add.w	d0,a0
	move.l	a0,ST_vfargs+4(a3)
	lea	.file(pc),a0
	lea	fnbuf(pc),a1
	bsr	rawdof
	rts

.createoptscr
;	lea	start+$17ab6(pc),a1	;fade out
;	move.l	(a1),a0			;start+$4d100 (null palette)
;	move.l	6(a1),a1		;start+$4ca1c (copper list)
;	lea	start+$0e5d8+$8000(pc),a2
;	lea	-$8000(a2),a2
;	jsr	(a2)

	move.w	ST_lastbank(a3),ST_newbank(a3)
	move.l	a3,-(sp)
	lea	start+$0e27a+$8000(pc),a2
	move.l	-$8000(a2),a1
	move.l	a1,a3
	lea	pic(pc),a0
	lea	bakpic-pic(a0),a2
;	move.l	a0,a2
;	add.l	#bakpic-pic,a2
	move.l	$286(a5),d0
	beq.s	.scrskp
	move.l	d0,a3
.scrskp	move.w	#(40000/4)-1,d1
.scrcpy	move.l	(a3)+,(a2)+
	dbra	d1,.scrcpy
	move.l	a1,a2
	move.l	#((bakpic-pic+3)/4)-1,d0
.edpcop	move.l	(a0)+,(a1)+
	dbra	d0,.edpcop
	move.l	a2,a0
	bsr	fimpdecrunch
	move.l	(sp)+,a3
	lea	start+$0e286+$8000(pc),a2
	jsr	-$8000(a2)		;copy pic to $906c0

	moveq.l	#7,d0
	lea	start+$00fc8+$18000(pc),a2
	sub.l	#$18000,a2
	jsr	(a2)
	lea	start+$01712+$18000(pc),a2
	sub.l	#$18000,a2
	jsr	(a2)
	bsr	start+$16722

	move.w	$120(a5),ST_vfargs(a3)
	lea	ST_mstyle(a3),a0
	move.l	a0,ST_vfargs+2(a3)
	lea	.mitext(pc),a0
	lea	ST_vfbuffer+6(a3),a1
	bsr	rawdof
	lea	ST_vfbuffer(a3),a0
	move.l	#$07010730,(a0)
	move.w	#$801,4(a0)
	bsr.s	.outtxt
	st	ST_lastupdbank(a3)
	bsr.s	.updateitem
	rts

.updateitem
	move.w	ST_newbank(a3),d0
	cmp.w	ST_lastupdbank(a3),d0
	bne.s	.updcnt
	rts
.updcnt	move.w	d0,ST_lastupdbank(a3)
	moveq.l	#7,d7
	moveq.l	#0,d6
	moveq.l	#$4c,d5
	lea	ST_catbuf(a3),a2
.itloop	move.w	d6,ST_vfargs(a3)
	addq.w	#1,ST_vfargs(a3)
	move.l	a2,ST_vfargs+2(a3)
	lea	.mitem(pc),a0
	lea	ST_vfbuffer+6(a3),a1
	bsr	rawdof
	lea	ST_vfbuffer(a3),a0
	move.l	#$07010700,(a0)
	move.b	d5,3(a0)
	move.w	#$800,4(a0)
	cmp.w	ST_newbank(a3),d6
	bne.s	.notcur
	move.b	#4,5(a0)
.notcur	bsr.s	.outtxt
	lea	32(a2),a2
	add.w	#10,d5
	addq.w	#1,d6
	dbra	d7,.itloop
	rts

.outtxt	movem.l	a2/d4-d7,-(sp)
	lea	start+$0f356+$8000(pc),a2
;	lea	-$8000(a2),a2
	jsr	-$8000(a2)
	movem.l	(sp)+,a2/d4-d7
	rts

.restoreoldscr
	bsr	start+$16736
	lea	start+$0e272+$8000(pc),a2	;$6e3a0
	jsr	-$8000(a2)
;	lea	start+$0e288+$8000(pc),a2	;$906c0
	lea	start+$0e28E+$8000(pc),a2	;$6e3a0
	move.l	-$8000(a2),a1
	lea	pic(pc),a0
	add.l	#bakpic-pic,a0
;	move.l	$286(a5),d0
;	beq.s	.sc2skp
;	move.l	d0,a0
.sc2skp	move.w	#(40000/4)-1,d1
.sc2cpy	move.l	(a0)+,(a1)+
	dbra	d1,.sc2cpy
	lea	start+$01018+$18000(pc),a2
	sub.l	#$18000,a2
	jsr	(a2)
	rts

.file	dc.b	'df0:%s/%s.wld',0
	even
.cat	dc.b	'df0:%s/cat.dat',0
.mpract	dc.b	'practice',0
;	dc.b	7,1,?,y,?,?,?
.mitext	dc.b	5,'About to load level %d of %s tribe.',10
	dc.b	'Currently selected: ',0
	dc.b	0
.mitem	dc.b	'%02.d: %s',0
	even

	IFEQ	0
flash	move.l	d0,-(sp)
	moveq.l	#-1,d0
.dra	move.w	d0,$DFF180
	dbra	d0,.dra
.dra2	move.w	#$F00,$DFF180
	dbra	d0,.dra2
	move.l	(sp)+,d0
	rts
	ENDC

customgfx
	lea	locvars(pc),a3
	move.l	a1,ST_mapadr(a3)
	move.l	a0,ST_custdat(a3)
	lea	CUST_OFFSET+4(a0),a0
	move.l	a0,ST_vfargs(a3)
	lea	.cust(pc),a0
	lea	fnbuf(pc),a1
	bsr	rawdof
	moveq.w	#5,d0
	bsr.s	playsound
	lea	bakpic(pc),a1
;	move.l	ST_mapadr(a3),a1
	bsr	loadfil
	lea	bakpic(pc),a0
	move.l	ST_mapadr(a3),a1
	bsr	unpackilbm
	tst.l	d0
	beq.s	.err
	move.l	ST_custdat(a3),a0		;custom palette
	lea	CMAP_OFFSET(a0),a0
	cmp.l	#'CMAP',(a0)
	bne.s	.skipcm
	move.l	a3,-(sp)
	lea	start+$01068e+$7000(pc),a2
	jsr	-$7000(a2)
	move.l	(sp)+,a3

.skipcm	move.l	ST_mapadr(a3),a0
	move.w	#($7B00/4)-1,d2
	movem.l	a1-a4,-(sp)
	lea	$7B00(a0),a1
	lea	$7B00(a1),a2
	lea	$7B00(a2),a3
	lea	$7B00(a3),a4
.makmsk	move.l	(a0)+,d0
	or.l	(a1)+,d0
	or.l	(a2)+,d0
	or.l	(a3)+,d0
	move.l	d0,(a4)+
	dbra	d2,.makmsk
	movem.l	(sp)+,a1-a4
;	lea	start+$00c584+$10000(pc),a2
;	sub.l	#$10000,a2
;	jsr	(a2)
.err	rts
.cust	dc.b	'df0:%s',0
	even

playsound
	movem.l	a0-a6/d0-d7,-(sp)
	move.l	start+$17310(pc),a0
	move.w	d0,$15c(a5)
	jsr	(a0)
	movem.l	(sp)+,a0-a6/d0-d7
	rts

rawdof	movem.l	a2/a3/a6,-(sp)
	lea	.makbuf(pc),a2
	lea	ST_vfargs(a3),a3
	exg	a3,a1
	move.l	4.w,a6
	jsr	_LVORawDoFmt(a6)
	movem.l	(sp)+,a2/a3/a6
	rts
.makbuf	move.b	d0,(a3)+
	rts

unpackilbm					;success=UnpackILBM(a0=*iffbuffer,a1=*planes)
	movem.l	a0-a6/d1-d7,-(sp)
	cmp.l	#'FORM',(a0)+
	bne.s	.err
	move.l	(a0)+,d7
	add.l	a0,d7
	cmp.l	#'ILBM',(a0)+
	bne.s	.err
.chklop	move.l	(a0)+,d0
	move.l	(a0)+,d6
	cmp.l	#'BMHD',d0
	beq.s	.bmhd
	cmp.l	#'BODY',d0
	beq	.body
.chkret	addq.l	#1,d6
	and.b	#$FE,d6
	add.l	d6,a0
	cmp.l	a0,d7
	bne.s	.chklop
	bra.s	.err
.good	addq.l	#4,sp
.goodz	moveq.l	#-1,d0
	bra.s	.good2
.err	bsr	flash
	moveq.l	#0,d0
.good2	movem.l	(sp)+,a0-a6/d1-d7
	rts
.bmhd	move.w	(a0),ST_iffwx(a3)		;width
	move.w	2(a0),ST_iffwy(a3)		;height
	moveq.l	#0,d0
	move.b	8(a0),d0			;planes
	cmp.w	#4,d0
	bne.s	.err
	move.w	d0,ST_iffpl(a3)
	move.b	9(a0),d0			;masking
	cmp.w	#1,d0
	beq.s	.err
	cmp.w	#4,d0
	beq.s	.err
	move.b	10(a0),ST_iffpk+1(a3)		;compression
	move.w	ST_iffwy(a3),d0
	move.w	$10E(a5),d1
	subq.w	#4,d1
	lsl.w	#3,d1
	cmp.w	d0,d1
	bne.s	.err
	move.w	ST_iffwx(a3),d0
	move.w	$10C(a5),d1
	subq.w	#2,d1
	lsl.w	#4,d1
	cmp.w	d0,d1
	bne.s	.err
	lsr.w	#3,d0
	move.w	d0,ST_iffbpr(a3)
	lea	ST_iffplanes(a3),a2
	move.w	$10C(a5),d0
	lsl.w	#5,d0
	lea	2(a1,d0.w),a1
	move.l	a1,(a2)+
	lea	$7B00(a1),a1
	move.l	a1,(a2)+
	lea	$7B00(a1),a1
	move.l	a1,(a2)+
	lea	$7B00(a1),a1
	move.l	a1,(a2)
	bra	.chkret

.body	moveq.w	#3,d5				;planecount
	move.w	ST_iffbpr(a3),d4		;bytecount
	lea	ST_iffplanes(a3),a2
	move.w	ST_iffwy(a3),d3
	move.l	(a2),a1
.bdylop	
	tst.w	ST_iffpk(a3)
	bne.s	.rle
	move.w	ST_iffbpr(a3),d0
	subq.w	#1,d0
.coplop	move.b	(a0)+,(a1)+
	dbra	d0,.coplop
	bra.s	.chkit2
.rle	moveq.l	#0,d0
	move.b	(a0)+,d0
	cmp.w	#128,d0
	beq.s	.bdylop
	blt.s	.datcop
	neg.w	d0
	add.w	#256,d0

.filrow	sub.w	d0,d4
	subq.w	#1,d4
	move.b	(a0)+,d1
.datfil	move.b	d1,(a1)+
	dbra	d0,.datfil
.chkit	tst.w	d4
	bne.s	.bdylop
.chkit2	bsr	.nxtrow
	bra.s	.bdylop

.datcop	sub.w	d0,d4
	subq.w	#1,d4
.datlop	move.b	(a0)+,(a1)+
	dbra	d0,.datlop
	bra.s	.chkit

.nxtrow	move.w	ST_iffbpr(a3),d4
	addq.l	#4,a1
	move.l	a1,(a2)+
	dbra	d5,.nxtrts
	subq.w	#1,d3
	beq	.good
	moveq.l	#3,d5
	lea	ST_iffplanes(a3),a2
.nxtrts	move.l	(a2),a1
	rts

fimpdecrunch					;FImpDecrunch(a0=*decrunchbuffer)
	movem.l	d2-d5/a2-a4,-(sp)
	move.l	a0,a3
	move.l	a0,a4
	addq.l	#4,a0
	add.l	(a0)+,a4
	add.l	(a0)+,a3
	move.l	a3,a2
	move.l	(a2)+,-(a0)
	move.l	(a2)+,-(a0)
	move.l	(a2)+,-(a0)
	move.l	(a2)+,d2
	move.w	(a2)+,d3
	bmi.s	.lb17ee
	subq.l	#1,a3
.lb17ee	lea	-$1c(sp),sp
	move.l	sp,a1
	moveq.l	#6,d0
.lb17f6	move.l	(a2)+,(a1)+
	dbra	d0,.lb17f6
	move.l	sp,a1
.lb1e70	tst.l	d2
	beq.s	.lb1e7a
.lb1e74	move.b	-(a3),-(a4)
	subq.l	#1,d2
	bne.s	.lb1e74
.lb1e7a	cmp.l	a4,a0
	bcs.s	.lb1e92
	lea	$1c(sp),sp
;	moveq.l	#-1,d0
;	cmp.l	a3,a0
;	beq.s	.lb1e8a
;	moveq.l	#0,d0
.lb1e8a	movem.l	(sp)+,d2-d5/a2-a4
;	tst.l	d0
	rts

.lb1e92	add.b	d3,d3
	bne.s	.lb1e9a
	move.b	-(a3),d3
	addx.b	d3,d3
.lb1e9a	bcc.s	.lb1f04
	add.b	d3,d3
	bne.s	.lb1ea4
	move.b	-(a3),d3
	addx.b	d3,d3
.lb1ea4	bcc.s	.lb1efe
	add.b	d3,d3
	bne.s	.lb1eae
	move.b	-(a3),d3
	addx.b	d3,d3
.lb1eae	bcc.s	.lb1ef8
	add.b	d3,d3
	bne.s	.lb1eb8
	move.b	-(a3),d3
	addx.b	d3,d3
.lb1eb8	bcc.s	.lb1ef2
	moveq.l	#0,d4
	add.b	d3,d3
	bne.s	.lb1ec4
	move.b	-(a3),d3
	addx.b	d3,d3
.lb1ec4	bcc.s	.lb1ece
	move.b	-(a3),d4
	moveq.l	#3,d0
	subq.b	#1,d4
	bra.s	.lb1f08
.lb1ece	add.b	d3,d3
	bne.s	.lb1ed6
	move.b	-(a3),d3
	addx.b	d3,d3
.lb1ed6	addx.b	d4,d4
	add.b	d3,d3
	bne.s	.lb1ee0
	move.b	-(a3),d3
	addx.b	d3,d3
.lb1ee0	addx.b	d4,d4
	add.b	d3,d3
	bne.s	.lb1eea
	move.b	-(a3),d3
	addx.b	d3,d3
.lb1eea	addx.b	d4,d4
	addq.b	#5,d4
	moveq.l	#3,d0
	bra.s	.lb1f08
.lb1ef2	moveq.l	#4,d4
	moveq.l	#3,d0
	bra.s	.lb1f08
.lb1ef8	moveq.l	#3,d4
	moveq.l	#2,d0
	bra.s	.lb1f08
.lb1efe	moveq.l	#2,d4
	moveq.l	#1,d0
	bra.s	.lb1f08
.lb1f04	moveq.l	#1,d4
	moveq.l	#0,d0
.lb1f08	moveq.l	#0,d5
	move.w	d0,d1
	add.b	d3,d3
	bne.s	.lb1f14
	move.b	-(a3),d3
	addx.b	d3,d3
.lb1f14	bcc.s	.lb1f2c
	add.b	d3,d3
	bne.s	.lb1f1e
	move.b	-(a3),d3
	addx.b	d3,d3
.lb1f1e	bcc.s	.lb1f28
	move.b	.lb1f8c(pc,d0.w),d5
	addq.b	#8,d0
	bra.s	.lb1f2c
.lb1f28	moveq.l	#2,d5
	addq.b	#4,d0
.lb1f2c	move.b	.lb1f90(pc,d0.w),d0
.lb1f30	add.b	d3,d3
	bne.s	.lb1f38
	move.b	-(a3),d3
	addx.b	d3,d3
.lb1f38	addx.w	d2,d2
	subq.b	#1,d0
	bne.s	.lb1f30
	add.w	d5,d2
	moveq.l	#0,d5
	move.l	d5,a2
	move.w	d1,d0
	add.b	d3,d3
	bne.s	.lb1f4e
	move.b	-(a3),d3
	addx.b	d3,d3
.lb1f4e	bcc.s	.lb1f6a
	add.w	d1,d1
	add.b	d3,d3
	bne.s	.lb1f5a
	move.b	-(a3),d3
	addx.b	d3,d3
.lb1f5a	bcc.s	.lb1f64
	move.w	8(a1,d1.w),a2
	addq.b	#8,d0
	bra.s	.lb1f6a
.lb1f64	move.w	(a1,d1.w),a2
	addq.b	#4,d0
.lb1f6a	move.b	$10(a1,d0.w),d0
.lb1f6e	add.b	d3,d3
	bne.s	.lb1f76
	move.b	-(a3),d3
	addx.b	d3,d3
.lb1f76	addx.l	d5,d5
	subq.b	#1,d0
	bne.s	.lb1f6e
	addq.w	#1,a2
	add.l	d5,a2
	add.l	a4,a2
.lb1f82	move.b	-(a2),-(a4)
	dbra	d4,.lb1f82
	bra	.lb1e70

.lb1f8c	dc.l	$060a0a12
.lb1f90	dc.l	$01010101
	dc.l	$02030304
	dc.l	$0405070e

fnbuf	ds.b	80

locvars	ds.b	ST_SIZEOF
pic	incbin	'L2Ed/|L2EdPic.bin.im',0
	even
bakpic	;ds.b	40000

	dc.b	'$VER: L2EdPatch V2.0 (17-Feb-97) by Chris Hodges.',0
	even

	section	blab,BSS
	ds.b	10
	section	blab1,BSS
	ds.b	10
	section	blab2,BSS
	ds.b	10
