*--------------------------------------------------------------------
* ACIAPAT.ASM
*   MiniFLEX (FLEX 1.0) does final console input/output through jump
*   table entries at $7109 (INCH), $710C (OUTCH) and $7136 (OUTCH2).
*   These entries, in turn, point to the SWTBUG INEEE and OUTEEE
*   routines. Custom I/O can be created by a monitor PROM which
*   keeps SWTBUG standard entry points or by patching these three
*   vectors in MiniFlex ($7109, $710C, $7136) to point to your own
*   I/O routines.
*
*   Mike Douglas, March 2022
*--------------------------------------------------------------------
	org	$7109		;part of MiniFLEX jump table
inCh	jmp	$E1AC		;default is SWTBUG INEEE
outCh	jmp	$E1D1		;default is SWTBUG OUTEEE

	org	$7136		;part of MiniFLEX jump table
outCh2	jmp	$E1D1		;default is SWTBUG OUTEEE


* The one exception to the above is looking for the TTYESC character
* while not processing an input request. This is done by directly
* accessing the status register of the ACIA. Patches to put in a
* different ACIA address for this purpose are below. This patch
* only works if the UART is a Motorola ACIA (or equivalent register
* and status bit positions).

ACIA	equ	$F000		;put actual ACIA address here

	org	$72E3		;input status check
	fdb	ACIA

	org	$72E9		;input byte
	fdb	ACIA+1

* Patch to force the check for an ACIA to always be true

	org	$760E		;ACIA presence test
	fcb	$20		;force true (BRA instead of BEQ)

	end
