		opt	o+,ow-,ow6+
		output	Source:Install

		; Install v1.2
		; © 1990 by David Kinder

		; "It installs disks!"

		; Assemble using Devpac v3

		; Note that the header "system.gs" must be compiled
		; with v36 or higher include files.

		; Thanks to HiSoft, Iron Maiden, Megadeth, Judas Priest,
		; The Sisters of Mercy, The Damned and Oriel...

		section	Install_Code,code

		incdir	Source:include/
		include	devices/trackdisk.i
		include	workbench/icon_lib.i
		include	workbench/workbench.i

CALLSYS		MACRO				; A usefull macro, saves
		jsr	_LVO\1(a6)		; a few bytes
		ENDM

		suba.l	a1,a1
		CALLEXEC FindTask
		move.l	d0,a5

		tst.l	pr_CLI(a5)		; Are we CLI or Workbench?
		bne.s	EndStartup

		lea	pr_MsgPort(a5),a0
		CALLSYS	WaitPort		; Wait for a message
		lea	pr_MsgPort(a5),a0
		CALLSYS	GetMsg			; Then get it
		move.l	d0,ReturnMsg

EndStartup	bsr.s	_Main
		tst.l	ReturnMsg
		beq.s	ExitToDOS
		CALLEXEC Forbid
		move.l	ReturnMsg,a1
		CALLSYS	ReplyMsg

ExitToDOS	moveq	#0,d0
		rts

_Main		lea	IntName,a1		; Open 'intuition.library'
		moveq	#36,d0
		CALLEXEC OpenLibrary
		move.l	d0,_IntuitionBase
		beq.s	NoNewOS

		lea	Gadg0,a0
		bsr.s	ModGadg2
		lea	Gadg1,a0
		bsr.s	ModGadg2
		lea	Gadg2,a0
		bsr.s	ModGadg
		lea	Gadg3,a0
		bsr.s	ModGadg

		eori	#CHECKED,KS13O+mi_Flags
		eori	#CHECKED,KS20O+mi_Flags
		bra.s	RunAllOS

ModGadg		subi	#1,gg_TopEdge(a0)	; Changes for OS 2.0
ModGadg2	subi	#2,gg_LeftEdge(a0)
		addi	#4,gg_Width(a0)
		addi	#2,gg_Height(a0)
		move.l	#x2_GBord1,gg_GadgetRender(a0)
		move.l	gg_GadgetText(a0),a1
		addi	#2,it_LeftEdge(a1)
		addi	#1,it_TopEdge(a1)
		move.b	#2,it_FrontPen(a1)
		rts

NoNewOS		lea	IntName,a1		; Try again
		moveq	#0,d0
		CALLEXEC OpenLibrary
		move.l	d0,_IntuitionBase
		beq	NoIntuition		; Open failed

RunAllOS	lea	DosName,a1		; Open 'dos.library'
		moveq	#0,d0
		CALLSYS	OpenLibrary
		move.l	d0,_DOSBase
		beq	NoDos
		lea	GfxName,a1		; Open 'graphics.library'
		moveq	#0,d0
		CALLSYS	OpenLibrary
		move.l	d0,_GfxBase
		beq	NoGfx

		tst.l	ReturnMsg		; Workbench?
		beq.s	NoIconLib

		lea	IconName,a1		; Open 'icon.library'
		moveq	#0,d0
		CALLSYS	OpenLibrary
		move.l	d0,_IconBase
		beq.s	NoIconLib

		move.l	ReturnMsg,a3
		move.l	sm_ArgList(a3),a3
		move.l	wa_Lock(a3),d1
		CALLDOS	CurrentDir		; Move to current directory

		move.l	wa_Name(a3),a0
		CALLICON GetDiskObject
		move.l	d0,a5
		tst.l	d0
		beq.s	EndIconFind

		move.l	do_ToolTypes(a5),a0
		lea	ToolType,a1
		CALLSYS	FindToolType
		beq.s	EndIconCode

		move.b	#1,CheckTest
EndIconCode	move.l	a5,a0
		CALLSYS	FreeDiskObject

