ùúùúÿ÷ÿÿÿ÷ÿÿÿ÷ÿÿÿ÷ÿÿÿ÷ÿÿÿ÷ÿÿÿ÷ÿÿÿ÷ÿÿÿ÷ÿÿ**V>*******************************************
**  negative.library v0.01 (ASM-Source)  **
**        Code by:   juen/nah-kolor      **
*******************************************

;internal library for negative crew! not for spread!

;Struktura biblioteki w pamieci:

***************************
* Funkcje standardowe:	  *
***************************
*  -24	 * ExtFuncLib	  *
*  -18	 * ExpungeLibrary *
*  -12	 * CloseLibrary	  *
*  -6	 * OpenLibrary	  *
***************************
* Baza biblioteki	  *
***************************
*   0	 * Struct Library *
***************************
* Wlasne dane biblioteki  *
***************************
*   34	 * LIB_BASE	  *
*  ....  * ...		  *
***************************

;juenized:

; offset.revision, function(regs)(args)

; -30.000, loaddiskfont(d0,a0)(size,name+0) -> d0=fontbase, d1=error
; -36.000, searchforwhite(a0)(winbase) -> d0=color, -1=not found!
; -42.000, searchforblack(a0)(winbase) -> d0=color, -1=not found!
; -48.000, searchforgray(a0)(winbase) -> d0=color, -1=not found!
; -54.000, setmaincolours(d0/d1/d2)(white,black,gray)
; -60.000, border(a0,d0/d1/d2/d3/d4)(rp,x,y,xsize,ysize,type)
; -66.000, hl(a0,d0/d1/d2)(rp,x,y,xmax)
; -72.000, xenaddgadget(a0/a1,d0/d1/d2/d3/d4)(wb,buf(44b),x,y,xsize,ys,number)

* exec.library
_LVOFreeMem	equ	-210
_LVORemove	equ	-252
;-----------------------
;Struktura NODE=14 bajtow	;	\
LIB_FLAGS	equ	14	;B	 |
LIB_pad		equ	15	;B	 |
LIB_NEGSIZE	equ	16	;W	 |
LIB_POSSIZE	equ	18	;W	  \Struktura Library dla kazdej bibl
LIB_VERSION	equ	20	;W	  /krora ma rozmiar 34 bajty!
LIB_REVISION	equ	22	;W	 |
LIB_IDSTRING	equ	24	;L	 |
LIB_SUM		equ	28	;L	 |
LIB_OPENCNT	equ	32	;W	/

LIB_SIZE	equ	34	;L	To jest juz wlasne pole dla tej bibl!
;-----------------------
FLAG_SUMMING	equ	0		* we are currently checksumming
FLAG_CHANGED	equ	1		* we have just changed the lib
FLAG_SUMUSED	equ	2		* set if we should bother to sum
FLAG_DELEXP	equ	3		* delayed expunge
;------------------------------------------------
MyLibraryStart
	moveq	#-1,d0		;Ten kod jest potrzebny, gdyby ktos chcial
	rts			;uruchomic bibl. jak zwykly EXECUTABLE!
				;Nie spowoduje przez to zawieszenia AMIGI!

;------------------------------------------------ RESIDENT structure
.MyLib	dc.w	$4AFC				;$4AFC=ILLEGAL
	dc.l	.MyLib,MyLibraryEnd		;Poczatek, Koniec bibl.
	dc.b	%10000000			;FLAGS-= tu AUTO_INIT
	dc.b	1				;VERSION - tu 1.00
	dc.b	9				;TYPE - tu LIBRARY
	dc.b	0				;PRIorytet bibl = tu 0
	dc.l	.LibName,.LibID,.LibInit	;nazwa,identyfikacja,inicjacja
