; (4,a7)  - left
; (8,a7)  - top
; (12,a7) - width
; (16,a7) - height
; (20,a7) - idcmp
; (24,a7) - flags
; (28,a7) - title
; (32,a7) - screen
; (36,a7) - type
; (40,a7) - gadget
; (44,a7) - tags

	xdef	_OpenW

_OpenW	move.w	(6,a7),newwindow
	move.w	(10,a7),newwindow+2
	move.w	(14,a7),newwindow+4
	move.w	(18,a7),newwindow+6
	move.l	(20,a7),idcmp
	move.l	(24,a7),flags
	move.l	(28,a7),title
	move.l	(32,a7),screen
	move.w	(38,a7),type
	move.l	(40,a7),gadget
	lea	(newwindow,pc),a0
	lea	(44,a7),a1
	move.l	_IntuitionBase,a6
	jsr	(-606,a6)		; OpenWindowTagList()
	tst.l	d0
	beq.s	.exit
	move.l	d0,a0
	move.l	(50,a0),_stdrast	; store rastport
.exit	rts

	xref	_IntuitionBase

newwindow	dc.w	0,0,0,0		; l,t,w,h
	dc.b	1,0
idcmp	dc.l	0
flags	dc.l	0
gadget	dc.l	0
	dc.l	0
title	dc.l	0
screen	dc.l	0
	dc.l	0
	dc.w	0,0,-1,-1
type	dc.w	0

	xdef	_stdrast
_stdrast	dc.l	0
	xdef	coloura
coloura	dc.l	0
