~rabbits/left

7d60e6ba9fcf5d2d2bf6278ce4e5d554a3bac147 — Devine Lu Linvega 18 days ago 435d15b
Optimized drawing
2 files changed, 21 insertions(+), 21 deletions(-)

M src/left.tal
M src/manifest.tal
M src/left.tal => src/left.tal +18 -18
@@ 43,8 43,8 @@
	.Screen/height DEI2
		DUP2 #0020 SUB2 #04 SFT2 .textarea/lines STZ2
		DUP2 #0018 SUB2 .scrollbar/height STZ2
		#06 SFT2 NIP INC #00 SWP SUB ;draw-textarea/height STA
	.Screen/width DEI2 #0088 SUB2 #03 SFT2 NIP #00 SWP SUB ;draw-textarea/width STA
		#06 SFT2 INC SUB ;draw-textarea/height STA
	.Screen/width DEI2 #0088 SUB2 #03 SFT2 SUB ;draw-textarea/width STA
	( defaults )
	#0001 .scroll/ratio STZ2
	;text .scroll/addr STZ2


@@ 105,7 105,7 @@ BRK
	;on-frame-trap .Screen/vector DEO2
	;on-button-trap .Controller/vector DEO2
	;on-mouse-trap .Mouse/vector DEO2
	#00 .Mouse/state DEO
	[ LIT2 00 -Mouse/state ] DEO
	( clear cursor )
	#40



@@ 116,7 116,7 @@ BRK
	#0000 .Screen/vector DEO2
	;on-button .Controller/vector DEO2
	;on-mouse .Mouse/vector DEO2
	#00 .Mouse/state DEO
	[ LIT2 00 -Mouse/state ] DEO

	( if filepath is empty, reset to untitled )
	;filepath LDA ?&no-empty


@@ 261,7 261,7 @@ JMP2r
@on-mouse ( -> )

	.Mouse/y DEI2 #0014 LTH2 ?trap-menu
	.Mouse/state DEI #00 NEQ #41 ADD ;cursor-icn update-cursor
	#00 .Mouse/state DEI NEQ #41 ADD ;cursor-icn update-cursor

	[ LIT2 15 -Screen/auto ] DEO
	( scroll )


@@ 274,7 274,7 @@ JMP2r
	.Mouse/y DEI2 #04 SFT2 NIP #02 SUB
		select-marker
	( release )
	#00 .Mouse/state DEO
	[ LIT2 00 -Mouse/state ] DEO

BRK



@@ 293,7 293,7 @@ BRK
			&no-shift
		[ #02 ] NEQk NIP ?&no-alt
			POP select-word
			#00 .Mouse/state DEO !&no-down
			[ LIT2 00 -Mouse/state ] DEO !&no-down
			&no-alt
		POP
		select-start


@@ 301,12 301,12 @@ BRK
	( mouse2 )
	DUP2 #0200 NEQ2 ?&no-down2
		touch-to-addr select-word
		#00 .Mouse/state DEO
		[ LIT2 00 -Mouse/state ] DEO
		&no-down2
	( mouse3 )
	DUP2 #0400 NEQ2 ?&no-down3
		capture-selection
		#00 .Mouse/state DEO
		[ LIT2 00 -Mouse/state ] DEO
		&no-down3
	POP2
	STHr ,&last STR


@@ 832,7 832,7 @@ JMP2r

@count-lines ( -- line* )

	LITr -scroll/y LDZ2r
	[ LITr -scroll/y ] LDZ2r
	.scroll/addr LDZ2
	&w
		LDAk #0a NEQ [ JMP INC2r ]


@@ 1230,23 1230,23 @@ JMP2r

	#0000 .Screen/x DEO2
	#0018 .Screen/y DEO2

	[ LIT2 02 -Screen/auto ] DEO
	( bg )
	;checkered-icn .Screen/addr DEO2
	.scrollbar/height LDZ2 #03 SFT2 NIP #00
	.scrollbar/height LDZ2 #03 SFT2 SUB
	&l
		[ LIT2 04 -Screen/sprite ] DEO
		INC GTHk ?&l
	POP2
		INC DUP ?&l
	POP
	( fg )
	;state-icns .Screen/addr DEO2
	#0018 STH2k .scroll/y LDZ2 .scroll/ratio LDZ2 STH2k DIV2 ADD2 .Screen/y DEO2
	.Screen/height DEI2 count-lines STH2r DIV2 SUB2 STH2r SUB2 #03 SFT2 NIP INC #00
	( TODO: Optimize )
	.Screen/height DEI2 count-lines STH2r DIV2 SUB2 STH2r SUB2 #03 SFT2 INC SUB
	&stretch
		[ LIT2 05 -Screen/sprite ] DEO
		INC GTHk ?&stretch
	POP2
		INC DUP ?&stretch
	POP
	[ LIT2 15 -Screen/auto ] DEO

JMP2r


@@ 1257,7 1257,7 @@ JMP2r
	#0017 .Screen/y DEO2
	[ LIT2 01 -Screen/auto ] DEO
	;dashed-icn .Screen/addr DEO2
	#00 .Screen/width DEI2 #03 SFT2 NIP SUB
	.Screen/width DEI2 #03 SFT2 SUB
	&l
		[ LIT2 05 -Screen/sprite ] DEO
		INC DUP ?&l

M src/manifest.tal => src/manifest.tal +3 -3
@@ 11,9 11,9 @@ BRK

@on-mouse-menu ( -> )

	#42 .Mouse/state DEI #00 NEQ ADD ;hand-icn update-cursor
	#00 .Mouse/state DEI NEQ #42 ADD ;hand-icn update-cursor
	( when touch cat )
	.Mouse/state DEI #00 EQU ?&no-touch-cat
	#00 .Mouse/state DEI EQU ?&no-touch-cat
	.Mouse/y DEI2 #0014 GTH2 ?&no-touch-cat
		.Mouse/x DEI2 #0004 ADD2 get-xcat menu-select
		( release ) #00 .Mouse/state DEO


@@ 29,7 29,7 @@ BRK
			&no-change
		POP
		( when touch sub )
		.Mouse/state DEI #00 EQU ?&no-touch-sub
		#00 .Mouse/state DEI EQU ?&no-touch-sub
			;draw-sub/sel LDA menu-select-sub
			( release ) #00 .Mouse/state DEO
			&no-touch-sub