;----------
.LibName	dc.b	"negative.library",0
.LibID		dc.b	"Negative v0.01 (13.12.2000) by Juen/Nah-Kolor",13,10,0
;-----------------------
.LibInit
	dc.l	LIB_SIZE+4	;Rozmiar bazy bibliteki - tu 34+4 (wlasne)
	dc.l	.Jumps		;Tablica skokow dla tej bibl
	dc.l	0		;NIE WYKORZYSTYWANE!
	dc.l	InitLibrary	;Adres procedury INICJUJACEJ!

;---------- Tablica skokow STANDARDOWYCH dla kazdej biblioteki
.Jumps	dc.l	OpenLibrary,CloseLibrary,ExpungeLibrary,ExtFuncLib

;---------- Tutaj zaczynaja sie skoki specyficzne dla danej biblioteki

	;juen

	dc.l	_LVOLoadDiskFont	;-30
	dc.l	_LVOSearchForWhite	;-36
	dc.l	_LVOSearchForBlack	;-42
	dc.l	_LVOSearchForGray	;-48
	dc.l	_LVOSetMainColours	;-54
	dc.l	_LVOBox			;-60
	dc.l	_LVOHl			;-66
	dc.l	_LVOXENAddGadget	;-72

;---------- Koniec tablicy skokow
	dc.l	-1

	even


;------------------------------------------------ STANDARD functions
InitLibrary
	exg	a0,d0			;A0-Adres bazy naszej biblioteki D0-rozmiar
	move.l	d0,LIB_SIZE(a0)		;Zapamietanie rozmiaru bazy
	move.w	#1,LIB_REVISION(a0)	;Tutaj mozesz wpisac SETNE wersji bibl.
	exg	a0,d0
	rts
;-----------------------
OpenLibrary
	addq.w	#1,LIB_OPENCNT(a6)		;Zwiekszenie liczby uzytkownikow
	bclr	#FLAG_DELEXP,LIB_FLAGS(a6)	;Opoznienie usuwania biblioteki
						;nie potrzebne!
	move.l	a6,d0				;Zwrot adresu bazy biblioteki
	rts
;-----------------------
CloseLibrary
	subq.w	#1,32(a6)			;Zmniejszenie liczby uzytkownikow
	bne.b	ExtFuncLib			;Skok jesli sa jeszcze jacys!
	btst	#FLAG_DELEXP,LIB_FLAGS(a6)
	beq.b	ExtFuncLib
	rts
;-----------------------
ExpungeLibrary
	tst.w	LIB_OPENCNT(a6)		;Sprawdzenie, czy sa uzytkownicy bibl.
	bne.b	.NoRemove		;TAK! = Usuniecie bibl. NIEMOZLIWE!

	movem.l	d2/a5/a6,-(sp)
	move.l	LIB_SIZE(a6),d2		;Pobranie rozmiaru bazy bibl.
					;zapamietanego wczesniej przy INICJACJI!
	move.l	a6,a5			;Adres bazy bibl. A5
	move.l	4.w,a6
	move.l	a5,a1			;Adres bazy bibl. (Struct NODE)
	jsr	_LVORemove(a6)		;Usuniecie bibl z listy wszystkich
	move.l	a5,a1			;Adres bazy bibl do A1
	moveq	#0,d0
	move.w	LIB_NEGSIZE(a5),d0	;Rozmiar tablicy wektorow
	sub.w	d0,a1
	add.w	LIB_POSSIZE(a5),d0	;Rozmiar samej bazy naszej biblioteki
	jsr	_LVOFreeMem(a6)		;Zwolnienie pamieci zajmowanej przez
					;baze naszej bibl. i jej wektory!
	move.l	d2,d0
	movem.l	(sp)+,d2/a5/a6
	rts
.NoRemove
	bset	#FLAG_DELEXP,LIB_FLAGS(a6)
					;Ustawienie bitu odpowiedzialnego
					;za opoznienie w usuwaniu bibl. z pamieci
					;jesli np. sa jacys uzytkownicy!