EndIconFind	move.l	_IconBase,a1
		CALLEXEC CloseLibrary

NoIconLib	moveq	#0,d0
		lea	SBBlock,a0
		lea	DiskBuffer1,a1
BootLoop1	move	(a0,d0),(a1,d0)		; Transfer bootblock
		addq	#2,d0
		cmpi	#EBBlock-SBBlock,d0
		bne	BootLoop1

		moveq	#0,d0
		lea	SNBBlock,a0
		lea	DiskBuffer2,a1
BootLoop2	move	(a0,d0),(a1,d0)
		addq	#2,d0
		cmpi	#ENBBlock-SNBBlock,d0
		bne	BootLoop2

		moveq	#MP_SIZE,d0		; Put together a port where
		move.l	#MEMF_PUBLIC!MEMF_CLEAR,d1
		CALLEXEC AllocMem		; we can recieve messages
		move.l	d0,a3			; from 'trackdisk.device'
		beq	NoMemPort
		move.l	a3,MsgPort
		moveq	#-1,d0
		CALLSYS	AllocSignal
		cmpi.b	#-1,d0
		beq	NoSigPort
		move.b	d0,MP_SIGBIT(a3)
		suba.l	a1,a1
		CALLSYS	FindTask
		move.b	#NT_MSGPORT,LN_TYPE(a3)
		move.b	#PA_SIGNAL,MP_FLAGS(a3)
		move.l	d0,MP_SIGTASK(a3)
		lea	MP_MSGLIST(a3),a0
		NEWLIST	a0

		moveq	#IOSTD_SIZE,d0		; Now use message port
		move.l	#MEMF_PUBLIC!MEMF_CLEAR,d1
		CALLSYS	AllocMem		; to construct an
		tst.l	d0			; IORequest struct so we
		beq	NoMemIO			; can communicate with
		move.l	d0,a0			; the drive
		move.l	a0,IORequest
		move.l	a3,MN_REPLYPORT(a0)
		move	#IOSTD_SIZE,MN_LENGTH(a0)
		move.b	#NT_MESSAGE,LN_TYPE(a0)

		moveq	#0,d0			; Which drives are present?
		lea	Gadg0+gg_Flags,a5
		bsr	CheckDevice
		moveq	#1,d0
		lea	Gadg1+gg_Flags,a5
		bsr	CheckDevice
		moveq	#2,d0
		lea	Gadg2+gg_Flags,a5
		bsr	CheckDevice
		moveq	#3,d0
		lea	Gadg3+gg_Flags,a5
		bsr	CheckDevice

		bsr	AdjustAll
		lea	MyWindow,a0		; Open our window on
		CALLINT	OpenWindow		; Workbench screen
		move.l	d0,Windowhd
		bne.s	GotWindow		; Open window failed
		lea	MyWindow,a0
		clr	nw_TopEdge(a0)
		CALLSYS	OpenWindow		; Try again
		move.l	d0,Windowhd
		beq	NoWindow

GotWindow	move.l	Windowhd,a1		; Set default font
		move.l	wd_RPort(a1),a1
		move.l	a5,a0
		CALLGRAF SetFont
		move.l	Windowhd,a0
		move.l	wd_UserPort(a0),UserPort
		move.l	wd_RPort(a0),a0
		lea	Text,a1
		moveq	#0,d0
		moveq	#0,d1
		CALLINT	PrintIText		; Print credit
		move.l	Windowhd,a0
		lea	BootMenu,a1
		CALLSYS	SetMenuStrip
		move.l	Windowhd,a0
		movea.l	#-1,a1
		lea	ScreenTitle,a2
		CALLSYS	SetWindowTitles		; Change title

MainLoop	move.l	UserPort,a0		; Wait for an Intuition
		CALLEXEC WaitPort		; message...
CheckMessage	move.l	UserPort,a0
		CALLEXEC GetMsg
		tst.l	d0
		beq	MainLoop
		move.l	d0,a1
		move.l	im_Class(a1),d2		; Store the message
		move.l	im_IAddress(a1),a2
		CALLSYS	ReplyMsg
		cmpi.l	#CLOSEWINDOW,d2		; Is it close time?
		beq.s	QuitProper
		cmpi.l	#GADGETUP,d2
		beq	StartInstall
		bra	CheckMessage

