; NoBorder 1.0 : make current shell window full screen (640x256 or bigger)
; by Kyzer/CSG
;
	incdir	include:
	include	lvo.i
	include	intuition/intuition.i
	include	intuition/screens.i	

	move.l	4.w,a6
	lea	intname(pc),a1
	moveq	#0,d0
	jsr	_LVOOpenLibrary(a6)
	move.l	d0,a6
	moveq	#0,d0
	jsr	_LVOLockIBase(a6)
	move.l	d0,d7
	move.l	ib_ActiveScreen(a6),a5
	move.w	sc_Width(a5),d2
	move.w	sc_Height(a5),d3

	move.l	ib_ActiveWindow(a6),a5
	move.l	#$23800,wd_Flags(a5)
	clr.l	wd_FirstGadget(a5)
	clr.L	wd_BorderLeft(a5)	; wd_Border(Left|Right|Top|Bottom)
	move.l	d7,a0
	jsr	_LVOUnlockIBase(a6)
	move.w	wd_LeftEdge(a5),d0
	move.w	wd_TopEdge(a5),d1
	neg.w	d0
	neg.w	d1
	move.l	a5,a0
	jsr	_LVOMoveWindow(a6)
	move.w	d2,d0
	move.w	d3,d1
	move.l	a5,a0
	jsr	_LVOWindowLimits(a6)
	move.w	d2,d0
	move.w	d3,d1
	sub.w	wd_Width(a5),d0
	sub.w	wd_Height(a5),d1
	move.l	a5,a0
	jsr	_LVOSizeWindow(a6)
	move.l	a6,a1
	move.l	4.w,a6
	jsr	_LVOCloseLibrary(a6)

	lea	dosname(pc),a1
	moveq	#0,d0
	jsr	_LVOOpenLibrary(a6)
	move.l	d0,a6
	jsr	_LVOOutput(a6)
	move.l	d0,d1
	lea	reset(pc),a0
	move.l	a0,d2
	moveq.l	#6,d3
	jsr	_LVOWrite(a6)
	move.l	a6,a1
	move.l	4.w,a6
	jsr	_LVOCloseLibrary(a6)
	moveq	#0,d0
	rts

dosname	dc.b	'dos.library',0
intname	dc.b	'intuition.library',0
reset	dc.b	$1b,'c',$9b,'H',$9b,'J'

; those window flags i used, are: SMART_REFRESH, NOCAREREFRESH, WINDOWACTIVE,
; ACTIVATE and BORDERLESS

; note: This is ONLY guaranteed to work from CON: shell windows! don't
;       run it on KingCon or RCON or DOPUS / filemaster or a CRASH is
;       likely. It's only real use is in startup-sequences to make an 80x32
;       cli screen. Use it to replace the old BORDER command.

;	$VER: NoBorder 1.0 source (15.12.95)
	dc.b	'$VER: NoBorder 1.0 (15.12.95)'