;----------
;	moveq	#0,d0			;W tym przypadku ten kod nie jest
;	rts				;potrzebny gdyz jest dalej!
;-----------------------
ExtFuncLib				;Funkcja, ktora nie jest wykorzystywana
					;na czas terazniejszy. Pozostawiona
	moveq	#0,d0			;do uzycia w przyszlosci!
	rts



_LVOLoadDiskFont:

	move.w	d0,font_size
	move.w	d0,font_size_the_second

	lea	font_name,a1
.x	move.b	(a0)+,(a1)+
	cmp.b	#0,(a0)
	bne.s	.x
	move.b	(a0)+,(a1)

	move.l	4.w,a6
	lea	diskname,a1
	jsr	-408(a6)	;Open diskfont.library
	tst	d0
	bne.s	.ok1
	moveq	#0,d0		;error
	moveq	#1,d1		;no diskfont.library
	rts

.ok1	move.l	d0,diskbase
	lea	font,a0	;textAttr
	move.l	DiskBase,a6
	jsr	-30(a6)
	moveq	#0,d1
	rts

FONT:	DC.L	FONT_NAME
font_size:
	DC.W	8
	DC.B	0,0
font_size_the_second:
	DC.W	8

FONT_NAME:
	blk.b	255

diskname	dc.b	'diskfont.library',0
diskbase	dc.l	0
	even



_LVOSearchForWhite:

	move.l	a0,a5

	move.l	4.w,a6
	lea	gfxname,a1
	jsr	-408(a6)
	move.l	d0,gfxbase
	move.l	4.w,a6
	lea	intname,a1
	jsr	-408(a6)	;Open intuition.library
	move.l	d0,intbase
	move.l	intbase,a6
	move.l	a5,a0
	jsr	-300(a6)
	move.l	d0,WinVPort
	move.l	d0,a0
	move.l	4(a0),ColorMap
GetRGB4	move.l	GfxBase(pc),a6
	moveq	#0,d7
	lea	wb_pal,a5
.Loop	move.l	d7,d0
	move.l	ColorMap(pc),a0
	jsr	-582(a6)
	move.w	d0,(a5)+
	addq.b	#1,d7
	cmp.b	#0,d7
	bne.s	.loop

	move.l	#$0FFF,d2	; w sumie nie ma bola, bialy musi byc!
	bsr	check_colour	; ( a jak nie to inne kombinacje... )
	cmp.l	#-1,d0
	bne.s	.ok

	move.l	#$0eee,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.s	.ok

	move.l	#$0Fee,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.s	.ok

	move.l	#$0FFe,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.s	.ok

	move.l	#$0FeF,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.s	.ok

	move.l	#$0eFe,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.s	.ok

	move.l	#$0eeF,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok

.ok	rts


check_colour
	move.l	#255-1,d0
	moveq	#0,d1
	lea	wb_pal,a0
.x	moveq	#0,d3
	move.w	(a0)+,d3
	cmp.w	d2,d3
	beq.s	.found
	addq.b	#1,d1
	dbf	d0,.x
	bra.s	.notfound
.found	move.l	d1,d0
	rts
.notfound
	moveq	#-1,d0
	rts

gfxname		dc.b	'graphics.library',0
intname		dc.b	'intuition.library',0
intbase		dc.l	0
gfxbase		dc.l	0
winvport	dc.l	0

ColorMap	dc.l	0
wb_pal		ds.b	255*2
		ds.b	255*2
	even


_LVOSearchForBlack:

	move.l	a0,a5

	move.l	4.w,a6
	lea	gfxname,a1
	jsr	-408(a6)
	move.l	d0,gfxbase
	move.l	4.w,a6
	lea	intname,a1
	jsr	-408(a6)	;Open intuition.library
	move.l	d0,intbase
	move.l	d0,a6
	move.l	a5,a0
	jsr	-300(a6)
	move.l	d0,WinVPort
	move.l	d0,a0
	move.l	4(a0),ColorMap
	move.l	GfxBase(pc),a6
	moveq	#0,d7
	lea	wb_pal,a5