QuitProper	move.l	Windowhd,a0		; Close window
		CALLINT	ClearMenuStrip
		move.l	Windowhd,a0
		CALLSYS	CloseWindow
NoWindow	move.l	IORequest,a1		; Free IORequest
		moveq	#IOSTD_SIZE,d0
		CALLEXEC FreeMem
NoMemIO		move.l	MsgPort,a3		; Unlink MsgPort
		moveq	#0,d0
		move.b	MP_SIGBIT(a3),d0
		CALLEXEC FreeSignal
NoSigPort	move.l	MsgPort,a1		; Free MsgPort
		moveq	#MP_SIZE,d0
		CALLEXEC FreeMem
NoMemPort	move.l	_GfxBase,a1		; Close Graphics
		CALLEXEC CloseLibrary
NoGfx		move.l	_DOSBase,a1		; Close DOS
		CALLEXEC CloseLibrary
NoDos		move.l	_IntuitionBase,a1	; Close Intuition
		CALLEXEC CloseLibrary
NoIntuition	rts

CheckDevice	lea	TrackDisk,a0		; Check for a drive and
		move.l	IORequest,a1		; disable gadget if not
		moveq	#0,d1			; present
		CALLEXEC OpenDevice
		cmpi	#TDERR_BadDriveType,d0
		bne.s	DeviceOn
		move	#GADGHCOMP!GADGDISABLED,(a5)
		rts
DeviceOn	tst	d0
		bne.s	OtherFail
		move.l	IORequest,a1
		CALLSYS	CloseDevice
OtherFail	rts

StartInstall	move	KS13O+mi_Flags,d0	; 1.3 (OFS) bootblock?
		andi	#CHECKED,d0
		beq.s	Check2
		move.l	#DiskBuffer1,DiskBuffer
		bra.s	StartGadg

Check2		move.l	#DiskBuffer2,DiskBuffer
		move	KS20O+mi_Flags,d0	; 2.0 (OFS) bootblock?
		andi	#CHECKED,d0
		beq.s	ChangeFFS
		clr.b	DiskBuffer2+3
		move.l	#$E33D0E73,DiskBuffer2+4
		bra.s	StartGadg

ChangeFFS	move.b	#1,DiskBuffer2+3	; Changes for FFS bootblock
		move.l	#$E33D0E72,DiskBuffer2+4

StartGadg	move	gg_GadgetID(a2),d0	; Which gadget was it?
		move.b	d0,d7
		addi.b	#$30,d0
		move.b	d0,CheckTxtPt
		cmpi.b	#1,CheckTest
		beq.s	NoTest

		move.l	Windowhd,a0
		lea	CheckText,a1
		lea	CYes,a2
		lea	CNo,a3
		moveq	#0,d0
		moveq	#0,d1
		move	AutoReqX+0,d2
		move	AutoReqY,d3
		CALLINT	AutoRequest		; Are you sure?
		tst.l	d0
		beq	CheckMessage

NoTest		lea	TrackDisk,a0
		moveq	#0,d0
		move.b	d7,d0
		move.l	IORequest,a1
		moveq	#0,d1
		CALLEXEC OpenDevice
		beq.s	NoOpenErr

		moveq	#1,d0
		bsr	ErrorTime
		bra	CheckMessage

NoOpenErr	move.l	IORequest,a1
		move	#TD_CHANGESTATE,IO_COMMAND(a1)
		CALLSYS	DoIO
		move.l	IORequest,a1
		move.l	IO_ACTUAL(a1),d0
		beq.s	NoDiskError

		move.l	Windowhd,a0
		lea	NoDiskErr,a1
		suba.l	a2,a2
		lea	AbortText,a3
		moveq	#0,d0
		moveq	#0,d1
		move	AutoReqX+2,d2
		move	AutoReqY,d3
		CALLINT	AutoRequest
		bra.s	CloseInstall

