            TITLE	OPERATOR DIALOG TONES

* ONE LONG BEEP FOR INVALID COMMAND
* THREE SHORT BEEPS FOR VALID COMMAND

		LDX	#BJTAB
                LDAB	BSTATUS
                LSLB
                ABX
                LDX	0,X
                JMP	0,X
*idle state
B00		JMP	END_BEEP
* one long beep
B10		LDAA	#10
		STAA	T100MS0	;one second beep
		LDAA	PORTA
		ORAA	#$20
		STAA	PORTA
		LDAA	#$02
		STAA	BSTATUS
		JMP	END_BEEP
B20		TST	T100MS0
		JNE	END_BEEP
		LDAA	PORTA
		ANDA	#$DF
		STAA	PORTA
		CLR	BSTATUS
		JMP	END_BEEP
* three short beeps
B30		LDAA	#$03
		STAA	BCNT
		STAA	T100MS0	;300ms beep
		LDAA	PORTA
		ORAA	#$20
		STAA	PORTA
		LDAA	#$04
		STAA	BSTATUS
		JMP	END_BEEP

B40		TST	T100MS0
		JNE	END_BEEP
		LDAA	PORTA
		ANDA	#$DF
		STAA	PORTA
		LDAA	#$05
		STAA	BSTATUS
		LDAA	#$01
		STAA	T100MS0
		JMP	END_BEEP
* 100ms pause between short beeps
B50		TST	T100MS0
		JNE	END_BEEP
		DEC	BCNT
		BEQ	B55
		LDAA	#$03
		STAA	T100MS0	;300ms beep
		LDAA	PORTA
		ORAA	#$20
		STAA	PORTA
		LDAA	#$04
		STAA	BSTATUS
		JMP	END_BEEP
B55		CLR	BSTATUS
		JMP	END_BEEP

BJTAB		DW	B00
                DW	B10
		DW	B20
		DW	B30
		DW	B40
		DW	B50
		DW	B00
		DW	B00

END_BEEP	EQU	*


