;
;	WarpCore-Breach
;
;	future features:
;
;	- reset all scsi devices
;	- revive all ide devices
;	- clear all ram
;	- ???
;
get	macro
	movec	\1,d0
	move.l	d0,\2
	endm

	section a,code
run
	btst	#6,$bfe001
	bne	geordi
	move.l	4,a6
	jsr	-132(a6)	; Forbid
	jsr	-120(a6)	; Disable
	lea	supervisor,a5
	jsr	-30(a6)
	; unreached
geordi
	moveq	#0,d0
	rts

supervisor

	move.l	a6,a1

	; no more irq and dma activity
	move.w	#$7fff,$dff09a
	move.w	#$7fff,$dff096

	move.l	#0,a0
	move.l	#1024-1,d0
clear
	clr.l	(a0)+			; destroy ZEROPAGE (4k)
	clr.l	(a1)+			; destroy EXECBASE a bit
	dbf	d0,clear

	; shut down all fucking other things

	moveq	#0,d0
	movec	d0,usp
	movec   d0,vbr
	movec   d0,msp
	movec   d0,isp
	movec   d0,tc
	movec   d0,itt0
	movec   d0,itt1
	movec   d0,dtt0
	movec   d0,dtt1
	movec   d0,mmusr
	movec   d0,urp
	movec   d0,srp

	reset
	jmp	$f80002	; the execbase is no more valid, so i must use
				; this absolut jump-in...
	rte

	dc.b	'$VER: WarpCore Breach 1.0 (Stardate 43712.1)'
	dc.b	'the hardcore reboot for 68040 boards'
	even

	END