NoDiskError	move	#TD_PROTSTATUS,IO_COMMAND(a1)
		CALLSYS	DoIO			; Check write protect
		move.l	IORequest,a1
		move.l	IO_ACTUAL(a1),d0
		beq.s	NoProtErr

		move.l	Windowhd,a0
		lea	ProtectErr,a1
		suba.l	a2,a2
		lea	AbortText,a3
		moveq	#0,d0
		moveq	#0,d1
		move	AutoReqX+4,d2
		move	AutoReqY,d3
		CALLINT	AutoRequest
		bra.s	CloseInstall

NoProtErr	move.l	#1024,IO_LENGTH(a1)	; Set up command
		move.l	DiskBuffer,IO_DATA(a1)
		move	#CMD_WRITE,IO_COMMAND(a1)
		clr.l	IO_OFFSET(a1)
		CALLSYS	DoIO			; Send new bootblock

		move.l	IORequest,a1
		move.b	IO_ERROR(a1),d0
		beq.s	NoWriteErr
		bsr.s	ErrorTime

CloseInstall	move.l	IORequest,a1
		CALLEXEC CloseDevice
		bra	CheckMessage

NoWriteErr	move	#CMD_UPDATE,IO_COMMAND(a1)
		CALLSYS	DoIO			; Force track write

		move.l	IORequest,a1
		clr.l	IO_LENGTH(a1)
		move	#TD_MOTOR,IO_COMMAND(a1)
		CALLSYS	DoIO			; Motor off
		bra	CloseInstall

ErrorTime	move.l	Windowhd,a0
		lea	GeneralErr,a1
		suba.l	a2,a2
		lea	AbortText,a3
		moveq	#0,d0
		moveq	#0,d1
		move	AutoReqX+6,d2
		move	AutoReqY,d3
		CALLINT	AutoRequest
		rts

AdjustAll	move.l	#sc_RastPort+rp_SIZEOF,d0
		move.l	#MEMF_CLEAR,d1		; Modify structures for
		CALLEXEC AllocMem		; different fonts
		tst.l	d0
		beq	NoMemA
		move.l	d0,a4
		move.l	d0,a0
		move.l	#sc_RastPort+rp_SIZEOF,d0
		move	#WBENCHSCREEN,d1
		suba.l	a1,a1
		CALLINT	GetScreenData		; Find screen
		move	sc_RastPort+rp_TxHeight(a4),d7
		lea	sc_RastPort(a4),a1
		lea	Txt,a0
		moveq	#22,d0
		CALLGRAF TextLength
		move	d0,d6

		lea	sc_RastPort(a4),a1
		lea	BootName,a0
		moveq	#9,d0
		CALLSYS	TextLength
		add	sc_RastPort+rp_TxWidth(a4),d0
		move	d0,BootMenu+mu_Width

		lea	MyWindow,a0		; Scale window etc.
		move	nw_Width(a0),d0
		muls	d6,d0
		divs	#176,d0
		move	d0,nw_Width(a0)
		move	nw_Height(a0),d0
		muls	d7,d0
		lsr	#3,d0
		move	d0,nw_Height(a0)

		lea	AutoReqX,a0
AutoLoop	move	(a0),d0
		beq.s	DoLastAuto
		muls	d6,d0
		divs	#176,d0
		move	d0,(a0)+
		bra	AutoLoop
