	*»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»*
	* Title	    : Game selector
	* Usage	    : Private
	* Function  :
	* Note	    : 
	* Bugs	    : 
	* Created   : 5.4.95
	* Last add  : 5.4.95
	*»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»*

Version	=	0

	Incdir	Inc:
	Include	Digital.i
	Include	Digital.macs
	Include	dfunc/dfunc.i
;	Include	Startup.i
	Incdir
	Include	lvo:dfunc.lvo
*»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»*
Start	movem.l	d0-a6,-(sp)

;init libraries:

	move.l	$4.w,a6

	OpenLib	Int,Version
	beq.w	Close
	OpenLib	DFunc,Version
	beq.w	Close
	OpenLib	Dos,Version
	beq.w	Close

;init screen and window:

	move.l	IntB(pc),a6
	lea	Window(pc),a0
	jsr	-204(a6)		OpenWindow()
	move.l	d0,WinB
	beq.w	Close

	move.l	d0,a0
	move.l	86(a0),Port		IDCMP port of window
	move.l	50(a0),Rast		rastport of window

	move.l	46(a0),a0
	jsr	-252(a6)		ScreenToFront()
*»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»*
	move.l	DFuncB(pc),a6

	move.l	Rast(pc),a0
	lea	TextAtt(pc),a1
	moveq	#DGF_Force,d0
	DCall	SetFont			SetFont()

	move.l	Rast(pc),a0
	moveq	#7,d0
	DCall	SetPen			SetPen()

	move.l	WinB(pc),a0
	moveq	#CLR_Ghosted,d0
	DCall	FillWindow		FillWindow()

	move.l	Rast(pc),a0
	lea	Gads(pc),a1
	DCall	RenderGadgets		RenderGadgets()

	move.l	WinB(pc),a0
	lea	Gads(pc),a1
	DCall	InitScale		InitScale()
	move.l	d0,Scale

MAIN	move.l	Rast(pc),a0
	move.l	Port(pc),a1
	lea	Gads(pc),a2
	DCall	WaitGad			WaitGad()

	move.l	20(a0),d1
	cmp.b	#$2,d1			new size?
	beq.b	.scale

	lea	Gads(pc),a1
	DCall	GetID

	cmp.b	#99,d0
	beq.w	Exit

	cmp.b	#1,d0
	beq.w	Load1

	cmp.b	#2,d0
	beq.w	Load2

	cmp.b	#3,d0
	beq.w	Load3

	cmp.b	#4,d0
	beq.w	Load4

	cmp.b	#5,d0
	beq.w	Load5

	cmp.b	#6,d0
	beq.w	Load6

	cmp.b	#7,d0
	beq.w	Load7

	cmp.b	#8,d0
	beq.w	Load8

	cmp.b	#9,d0
	beq.w	Load9

	cmp.b	#10,d0
	beq.w	Load10

	bra.b	MAIN

.scale	move.l	Scale(pc),d0
	DCall	ScaleGads		ScaleGads()

	move.l	Rast(pc),a0
	moveq	#0,d0
	DCall	SetPen			SetPen()
	move.l	WinB(pc),a0
	moveq	#CLR_Normal,d0
	DCall	FillWindow		FillWindow()

	move.l	Rast(pc),a0
	moveq	#7,d0
	DCall	SetPen			SetPen()
	move.l	WinB(pc),a0
	moveq	#CLR_Ghosted,d0
	DCall	FillWindow		FillWindow()

	move.l	Rast(pc),a0
	lea	Gads(pc),a1
	DCall	RenderGadgets		RenderGadgets()

	bra.w	Main

Load1	move.l	#GLoad1,d1
	bra.w	Load

Load2	move.l	#GLoad2,d1
	bra.w	Load

Load3	move.l	#GLoad3,d1
	bra.w	Load

Load4	move.l	#GLoad4,d1
	bra.w	Load

Load5	move.l	#GLoad5,d1
	bra.w	Load

Load6	move.l	#GLoad6,d1
	bra.w	Load

Load7	move.l	#GLoad7,d1
	bra.w	Load

Load8	move.l	#GLoad8,d1
	bra.w	Load

Load9	move.l	#GLoad9,d1
	bra.w	Load

Load10	move.l	#GLoad10,d1

Load	move.l	DosB(pc),a6
	moveq	#0,d2
	moveq	#0,d3
	jsr	-222(a6)		Execute()
	move.l	DFuncB(pc),a6
	bra.w	Main

Exit	move.l	Scale(pc),d0
	DCall	RemScale		RemScale()

	move.l	GadB(pc),a0
	DCall	FreeGadList		FreeGadList()
*»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»*
Close	move.l	IntB(pc),a6
	move.l	WinB(pc),d0
	beq.b	.noWin
	move.l	d0,a0
	jsr	-72(a6)			CloseWindow()

.noWin	move.l	$4.w,a6

	CloseLib DFunc
	CloseLib Int

	movem.l	(sp)+,d0-a6
	rts
