FILTER


INTUITION_REV	equ	31		v1.1
execbase = 4
GetMsg = -372
Wait = -318
ReplyMsg = -378
OpenWorkBench = -210
DrawBorder = -108
PrintLText = -216
	incdir	"dh0:assembler/include/"
	include	exec/exec_lib.i
	include	intuition/intuition.i
	include	intuition/intuition_lib.i

s:
	bsr	openall
	bsr	interface
	bsr	loop			;set to again to debug
	rts


openall:
	moveq	#100,d4			
	moveq	#INTUITION_REV,d0	
	lea	int_name(pc),a1
	CALLEXEC OpenLibrary
	tst.l	d0
	beq	exit_false		
	move.l	d0,_IntuitionBase	
	move.l	_IntuitionBase,a6
	jsr	OpenWorkBench(a6)

openwin:
	lea	windowdef,a0	
	CALLINT	OpenWindow
	move.l	d0,MyWindow			
	
interface:
	bsr	lines
	bsr	textpr
	rts

lines:
	lea	box,a1
	move	#9,d0
	move	#14,d1
	bsr	drawit
	rts	

drawit:
	move.l	_IntuitionBase,a6
	move.l	MyWindow,a0
	move.l	50(a0),a0
	jsr	DrawBorder(a6)
	rts
textpr:
	lea	text,a1
	move	#105,d0
	move	#15,d1
	bsr	printit
	rts	
	

printit:
	move.l	_IntuitionBase,a6
	move.l	MyWindow,a0
	move.l	50(a0),a0
	jsr	PrintLText(a6)
	rts

loop:
	move.l	MyWindow(pc),a0
        move.l	wd_UserPort(a0),a0
	moveq	#0,d1
	move.b	MP_SIGBIT(a0),d1
	moveq	#0,d0
	bset	d1,d0
	move.l	execbase,a6
	CALLEXEC Wait
	move.l	#0,d4
	bsr	again		

again:
	move.l	MyWindow(pc),a0
	move.l	wd_UserPort(a0),a0
	move.l	execbase,a6
	jsr 	GetMsg(a6)
	move.l	d0,a1
	moveq.l	#0,d6
	moveq	#0,d7
	move.l	$14(a1),d6
	move.l	$1c(a1),a2
	move	38(a2),d7
	jsr	ReplyMsg(a6)	;disable to debug
	cmp.l	#$200,d6
	beq	slut
	cmp	#1,d7
	beq	filter
	bne	loop		;set to again to debug
	

;routines

filter:
	bchg	#1,$bfe001
	bsr	loop		;set to again to debug
	rts

slut:
closewin:
	move.l	MyWindow(pc),a0
	CALLINT CloseWindow

closeint:
	move.l	_IntuitionBase(pc),a1
	CALLEXEC CloseLibrary

exit_false:
	moveq	#0,d4
	move.l	d4,d0				
	rts


_IntuitionBase	dc.l	0		
MyWindow	dc.l	0
int_name	INTNAME

windowdef:
	dc.w	200
	dc.w	20
	dc.w	400
	dc.w	50
	dc.b	2
	dc.b	1
	dc.l	$220
	dc.l	$200120e
	dc.l	gad1
	dc.l	0
	dc.l	windowname
	
screenhd:
	
	dc.l	0
	dc.l	0
	dc.w	150
	dc.w	50
	dc.w	320
	dc.w	200
	dc.w	1
	

windowname:
	dc.b	'Kill Filter V1.0',0
	even

gad1:
	dc.l	0
	dc.w	37
	dc.w	20
	dc.w	40
	dc.w	13
	dc.w	$6
	dc.w	$102
	dc.w	1
	dc.l	image1
	dc.l	image2
	dc.l	gad1text
	dc.l	0
	dc.l	0
	dc.w	1
	dc.l	0

gad1text:
	dc.b	3,0
	dc.b	1
	even
	dc.w	-12,14
	dc.l	0
	dc.l	gd1txt
	dc.l	0

gd1txt:
	dc.b	"ON/OFF",0
	even

image1:
	dc.w	0,0
	dc.w	32,13
	dc.w	1
	dc.l	imagedata
	dc.b	1 
	dc.b	1
	dc.l	0

imagedata:
	dc.l	%00000000000000111000000000000000
	dc.l	%00000000000111000111000000000000
	dc.l	%00000000111000000000111000000000
	dc.l	%00000011000011000110000110000000
	dc.l	%00000010000000000000000010000000	
	dc.l	%00000001000100000001000100000000
	dc.l	%00000000100010000010001000000000
	dc.l	%00000000010001111100010000000000
	dc.l	%00000000001000000001000000000000
	dc.l	%00000000000011111110000000000000
	dc.l	%00000000000000000000000000000000
	dc.l	%00000000000000000000000000000000

image2:
	dc.w	0,0
	dc.w	32,13
	dc.w	1
	dc.l	image2data
	dc.b	1
	dc.b	1
	dc.l	0

image2data:
	dc.l	%00000000000000111000000000000000
	dc.l	%00000000000111000111000000000000
	dc.l	%00000000111000000000111000000000
	dc.l	%00000011000011000110000110000000
	dc.l	%00000010000000000000000010000000
	dc.l	%00000010000001111100000100000000
	dc.l	%00000001000010000010000100000000
	dc.l	%00000000100100000001001000000000
	dc.l	%00000000010000000000010000000000
	dc.l	%00000000001000000001000000000000
	dc.l	%00000000000011111110000000000000
	dc.l	%00000000000000000000000000000000
	dc.l	%00000000000000000000000000000000

box:
	dc.w	0,0
	dc.b	1,3
	dc.b	0
	dc.b	5
	dc.l	boxcords
	dc.l	box2


box2:
	dc.w	0,0
	dc.b	2,3
	dc.b	0
	dc.b	3
	dc.l	box2cords
	dc.l	0

boxcords:
	dc.w	0,0
	dc.w	85,0
	dc.w	85,30
	dc.w	0,30
	dc.w	0,0

box2cords:
	dc.w	85,0
	dc.w	0,0
	dc.w	0,30


text:
	dc.b	1,0
	dc.b	1
	even
	dc.w	0,0
	dc.l	0
	dc.l	txt
	dc.l	text2

txt:
	dc.b	"By Henrik Stolpe",0
	even

text2:
	dc.b	1,0
	dc.b	1
	even
	dc.w	0,8
	dc.l	0
	dc.l	txt2
	dc.l	0
txt2:
	dc.b	"100% assembler!",0