~rabbits/left

5f207f95e4cb182e68c96d8f2cbc5e39bac67f46 — neauoire 4 months ago 1484ca8
Housekeeping
1 files changed, 23 insertions(+), 27 deletions(-)

M src/left.tal
M src/left.tal => src/left.tal +23 -27
@@ 16,9 16,7 @@
	@cursor
		&x $2 &y $2
	@textarea
		&fixed $1
		&highlight $1 &lines $2 &length $2
		&commented $1
		&fixed $1 &highlight $1 &lines $2 &length $2
	@scrollbar
		&height $2
	@scroll


@@ 807,8 805,6 @@ JMP2
	( paint )
	#0010 .scroll/x LDZ2 SUB2 #0080 ADD2 .Screen/x DEO2
	#0020 .Screen/y DEO2
	#00 .textarea/commented STZ

	.scroll/y LDZ2 .textarea/lines LDZ2 ADD2 ;line-to-addr JSR2 .scroll/addr LDZ2
	&loop
		,draw-token JSR


@@ 822,42 818,29 @@ JMP2

@draw-token ( str* -- str* )

	;get-color JSR2 STH
	;walk-color JSR2 STH
	;is-ul JSR2 ;draw-ufx/ul STA
	&w
		;is-selected JSR2 STH
		,is-selected JSR STH
		LDAk STH2kr #09 ROT ROT [ JMP SWP POP ] ;draw-ufx JSR2 POPr
		INC2 LDAk #20 GTH ,&w JCN
	#00 ;draw-ufx/ul STA
	&w2
		;is-selected JSR2 STH
		,is-selected JSR STH
		LDAk STH2kr #09 ROT ROT [ JMP SWP POP ] ;draw-ufx JSR2 POPr
		INC2 LDAk #21 LTH ,&w2 JCN
	POPr

JMP2r

@is-ul ( addr* -- addr* bool )

	LDAk LIT ", EQU ,&pass JCN
	LDAk LIT ": EQU ,&pass JCN
	LDAk LIT "; EQU ,&pass JCN
	LDAk LIT ". EQU ,&pass JCN
	#00

JMP2r
	&pass #01 JMP2r

@is-selected ( addr* -- addr* bool )

	DUP2
	STH2k .selection/from LDZ2 #0001 SUB2 GTH2
	STH2r .selection/to LDZ2 LTH2
	AND
	DUP2 .selection/from LDZ2 #0001 SUB2 GTH2 STH
	DUP2 .selection/to LDZ2 LTH2 STHr AND

JMP2r

@get-color ( addr* -- addr* color )
@walk-color ( addr* -- addr* color )

	LDAk LIT ") EQU ,&comment-end JCN
	[ LIT &c $1 ] ,&comment JCN


@@ 867,9 850,22 @@ JMP2r
	#01

JMP2r
&comment #01 ,&c STR #03 JMP2r
&comment-end #00 ,&c STR #03 JMP2r
&label #02 JMP2r
	&comment #01 ,&c STR #03 JMP2r
	&comment-end #00 ,&c STR #03 JMP2r
	&label #02 JMP2r

@is-ul ( addr* -- addr* bool )

	;walk-color/c LDA ,&skip JCN
	LDAk LIT ", EQU ,&pass JCN
	LDAk LIT ": EQU ,&pass JCN
	LDAk LIT "; EQU ,&pass JCN
	LDAk LIT ". EQU ,&pass JCN
	&skip
	#00

JMP2r
	&pass #01 JMP2r

@draw-uf2 ( text* color -- )