*»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»*
Window	dc.w	150,5,330,255,$10
	dc.l	IMouseMove!IMouseButtons!IVanillaKey!INewSize
	dc.l	WSizeBottom!WWindowSizing!WNocareRefresh!WActivate!WRmbTrap!WReportMouse!WWindowdrag
	dc.l	0,0,Name
	dc.l	0,0
	dc.w	180,170,-1,-1,$1
*»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»*
WinSz	dc.l	0,0
*»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»*
TextAtt	dc.l	FontN
	dc.w	11
	dc.w	0
*»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»*
DosB	dc.l	0
IntB	dc.l	0
WinB	dc.l	0
GadB	dc.l	0
DFuncB	dc.l	0
Scale	dc.l	0
*»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»*
Rast	dc.l	0
Port	dc.l	0
*»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»*
Gads	dc.w	10,225,210,19,99
	dc.l	GExit,0,0,0
	dc.l	$21101245
	dc.l	dg_HotKey!dg_DblBorderV!dg_Insensitive
	dc.l	TextAtt,0

	dc.w	10,20,310,19,1
	dc.l	Game1,0,0,0
	dc.l	$21471213
	dc.l	dg_TextLeft!dg_HotKey!dg_DblBorderV
	dc.l	TextAtt,0

	dc.w	10,40,310,19,2
	dc.l	Game2,0,0,0
	dc.l	$21471213
	dc.l	dg_TextLeft!dg_HotKey!dg_DblBorderV
	dc.l	TextAtt,0

	dc.w	10,60,310,19,3
	dc.l	Game3,0,0,0
	dc.l	$21471213
	dc.l	dg_TextLeft!dg_HotKey!dg_DblBorderV
	dc.l	TextAtt,0

	dc.w	10,80,310,19,4
	dc.l	Game4,0,0,0
	dc.l	$21471213
	dc.l	dg_TextLeft!dg_HotKey!dg_DblBorderV
	dc.l	TextAtt,0

	dc.w	10,100,310,19,5
	dc.l	Game5,0,0,0
	dc.l	$21471213
	dc.l	dg_TextLeft!dg_HotKey!dg_DblBorderV
	dc.l	TextAtt,0

	dc.w	10,120,310,19,6
	dc.l	Game6,0,0,0
	dc.l	$21471213
	dc.l	dg_TextLeft!dg_HotKey!dg_DblBorderV
	dc.l	TextAtt,0

	dc.w	10,140,310,19,7
	dc.l	Game7,0,0,0
	dc.l	$21471213
	dc.l	dg_TextLeft!dg_HotKey!dg_DblBorderV
	dc.l	TextAtt,0

	dc.w	10,160,310,19,8
	dc.l	Game8,0,0,0
	dc.l	$21471213
	dc.l	dg_TextLeft!dg_HotKey!dg_DblBorderV
	dc.l	TextAtt,0

	dc.w	10,180,310,19,9
	dc.l	Game9,0,0,0
	dc.l	$21471213
	dc.l	dg_TextLeft!dg_HotKey!dg_DblBorderV
	dc.l	TextAtt,0

	dc.w	10,200,310,19,10
	dc.l	Game10,0,0,0
	dc.l	$21471213
	dc.l	dg_TextLeft!dg_HotKey!dg_DblBorderV
	dc.l	TextAtt,0

	dc.l	-1			end tag
*»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»*
GExit	dc.b	'RqQUIT',0
Game1	dc.b	'11 > Stepz',0
Game2	dc.b	'22 > Dilemma',0
Game3	dc.b	'33 > Up and down',0
Game4	dc.b	'44 > Amigatration',0
Game5	dc.b	'55 > Master Mind',0
Game6	dc.b	'66 > Amiga Q',0
Game7	dc.b	'77 > Pesten',0
Game8	dc.b	'88 > Squigs',0
Game9	dc.b	'99 > PacMan',0
Game10	dc.b	'00 > ASokoban',0
*»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»*
GLoad1	dc.b	'Games:Stepz',0
GLoad2	dc.b	'Games:Dilemma',0
GLoad3	dc.b	'Games:Up&Down',0
GLoad4	dc.b	'Games:Amigatration',0
GLoad5	dc.b	'Games:MasterMind',0
GLoad6	dc.b	'Games:AmigaQ',0
GLoad7	dc.b	'Games:Pesten',0
GLoad8	dc.b	'Games:Squigs',0
GLoad9	dc.b	'Games:PacMan',0
GLoad10	dc.b	'Games:Asokoban',0
*»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»*
FontN	dc.b	'topaz.font',0
IntN	dc.b	'intuition.library',0
DFuncN	dc.b	'dfunc.library',0
DosN	dc.b	'dos.library',0
Name	dc.b	'SELECTOR 1.0 - © 1995, Digital Surface',0
	even
*»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»*
