
;TRACKDISK-COMMANDS -> 28(A1)

;$1 RESET (AUTOMATICAL DONE)
;$2 LOAD 40-MEMDEST 36-LENGTH 44-DISKPOS  JSR -456(A6)  D0=ERRCODE
;$3 SAVE SAME ^						D0=ERRCODE
;$5 DISK IN DRIVE? D1;0=YES
;$9 LAMP 36-ON/OFF  1=ON  0=OFF
;$A MOVE HEAD (SE LOAD)
;$B  FORMAT
;$C  REMOVE (DISK CHANGE?)
;$D  NUMBER OF DISK CHANGES
;$E  DISK IN DRIVE?
;$F WRITE-PROTECT? D1;0=YES

S:	MOVE.L	A7,OLDSTACK
	MOVE.L	#MYSTACKSTART,A7
	JSR	TRACKINIT

	LEA	TRACKSHIT,A1
	MOVE.W	#$2,28(A1)
	MOVE.L	#$50000,40(A1)	;DEST
	MOVE.L	#$00000,44(A1)	;DISKPOS
	MOVE.L	#$02C00,36(A1)	;LENGTH
	MOVE.L	$04.W,A6
	JSR	-456(A6)
		MOVE.W	#$9,28(A1)
		MOVE.L	#$0,36(A1)
		MOVE.L	$04.W,A6
		JSR	-456(A6)

	JSR	TRACKEND
	MOVE.L	OLDSTACK,A7
	CLR.L	D0
	RTS

TRACKINIT:
	MOVE.L	$04.W,A6
	SUBA.L	A1,A1
	JSR	-294(A6)	;FINDTASK
	MOVE.L	D0,TRACKTAL2
	LEA	TRACKTAL,A1
	MOVE.L	$04.W,A6
	JSR	-354(A6)	;ADDPORT

	CLR.L	D0
	CLR.L	D1
	LEA	TRACKDISK,A0
	LEA	TRACKSHIT,A1
	JSR	-444(A6)	;OPENDEVICE

	LEA	TRACKSHIT,A1
	MOVE.L	#TRACKTAL,14(A1)
	RTS

TRACKEND:
	LEA	TRACKTAL,A1
	MOVE.L	$04.W,A6
	JSR	-360(A6)
	LEA	TRACKSHIT,A1
	MOVE.L	$04.W,A6
	JSR	-450(A6)
	RTS

TRACKDISK:	DC.B  'trackdisk.device',$00,$00
TRACKSHIT:	BLK.B $50,0
TRACKTAL:	DC.L  0,0,0,0
TRACKTAL2:	DC.L  0,TRACKTAL2+$C,0,TRACKTAL2+$4

OLDSTACK:	DC.L  0
MYSTACK:	BLK.L $80,0
MYSTACKSTART:	DC.L  0