DoLastAuto	move	AutoReqY,d0
		muls	d7,d0
		lsr	#3,d0
		move	d0,AutoReqY

		move	sc_RastPort+rp_TxWidth(a4),d0
		mulu	#10,d0			; Scale menus
		addi	#COMMWIDTH+CHECKWIDTH,d0
		move	d0,KS13O+mi_Width
		move	d0,KS20O+mi_Width
		move	d0,KS20F+mi_Width
		move	d7,d0
		addq	#1,d0
		move	d0,KS13O+mi_Height
		move	d0,KS20O+mi_Height
		move	d0,KS20F+mi_Height
		move	d0,KS20O+mi_TopEdge
		lsl	#1,d0
		move	d0,KS20F+mi_TopEdge

		moveq	#22,d2
		move	MyWindow+nw_Width,d3
		lea	Text,a2
		bsr	ScaleText
		lea	Gadg0,a0
		move	gg_Width(a0),d4
		move	gg_Height(a0),d5
		bsr	ScaleGadget
		lea	Gadg1,a0
		bsr	ScaleGadget
		lea	Gadg2,a0
		bsr	ScaleGadget
		lea	Gadg3,a0
		bsr	ScaleGadget
		lea	GadgBord1,a0
		bsr	ScaleBorder
		lea	GadgBord2,a0
		bsr.s	ScaleBorder
		lea	GadgBord3,a0
		bsr.s	ScaleBorder
		lea	x2_GBord1,a0
		bsr.s	ScaleBorder
		lea	x2_GBord2,a0
		bsr.s	ScaleBorder

		lea	CheckText,a2
		bsr.s	ScaleText2
		lea	AbortText,a2
		bsr.s	ScaleText2
		lea	GeneralErr,a2
		bsr.s	ScaleText2
		lea	ProtectErr,a2
		bsr.s	ScaleText2
		lea	NoDiskErr,a2
		bsr.s	ScaleText2
		lea	CYes,a2
		bsr.s	ScaleText2
		lea	CNo,a2
		bsr.s	ScaleText2

		move.l	sc_RastPort+rp_Font(a4),a5
		move.l	#sc_RastPort+rp_SIZEOF,d0
		move.l	a4,a1
		CALLEXEC FreeMem
NoMemA		rts

ScaleText2	move	it_LeftEdge(a2),d0	; Scale IText (a2)
		muls	d6,d0
		divs	#176,d0
		move	d0,it_LeftEdge(a2)
		bra	ScaleText3

ScaleBorder	move.b	bd_Count(a0),d1		; Scale Border (a0)
		move.l	bd_XY(a0),a0
BordLoop1	move	(a0),d0
		cmpi	#10,d0
		blt.s	BordLoop2
		sub	d4,d0
		add	Gadg0+gg_Width,d0
BordLoop2	move	d0,(a0)+
		move	(a0),d0
		cmpi	#10,d0
		blt.s	BordLoop3
		sub	d5,d0
		add	Gadg0+gg_Height,d0
BordLoop3	move	d0,(a0)+
		subq.b	#1,d1
		bne	BordLoop1
		rts

ScaleGadget	move	gg_LeftEdge(a0),d0	; Scale Gadget (a0)
		muls	d6,d0
		divs	#176,d0
		move	d0,gg_LeftEdge(a0)
		move	gg_TopEdge(a0),d0
		muls	d7,d0
		lsr	#3,d0
		move	d0,gg_TopEdge(a0)
		move	gg_Width(a0),d0
		muls	d6,d0
		divs	#176,d0
		move	d0,gg_Width(a0)
		move	gg_Height(a0),d0
		muls	d7,d0
		lsr	#3,d0
		move	d0,gg_Height(a0)
		moveq	#3,d2
		move	gg_Width(a0),d3
		move.l	gg_GadgetText(a0),a2
ScaleText	lea	sc_RastPort(a4),a1	; Scale IText (a2) with
		move.l	it_IText(a2),a0		; length (d2) in space (d3)
		move	d2,d0
		CALLGRAF TextLength
		sub	d0,d3
		lsr	#1,d3
		move	d3,it_LeftEdge(a2)
ScaleText3	move	it_TopEdge(a2),d0
		muls	d7,d0
		lsr	#3,d0
		move	d0,it_TopEdge(a2)
		rts

		; The following code represents the standard 1.3 bootblock

SBBlock		dc.b	"DOS",0
		dc.l	$C0200F19
		dc.l	$00000370
		lea	Boot1(pc),a1
		jsr	_LVOFindResident(a6)
		tst.l	d0
		beq.s	Boot2
		move.l	d0,a0
		move.l	22(a0),a0
		moveq	#0,d0
Boot3		rts
Boot2		moveq	#-1,d0
		bra.s	Boot3
Boot1		dc.b	"dos.library"
		even
EBBlock
		; This code is the 2.04 OFS bootblock