.Loop	move.l	d7,d0
	move.l	ColorMap(pc),a0
	jsr	-582(a6)
	move.w	d0,(a5)+
	addq.b	#1,d7
	cmp.b	#0,d7
	bne.s	.loop

	move.l	#$0000,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok

	move.l	#$0111,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok

	move.l	#$0100,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.s	.ok

	move.l	#$0110,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.s	.ok

	move.l	#$0101,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.s	.ok

	move.l	#$0010,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.s	.ok

	move.l	#$0001,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok

	move.l	#$0222,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok

	move.l	#$0333,d2	;ostateczna ostatecznosc!
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok

.ok	rts


_LVOSearchForGray:

	move.l	a0,a5

	move.l	4.w,a6
	lea	gfxname,a1
	jsr	-408(a6)
	move.l	d0,gfxbase
	move.l	4.w,a6
	lea	intname,a1
	jsr	-408(a6)	;Open intuition.library
	move.l	d0,intbase
	move.l	d0,a6
	move.l	a5,a0
	jsr	-300(a6)
	move.l	d0,WinVPort
	move.l	d0,a0
	move.l	4(a0),ColorMap
	move.l	GfxBase(pc),a6
	moveq	#0,d7
	lea	wb_pal,a5
.Loop	move.l	d7,d0
	move.l	ColorMap(pc),a0
	jsr	-582(a6)
	move.w	d0,(a5)+
	addq.b	#1,d7
	cmp.b	#0,d7
	bne.s	.loop

	move.l	#$0999,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok

	move.l	#$0888,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok

	move.l	#$0899,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok

	move.l	#$0889,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok

	move.l	#$0898,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok

	move.l	#$0989,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok

	move.l	#$0998,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok

	move.l	#$0777,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok

	move.l	#$0887,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok

	move.l	#$0878,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok

	move.l	#$0788,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok

	move.l	#$0878,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok

	move.l	#$0787,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok

	move.l	#$0887,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok

	move.l	#$0666,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok

	move.l	#$0555,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok

	move.l	#$0444,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok

	move.l	#$0566,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok

	move.l	#$0656,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok

	move.l	#$0665,d2
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok

	move.l	#$0000,d2	;ostateczna ostatecznosc ostatecznosci!!!!
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok

	move.l	#$0111,d2	;ostateczna ostatecznosc ostatecznosci!!!!
	bsr	check_colour
	cmp.l	#-1,d0
	bne.w	.ok


.ok	rts


_LVOSetMainColours:

	move.b	d0,PenWhite
	move.b	d1,PenBlack
	move.b	d2,PenGray

	rts


_LVOBox:

	movem.l d0-a6,-(sp)		;wartosci na stos

	move.l	4.w,a6
	lea	intname,a1
	jsr	-408(a6)		;Open intuition.library
	move.l	d0,intbase

	movem.l (sp)+,d0-a6		;zwrocenie wartosci ze stosu

	cmp.l	#0,d4
	bne.s	.n0
	move.l	#border_type1,a1
	move.w	d2,bt1x1
	move.w	d2,bt1x2
	move.w	d3,bt1y1
	move.w	d3,bt1y2
	subq.l	#1,d2
	subq.l	#1,d3
	move.w	d2,bt1x4
	move.w	d2,bt1x5
	move.w	d3,bt1y4
	move.w	d3,bt1y5
	subq.l	#1,d2
	subq.l	#1,d3
	move.w	d2,bt1x3
	move.w	d3,bt1y3
	move.b	PenBlack,bt1p1
	move.b	PenWhite,bt1p2
	move.b	PenGray,bt1p3
	bra.w	.ok
.n0	cmp.l	#1,d4
	bne.s	.n1
	move.l	#border_type2,a1
	move.w	d2,b2x1
	move.w	d2,b2x2
	move.w	d3,b2y1
	move.w	d3,b2y2
	move.w	d2,b2x3
	move.w	d3,b2y3
	move.b	PenWhite,bt2p1
	move.b	PenBlack,bt2p2
	bra.s	.ok
