ypress
; output:
; Y=0 - no data to be sent (i.e. ignore keypress)
; Y=1 - A contains single byte to send
; Y=2 - AX points to null terminated string to send
; -------------------------------------

;Y=0 nothing to send
;Y=1 A = char to send
;Y=2 AX=pointer to asciiz string to send

vt100_transform_outbound_char: 
  tay
  lda petscii_to_ascii,y   ; PETSCII to ASCII
  bne :+
  ldy #0  ; ignore key
  rts
:                
  cmp #$ff
  beq output_string
  cmp #$fe
  beq command_key  ; comm