~rabbits/nasu

cacc4ce994f75cbf921fbae30e36cdcbc72bf599 — Devine Lu Linvega a month ago c83a751
Trap mouse on menu
2 files changed, 34 insertions(+), 0 deletions(-)

M src/manifest.tal
M src/nasu.tal
M src/manifest.tal => src/manifest.tal +31 -0
@@ 38,6 38,37 @@
			00 20 :option-zoom "Zoom $1
		$1

@trap-menu ( -> )

	;on-mouse-menu .Mouse/vector DEO2
	;on-control-menu .Controller/vector DEO2

BRK

@on-mouse-menu ( -> )

	( clear last cursor )
	.cursor/x LDZ2 .Screen/x DEO2
	.cursor/y LDZ2 .Screen/y DEO2
	#40 .Screen/sprite DEO
	( record mouse positions )
	.Mouse/x DEI2 DUP2 .cursor/x STZ2 .Screen/x DEO2
	.Mouse/y DEI2 DUP2 .cursor/y STZ2 .Screen/y DEO2
	( draw new cursor )
	;hand-icn .Screen/addr DEO2
	#42 .Mouse/state DEI #00 NEQ ADD .Screen/sprite DEO

	.Mouse/y DEI2 #0008 LTH2 ,&no-exit JCN
		;untrap JSR2
		&no-exit

BRK


@on-control-menu ( -> )

BRK

@print-manifest ( -- )

	;manifest/name ;print-str JSR2

M src/nasu.tal => src/nasu.tal +3 -0
@@ 191,6 191,8 @@ BRK

	;draw-cursor JSR2

	.Mouse/y DEI2 #0008 LTH2 ;trap-menu JCN2

	.Mouse/state DEI #00 EQU ,&no-touch JCN
		.Mouse/x DEI2 .Mouse/y DEI2 .tileview ;within-rect JSR2 ;on-touch-tileview JCN2
		.Mouse/x DEI2 .Mouse/y DEI2 .nametable ;within-rect JSR2 ;on-touch-nametable JCN2


@@ 1380,6 1382,7 @@ JMP2r
@bigpixel-icn   f0f0 f0f0 0000 0000
@halftone-icn   aa55 aa55 aa55 aa55

@hand-icn 2020 20b8 7c7c 3838
@tool-brush     0070 6844 2211 0906
@tool-selector  0040 6070 787c 7008
@tool-zoom      0030 4884 8448 3402