* FD2.ASM
*   Patch to the FLEX 1.0 disk driver to clear the E bit in the read and
*   write commands so the disk does not slip a revolution for every
*   sector read or write. This is for the FD-2 with the 2797 controller
*   for which the E bit delay is 30ms instead of 20ms. This extra 10ms
*   causes the slipped revolution. With the 2797, read and write commands
*   load the head and wait for HLT even without the E bit set.
*
*   Can be run as a command at startup so that the same disk can be used
*   with a 1771 based controller (DC-1, DC-2).

WARMS	equ	$7103		;FLEX re-entry address
PSTRNG	equ	$7118		;display string on console
EOT	equ	$04		;ASCII EOT character

	org	$7600

	bra	start
	fcb	1		;version number

start	ldaa	#$88		;read command without E bit set
	staa	$7F1C		;read command in readSec
	staa	$7F93		;read command in vfySec

	ldaa	#$A8		;write command without E bit set
	staa	$7F6C		;write command in wrtSec

	ldx	#mDone		;disply status message
	jsr	PSTRNG
	jmp	WARMS		;exit

mDone	fcc	"PATCHED FOR THE 2797 DISK CONTROLLER IC"
	fcb	EOT
	end
