* Patch to CORES to work with MP-S and to allow it to work with
*   a controller other than the original 1771 (e.g., the 2797 on
*   the Peripheral Technologies FD-2). 
*
*   CORES performs a "Read Multiple" command for disk reads and
*   aborts the operation with a "Force Interrupt" command to the
*   1771 when it has read the number of bytes it wants. CORES
*   expects the sector number to have incremented in the 1771's
*   sector register by the time it issues the Force Interrupt.
*   However, the 2797 (for example) does not do this as soon
*   as the 1771, so a delay before issuing the Force Interrupt
*   command is required. This patch does not affect operation
*   of the original 1771 controllers. 


	org	$1682		;ctrl-c patch for MP-S
	asra			;character present?
	bcc	$1687		;no
	bra	$1627		;else, process it

*----------------------------------------------------------

	org	$207D		;replace the 3 byte Force Interrupt
	jsr	patch

	org	$236D		;this area unused by CORES
patch	ldaa	$801A		;A=sector from 1771
	ldab	#35		;wait up to 490us

wait	cmpa	$801A		;controller change sector yet?
	bne	done		;yes
	decb			;else wait up to 490us
	bne	wait

done	ldaa	#$D0		;now do the Force Interrupt
	staa	$8018
	rts

	end