SNBBlock	dc.b	"DOS",0
		dc.l	$E33D0E73
		dc.l	$00000370
		lea	NBoot1(pc),a1
		moveq	#37,d0
		jsr	_LVOOpenLibrary(a6)
		tst.l	d0
		beq.s	NBoot2
		movea.l	d0,a1
		bset	#6,34(a1)
		jsr	_LVOCloseLibrary(a6)
NBoot2		lea	NBoot3(pc),a1
		jsr	_LVOFindResident(a6)
		tst.l	d0
		beq.s	NBoot4
		movea.l	d0,a0
		movea.l	22(a0),a0
		moveq	#0,d0
		rts
NBoot4		moveq	#-1,d0
		rts

NBoot3		dc.b	"dos.library",0
NBoot1		dc.b	"expansion.library",0
		even
ENBBlock
		section	Install_Data,data

MyWindow	dc.w	80,35,202,81
		dc.b	0,1
		dc.l	GADGETUP!CLOSEWINDOW
		dc.l	WINDOWDRAG!WINDOWDEPTH!WINDOWCLOSE!ACTIVATE!SMART_REFRESH
		dc.l	Gadg0,0,WindName,0,0
		dc.w	0,0,0,0,WBENCHSCREEN
WindName	dc.b	"Install v1.2",0
		even

BootMenu	dc.l	0
		dc.w	5,0,0,0,MENUENABLED
		dc.l	BootName
		dc.l	KS13O
		dc.w	0,0,0,0
BootName	dc.b	"BootBlock",0
		even

KS13O		dc.l	KS20O
		dc.w	0,0,0,0
		dc.w	HIGHCOMP!ITEMENABLED!ITEMTEXT!COMMSEQ!CHECKIT!CHECKED
		dc.l	2+4,KS13OName,0
		dc.b	"1",0
		dc.l	0
		dc.w	0
KS13OName	dc.b	0,1,0,0
		dc.w	1+CHECKWIDTH,1
		dc.l	0,KS13OText,0
KS13OText	dc.b	"OFS 1.3",0
		even

KS20O		dc.l	KS20F
		dc.w	0,0,0,0
		dc.w	HIGHCOMP!ITEMENABLED!ITEMTEXT!COMMSEQ!CHECKIT
		dc.l	1+4,KS20OName,0
		dc.b	"2",0
		dc.l	0
		dc.w	0
KS20OName	dc.b	0,1,0,0
		dc.w	1+CHECKWIDTH,1
		dc.l	0,KS20OText,0
KS20OText	dc.b	"OFS 2.0",0
		even

KS20F		dc.l	0
		dc.w	0,0,0,0
		dc.w	HIGHCOMP!ITEMENABLED!ITEMTEXT!COMMSEQ!CHECKIT
		dc.l	1+2,KS20FName,0
		dc.b	"3",0
		dc.l	0
		dc.w	0
KS20FName	dc.b	0,1,0,0
		dc.w	1+CHECKWIDTH,1
		dc.l	0,KS20FText,0
KS20FText	dc.b	"FFS 2.0",0
		even

Gadg0		dc.l	Gadg1
		dc.w	14,15,80,20,GADGHCOMP,RELVERIFY,BOOLGADGET
		dc.l	GadgBord1,0,Gadg0Text,0,0
		dc.w	0
		dc.l	0
Gadg0Text	dc.b	1,0,0,0
		dc.w	0,6
		dc.l	0,Gadg0Txt,0
Gadg0Txt	dc.b	"DF0",0
		even

Gadg1		dc.l	Gadg2
		dc.w	108,15,80,20,GADGHCOMP,RELVERIFY,BOOLGADGET
		dc.l	GadgBord1,0,Gadg1Text,0,0
		dc.w	1
		dc.l	0
Gadg1Text	dc.b	1,0,0,0
		dc.w	0,6
		dc.l	0,Gadg1Txt,0
Gadg1Txt	dc.b	"DF1",0
		even

Gadg2		dc.l	Gadg3
		dc.w	14,42,80,20,GADGHCOMP,RELVERIFY,BOOLGADGET
		dc.l	GadgBord1,0,Gadg2Text,0,0
		dc.w	2
		dc.l	0
