~rabbits/dexe

47f0c12ecf0317af19693135998463db5d780264 — neauoire 3 months ago a5bfb9a
Added fast scrolling with arrow keys
2 files changed, 35 insertions(+), 13 deletions(-)

M README.md
M dexe.tal
M README.md => README.md +1 -0
@@ 13,6 13,7 @@ uxnasm noodle.tal noodle.rom && uxnemu noodle.rom
## Controls

- `arrows`, move selection
- `ctrl+arrows`, move selection(fast)
- `enter`, insert byte
- `backspace`, delete byte
- `left-click`, select bytes

M dexe.tal => dexe.tal +34 -13
@@ 137,16 137,28 @@ BRK

@on-touch-scrollbar ( -> )
	
	.Mouse/y DEI2 8// 
	DUP #00 ! ,&no-up JCN
		( clamp ) .selection/scroll LDZ2 #0000 == ,&no-up JCN
	;MEMORY-LEN LDA2 8// .Screen/height DEI2 8// #0003 -- >> #01 JCN BRK

	.Mouse/y DEI2
	DUP2 8// TOB #00 ! ,&no-up JCN
		( clamp ) .selection/scroll LDZ2 #0000 == ,&no-scroll JCN
		.selection/scroll LDZ2 #0001 -- .selection/scroll STZ2
		;redraw JSR2 POP RELEASE-MOUSE BRK &no-up
	DUP .Screen/height DEI2 8// TOB #03 - ! ,&no-down JCN
		;redraw JSR2 POP2 RELEASE-MOUSE BRK &no-up
	DUP2 8// TOB .Screen/height DEI2 8// TOB #03 - ! ,&no-down JCN
		( clamp ) ( TODO )
		.selection/scroll LDZ2 #0001 ++ .selection/scroll STZ2
		;redraw JSR2 POP RELEASE-MOUSE BRK &no-down
	POP
		;redraw JSR2 POP2 RELEASE-MOUSE BRK &no-down
	DUP2 
		#aa DEBUG
		POP2
		(
		#0008 -- #0010 ** #0010 ** 
		;MEMORY-LEN LDA2 8// #0010 **
		// DEBUG2
		.Screen/height DEI2 8// #0003 -- DEBUG2
		)
	&no-scroll
	POP2

BRK



@@ 175,26 187,35 @@ BRK
	
	.Controller/key DEI #00 ! .state/trap LDZ #0101 == ;on-button-trap JCN2

	.Controller/button DEI #f0 AND
	DUP #04 SFT #01 AND #01 ! ,&no-up JCN
	.Controller/button DEI
	DUP #10 ! ,&no-up JCN
		( clamp ) .selection/from LDZ2 #0008 << ,&no-up JCN
		( move ) .selection/from LDZ2 #0008 -- DUP2 .selection/from STZ2 .selection/to STZ2 
		;follow JSR2
		#00 .selection/nibble STZ &no-up
	DUP #05 SFT #01 AND #01 ! ,&no-down JCN
	DUP #11 ! ,&no-up-jump JCN
		( clamp ) .selection/from LDZ2 #0020 << ,&no-up-jump JCN
		( move ) .selection/from LDZ2 #0020 -- DUP2 .selection/from STZ2 .selection/to STZ2 
		;follow JSR2
		#00 .selection/nibble STZ &no-up-jump
	DUP #20 ! ,&no-down JCN
		( move ) .selection/from LDZ2 #0008 ++ DUP2 .selection/from STZ2 .selection/to STZ2 
		;follow JSR2
		#00 .selection/nibble STZ &no-down
	DUP #06 SFT #01 AND #01 ! ,&no-left JCN
	DUP #21 ! ,&no-down-jump JCN
		( move ) .selection/from LDZ2 #0020 ++ DUP2 .selection/from STZ2 .selection/to STZ2 
		;follow JSR2
		#00 .selection/nibble STZ &no-down-jump
	DUP #40 ! ,&no-left JCN
		( clamp ) .selection/from LDZ2 #0007 AND2 #0000 == ,&no-left JCN
		( move ) .selection/from LDZ2 #0001 -- DUP2 .selection/from STZ2 .selection/to STZ2 
		#00 .selection/nibble STZ &no-left
	DUP #07 SFT #01 AND #01 ! ,&no-right JCN
	DUP #80 ! ,&no-right JCN
		( clamp ) .selection/from LDZ2 #0007 AND2 #0007 == ,&no-right JCN
		( move ) .selection/from LDZ2 #0001 ++ DUP2 .selection/from STZ2 .selection/to STZ2 
		#00 .selection/nibble STZ &no-right
	POP

	
	;clamp-selection JSR2

	.Controller/key DEI