.n1	cmp.l	#2,d4
	bne.s	.n2
	move.l	#border_type3,a1
	move.w	d2,b3x1
	move.w	d2,b3x2
	move.w	d2,b3x3
	move.w	d3,b3y1
	move.w	d3,b3y2
	move.w	d3,b3y3
	subq.l	#1,d2
	subq.l	#1,d3
	move.w	d2,b3x4
	move.w	d2,b3x5
	move.w	d3,b3y4
	move.w	d3,b3y5
	move.b	PenWhite,bt3p1
	move.b	PenBlack,bt3p2
	move.b	PenBlack,bt3p3
	bra.s	.ok
.n2

	rts

.ok	move.l	intbase,a6
	jsr	-108(a6)		;drawborder()
	rts


border_type1	dc.w	0,0		;gadget like XEN!
bt1p1		dc.b	0,0
		dc.b	1
		dc.b	5
		dc.l	border1.1xy
		dc.l	border1.2
border1.1xy	dc.w	0,0
bt1x1		dc.w	0,0
bt1x2		dc.w	0
bt1y1		dc.w	0,0
bt1y2		dc.w	0,0,0,0
border1.2	dc.w	0,0
bt1p2		dc.b	0,0
		dc.b	1
		dc.b	3
		dc.l	border1.2xy
		dc.l	border1.3
border1.2xy	dc.w	1
bt1y3		dc.w	0,1,1
bt1x3		dc.w	0,1,0
border1.3	dc.w	0,0
bt1p3		dc.b	0,0
		dc.b	1
		dc.b	3
		dc.l	border1.3xy
		dc.l	0
border1.3xy	dc.w	1
bt1y4		dc.w	0
bt1x4		dc.w	0
bt1y5		dc.w	0
bt1x5		dc.w	0,1,0


border_type2	dc.w	0,0		;3d standard gadget
bt2p1		dc.b	2,0
		dc.b	1
		dc.b	3
		dc.l	border2.1xy
		dc.l	border2.2
border2.1xy	dc.w	0
b2y1		dc.w	4
b2x1		dc.w	3
b2y2		dc.w	4
b2x2		dc.w	3,0,0
border2.2	dc.w	0,0
bt2p2		dc.b	1,0
		dc.b	1
		dc.b	3
		dc.l	border2.2xy
		dc.l	0
border2.2xy
b2x3		dc.w	3,0,0,0,0
b2y3		dc.w	4,0

border_type3	dc.w	0,0
bt3p1		dc.b	2,0
		dc.b	1
		dc.b	5
		dc.l	border3.1xy
		dc.l	border3.2
border3.1xy	dc.w	1,1
b3x1		dc.w	3,1
b3x2		dc.w	3
b3y1		dc.w	4,1
b3y2		dc.w	4,1,1,0
border3.2	dc.w	0,0
bt3p2		dc.b	1,0
		dc.b	1
		dc.b	3
		dc.l	border3.2xy
		dc.l	border3.3
border3.2xy	dc.w	2
b3y4		dc.w	4
b3x4		dc.w	3
b3y5		dc.w	4
b3x5		dc.w	3,2,0
border3.3	dc.w	0,0
bt3p3		dc.b	1,0
		dc.b	1
		dc.b	3
		dc.l	border3.3xy
		dc.l	0
border3.3xy	dc.w	0
b3y3		dc.w	4,0,0
b3x3		dc.w	3,0,0

PenWhite	dc.b	0
PenBlack	dc.b	0
PenGray		dc.b	0

	even

