[cc65] conio tabs

From: MagerValp <MagerValp1cling.gu.se>
Date: 2004-09-22 11:41:57
Someone in comp.sys.cbm wanted support for tabs (\t, ascii 09), so I
wrote a small patch for cputc.s:

------------------------------------------------------------------------
L1:	cmp	#$0D		; LF?
	beq	newline		; Recalculate pointers

	cmp	#$09		; TAB?
	bne	@printable
	lda	CURS_X
	ora	#7
	clc
	adc	#1
	cmp	#XSIZE		; end of line?
	beq	newline
	sta	CURS_X
	rts

@printable:
; Printable char of some sort
------------------------------------------------------------------------

This should work for c64, c16, plus4, pet, vic-20, and the cbm2
machines. The C128 needs this:

------------------------------------------------------------------------
	cmp	#$0D		; LF?
	bne	TAB
	jmp     NEWLINE		; Update cursor position

TAB:	cmp	#$09		; TAB?
	bne	L2
	lda	CURS_X
	ora	#7
	clc
	adc	#1
	cmp	#XSIZE		; end of line?
	bne	@no
	jmp	NEWLINE
@no:	sta	CURS_X
	tay
	ldx	CURS_Y
	clc
	jmp	PLOT		; Set the new cursor

; Printable char of some sort
------------------------------------------------------------------------

The other platforms could probably be done in a similar way.

-- 
    ___          .     .  .         .       . +  .         .      o   
  _|___|_   +   .  +     .     +         .  Per Olofsson, arkadspelare
    o-o    .      .     .   o         +          MagerValp@cling.gu.se
     -       +            +    .     http://www.cling.gu.se/~cl3polof/
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Wed Sep 22 11:42:00 2004

This archive was generated by hypermail 2.1.8 : 2004-09-22 11:42:09 CEST