	opt c+,d+

; this is a program actually written by myself (-BAZ-) which should
; use the initialise bitmap routine from the graphics library
; as i would have expected from a program written by myself - it doesn't
; work!! anyway i will try again now

initbitmap	= -186
openlib	= -408
ioerr	= -132
execbase	= 4
closelib	= -414
setrast	= -234

	bsr opengraphlib
	bsr bitmapset
	bsr setuprast
loop:	jmp loop

bitmapset:
	lea bitdata(pc),a0
	move.l #5,d0
	move.l #320,d1
	move.l #200,d2	
	move.l graphicsbase,a6
	jsr initbitmap(a6)
	rts
	
setuprast:
	lea bitdata(pc),a1
	move.w #$000f,d0
	move.l graphicsbase,a6
	jsr setrast(a6)
	rts
	
opengraphlib:	
	move.l execbase,a6
	lea graphicsname(pc),a1
	moveq #0,d0
	jsr openlib(a6)
	move.l d0,graphicsbase
	beq error
	rts
	
error:	
	move.l graphicsbase,a6
	jsr ioerr(a6)
	move.l d0,d5
	move.l #-1,d7
	
quit:	
	move.l graphicsbase,a1
	move.l execbase,a6
	jsr closelib(a6)
	rts

graphicsname:	dc.b 'graphics.library',0,0
	even
graphicsbase	ds.l 1

bitdata:	ds.b 40000