_LVOHl:

	movem.l d0-a6,-(sp)		;wartosci na stos

	move.l	4.w,a6
	lea	gfxname,a1
	jsr	-408(a6)		;Open intuition.library
	move.l	d0,gfxbase

	movem.l (sp)+,d0-a6		;zwrocenie wartosci ze stosu
	movem.l d0-a6,-(sp)		;wartosci na stos

	move.l	gfxbase,a6
	move.l	a0,a1
	moveq	#0,d0
	move.b	PenBlack,d0
	jsr	-342(a6)

	movem.l (sp)+,d0-a6		;zwrocenie wartosci ze stosu
	movem.l d0-a6,-(sp)		;wartosci na stos

	move.l	gfxbase,a6
	move.l	a0,a1
	jsr	-240(a6)		;move

	movem.l (sp)+,d0-a6		;zwrocenie wartosci ze stosu
	movem.l d0-a6,-(sp)		;wartosci na stos

	move.l	gfxbase,a6
	move.l	d2,d0
	move.l	d1,d2
	move.l	a0,a1
	jsr	-246(a6)

	movem.l (sp)+,d0-a6		;zwrocenie wartosci ze stosu
	movem.l d0-a6,-(sp)		;wartosci na stos

	move.l	gfxbase,a6
	move.l	a0,a1
	moveq	#0,d0
	move.b	PenWhite,d0
	jsr	-342(a6)

	movem.l (sp)+,d0-a6		;zwrocenie wartosci ze stosu
	movem.l d0-a6,-(sp)		;wartosci na stos

	move.l	gfxbase,a6
	move.l	a0,a1
	addq.l	#1,d1
	jsr	-240(a6)		;move

	movem.l (sp)+,d0-a6		;zwrocenie wartosci ze stosu

	move.l	gfxbase,a6
	move.l	d2,d0
	addq.l	#1,d1
	move.l	a0,a1
	jsr	-246(a6)
	rts


_LVOXENAddGadget:

	movem.l d0-a6,-(sp)		;wartosci na stos

	move.w	d2,bt1x1
	move.w	d2,bt1x2
	move.w	d3,bt1y1
	move.w	d3,bt1y2
	move.w	d2,bt1.2x1
	move.w	d2,bt1.2x2
	move.w	d3,bt1.2y1
	move.w	d3,bt1.2y2
	subq.l	#1,d2
	subq.l	#1,d3
	move.w	d2,bt1x4
	move.w	d2,bt1x5
	move.w	d3,bt1y4
	move.w	d3,bt1y5
	move.w	d2,bt1.2x4
	move.w	d2,bt1.2x5
	move.w	d3,bt1.2y4
	move.w	d3,bt1.2y5
	subq.l	#1,d2
	subq.l	#1,d3
	move.w	d2,bt1x3
	move.w	d3,bt1y3
	move.w	d2,bt1.2x3
	move.w	d3,bt1.2y3
	move.b	PenBlack,bt1p1
	move.b	PenWhite,bt1p2
	move.b	PenGray,bt1p3

	move.b	PenBlack,bt1.2p1
	move.b	PenGray,bt1.2p2
	move.b	PenWhite,bt1.2p3

	move.l	4.w,a6
	lea	intname,a1
	jsr	-408(a6)		;Open intuition.library
	move.l	d0,intbase

	movem.l (sp)+,d0-a6		;zwrocenie wartosci ze stosu

	move.l	a1,a2

	move.l	#0,(a2)+		;budowa gadgetu
	move.w	d0,(a2)+		;x
	move.w	d1,(a2)+		;y
	move.w	d2,(a2)+		;xsize
	move.w	d3,(a2)+		;ysize
	move.w	#$2,(a2)+
	move.w	#$3,(a2)+
	move.w	#$1,(a2)+

;	move.l	#border_type1,(a2)+
	move.l	a2,a6
	adda.l	#4,a2

;	move.l	#border_type1_2,(a2)+
	move.l	a2,a4
	adda.l	#4,a2