Gadg2Text	dc.b	1,0,0,0
		dc.w	0,6
		dc.l	0,Gadg2Txt,0
Gadg2Txt	dc.b	"DF2",0
		even

Gadg3		dc.l	0
		dc.w	108,42,80,20,GADGHCOMP,RELVERIFY,BOOLGADGET
		dc.l	GadgBord1,0,Gadg3Text,0,0
		dc.w	3
		dc.l	0
Gadg3Text	dc.b	1,0,0,0
		dc.w	0,6
		dc.l	0,Gadg3Txt,0
Gadg3Txt	dc.b	"DF3",0
		even

CheckText	dc.b	0,0,0,0
		dc.w	9,7
		dc.l	0,CheckTxt,0
CheckTxt	dc.b	"Install disk in drive DF"
CheckTxtPt	dc.b	"0. Are you sure?",0
		even

Text		dc.b	1,0,0,0
		dc.w	0,68
		dc.l	0,Txt,0
Txt		dc.b	"© 1990 by David Kinder",0
		even

GadgBord1	dc.w	-2,-1
		dc.b	1,0,0,5
		dc.l	Coords1,GadgBord2
Coords1		dc.w	0,0,83,0,83,21,0,21,0,0

GadgBord2	dc.w	-2,-1
		dc.b	1,0,0,2
		dc.l	Coords2,GadgBord3
Coords2		dc.w	1,0,1,21

GadgBord3	dc.w	-2,-1
		dc.b	1,0,0,2
		dc.l	Coords3,0
Coords3		dc.w	82,0,82,21

x2_GBord1	dc.w	0,0
		dc.b	2,0,0,5
		dc.l	x2_Coords1,x2_GBord2
x2_Coords1	dc.w	82,0,0,0,0,21,1,20,1,0

x2_GBord2	dc.w	0,0
		dc.b	1,0,0,5
		dc.l	x2_Coords2,0
x2_Coords2	dc.w	1,21,83,21,83,0,82,1,82,21

TrackDisk	dc.b	"trackdisk.device",0
		even

ScreenTitle	dc.b	"Insert disk to be installed then click "
		dc.b	"on drive gadget",0
		even

AbortText	dc.b	0,1,0,0
		dc.w	6,3
		dc.l	0,AbortTxt,0
AbortTxt	dc.b	"Abort Operation",0
		even

GeneralErr	dc.b	0,1,0,0
		dc.w	9,7
		dc.l	0,GeneralTxt,0
GeneralTxt	dc.b	"Cannot install specified disk",0
		even

ProtectErr	dc.b	0,1,0,0
		dc.w	9,7
		dc.l	0,ProtectTxt,0
ProtectTxt	dc.b	"The disk is write protected!",0
		even

NoDiskErr	dc.b	0,1,0,0
		dc.w	9,7
		dc.l	0,NoDiskTxt,0
NoDiskTxt	dc.b	"There is no disk in the drive!",0
		even

CYes		dc.b	0,1,0,0
		dc.w	6,3
		dc.l	0,TYes,0
TYes		dc.b	"Yes",0
		even

CNo		dc.b	0,1,0,0
		dc.w	6,3
		dc.l	0,TNo,0
TNo		dc.b	"No",0
		even

ToolType	dc.b	"NOCHECK",0
		even

DosName		DOSNAME
GfxName		GRAFNAME
IconName	ICONNAME
IntName		INTNAME

AutoReqX	dc.w	360,281,265,276,0
AutoReqY	dc.w	53

		section	Install_BSS,bss

IORequest	ds.l	1
MsgPort		ds.l	1
Windowhd	ds.l	1
UserPort	ds.l	1
DiskBuffer	ds.l	1
ReturnMsg	ds.l	1
_DOSBase	ds.l	1
_GfxBase	ds.l	1
_IconBase	ds.l	1
_IntuitionBase	ds.l	1
CheckTest	ds.b	1

		section	Install_ChipBSS,bss_c

DiskBuffer1	ds.b	1024
DiskBuffer2	ds.b	1024