;	move.l	#xengad_text,(a2)+
	move.l	a2,a5
	adda.l	#4,a2

	move.l	#0,(a2)+
	move.l	#0,(a2)+
	move.w	d4,(a2)+
	move.l	#0,(a2)+

	move.l	a2,(a5)	;text

	move.b	PenBlack,(A2)+
	move.w	#0,(a2)+
	move.b	#0,(a2)+
	move.w	d6,(a2)+
	move.w	d7,(a2)+
	move.l	#0,(a2)+
	move.l	d5,(a2)+
	move.l	#0,(a2)+

	move.l	a2,(a4)	;border1.2

	move.l	#0,(a2)+
	move.b	PenBlack,(a2)+
	move.b	#0,(a2)+
	move.b	#1,(a2)+
	move.b	#5,(a2)+

	move.l	a2,a4
	addq.l	#4,a2
	move.l	a2,a5
	addq.l	#4,a2

	move.l	a2,(a4)
	move.l	#0,(a2)+
	move.w	d2,(a2)+
	move.w	#0,(a2)+
	move.w	d2,(a2)+
	move.w	d3,(a2)+
	move.w	#0,(a2)+
	move.w	d3,(a2)+
	move.w	#0,(a2)+
	move.b	#0,(a2)+

	move.l	a2,(a5)

	move.l	#0,(a2)+
	move.b	PenGray,(a2)+
	move.b	#0,(a2)+
	move.b	#1,(a2)+
	move.b	#3,(a2)+

	move.l	a2,a4
	addq.l	#4,a2
	move.l	a2,a5
	addq.l	#4,a2

	move.l	a2,(a4)
	move.w	#1,(a2)+

	move.w	d3,(a2)
	subq.w	#2,(a2)+
	move.w	#1,(a2)+
	move.w	#1,(a2)+
	move.w	d2,(a2)
	subq.w	#2,(a2)+
	move.w	#1,(a2)+
	move.w	#0,(a2)+

	move.l	a2,(a5)
	move.l	#0,(a2)+
	move.b	PenWhite,(a2)+
	move.b	#0,(a2)+
	move.b	#1,(a2)+
	move.b	#3,(a2)+

	move.l	a2,a4
	addq.l	#4,a2
	move.l	#0,(a2)+
	move.l	a2,(a4)

	move.w	#1,(a2)+
	move.w	d3,(a2)
	subq.w	#1,(a2)+
	move.w	d2,(a2)
	subq.w	#1,(a2)+
	move.w	d3,(a2)
	subq.w	#1,(a2)+
	move.w	d2,(a2)
	subq.w	#1,(a2)+
	move.w	#1,(a2)+
	move.w	#0,(a2)+

;---


	move.l	a0,a5
	move.l	a1,a4

	move.l	intbase,a6
	moveq	#-1,d0
	jsr	-42(a6)

	move.l	intbase,a6
	move.l	a5,a1
	move.l	a4,a0
	move.l	#0,a2
	jsr	-222(a6)

	rts

border_type1_2	dc.w	0,0
bt1.2p1		dc.b	1,0
		dc.b	1
		dc.b	5
		dc.l	border1.2.1xy
		dc.l	border1.2.2
border1.2.1xy	dc.w	0,0
bt1.2x1		dc.w	3,0
bt1.2x2		dc.w	3
bt1.2y1		dc.w	4,0
bt1.2y2		dc.w	4,0,0,0
border1.2.2	dc.w	0,0
bt1.2p2		dc.b	28,0
		dc.b	1
		dc.b	3
		dc.l	border1.2.2xy
		dc.l	border1.2.3
border1.2.2xy	dc.w	1
bt1.2y3		dc.w	4-2,1,1
bt1.2x3		dc.w	3-2,1,0
border1.2.3	dc.w	0,0
bt1.2p3		dc.b	2,0
		dc.b	1
		dc.b	3
		dc.l	border1.2.3xy
		dc.l	0
border1.2.3xy	dc.w	1
bt1.2y4		dc.w	4-1
bt1.2x4		dc.w	3-1
bt1.2y5		dc.w	4-1
bt1.2x5		dc.w	3-1,1,0

;------------------------------------------------
MyLibraryEnd
	end

